diff --git a/index.html b/index.html index 4c6422ce..adb0c7e8 100644 --- a/index.html +++ b/index.html @@ -8066,89 +8066,103 @@ - + + + + + + + + + + + + + + + + + + - + + - - - - - - + + + - + - - - + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - + + + diff --git a/main.js b/main.js index dd502f56..6881edeb 100644 --- a/main.js +++ b/main.js @@ -2,10 +2,7 @@ // https://github.com/Azgaar/Fantasy-Map-Generator "use strict"; -const version = "1.662"; // generator version -document.title += " v" + version; - -// switches to disable/enable logging features +// set debug options const PRODUCTION = location.hostname && location.hostname !== "localhost" && location.hostname !== "127.0.0.1"; const DEBUG = localStorage.getItem("debug"); const INFO = DEBUG || !PRODUCTION; @@ -53,7 +50,7 @@ let landmass = viewbox.append("g").attr("id", "landmass"); let texture = viewbox.append("g").attr("id", "texture"); let terrs = viewbox.append("g").attr("id", "terrs"); let biomes = viewbox.append("g").attr("id", "biomes"); -let gridCells = viewbox.append("g").attr("id", "cells"); +let cells = viewbox.append("g").attr("id", "cells"); let gridOverlay = viewbox.append("g").attr("id", "gridOverlay"); let coordinates = viewbox.append("g").attr("id", "coordinates"); let compass = viewbox.append("g").attr("id", "compass"); @@ -731,21 +728,6 @@ async function generate(options) { BurgsAndStates.defineStateForms(); BurgsAndStates.defineTaxes(); - Production.collectResources(); - - Trade.defineCenters(); - Trade.calculateDistances(); - Trade.exportGoods(); - Trade.importGoods(); - - // temp, replace with route generator - // pack.cells.road = new Uint16Array(pack.cells.i.length); - // pack.cells.crossroad = new Uint16Array(pack.cells.i.length); - - Religions.generate(); - BurgsAndStates.defineStateForms(); - BurgsAndStates.defineTaxes(); - Production.collectResources(); Production.defineExport(); diff --git a/modules/ui/burg-editor.js b/modules/ui/burg-editor.js index 3a217f29..6cad8765 100644 --- a/modules/ui/burg-editor.js +++ b/modules/ui/burg-editor.js @@ -96,12 +96,6 @@ function editBurg(id) { document.getElementById('burgExport').innerHTML = getExport(deals.filter((deal) => deal.exporter === b.i)); document.getElementById('burgImport').innerHTML = ''; - // economics block - document.getElementById('burgProduction').innerHTML = getProduction(b.produced); - const deals = pack.trade.deals; - document.getElementById('burgExport').innerHTML = getExport(deals.filter((deal) => deal.exporter === b.i)); - document.getElementById('burgImport').innerHTML = ''; - //toggle lock updateBurgLockIcon(); @@ -663,16 +657,8 @@ function editBurg(id) { } } }); - } else { - const message = 'Are you sure you want to remove the burg?
This action cannot be reverted'; - const onConfirm = () => { - removeBurg(id); - $('#burgEditor').dialog('close'); - }; - confirmationDialog({title: 'Remove burg', message, confirm: 'Remove', onConfirm}); - } + } } - function closeBurgEditor() { document.getElementById('burgRelocate').classList.remove('pressed'); burgLabels.selectAll('text').call(d3.drag().on('drag', null)).classed('draggable', false); diff --git a/modules/ui/heightmap-editor.js b/modules/ui/heightmap-editor.js index 5f62ebd6..88953262 100644 --- a/modules/ui/heightmap-editor.js +++ b/modules/ui/heightmap-editor.js @@ -3,7 +3,7 @@ function editHeightmap(options) { const {mode, tool} = options || {}; restartHistory(); - viewbox.insert('g', '#terrs').attr('id', 'heights'); + viewbox.insert("g", "#terrs").attr("id", "heights"); if (!mode) showModeDialog(); else enterHeightmapEditMode(mode); @@ -982,9 +982,6 @@ function editHeightmap(options) { const steps = byId("templateBody").querySelectorAll("#templateBody > div"); if (!steps.length) return; - const seed = byId("templateSeed").value; - if (seed) Math.random = aleaPRNG(seed); - grid.cells.h = createTypedArray({maxValue: 100, length: grid.points.length}); HeightmapGenerator.setGraph(grid); restartHistory(); diff --git a/modules/ui/tools.js b/modules/ui/tools.js index 73e8536b..54caec75 100644 --- a/modules/ui/tools.js +++ b/modules/ui/tools.js @@ -343,13 +343,6 @@ function regenerateBurgs() { if (document.getElementById("statesEditorRefresh")?.offsetParent) statesEditorRefresh.click(); } -function regenerateResources() { - Resources.generate(); - goods.selectAll('*').remove(); - if (layerIsOn('toggleResources')) drawResources(); - refreshAllEditors(); -} - function regenerateResources() { Resources.generate(); goods.selectAll("*").remove();