diff --git a/main.js b/main.js index e9343933..ebf156bb 100644 --- a/main.js +++ b/main.js @@ -184,7 +184,8 @@ let options = { pinNotes: false, showMFCGMap: true, winds: [225, 45, 225, 315, 135, 315], - SouthPoleTemperature: 0, + tempNorthPole: 0, + tempSouthPole: 0, stateLabelsMode: "auto" }; let mapCoordinates = {}; // map coordinates on globe @@ -1009,13 +1010,14 @@ function calculateTemperatures() { TIME && console.time("calculateTemperatures"); const cells = grid.cells; cells.temp = new Int8Array(cells.i.length); // temperature array - const tEq = +temperatureEquatorInput.value; - const tNPole = +temperatureNorthPoleInput.value; - //TODO Find proper delta to calculate - const tSPole = +temperatureSouthPoleInput.value; - const tNDelta = tEq - tNPole; - const tSDelta = tEq - tSPole; + const tNorthPole = +temperatureNorthPoleInput.value; + const tSouthPole = +temperatureSouthPoleInput.value; + //Update Settings to match the slider(there may be a better solution) + options.tempSouthPole = +tSouthPole; + options.tempNorthPole = +tNorthPole; + const tNDelta = tEq - tNorthPole; + const tSDelta = tEq - tSouthPole; const int = d3.easePolyInOut.exponent(0.5); // interpolation function d3.range(0, cells.i.length, grid.cellsX).forEach(function (r) { diff --git a/modules/dynamic/auto-update.js b/modules/dynamic/auto-update.js index 4ed974af..1ba05747 100644 --- a/modules/dynamic/auto-update.js +++ b/modules/dynamic/auto-update.js @@ -639,6 +639,7 @@ export function resolveVersionConflicts(version) { if (version < 1.89) { //May need a major bump - options.SouthPoleTemperature = +temperatureNorthPoleInput.value; + options.tempNorthPole = +temperatureNorthPoleInput.value; + options.tempSouthPole = +temperatureNorthPoleInput.value; } } diff --git a/modules/io/load.js b/modules/io/load.js index 56452780..38e1dcea 100644 --- a/modules/io/load.js +++ b/modules/io/load.js @@ -589,7 +589,7 @@ async function parseLoadedData(data) { // set options yearInput.value = options.year; eraInput.value = options.era; - temperatureSouthPoleOutput.value = temperatureSouthPoleInput.value = options.SouthPoleTemperature; + temperatureSouthPoleOutput.value = temperatureSouthPoleInput.value = options.tempSouthPole; shapeRendering.value = viewbox.attr("shape-rendering") || "geometricPrecision"; if (window.restoreDefaultEvents) restoreDefaultEvents(); diff --git a/modules/ui/options.js b/modules/ui/options.js index 547ccada..ce34109d 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -613,12 +613,8 @@ function randomizeOptions() { if (randomize || !locked("temperatureEquator")) temperatureEquatorOutput.value = temperatureEquatorInput.value = rand(tMax - 10, tMax); if (randomize || !locked("temperaturePole")) { - temperatureNorthPoleOutput.value - = temperatureNorthPoleInput.value - = temperatureSouthPoleOutput.value - = temperatureSouthPoleInput.value - = options.SouthPoleTemperature - = rand(tMin, tMin + 30); + temperatureNorthPoleOutput.value = temperatureNorthPoleInput.value = rand(tMin, tMin + 30); + temperatureSouthPoleOutput.value = temperatureSouthPoleInput.value = rand(tMin, tMin + 30); } diff --git a/modules/ui/world-configurator.js b/modules/ui/world-configurator.js index 6b9adf78..c8639d3d 100644 --- a/modules/ui/world-configurator.js +++ b/modules/ui/world-configurator.js @@ -111,8 +111,6 @@ function editWorld() { 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)));