mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-21 19:41:23 +01:00
Merge c3f2057718 into 0920b86eaa
This commit is contained in:
commit
f76a358d29
2 changed files with 16 additions and 1 deletions
|
|
@ -758,6 +758,7 @@
|
|||
<button id="burgName" onmouseover="tip('Change Burg name')" class="icon-pencil"></button>
|
||||
<div id="burgNameSection" style="display: none">
|
||||
<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="burgNameReRandom" onmouseover="tip('Generate random name for the Burg')" class="icon-globe pointer"></span>
|
||||
</div>
|
||||
|
|
|
|||
16
script.js
16
script.js
|
|
@ -3383,6 +3383,7 @@ function fantasyMap() {
|
|||
const labelGroup = burgLabels.select("#"+type);
|
||||
const iconGroup = burgIcons.select("#"+type);
|
||||
burgNameInput.value = manors[id].name;
|
||||
burgSeedInput.value = manors[id].seed;
|
||||
updateBurgsGroupOptions();
|
||||
burgSelectGroup.value = labelGroup.attr("id");
|
||||
burgSelectDefaultFont.value = fonts.indexOf(labelGroup.attr("data-font"));
|
||||
|
|
@ -3545,6 +3546,15 @@ function fantasyMap() {
|
|||
manors[id].name = 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() {
|
||||
const id = +elSelected.attr("data-id");
|
||||
|
|
@ -3767,11 +3777,14 @@ function fantasyMap() {
|
|||
// open in MFCG
|
||||
$("#burgSeeInMFCG").click(function() {
|
||||
const id = +elSelected.attr("data-id");
|
||||
console.log(manors[id]);
|
||||
const name = manors[id].name;
|
||||
const cell = manors[id].cell;
|
||||
const pop = rn(manors[id].population);
|
||||
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 river = cells[cell].river ? 1 : 0;
|
||||
const coast = cells[cell].port !== undefined ? 1 : 0;
|
||||
|
|
@ -8047,6 +8060,7 @@ function fantasyMap() {
|
|||
population = population > 1e4 ? si(population) : rn(population, -1);
|
||||
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="Seed. Input to change" class="burgSeed" value="'+ b.seed + '"/>');
|
||||
var capital = states[s].capital;
|
||||
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";}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue