From 5ac99d180de7a2348fc44b0bbc9647c8794f39ba Mon Sep 17 00:00:00 2001 From: Azgaar Date: Tue, 22 Oct 2024 14:45:25 +0200 Subject: [PATCH 1/7] chore: parse DEBUG setting as an object --- index.html | 6 +++--- main.js | 4 ++-- modules/io/cloud.js | 6 +++--- modules/io/load.js | 2 +- modules/renderers/draw-state-labels.js | 14 +++++++++----- modules/submap.js | 3 +-- utils/stringUtils.js | 8 ++++++++ versioning.js | 2 +- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index d14c9381..8f2705fb 100644 --- a/index.html +++ b/index.html @@ -8073,7 +8073,7 @@ - + @@ -8120,7 +8120,7 @@ - + @@ -8131,7 +8131,7 @@ - + diff --git a/main.js b/main.js index 7beab61f..c4279296 100644 --- a/main.js +++ b/main.js @@ -4,7 +4,7 @@ // set debug options const PRODUCTION = location.hostname && location.hostname !== "localhost" && location.hostname !== "127.0.0.1"; -const DEBUG = localStorage.getItem("debug"); +const DEBUG = JSON.safeParse(localStorage.getItem("debug")) || {}; const INFO = true; const TIME = true; const WARN = true; @@ -922,7 +922,7 @@ function calculateTemperatures() { const [, y] = grid.points[rowCellId]; const rowLatitude = mapCoordinates.latN - (y / graphHeight) * mapCoordinates.latT; // [90; -90] const tempSeaLevel = calculateSeaLevelTemp(rowLatitude); - DEBUG && console.info(`${rn(rowLatitude)}° sea temperature: ${rn(tempSeaLevel)}°C`); + DEBUG.temperature && console.info(`${rn(rowLatitude)}° sea temperature: ${rn(tempSeaLevel)}°C`); for (let cellId = rowCellId; cellId < rowCellId + grid.cellsX; cellId++) { const tempAltitudeDrop = getAltitudeTemperatureDrop(cells.h[cellId]); diff --git a/modules/io/cloud.js b/modules/io/cloud.js index b25b6a90..17ca92db 100644 --- a/modules/io/cloud.js +++ b/modules/io/cloud.js @@ -60,7 +60,7 @@ window.Cloud = (function () { async save(fileName, contents) { const resp = await this.call("filesUpload", {path: "/" + fileName, contents}); - DEBUG && console.info("Dropbox response:", resp); + DEBUG.cloud && console.info("Dropbox response:", resp); return true; }, @@ -104,7 +104,7 @@ window.Cloud = (function () { // Callback function for auth window async setDropBoxToken(token) { - DEBUG && console.info("Access token:", token); + DEBUG.cloud && console.info("Access token:", token); setToken(this.name, token); await this.connect(token); this.authWindow.close(); @@ -131,7 +131,7 @@ window.Cloud = (function () { allow_download: true }; const resp = await this.call("sharingCreateSharedLinkWithSettings", {path, settings}); - DEBUG && console.info("Dropbox link object:", resp.result); + DEBUG.cloud && console.info("Dropbox link object:", resp.result); return resp.result.url; } }; diff --git a/modules/io/load.js b/modules/io/load.js index cd00b28c..05819ce7 100644 --- a/modules/io/load.js +++ b/modules/io/load.js @@ -13,7 +13,7 @@ async function quickLoad() { async function loadFromDropbox() { const mapPath = byId("loadFromDropboxSelect")?.value; - DEBUG && console.info("Loading map from Dropbox:", mapPath); + console.info("Loading map from Dropbox:", mapPath); const blob = await Cloud.providers.dropbox.load(mapPath); uploadMap(blob); } diff --git a/modules/renderers/draw-state-labels.js b/modules/renderers/draw-state-labels.js index ab49437d..d30d185c 100644 --- a/modules/renderers/draw-state-labels.js +++ b/modules/renderers/draw-state-labels.js @@ -47,8 +47,10 @@ function drawStateLabels(list) { const pathPoints = [[ray1.x, ray1.y], state.pole, [ray2.x, ray2.y]]; if (ray1.x > ray2.x) pathPoints.reverse(); - DEBUG && drawPoint(state.pole, {color: "black", radius: 1}); - DEBUG && drawPath(pathPoints, {color: "black", width: 0.2}); + if (DEBUG.stateLabels) { + drawPoint(state.pole, {color: "black", radius: 1}); + drawPath(pathPoints, {color: "black", width: 0.2}); + } labelPaths.push([state.i, pathPoints]); } @@ -163,9 +165,11 @@ function drawStateLabels(list) { const offset1 = [x + -dy * offset, y + dx * offset]; const offset2 = [x + dy * offset, y + -dx * offset]; - DEBUG && drawPoint([x, y], {color: isInsideState(x, y) ? "blue" : "red", radius: 0.8}); - DEBUG && drawPoint(offset1, {color: isInsideState(...offset1) ? "blue" : "red", radius: 0.4}); - DEBUG && drawPoint(offset2, {color: isInsideState(...offset2) ? "blue" : "red", radius: 0.4}); + if (DEBUG.stateLabels) { + drawPoint([x, y], {color: isInsideState(x, y) ? "blue" : "red", radius: 0.8}); + drawPoint(offset1, {color: isInsideState(...offset1) ? "blue" : "red", radius: 0.4}); + drawPoint(offset2, {color: isInsideState(...offset2) ? "blue" : "red", radius: 0.4}); + } const inState = isInsideState(x, y) && isInsideState(...offset1) && isInsideState(...offset2); if (!inState) break; diff --git a/modules/submap.js b/modules/submap.js index 2fb4582f..3c783fb0 100644 --- a/modules/submap.js +++ b/modules/submap.js @@ -31,7 +31,6 @@ window.Submap = (function () { seed = parentMap.seed; Math.random = aleaPRNG(seed); INFO && console.group("SubMap with seed: " + seed); - DEBUG && console.info("Using Options:", options); applyGraphSize(); grid = generateGrid(); @@ -373,7 +372,7 @@ window.Submap = (function () { b.removed = true; return; } - DEBUG && console.info(`Moving ${b.name} from ${cityCell} to ${newCell} near ${neighbor}.`); + [b.x, b.y] = b.port ? getCloseToEdgePoint(newCell, neighbor) : cells.p[newCell]; if (b.port) b.port = cells.f[neighbor]; // copy feature number b.cell = newCell; diff --git a/utils/stringUtils.js b/utils/stringUtils.js index 6325d278..1027ee8f 100644 --- a/utils/stringUtils.js +++ b/utils/stringUtils.js @@ -56,3 +56,11 @@ JSON.isValid = str => { } return true; }; + +JSON.safeParse = str => { + try { + return JSON.parse(str); + } catch (e) { + return null; + } +}; diff --git a/versioning.js b/versioning.js index acb67e2b..076de37c 100644 --- a/versioning.js +++ b/versioning.js @@ -12,7 +12,7 @@ * * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.105.18"; +const VERSION = "1.105.19"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); { From 2ec2c9f77368554bbe53b9198974c783e4f0c81d Mon Sep 17 00:00:00 2001 From: Azgaar Date: Tue, 22 Oct 2024 15:10:33 +0200 Subject: [PATCH 2/7] chore: update 1.105.19 hash --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 8f2705fb..41afe3b6 100644 --- a/index.html +++ b/index.html @@ -8037,7 +8037,7 @@ - + From 54491cfd099bcd3d094b658cce1945aa51114769 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Tue, 22 Oct 2024 23:04:57 +0200 Subject: [PATCH 3/7] feat: zones editor - don't close other editors on open --- index.html | 2 +- modules/ui/zones-editor.js | 2 +- versioning.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 41afe3b6..96b9374e 100644 --- a/index.html +++ b/index.html @@ -8101,7 +8101,7 @@ - + diff --git a/modules/ui/zones-editor.js b/modules/ui/zones-editor.js index d575a544..85888c4e 100644 --- a/modules/ui/zones-editor.js +++ b/modules/ui/zones-editor.js @@ -1,7 +1,7 @@ "use strict"; function editZones() { - closeDialogs(); + closeDialogs("#zonesEditor, .stable"); if (!layerIsOn("toggleZones")) toggleZones(); const body = byId("zonesBodySection"); diff --git a/versioning.js b/versioning.js index 076de37c..fcd5504b 100644 --- a/versioning.js +++ b/versioning.js @@ -12,7 +12,7 @@ * * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.105.19"; +const VERSION = "1.105.20"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); { From d7f5cae2298cef6748f90d92d6a2161b39e62b74 Mon Sep 17 00:00:00 2001 From: "Ryan D. Guild" Date: Sat, 26 Oct 2024 08:26:59 -0400 Subject: [PATCH 4/7] Removed priority queue in favor of FlatQueue (#1157) * removed priority queue in favor of simple array extension as it will be easier to migrate to esm * patch: bump version * spacing * moved references to globalThis * demonstrate module interop * added version to priority-queue and moved to utils to follow dom loading pattern * removed PriorityQueue in favor of FlatQueue * update index.html * never mind that force push I don't know how to amend commits right * missing capitalization * priority set to 0 on 541 --------- Co-authored-by: RyanGuild --- index.html | 11 +++++------ libs/priority-queue.min.js | 1 - modules/burgs-and-states.js | 10 ++++++---- modules/cultures-generator.js | 8 ++++---- modules/provinces-generator.js | 22 +++++++++++----------- modules/religions-generator.js | 8 ++++---- modules/zones-generator.js | 16 ++++++++-------- versioning.js | 3 ++- 8 files changed, 40 insertions(+), 39 deletions(-) delete mode 100644 libs/priority-queue.min.js diff --git a/index.html b/index.html index 96b9374e..3b2d7203 100644 --- a/index.html +++ b/index.html @@ -8022,7 +8022,6 @@ - @@ -8053,14 +8052,14 @@ - - - + + + - + - + diff --git a/libs/priority-queue.min.js b/libs/priority-queue.min.js deleted file mode 100644 index acf2506b..00000000 --- a/libs/priority-queue.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).PriorityQueue=t()}}(function(){return function t(e,i,r){function o(n,s){if(!i[n]){if(!e[n]){var h="function"==typeof require&&require;if(!s&&h)return h(n,!0);if(a)return a(n,!0);var u=new Error("Cannot find module '"+n+"'");throw u.code="MODULE_NOT_FOUND",u}var p=i[n]={exports:{}};e[n][0].call(p.exports,function(t){var i=e[n][1][t];return o(i||t)},p,p.exports,t,e,i,r)}return i[n].exports}for(var a="function"==typeof require&&require,n=0;n>>1],e)>=0?o=a+1:r=a;return o},e.exports=function(){function t(t){var e;this.options=t,this.comparator=this.options.comparator,this.data=(null!=(e=this.options.initialValues)?e.slice(0):void 0)||[],this.data.sort(this.comparator).reverse()}return t.prototype.queue=function(t){var e;e=r(this.data,t,this.comparator),this.data.splice(e,0,t)},t.prototype.dequeue=function(){return this.data.pop()},t.prototype.peek=function(){return this.data[this.data.length-1]},t.prototype.clear=function(){this.data.length=0},t}()},{}],4:[function(t,e,i){e.exports=function(){function t(t){var e,i,r,o,a,n,s,h;for(this.comparator=(null!=t?t.comparator:void 0)||function(t,e){return t-e},this.pageSize=(null!=t?t.pageSize:void 0)||512,this.length=0,s=0;1<a;0<=a?++i:--i)e.push(null);if(this._memory=[],this._mask=this.pageSize-1,t.initialValues)for(r=0,o=(n=t.initialValues).length;r0&&(this._write(1,e),this._bubbleDown(1,e)),t},t.prototype.peek=function(){return this._read(1)},t.prototype.clear=function(){this.length=0,this._memory.length=0},t.prototype._write=function(t,e){var i;for(i=t>>this._shift;i>=this._memory.length;)this._memory.push(this._emptyMemoryPageTemplate.slice(0));return this._memory[i][t&this._mask]=e},t.prototype._read=function(t){return this._memory[t>>this._shift][t&this._mask]},t.prototype._bubbleUp=function(t,e){var i,r,o,a;for(i=this.comparator;t>1&&(r=t&this._mask,t3?o=t&~this._mask|r>>1:r<2?(o=t-this.pageSize>>this._shift,o+=o&~(this._mask>>1),o|=this.pageSize>>1):o=t-2,!(i(a=this._read(o),e)<0));)this._write(o,e),this._write(t,a),t=o},t.prototype._bubbleDown=function(t,e){var i,r,o,a,n;for(n=this.comparator;tthis._mask&&!(t&this._mask-1)?i=r=t+2:t&this.pageSize>>1?(i=(t&~this._mask)>>1,r=(i=(i|=t&this._mask>>1)+1<0)for(t=e=1,i=this.data.length;1<=i?ei;t=1<=i?++e:--e)this._bubbleUp(t)},t.prototype.queue=function(t){this.data.push(t),this._bubbleUp(this.data.length-1)},t.prototype.dequeue=function(){var t,e;return e=this.data[0],t=this.data.pop(),this.data.length>0&&(this.data[0]=t,this._bubbleDown(0)),e},t.prototype.peek=function(){return this.data[0]},t.prototype.clear=function(){this.length=0,this.data.length=0},t.prototype._bubbleUp=function(t){for(var e,i;t>0&&(e=t-1>>>1,this.comparator(this.data[t],this.data[e])<0);)i=this.data[e],this.data[e]=this.data[t],this.data[t]=i,t=e},t.prototype._bubbleDown=function(t){var e,i,r,o,a;for(e=this.data.length-1;o=(i=1+(t<<1))+1,r=t,i<=e&&this.comparator(this.data[i],this.data[r])<0&&(r=i),o<=e&&this.comparator(this.data[o],this.data[r])<0&&(r=o),r!==t;)a=this.data[r],this.data[r]=this.data[t],this.data[t]=a,t=r},t}()},{}]},{},[1])(1)}); \ No newline at end of file diff --git a/modules/burgs-and-states.js b/modules/burgs-and-states.js index 90ab2bf2..4b73276b 100644 --- a/modules/burgs-and-states.js +++ b/modules/burgs-and-states.js @@ -286,7 +286,8 @@ window.BurgsAndStates = (() => { const {cells, states, cultures, burgs} = pack; cells.state = cells.state || new Uint16Array(cells.i.length); - const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p}); + + const queue = new FlatQueue(); const cost = []; const globalGrowthRate = byId("growthRate").valueAsNumber || 1; @@ -307,12 +308,13 @@ window.BurgsAndStates = (() => { cells.state[capitalCell] = state.i; const cultureCenter = cultures[state.culture].center; const b = cells.biome[cultureCenter]; // state native biome - queue.queue({e: state.center, p: 0, s: state.i, b}); + queue.push({e: state.center, p: 0, s: state.i, b}, 0); cost[state.center] = 1; } while (queue.length) { - const next = queue.dequeue(); + const next = queue.pop(); + const {e, p, s, b} = next; const {type, culture} = states[s]; @@ -335,7 +337,7 @@ window.BurgsAndStates = (() => { if (!cost[e] || totalCost < cost[e]) { if (cells.h[e] >= 20) cells.state[e] = s; // assign state to cell cost[e] = totalCost; - queue.queue({e, p: totalCost, s, b}); + queue.push({e, p: totalCost, s, b}, totalCost); } }); } diff --git a/modules/cultures-generator.js b/modules/cultures-generator.js index f2203146..34dc5edd 100644 --- a/modules/cultures-generator.js +++ b/modules/cultures-generator.js @@ -518,7 +518,7 @@ window.Cultures = (function () { TIME && console.time("expandCultures"); const {cells, cultures} = pack; - const queue = new PriorityQueue({comparator: (a, b) => a.priority - b.priority}); + const queue = new FlatQueue(); const cost = []; const neutralRate = byId("neutralRate")?.valueAsNumber || 1; @@ -538,11 +538,11 @@ window.Cultures = (function () { for (const culture of cultures) { if (!culture.i || culture.removed || culture.lock) continue; - queue.queue({cellId: culture.center, cultureId: culture.i, priority: 0}); + queue.push({cellId: culture.center, cultureId: culture.i, priority: 0}, 0); } while (queue.length) { - const {cellId, priority, cultureId} = queue.dequeue(); + const {cellId, priority, cultureId} = queue.pop(); const {type, expansionism} = cultures[cultureId]; cells.c[cellId].forEach(neibCellId => { @@ -566,7 +566,7 @@ window.Cultures = (function () { if (!cost[neibCellId] || totalCost < cost[neibCellId]) { if (cells.pop[neibCellId] > 0) cells.culture[neibCellId] = cultureId; // assign culture to populated cell cost[neibCellId] = totalCost; - queue.queue({cellId: neibCellId, cultureId, priority: totalCost}); + queue.push({cellId: neibCellId, cultureId, priority: totalCost}, totalCost); } }); } diff --git a/modules/provinces-generator.js b/modules/provinces-generator.js index 8563f682..c0f8e8f7 100644 --- a/modules/provinces-generator.js +++ b/modules/provinces-generator.js @@ -77,18 +77,18 @@ window.Provinces = (function () { }); // expand generated provinces - const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p}); + const queue = new FlatQueue(); const cost = []; provinces.forEach(p => { if (!p.i || p.removed || isProvinceLocked(p)) return; provinceIds[p.center] = p.i; - queue.queue({e: p.center, p: 0, province: p.i, state: p.state}); + queue.push({e: p.center, province: p.i, state: p.state, p: 0}, 0); cost[p.center] = 1; }); while (queue.length) { - const {e, p, province, state} = queue.dequeue(); + const {e, p, province, state} = queue.pop(); cells.c[e].forEach(e => { if (isProvinceCellLocked(e)) return; // do not overwrite cell of locked provinces @@ -103,7 +103,7 @@ window.Provinces = (function () { if (!cost[e] || totalCost < cost[e]) { if (land) provinceIds[e] = province; // assign province to a cell cost[e] = totalCost; - queue.queue({e, p: totalCost, province, state}); + queue.push({e, province, state, p: totalCost}, totalCost); } }); } @@ -158,9 +158,9 @@ window.Provinces = (function () { // expand province const cost = []; cost[center] = 1; - queue.queue({e: center, p: 0}); + queue.push({e: center, p: 0}, 0); while (queue.length) { - const {e, p} = queue.dequeue(); + const {e, p} = queue.pop(); cells.c[e].forEach(nextCellId => { if (provinceIds[nextCellId]) return; @@ -173,7 +173,7 @@ window.Provinces = (function () { if (!cost[nextCellId] || totalCost < cost[nextCellId]) { if (land && cells.state[nextCellId] === s.i) provinceIds[nextCellId] = provinceId; // assign province to a cell cost[nextCellId] = totalCost; - queue.queue({e: nextCellId, p: totalCost}); + queue.push({e: nextCellId, p: totalCost}, totalCost); } }); } @@ -216,15 +216,15 @@ window.Provinces = (function () { // check if there is a land way within the same state between two cells function isPassable(from, to) { if (cells.f[from] !== cells.f[to]) return false; // on different islands - const queue = [from], + const passableQueue = [from], used = new Uint8Array(cells.i.length), state = cells.state[from]; - while (queue.length) { - const current = queue.pop(); + while (passableQueue.length) { + const current = passableQueue.pop(); if (current === to) return true; // way is found cells.c[current].forEach(c => { if (used[c] || cells.h[c] < 20 || cells.state[c] !== state) return; - queue.push(c); + passableQueue.push(c); used[c] = 1; }); } diff --git a/modules/religions-generator.js b/modules/religions-generator.js index 5e5e08f6..2bb972db 100644 --- a/modules/religions-generator.js +++ b/modules/religions-generator.js @@ -695,7 +695,7 @@ window.Religions = (function () { const {cells, routes} = pack; const religionIds = spreadFolkReligions(religions); - const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p}); + const queue = new FlatQueue(); const cost = []; // limit cost for organized religions growth @@ -705,14 +705,14 @@ window.Religions = (function () { .filter(r => r.i && !r.lock && r.type !== "Folk" && !r.removed) .forEach(r => { religionIds[r.center] = r.i; - queue.queue({e: r.center, p: 0, r: r.i, s: cells.state[r.center]}); + queue.push({e: r.center, p: 0, r: r.i, s: cells.state[r.center]}, 0); cost[r.center] = 1; }); const religionsMap = new Map(religions.map(r => [r.i, r])); while (queue.length) { - const {e: cellId, p, r, s: state} = queue.dequeue(); + const {e: cellId, p, r, s: state} = queue.pop(); const {culture, expansion, expansionism} = religionsMap.get(r); cells.c[cellId].forEach(nextCell => { @@ -732,7 +732,7 @@ window.Religions = (function () { if (cells.culture[nextCell]) religionIds[nextCell] = r; // assign religion to cell cost[nextCell] = totalCost; - queue.queue({e: nextCell, p: totalCost, r, s: state}); + queue.push({e: nextCell, p: totalCost, r, s: state}, totalCost); } }); } diff --git a/modules/zones-generator.js b/modules/zones-generator.js index 7e8ec94b..0fdab688 100644 --- a/modules/zones-generator.js +++ b/modules/zones-generator.js @@ -209,11 +209,11 @@ window.Zones = (function () { const cost = []; const maxCells = rand(20, 40); - const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p}); - queue.queue({e: burg.cell, p: 0}); + const queue = new FlatQueue(); + queue.push({e: burg.cell, p: 0}, 0); while (queue.length) { - const next = queue.dequeue(); + const next = queue.pop(); if (cells.burg[next.e] || cells.pop[next.e]) cellsArray.push(next.e); usedCells[next.e] = 1; @@ -224,7 +224,7 @@ window.Zones = (function () { if (!cost[nextCellId] || p < cost[nextCellId]) { cost[nextCellId] = p; - queue.queue({e: nextCellId, p}); + queue.push({e: nextCellId, p}, p); } }); } @@ -251,11 +251,11 @@ window.Zones = (function () { const cost = []; const maxCells = rand(5, 25); - const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p}); - queue.queue({e: burg.cell, p: 0}); + const queue = new FlatQueue(); + queue.push({e: burg.cell, p: 0}, 0); while (queue.length) { - const next = queue.dequeue(); + const next = queue.pop(); if (cells.burg[next.e] || cells.pop[next.e]) cellsArray.push(next.e); usedCells[next.e] = 1; @@ -266,7 +266,7 @@ window.Zones = (function () { if (!cost[e] || p < cost[e]) { cost[e] = p; - queue.queue({e, p}); + queue.push({e, p}), p; } }); } diff --git a/versioning.js b/versioning.js index fcd5504b..c5bf2fa4 100644 --- a/versioning.js +++ b/versioning.js @@ -12,7 +12,8 @@ * * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.105.20"; + +const VERSION = "1.105.21"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); { From 1706fa0981edf0dd825cd1ee3c604b721dc0f1fd Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 26 Oct 2024 14:29:52 +0200 Subject: [PATCH 5/7] fix: add p to priority queue --- modules/zones-generator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/zones-generator.js b/modules/zones-generator.js index 0fdab688..641a0784 100644 --- a/modules/zones-generator.js +++ b/modules/zones-generator.js @@ -266,7 +266,7 @@ window.Zones = (function () { if (!cost[e] || p < cost[e]) { cost[e] = p; - queue.push({e, p}), p; + queue.push({e, p}, p); } }); } From 91dc16878eade53217a29f710f4b3603157157b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Montero=20Lamas?= Date: Sat, 26 Oct 2024 14:40:43 +0200 Subject: [PATCH 6/7] Stroke dash to cells (#1159) * style.js sorted items alphabetically * style.js added strokeDash to "cells" --- modules/ui/style.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/ui/style.js b/modules/ui/style.js index 49d1d8fb..3df79026 100644 --- a/modules/ui/style.js +++ b/modules/ui/style.js @@ -116,20 +116,20 @@ function selectStyleElement() { if ( [ "armies", - "routes", - "lakes", "biomes", "borders", - "cults", - "relig", "cells", "coastline", - "prec", + "coordinates", + "cults", + "gridOverlay", "ice", "icons", - "coordinates", - "zones", - "gridOverlay" + "lakes", + "prec", + "relig", + "routes", + "zones" ].includes(styleElement) ) { styleStroke.style.display = "block"; @@ -140,7 +140,7 @@ function selectStyleElement() { // stroke dash if ( - ["routes", "borders", "temperature", "legend", "population", "coordinates", "zones", "gridOverlay"].includes( + ["borders", "cells", "coordinates", "gridOverlay", "legend", "population", "routes", "temperature", "zones"].includes( styleElement ) ) { @@ -788,7 +788,7 @@ styleShadowInput.on("input", function () { styleFontAdd.on("click", function () { addFontNameInput.value = ""; addFontURLInput.value = ""; - + $("#addFontDialog").dialog({ title: "Add custom font", width: "26em", From ca8e7230067d8569472c4ba4beac4e5e79a885a7 Mon Sep 17 00:00:00 2001 From: Dyxang <36600710+dyxang@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:23:38 +0800 Subject: [PATCH 7/7] Temperature parameters can be customized (#1162) * Temperature parameters can be customized * fix typo * update to 1.105.22 * Update index.html --- index.html | 15 +++++++++++++-- modules/ui/ai-generator.js | 15 +++++++++++---- modules/ui/notes-editor.js | 2 +- versioning.js | 2 +- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 3b2d7203..99c9f849 100644 --- a/index.html +++ b/index.html @@ -4951,7 +4951,18 @@ >Model: - +