HaggaBasin first in map list, both maps default 15% zoom, slider min 15%
This commit is contained in:
1 parent
c06660ae5a
commit
df2cff537c
2 files changed
+12
-7
No files matched your search
+2
-2
@@ -85,7 +85,7 @@ DEFAULTS = {
|
|||||||
},
|
},
|
||||||
'flip_y': False,
|
'flip_y': False,
|
||||||
'image_size': {'width': 8000, 'height': 8000},
|
'image_size': {'width': 8000, 'height': 8000},
|
||||||
'default_zoom': 1.0
|
'default_zoom': 0.15
|
||||||
},
|
},
|
||||||
'HaggaBasin': {
|
'HaggaBasin': {
|
||||||
'image': 'maps/HaggaBasin_8k.webp',
|
'image': 'maps/HaggaBasin_8k.webp',
|
||||||
@@ -98,7 +98,7 @@ DEFAULTS = {
|
|||||||
},
|
},
|
||||||
'flip_y': False,
|
'flip_y': False,
|
||||||
'image_size': {'width': 8000, 'height': 8000},
|
'image_size': {'width': 8000, 'height': 8000},
|
||||||
'default_zoom': 0.05
|
'default_zoom': 0.15
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-5
@@ -426,7 +426,7 @@
|
|||||||
<h3 class="panel-title">Zoom</h3>
|
<h3 class="panel-title">Zoom</h3>
|
||||||
<div class="map-controls">
|
<div class="map-controls">
|
||||||
<button type="button" id="zoom-out" title="Zoom out">-</button>
|
<button type="button" id="zoom-out" title="Zoom out">-</button>
|
||||||
<input type="range" id="zoom-slider" min="5" max="350" value="100" step="10">
|
<input type="range" id="zoom-slider" min="15" max="350" value="100" step="10">
|
||||||
<button type="button" id="zoom-in" title="Zoom in">+</button>
|
<button type="button" id="zoom-in" title="Zoom in">+</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="zoom-readout" id="zoom-readout">100%</div>
|
<div class="zoom-readout" id="zoom-readout">100%</div>
|
||||||
@@ -472,11 +472,11 @@ const mapImageUrls = {
|
|||||||
|
|
||||||
let currentMap = "HaggaBasin";
|
let currentMap = "HaggaBasin";
|
||||||
let currentZoom = 0;
|
let currentZoom = 0;
|
||||||
let defaultZoom = 0.05;
|
let defaultZoom = 0.15;
|
||||||
let activeMarkerId = null;
|
let activeMarkerId = null;
|
||||||
const enabledTypes = { player: true, vehicle: true, base: true };
|
const enabledTypes = { player: true, vehicle: true, base: true };
|
||||||
|
|
||||||
const mapDefaultZoom = 0.05;
|
const mapDefaultZoom = 0.15;
|
||||||
currentZoom = mapDefaultZoom;
|
currentZoom = mapDefaultZoom;
|
||||||
defaultZoom = mapDefaultZoom;
|
defaultZoom = mapDefaultZoom;
|
||||||
|
|
||||||
@@ -532,7 +532,7 @@ function setZoom(nextZoom, keepCenter = true) {
|
|||||||
const map = selectedMapConfig();
|
const map = selectedMapConfig();
|
||||||
if (!map) return;
|
if (!map) return;
|
||||||
|
|
||||||
currentZoom = Math.min(3.5, Math.max(0.05, nextZoom));
|
currentZoom = Math.min(3.5, Math.max(0.15, nextZoom));
|
||||||
|
|
||||||
els.canvas.style.width = `${map.width * currentZoom}px`;
|
els.canvas.style.width = `${map.width * currentZoom}px`;
|
||||||
els.canvas.style.height = `${map.height * currentZoom}px`;
|
els.canvas.style.height = `${map.height * currentZoom}px`;
|
||||||
@@ -542,7 +542,12 @@ function setZoom(nextZoom, keepCenter = true) {
|
|||||||
|
|
||||||
function renderChoices() {
|
function renderChoices() {
|
||||||
els.choices.innerHTML = '';
|
els.choices.innerHTML = '';
|
||||||
mapOptions.forEach(map => {
|
const sortedMaps = [...mapOptions].sort((a, b) => {
|
||||||
|
if (a.key === 'HaggaBasin') return -1;
|
||||||
|
if (b.key === 'HaggaBasin') return 1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
sortedMaps.forEach(map => {
|
||||||
const button = document.createElement('button');
|
const button = document.createElement('button');
|
||||||
button.type = 'button';
|
button.type = 'button';
|
||||||
button.className = `map-choice${map.key === currentMap ? ' active' : ''}`;
|
button.className = `map-choice${map.key === currentMap ? ' active' : ''}`;
|
||||||
|
|||||||
Reference in new issue
Block a user