mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
Current Version(without the save changes)
This commit is contained in:
parent
0936a03c60
commit
104fd9b8d5
5 changed files with 14 additions and 17 deletions
16
main.js
16
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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue