From 6df087b9e8dd18f7f7da35f5ef4e5b9f58a196a8 Mon Sep 17 00:00:00 2001 From: Youri Schuurmans Date: Mon, 2 Jul 2018 15:59:22 +0200 Subject: [PATCH 1/3] Set theme jekyll-theme-slate From c3f205771864f944bce0305e8079109d728a458b Mon Sep 17 00:00:00 2001 From: Youri Schuurmans Date: Tue, 11 Sep 2018 14:21:55 +0200 Subject: [PATCH 2/3] Added seed to burg edit menu --- index.html | 1 + script.js | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index a82db6a4..b0c0c789 100644 --- a/index.html +++ b/index.html @@ -731,6 +731,7 @@ diff --git a/script.js b/script.js index a18bc1d7..976b9d08 100644 --- a/script.js +++ b/script.js @@ -3021,6 +3021,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")); @@ -3183,6 +3184,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"); @@ -3405,11 +3415,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; @@ -7961,6 +7974,7 @@ function fantasyMap() { population = population > 1e4 ? si(population) : rn(population, -1); el.append(''); el.append(''); + el.append(''); var capital = states[s].capital; var type = "z-burg"; // usual burg by default if (b.i === capital) {el.append(''); type = "c-capital";} From 73f7969bff0cd86d5db8cb4444118689c0dc41f3 Mon Sep 17 00:00:00 2001 From: Youri Schuurmans Date: Tue, 11 Sep 2018 14:29:54 +0200 Subject: [PATCH 3/3] fixed undefined error. --- script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index 976b9d08..ba3d3a32 100644 --- a/script.js +++ b/script.js @@ -3021,7 +3021,7 @@ function fantasyMap() { const labelGroup = burgLabels.select("#"+type); const iconGroup = burgIcons.select("#"+type); burgNameInput.value = manors[id].name; - burgSeedInput.value = manors[id].seed; + burgSeedInput.value = manors[id].seed == undefined ? "" : manors[id].seed; updateBurgsGroupOptions(); burgSelectGroup.value = labelGroup.attr("id"); burgSelectDefaultFont.value = fonts.indexOf(labelGroup.attr("data-font")); @@ -3200,6 +3200,7 @@ function fantasyMap() { const name = generateName(culture); burgLabels.selectAll("[data-id='" + id + "']").text(name) manors[id].name = name; + manors[id].seed = ""; burgNameInput.value = name; $("div[aria-describedby='burgEditor'] .ui-dialog-title").text("Edit Burg: " + name); });