mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-21 19:41:23 +01:00
Added seed to burg edit menu
This commit is contained in:
parent
51f46d5183
commit
c3f2057718
2 changed files with 16 additions and 1 deletions
|
|
@ -731,6 +731,7 @@
|
||||||
<button id="burgName" onmouseover="tip('Change Burg name')" class="icon-pencil"></button>
|
<button id="burgName" onmouseover="tip('Change Burg name')" class="icon-pencil"></button>
|
||||||
<div id="burgNameSection" style="display: none">
|
<div id="burgNameSection" style="display: none">
|
||||||
<input id="burgNameInput" onmouseover="tip('Populate to rename the Burg')" style="width: 117px"/>
|
<input id="burgNameInput" onmouseover="tip('Populate to rename the Burg')" style="width: 117px"/>
|
||||||
|
<input id="burgSeedInput" onmouseover="tip('Populate to seed the Burg')" style="width: 50px"/>
|
||||||
<span id="burgNameReCulture" onmouseover="tip('Generate culture-specific name for the Burg')" class="icon-book pointer"></span>
|
<span id="burgNameReCulture" onmouseover="tip('Generate culture-specific name for the Burg')" class="icon-book pointer"></span>
|
||||||
<span id="burgNameReRandom" onmouseover="tip('Generate random name for the Burg')" class="icon-globe pointer"></span>
|
<span id="burgNameReRandom" onmouseover="tip('Generate random name for the Burg')" class="icon-globe pointer"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
16
script.js
16
script.js
|
|
@ -3021,6 +3021,7 @@ function fantasyMap() {
|
||||||
const labelGroup = burgLabels.select("#"+type);
|
const labelGroup = burgLabels.select("#"+type);
|
||||||
const iconGroup = burgIcons.select("#"+type);
|
const iconGroup = burgIcons.select("#"+type);
|
||||||
burgNameInput.value = manors[id].name;
|
burgNameInput.value = manors[id].name;
|
||||||
|
burgSeedInput.value = manors[id].seed;
|
||||||
updateBurgsGroupOptions();
|
updateBurgsGroupOptions();
|
||||||
burgSelectGroup.value = labelGroup.attr("id");
|
burgSelectGroup.value = labelGroup.attr("id");
|
||||||
burgSelectDefaultFont.value = fonts.indexOf(labelGroup.attr("data-font"));
|
burgSelectDefaultFont.value = fonts.indexOf(labelGroup.attr("data-font"));
|
||||||
|
|
@ -3184,6 +3185,15 @@ function fantasyMap() {
|
||||||
$("div[aria-describedby='burgEditor'] .ui-dialog-title").text("Edit Burg: " + this.value);
|
$("div[aria-describedby='burgEditor'] .ui-dialog-title").text("Edit Burg: " + this.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#burgSeedInput").on("input", function() {
|
||||||
|
if (this.value === "") {
|
||||||
|
tip("Seed can be blank");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const id = +elSelected.attr("data-id");
|
||||||
|
manors[id].seed = this.value;
|
||||||
|
});
|
||||||
|
|
||||||
$("#burgNameReCulture, #burgNameReRandom").click(function() {
|
$("#burgNameReCulture, #burgNameReRandom").click(function() {
|
||||||
const id = +elSelected.attr("data-id");
|
const id = +elSelected.attr("data-id");
|
||||||
const culture = this.id === "burgNameReCulture" ? manors[id].culture : Math.floor(Math.random() * cultures.length);
|
const culture = this.id === "burgNameReCulture" ? manors[id].culture : Math.floor(Math.random() * cultures.length);
|
||||||
|
|
@ -3405,11 +3415,14 @@ function fantasyMap() {
|
||||||
// open in MFCG
|
// open in MFCG
|
||||||
$("#burgSeeInMFCG").click(function() {
|
$("#burgSeeInMFCG").click(function() {
|
||||||
const id = +elSelected.attr("data-id");
|
const id = +elSelected.attr("data-id");
|
||||||
|
console.log(manors[id]);
|
||||||
const name = manors[id].name;
|
const name = manors[id].name;
|
||||||
const cell = manors[id].cell;
|
const cell = manors[id].cell;
|
||||||
const pop = rn(manors[id].population);
|
const pop = rn(manors[id].population);
|
||||||
const size = pop > 65 ? 65 : pop < 6 ? 6 : pop;
|
const size = pop > 65 ? 65 : pop < 6 ? 6 : pop;
|
||||||
const s = seed + "" + id;
|
var bs = "";
|
||||||
|
if(manors[id].seed) bs += manors[id].seed
|
||||||
|
const s = seed + "" + id + "" + bs;
|
||||||
const hub = cells[cell].crossroad > 2 ? 1 : 0;
|
const hub = cells[cell].crossroad > 2 ? 1 : 0;
|
||||||
const river = cells[cell].river ? 1 : 0;
|
const river = cells[cell].river ? 1 : 0;
|
||||||
const coast = cells[cell].port !== undefined ? 1 : 0;
|
const coast = cells[cell].port !== undefined ? 1 : 0;
|
||||||
|
|
@ -7961,6 +7974,7 @@ function fantasyMap() {
|
||||||
population = population > 1e4 ? si(population) : rn(population, -1);
|
population = population > 1e4 ? si(population) : rn(population, -1);
|
||||||
el.append('<span title="Population" class="icon-male"></span>');
|
el.append('<span title="Population" class="icon-male"></span>');
|
||||||
el.append('<input title="Population. Input to change" class="burgPopulation" value="' + population + '"/>');
|
el.append('<input title="Population. Input to change" class="burgPopulation" value="' + population + '"/>');
|
||||||
|
el.append('<input title="Seed. Input to change" class="burgSeed" value="'+ b.seed + '"/>');
|
||||||
var capital = states[s].capital;
|
var capital = states[s].capital;
|
||||||
var type = "z-burg"; // usual burg by default
|
var type = "z-burg"; // usual burg by default
|
||||||
if (b.i === capital) {el.append('<span title="Capital" class="icon-star-empty"></span>'); type = "c-capital";}
|
if (b.i === capital) {el.append('<span title="Capital" class="icon-star-empty"></span>'); type = "c-capital";}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue