mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-04-04 14:37:24 +02:00
This commit is contained in:
parent
0ff0311a98
commit
a276b61b2d
5 changed files with 71 additions and 31 deletions
|
|
@ -1104,6 +1104,12 @@ export function resolveVersionConflicts(mapVersion) {
|
||||||
// Re-render ice from migrated data
|
// Re-render ice from migrated data
|
||||||
if (layerIsOn("toggleIce")) drawIce();
|
if (layerIsOn("toggleIce")) drawIce();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isOlderThan("1.113.0")) {
|
||||||
|
// v1.113.0 fixed issue with zone.cells getting rediculously long
|
||||||
|
pack.zones.forEach(zone => {
|
||||||
|
zone.cells = unique(zone.cells);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -473,7 +473,7 @@ async function parseLoadedData(data, mapVersion) {
|
||||||
|
|
||||||
{
|
{
|
||||||
// dynamically import and run auto-update script
|
// dynamically import and run auto-update script
|
||||||
const {resolveVersionConflicts} = await import("../dynamic/auto-update.js?v=1.109.4");
|
const {resolveVersionConflicts} = await import("../dynamic/auto-update.js?v=1.113.0");
|
||||||
resolveVersionConflicts(mapVersion);
|
resolveVersionConflicts(mapVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -330,10 +330,12 @@ function editHeightmap(options) {
|
||||||
c.y = p[1];
|
c.y = p[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// save zone grid cells to restore them later
|
||||||
const zoneGridCellsMap = new Map();
|
const zoneGridCellsMap = new Map();
|
||||||
for (const zone of pack.zones) {
|
for (const zone of pack.zones) {
|
||||||
if (!zone.cells || !zone.cells.length) continue;
|
if (!zone.cells?.length) continue;
|
||||||
zoneGridCellsMap.set(zone.i, zone.cells.map(i => pack.cells.g[i]));
|
const zoneGridCells = zone.cells.map(i => pack.cells.g[i]);
|
||||||
|
zoneGridCellsMap.set(zone.i, unique(zoneGridCells));
|
||||||
}
|
}
|
||||||
|
|
||||||
Features.markupGrid();
|
Features.markupGrid();
|
||||||
|
|
@ -451,10 +453,15 @@ function editHeightmap(options) {
|
||||||
gridToPackMap.get(g).push(i);
|
gridToPackMap.get(g).push(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// restore zone cells
|
||||||
for (const zone of pack.zones) {
|
for (const zone of pack.zones) {
|
||||||
const gridCells = zoneGridCellsMap.get(zone.i);
|
const gridCells = zoneGridCellsMap.get(zone.i);
|
||||||
if (!gridCells || !gridCells.length) continue;
|
if (gridCells?.length) {
|
||||||
zone.cells = gridCells.flatMap(g => gridToPackMap.get(g) || []);
|
const packCells = gridCells.flatMap(g => gridToPackMap.get(g) || []);
|
||||||
|
zone.cells = unique(packCells);
|
||||||
|
} else {
|
||||||
|
zone.cells = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// recalculate ice
|
// recalculate ice
|
||||||
|
|
@ -665,7 +672,10 @@ function editHeightmap(options) {
|
||||||
if (power === 0) return tip("Power should not be zero", false, "error");
|
if (power === 0) return tip("Power should not be zero", false, "error");
|
||||||
|
|
||||||
const heights = grid.cells.h;
|
const heights = grid.cells.h;
|
||||||
const operation = power > 0 ? HeightmapGenerator.addRange.bind(HeightmapGenerator) : HeightmapGenerator.addTrough.bind(HeightmapGenerator);
|
const operation =
|
||||||
|
power > 0
|
||||||
|
? HeightmapGenerator.addRange.bind(HeightmapGenerator)
|
||||||
|
: HeightmapGenerator.addTrough.bind(HeightmapGenerator);
|
||||||
HeightmapGenerator.setGraph(grid);
|
HeightmapGenerator.setGraph(grid);
|
||||||
operation("1", String(Math.abs(power)), null, null, fromCell, toCell);
|
operation("1", String(Math.abs(power)), null, null, fromCell, toCell);
|
||||||
const changedHeights = HeightmapGenerator.getHeights();
|
const changedHeights = HeightmapGenerator.getHeights();
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
* Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2
|
* Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const VERSION = "1.112.4";
|
const VERSION = "1.113.0";
|
||||||
if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function");
|
if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function");
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
|
@ -138,13 +138,32 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<link rel="preload" href="index.css?v=1.109.1" as="style" onload="this.onload=null; this.rel='stylesheet'" />
|
<link
|
||||||
<link rel="preload" href="icons.css" as="style" onload="this.onload=null; this.rel='stylesheet'" />
|
rel="preload"
|
||||||
|
href="index.css?v=1.109.1"
|
||||||
|
as="style"
|
||||||
|
onload="
|
||||||
|
this.onload = null;
|
||||||
|
this.rel = 'stylesheet';
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
rel="preload"
|
||||||
|
href="icons.css"
|
||||||
|
as="style"
|
||||||
|
onload="
|
||||||
|
this.onload = null;
|
||||||
|
this.rel = 'stylesheet';
|
||||||
|
"
|
||||||
|
/>
|
||||||
<link
|
<link
|
||||||
rel="preload"
|
rel="preload"
|
||||||
href="libs/jquery-ui.css?v=1.106.5"
|
href="libs/jquery-ui.css?v=1.106.5"
|
||||||
as="style"
|
as="style"
|
||||||
onload="this.onload=null; this.rel='stylesheet'"
|
onload="
|
||||||
|
this.onload = null;
|
||||||
|
this.rel = 'stylesheet';
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -4289,7 +4308,9 @@
|
||||||
id="templateCA"
|
id="templateCA"
|
||||||
data-tip="Find or share custom template on Cartography Assets portal"
|
data-tip="Find or share custom template on Cartography Assets portal"
|
||||||
class="icon-drafting-compass"
|
class="icon-drafting-compass"
|
||||||
onclick="openURL('https://cartographyassets.com/asset-category/specific-assets/azgaars-generator/templates')"
|
onclick="
|
||||||
|
openURL('https://cartographyassets.com/asset-category/specific-assets/azgaars-generator/templates')
|
||||||
|
"
|
||||||
></button>
|
></button>
|
||||||
<button
|
<button
|
||||||
id="templateTutorial"
|
id="templateTutorial"
|
||||||
|
|
@ -6120,7 +6141,10 @@
|
||||||
id="showLabels"
|
id="showLabels"
|
||||||
class="checkbox"
|
class="checkbox"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
onchange="hideLabels.checked = !this.checked; invokeActiveZooming()"
|
onchange="
|
||||||
|
hideLabels.checked = !this.checked;
|
||||||
|
invokeActiveZooming();
|
||||||
|
"
|
||||||
checked=""
|
checked=""
|
||||||
/>
|
/>
|
||||||
<label for="showLabels" class="checkbox-label">Show all labels</label>
|
<label for="showLabels" class="checkbox-label">Show all labels</label>
|
||||||
|
|
@ -8512,7 +8536,7 @@
|
||||||
<script defer src="modules/ui/editors.js?v=1.112.1"></script>
|
<script defer src="modules/ui/editors.js?v=1.112.1"></script>
|
||||||
<script defer src="modules/ui/tools.js?v=1.111.0"></script>
|
<script defer src="modules/ui/tools.js?v=1.111.0"></script>
|
||||||
<script defer src="modules/ui/world-configurator.js?v=1.105.4"></script>
|
<script defer src="modules/ui/world-configurator.js?v=1.105.4"></script>
|
||||||
<script defer src="modules/ui/heightmap-editor.js?v=1.112.2"></script>
|
<script defer src="modules/ui/heightmap-editor.js?v=1.113.0"></script>
|
||||||
<script defer src="modules/ui/provinces-editor.js?v=1.108.1"></script>
|
<script defer src="modules/ui/provinces-editor.js?v=1.108.1"></script>
|
||||||
<script defer src="modules/ui/biomes-editor.js?v=1.112.0"></script>
|
<script defer src="modules/ui/biomes-editor.js?v=1.112.0"></script>
|
||||||
<script defer src="modules/ui/namesbase-editor.js?v=1.105.11"></script>
|
<script defer src="modules/ui/namesbase-editor.js?v=1.105.11"></script>
|
||||||
|
|
@ -8552,7 +8576,7 @@
|
||||||
<script defer src="libs/rgbquant.min.js"></script>
|
<script defer src="libs/rgbquant.min.js"></script>
|
||||||
<script defer src="libs/jquery.ui.touch-punch.min.js"></script>
|
<script defer src="libs/jquery.ui.touch-punch.min.js"></script>
|
||||||
<script defer src="modules/io/save.js?v=1.111.0"></script>
|
<script defer src="modules/io/save.js?v=1.111.0"></script>
|
||||||
<script defer src="modules/io/load.js?v=1.111.0"></script>
|
<script defer src="modules/io/load.js?v=1.113.0"></script>
|
||||||
<script defer src="modules/io/cloud.js?v=1.106.0"></script>
|
<script defer src="modules/io/cloud.js?v=1.106.0"></script>
|
||||||
<script defer src="modules/io/export.js?v=1.112.2"></script>
|
<script defer src="modules/io/export.js?v=1.112.2"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue