Skip to content

Commit

Permalink
Update ats map (#138)
Browse files Browse the repository at this point in the history
* Starting new ATS tiles... scale is messed up though

* Some randomness trying to get everything centered

* New scale, but still wrong

* New tiles from rotated version.... getting closer!

* Moar tile updates

* Remove ATS map
  • Loading branch information
mike-koch committed Aug 13, 2017
1 parent 2581554 commit f87714a
Show file tree
Hide file tree
Showing 10,942 changed files with 30 additions and 1,617 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions config.json
Expand Up @@ -19,8 +19,8 @@

"config": {
"name": "ets2-mobile-route-advisor",
"title": "Mobile Route Advisor (3.3.2)",
"author": "mkoch227 and denilsonsa",
"title": "Mobile Route Advisor (3.3.3)",
"author": "mkoch227 and contributors",
"width": -1,
"height": -1,

Expand Down
9 changes: 7 additions & 2 deletions dashboard.html
Expand Up @@ -61,8 +61,6 @@
<svg width="0.7em" height="0.7em"><use xlink:href="#svg-arrow-up" fill="currentColor"/></svg>
</button>
</div>
<div id="speed-limit" class="ol-unselectable ol-control game-specific"><span class="speedLimitRoundedKmhMph"></span></div>
<div id="map-text" class="hasJob ol-unselectable ol-control"><span data-mra-text="ETA"></span>: <span class="navigation-estimatedTime"></span>, <span class="navigationEstimatedDistanceKmMi"></span> <span class="distanceUnits"></span>, <span class="navigation-timeToDestination"></span></div>

<div class="dashboard connected">
<aside>
Expand Down Expand Up @@ -103,6 +101,13 @@

<article id="_map">
<p class="loading-text" data-mra-text="LoadingMapPleaseWait"></p>
<div class="_no-map">
<div class="_row">
<p style="margin-top: 250px">No map available</p>
<div id="map-text" class="hasJob ol-unselectable ol-control"><span data-mra-text="ETA"></span>: <span class="navigation-estimatedTime"></span>, <span class="navigationEstimatedDistanceKmMi"></span> <span class="distanceUnits"></span>, <span class="navigation-timeToDestination"></span></div>
<div id="speed-limit" class="ol-unselectable ol-control game-specific"><span class="speedLimitRoundedKmhMph"></span></div>
</div>
</div>
</article>

<article id="_cargo">
Expand Down
28 changes: 19 additions & 9 deletions dashboard.js
Expand Up @@ -77,7 +77,11 @@ Funbit.Ets.Telemetry.Dashboard.prototype.filter = function (data) {
// ATS-specific logic
if (data.isAts) {
data.jobIncome = getAtsJobIncome(data.job.income);
}
$('#_map').find('._no-map').show();
$('#_map').find('.loading-text').hide();
} else {
$('#_map').find('._no-map').hide();
}

// Non-WoT stuff here
if (!data.isWorldOfTrucksContract || data.isAts) {
Expand Down Expand Up @@ -459,15 +463,18 @@ function processDomChanges(data) {
g_configPrefix = data.game.gameName.toLowerCase();
}

// Initialize JavaScript
var mapPack = g_skinConfig[g_configPrefix].mapPack;
// Initialize JavaScript if ETS2
if (g_configPrefix === 'ets2') {
var mapPack = g_skinConfig[g_configPrefix].mapPack;

// Process map pack JSON
$.getJSON(g_pathPrefix + '/maps/' + mapPack + '/config.json', function(json) {
g_mapPackConfig = json;
// Process map pack JSON
$.getJSON(g_pathPrefix + '/maps/' + mapPack + '/config.json', function(json) {
g_mapPackConfig = json;

loadScripts(mapPack, 0, g_mapPackConfig.scripts);
});
loadScripts(mapPack, 0, g_mapPackConfig.scripts);
});
}


// Process Speed Units
var distanceUnits = g_skinConfig[g_configPrefix].distanceUnits;
Expand Down Expand Up @@ -521,7 +528,10 @@ function loadScripts(mapPack, index, array) {

function goToMap() {
showTab('_map');
g_map.updateSize();

if (g_configPrefix === 'ets2') {
g_map.updateSize();
}
}

function updateSpeedIndicator(speedLimit, currentSpeed) {
Expand Down
3 changes: 2 additions & 1 deletion language/en-US.json
Expand Up @@ -23,5 +23,6 @@
"FridayAbbreviated": "Fri",
"SaturdayAbbreviated": "Sat",
"WorldOfTrucksContract": "World of Trucks Contract",
"LoadingMapPleaseWait": "Loading map, please wait..."
"LoadingMapPleaseWait": "Loading map, please wait...",
"NoMapAvailable": "No map available"
}
3 changes: 0 additions & 3 deletions maps/ats/config.json
Expand Up @@ -8,8 +8,5 @@
" https://github.com/mike-koch/ets2-mobile-route-advisor/wiki/Creating-a-Map-Pack"
],
"scripts": [
"js/cities.js",
"js/map.js",
"js/ol.js"
]
}

0 comments on commit f87714a

Please sign in to comment.