mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-21 19:41:23 +01:00
Scuffed Saving solution
This commit is contained in:
parent
ed723c374a
commit
0936a03c60
6 changed files with 23 additions and 12 deletions
1
main.js
1
main.js
|
|
@ -184,6 +184,7 @@ let options = {
|
|||
pinNotes: false,
|
||||
showMFCGMap: true,
|
||||
winds: [225, 45, 225, 315, 135, 315],
|
||||
SouthPoleTemperature: 0,
|
||||
stateLabelsMode: "auto"
|
||||
};
|
||||
let mapCoordinates = {}; // map coordinates on globe
|
||||
|
|
|
|||
|
|
@ -639,6 +639,6 @@ export function resolveVersionConflicts(version) {
|
|||
|
||||
if (version < 1.89) {
|
||||
//May need a major bump
|
||||
|
||||
options.SouthPoleTemperature = +temperatureNorthPoleInput.value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ async function parseLoadedData(data) {
|
|||
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[16]) temperatureEquatorInput.value = temperatureEquatorOutput.value = settings[16];
|
||||
if (settings[17]) temperaturePoleInput.value = temperaturePoleOutput.value = settings[17];
|
||||
if (settings[17]) temperatureNorthPoleInput.value = temperatureNorthPoleOutput.value = settings[17];
|
||||
if (settings[18]) precInput.value = precOutput.value = settings[18];
|
||||
if (settings[19]) options = JSON.parse(settings[19]);
|
||||
if (settings[20]) mapName.value = settings[20];
|
||||
|
|
@ -589,6 +589,7 @@ async function parseLoadedData(data) {
|
|||
// set options
|
||||
yearInput.value = options.year;
|
||||
eraInput.value = options.era;
|
||||
temperatureSouthPoleOutput.value = temperatureSouthPoleInput.value = options.SouthPoleTemperature;
|
||||
shapeRendering.value = viewbox.attr("shape-rendering") || "geometricPrecision";
|
||||
|
||||
if (window.restoreDefaultEvents) restoreDefaultEvents();
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ function getMapData() {
|
|||
mapSizeOutput.value,
|
||||
latitudeOutput.value,
|
||||
temperatureEquatorOutput.value,
|
||||
temperaturePoleOutput.value,
|
||||
temperatureNorthPoleOutput.value,
|
||||
precOutput.value,
|
||||
JSON.stringify(options),
|
||||
mapName.value,
|
||||
|
|
|
|||
|
|
@ -612,8 +612,15 @@ function randomizeOptions() {
|
|||
tMin = -30; // temperature extremes
|
||||
if (randomize || !locked("temperatureEquator"))
|
||||
temperatureEquatorOutput.value = temperatureEquatorInput.value = rand(tMax - 10, tMax);
|
||||
if (randomize || !locked("temperaturePole"))
|
||||
temperatureNorthPoleOutput.value = temperatureNorthPoleInput.value = temperatureSouthPoleOutput.value = temperatureSouthPoleInput.value = rand(tMin, tMin + 30);
|
||||
if (randomize || !locked("temperaturePole")) {
|
||||
temperatureNorthPoleOutput.value
|
||||
= temperatureNorthPoleInput.value
|
||||
= temperatureSouthPoleOutput.value
|
||||
= temperatureSouthPoleInput.value
|
||||
= options.SouthPoleTemperature
|
||||
= rand(tMin, tMin + 30);
|
||||
}
|
||||
|
||||
|
||||
// 'Units Editor' settings
|
||||
const US = navigator.language === "en-US";
|
||||
|
|
|
|||
|
|
@ -107,13 +107,15 @@ function editWorld() {
|
|||
function updateGlobeTemperature() {
|
||||
const tEq = +document.getElementById("temperatureEquatorOutput").value;
|
||||
document.getElementById("temperatureEquatorF").innerHTML = rn((tEq * 9) / 5 + 32);
|
||||
const tNPole = +document.getElementById("temperatureNorthPoleOutput").value;
|
||||
document.getElementById("temperatureNorthPoleF").innerHTML = rn((tNPole * 9) / 5 + 32);
|
||||
const tSPole = +document.getElementById("temperatureSouthPoleOutput").value;
|
||||
document.getElementById("temperatureSouthPoleF").innerHTML = rn((tSPole * 9) / 5 + 32);
|
||||
globe.selectAll(".tempGradient90").attr("stop-color", clr(1 - (tNPole - tMin) / (tMax - tMin)));
|
||||
globe.selectAll(".tempGradient60").attr("stop-color", clr(1 - (tEq - ((tEq - tNPole) * 2) / 3 - tMin) / (tMax - tMin)));
|
||||
globe.selectAll(".tempGradient30").attr("stop-color", clr(1 - (tEq - ((tEq - tNPole) * 1) / 3 - tMin) / (tMax - tMin)));
|
||||
const tNorthPole = +document.getElementById("temperatureNorthPoleOutput").value;
|
||||
document.getElementById("temperatureNorthPoleF").innerHTML = rn((tNorthPole * 9) / 5 + 32);
|
||||
const tSouthPole = +document.getElementById("temperatureSouthPoleOutput").value;
|
||||
document.getElementById("temperatureSouthPoleF").innerHTML = rn((tSouthPole * 9) / 5 + 32);
|
||||
//Update Settings to match the slider(there may be a better solution)
|
||||
options.SouthPoleTemperature = +tSouthPole;
|
||||
globe.selectAll(".tempGradient90").attr("stop-color", clr(1 - (tNorthPole - tMin) / (tMax - tMin)));
|
||||
globe.selectAll(".tempGradient60").attr("stop-color", clr(1 - (tEq - ((tEq - tNorthPole) * 2) / 3 - tMin) / (tMax - tMin)));
|
||||
globe.selectAll(".tempGradient30").attr("stop-color", clr(1 - (tEq - ((tEq - tNorthPole) * 1) / 3 - tMin) / (tMax - tMin)));
|
||||
globe.select(".tempGradient0").attr("stop-color", clr(1 - (tEq - tMin) / (tMax - tMin)));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue