mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
feat(#901): ability to lock seed in templates editor
This commit is contained in:
parent
425325888e
commit
f20029eac5
5 changed files with 14 additions and 12 deletions
|
|
@ -980,7 +980,7 @@ fieldset {
|
|||
|
||||
#templateBody > div > span {
|
||||
float: right;
|
||||
margin: 0 1px 0 0.5px;
|
||||
margin-inline: 1px;
|
||||
}
|
||||
|
||||
#templateBody > div > i {
|
||||
|
|
@ -989,10 +989,9 @@ fieldset {
|
|||
|
||||
#templateBody input,
|
||||
#templateBody select {
|
||||
width: 4em;
|
||||
width: 4.5em;
|
||||
height: 1em;
|
||||
border: 0;
|
||||
font-size: 0.95em;
|
||||
background-color: #ffffff95;
|
||||
color: #05044d;
|
||||
font-style: italic;
|
||||
|
|
|
|||
11
index.html
11
index.html
|
|
@ -108,7 +108,7 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<link rel="preload" href="index.css?v=1.88.00" as="style" onload="this.onload=null; this.rel='stylesheet'" />
|
||||
<link rel="preload" href="index.css?v=1.88.03" 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 rel="preload" href="libs/jquery-ui.css" as="style" onload="this.onload=null; this.rel='stylesheet'" />
|
||||
</head>
|
||||
|
|
@ -4055,9 +4055,10 @@
|
|||
onclick="wiki('Heightmap-template-editor')"
|
||||
></button>
|
||||
<label
|
||||
data-tip="Set seed if you want template to generate the same heightmap each time. Leave blank to use random seed"
|
||||
data-tip="Lock seed (click on lock icon) if you want template to generate the same heightmap each time"
|
||||
>
|
||||
Seed: <input id="templateSeed" value="" type="number" min="1" max="999999999" step="1" style="width: 7em" />
|
||||
Seed: <input id="templateSeed" value="" type="number" min="1" max="999999999" step="1" style="width: 8em" />
|
||||
<i data-locked="0" id="lock_templateSeed" class="icon-lock-open"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -7857,7 +7858,7 @@
|
|||
<script src="modules/ui/measurers.js?v=1.87.02"></script>
|
||||
<script src="modules/ui/stylePresets.js"></script>
|
||||
|
||||
<script src="modules/ui/general.js?v=1.87.00"></script>
|
||||
<script src="modules/ui/general.js?v=1.87.03"></script>
|
||||
<script src="modules/ui/options.js?v=1.88.02"></script>
|
||||
<script src="main.js?v=1.88.02"></script>
|
||||
|
||||
|
|
@ -7866,7 +7867,7 @@
|
|||
<script defer src="modules/ui/editors.js?v=1.87.07"></script>
|
||||
<script defer src="modules/ui/tools.js?v=1.87.03"></script>
|
||||
<script defer src="modules/ui/world-configurator.js"></script>
|
||||
<script defer src="modules/ui/heightmap-editor.js?v=1.88.00"></script>
|
||||
<script defer src="modules/ui/heightmap-editor.js?v=1.88.03"></script>
|
||||
<script defer src="modules/ui/provinces-editor.js"></script>
|
||||
<script defer src="modules/ui/biomes-editor.js"></script>
|
||||
<script defer src="modules/ui/namesbase-editor.js?v=1.87.10"></script>
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ function unlock(id) {
|
|||
// check if option is locked
|
||||
function locked(id) {
|
||||
const lockEl = document.getElementById("lock_" + id);
|
||||
return lockEl.dataset.locked == 1;
|
||||
return lockEl.dataset.locked === "1";
|
||||
}
|
||||
|
||||
// return key value stored in localStorage or null
|
||||
|
|
|
|||
|
|
@ -1041,8 +1041,10 @@ 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);
|
||||
const currentSeed = byId("templateSeed").value;
|
||||
const seed = (locked("templateSeed") && currentSeed) || generateSeed();
|
||||
Math.random = aleaPRNG(seed);
|
||||
byId("templateSeed").value = seed;
|
||||
|
||||
grid.cells.h = createTypedArray({maxValue: 100, length: grid.points.length});
|
||||
HeightmapGenerator.setGraph(grid);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
// version and caching control
|
||||
const version = "1.88.02"; // generator version, update each time
|
||||
const version = "1.88.03"; // generator version, update each time
|
||||
|
||||
{
|
||||
document.title += " v" + version;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue