mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
refactor: update options on load, don't update temperature UI
This commit is contained in:
parent
457db89cda
commit
1d252a1d90
2 changed files with 6 additions and 11 deletions
|
|
@ -218,8 +218,7 @@ async function parseLoadedData(data) {
|
||||||
if (settings[13]) urbanization = urbanizationInput.value = urbanizationOutput.value = settings[13];
|
if (settings[13]) urbanization = urbanizationInput.value = urbanizationOutput.value = settings[13];
|
||||||
if (settings[14]) mapSizeInput.value = mapSizeOutput.value = minmax(settings[14], 1, 100);
|
if (settings[14]) mapSizeInput.value = mapSizeOutput.value = minmax(settings[14], 1, 100);
|
||||||
if (settings[15]) latitudeInput.value = latitudeOutput.value = minmax(settings[15], 0, 100);
|
if (settings[15]) latitudeInput.value = latitudeOutput.value = minmax(settings[15], 0, 100);
|
||||||
if (settings[16]) temperatureEquatorInput.value = temperatureEquatorOutput.value = settings[16];
|
// setting 16 and 17 (temperature) are moved to options
|
||||||
if (settings[17]) temperatureNorthPoleInput.value = temperatureNorthPoleOutput.value = settings[17]; //Not used see options: only for compatibility
|
|
||||||
if (settings[18]) precInput.value = precOutput.value = settings[18];
|
if (settings[18]) precInput.value = precOutput.value = settings[18];
|
||||||
if (settings[19]) options = JSON.parse(settings[19]);
|
if (settings[19]) options = JSON.parse(settings[19]);
|
||||||
if (settings[20]) mapName.value = settings[20];
|
if (settings[20]) mapName.value = settings[20];
|
||||||
|
|
@ -231,6 +230,9 @@ async function parseLoadedData(data) {
|
||||||
|
|
||||||
void (function applyOptionsToUI() {
|
void (function applyOptionsToUI() {
|
||||||
stateLabelsModeInput.value = options.stateLabelsMode;
|
stateLabelsModeInput.value = options.stateLabelsMode;
|
||||||
|
yearInput.value = options.year;
|
||||||
|
eraInput.value = options.era;
|
||||||
|
shapeRendering.value = viewbox.attr("shape-rendering") || "geometricPrecision";
|
||||||
})();
|
})();
|
||||||
|
|
||||||
void (function parseConfiguration() {
|
void (function parseConfiguration() {
|
||||||
|
|
@ -586,13 +588,6 @@ async function parseLoadedData(data) {
|
||||||
if (rulers && layerIsOn("toggleRulers")) rulers.draw();
|
if (rulers && layerIsOn("toggleRulers")) rulers.draw();
|
||||||
if (layerIsOn("toggleGrid")) drawGrid();
|
if (layerIsOn("toggleGrid")) drawGrid();
|
||||||
|
|
||||||
// set options
|
|
||||||
yearInput.value = options.year;
|
|
||||||
eraInput.value = options.era;
|
|
||||||
temperatureNorthPoleOutput.value = temperatureNorthPoleInput.value = options.temperatureNorthPole;
|
|
||||||
temperatureSouthPoleOutput.value = temperatureSouthPoleInput.value = options.temperatureSouthPole;
|
|
||||||
shapeRendering.value = viewbox.attr("shape-rendering") || "geometricPrecision";
|
|
||||||
|
|
||||||
if (window.restoreDefaultEvents) restoreDefaultEvents();
|
if (window.restoreDefaultEvents) restoreDefaultEvents();
|
||||||
focusOn(); // based on searchParams focus on point, cell or burg
|
focusOn(); // based on searchParams focus on point, cell or burg
|
||||||
invokeActiveZooming();
|
invokeActiveZooming();
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ function getMapData() {
|
||||||
urbanization,
|
urbanization,
|
||||||
mapSizeOutput.value,
|
mapSizeOutput.value,
|
||||||
latitudeOutput.value,
|
latitudeOutput.value,
|
||||||
temperatureEquatorOutput.value,
|
0, // previously used for temperatureEquatorOutput.value
|
||||||
0, //Dummy for tempNorthOutput.value
|
0, // previously used for tempNorthOutput.value
|
||||||
precOutput.value,
|
precOutput.value,
|
||||||
JSON.stringify(options),
|
JSON.stringify(options),
|
||||||
mapName.value,
|
mapName.value,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue