diff --git a/modules/ui/biomes-editor.js b/modules/ui/biomes-editor.js
index 3d6ee26c..07d25364 100644
--- a/modules/ui/biomes-editor.js
+++ b/modules/ui/biomes-editor.js
@@ -97,7 +97,7 @@ function editBiomes() {
${si(area) + unit}
${si(population)}
-
+
${i>12 && !b.cells[i] ? '' : ''}
`;
}
diff --git a/modules/ui/cultures-editor.js b/modules/ui/cultures-editor.js
index fd9d4071..88820810 100644
--- a/modules/ui/cultures-editor.js
+++ b/modules/ui/cultures-editor.js
@@ -298,18 +298,27 @@ function editCultures() {
function cultureRemove() {
if (customization === 4) return;
const culture = +this.parentNode.dataset.id;
- cults.select("#culture"+culture).remove();
- debug.select("#cultureCenter"+culture).remove();
- pack.burgs.filter(b => b.culture == culture).forEach(b => b.culture = 0);
- pack.states.forEach((s, i) => {if(s.culture === culture) s.culture = 0;});
- pack.cells.culture.forEach((c, i) => {if(c === culture) pack.cells.culture[i] = 0;});
- pack.cultures[culture].removed = true;
-
- const origin = pack.cultures[culture].origin;
- pack.cultures.forEach(c => {if(c.origin === culture) c.origin = origin;});
-
- refreshCulturesEditor();
+ alertMessage.innerHTML = "Are you sure you want to remove the culture?
This action cannot be reverted";
+ $("#alert").dialog({resizable: false, title: "Remove culture",
+ buttons: {
+ Remove: function() {
+ cults.select("#culture"+culture).remove();
+ debug.select("#cultureCenter"+culture).remove();
+
+ pack.burgs.filter(b => b.culture == culture).forEach(b => b.culture = 0);
+ pack.states.forEach((s, i) => {if(s.culture === culture) s.culture = 0;});
+ pack.cells.culture.forEach((c, i) => {if(c === culture) pack.cells.culture[i] = 0;});
+ pack.cultures[culture].removed = true;
+
+ const origin = pack.cultures[culture].origin;
+ pack.cultures.forEach(c => {if(c.origin === culture) c.origin = origin;});
+ refreshCulturesEditor();
+ $(this).dialog("close");
+ },
+ Cancel: function() {$(this).dialog("close");}
+ }
+ });
}
function drawCultureCenters() {
diff --git a/modules/ui/provinces-editor.js b/modules/ui/provinces-editor.js
index eeeb038c..0df48a00 100644
--- a/modules/ui/provinces-editor.js
+++ b/modules/ui/provinces-editor.js
@@ -39,7 +39,7 @@ function editProvinces() {
if (cl.contains("name")) editProvinceName(p); else
if (cl.contains("icon-coa")) provinceOpenCOA(ev, p); else
if (cl.contains("icon-star-empty")) capitalZoomIn(p); else
- if (cl.contains("icon-flag-empty")) declareProvinceIndependence(p); else
+ if (cl.contains("icon-flag-empty")) triggerIndependencePromps(p); else
if (cl.contains("culturePopulation")) changePopulation(p); else
if (cl.contains("icon-pin")) focusOn(p, cl); else
if (cl.contains("icon-trash-empty")) removeProvince(p);
@@ -211,6 +211,19 @@ function editProvinces() {
zoomTo(x, y, 8, 2000);
}
+ function triggerIndependencePromps(p) {
+ alertMessage.innerHTML = "Are you sure you want to declare province independence?
It will turn province into a new state";
+ $("#alert").dialog({resizable: false, title: "Declare independence",
+ buttons: {
+ Declare: function() {
+ declareProvinceIndependence(p);
+ $(this).dialog("close");
+ },
+ Cancel: function() {$(this).dialog("close");}
+ }
+ });
+ }
+
function declareProvinceIndependence(p) {
const states = pack.states, provinces = pack.provinces, cells = pack.cells;
const oldState = pack.provinces[p].state;
@@ -352,17 +365,29 @@ function editProvinces() {
}
function removeProvince(p) {
- pack.cells.province.forEach((province, i) => {if(province === p) pack.cells.province[i] = 0;});
- const state = pack.provinces[p].state;
- if (pack.states[state].provinces.includes(p)) pack.states[state].provinces.splice(pack.states[state].provinces.indexOf(p), 1);
- pack.provinces[p].removed = true;
- unfocus(p);
- const g = provs.select("#provincesBody");
- g.select("#province"+p).remove();
- g.select("#province-gap"+p).remove();
- if (!layerIsOn("toggleBorders")) toggleBorders(); else drawBorders();
- refreshProvincesEditor();
+ alertMessage.innerHTML = `Are you sure you want to remove the province?
This action cannot be reverted`;
+ $("#alert").dialog({resizable: false, title: "Remove province",
+ buttons: {
+ Remove: function() {
+ pack.cells.province.forEach((province, i) => {if(province === p) pack.cells.province[i] = 0;});
+ const state = pack.provinces[p].state;
+ if (pack.states[state].provinces.includes(p)) pack.states[state].provinces.splice(pack.states[state].provinces.indexOf(p), 1);
+ pack.provinces[p].removed = true;
+ unfocus(p);
+
+ const g = provs.select("#provincesBody");
+ g.select("#province"+p).remove();
+ g.select("#province-gap"+p).remove();
+ if (!layerIsOn("toggleBorders")) toggleBorders(); else drawBorders();
+ refreshProvincesEditor();
+ $(this).dialog("close");
+ },
+ Cancel: function() {$(this).dialog("close");}
+ }
+ });
+
+
}
function editProvinceName(province) {
@@ -804,7 +829,7 @@ function editProvinces() {
}
function removeAllProvinces() {
- alertMessage.innerHTML = `Are you sure you want to remove all provinces?`;
+ alertMessage.innerHTML = `Are you sure you want to remove all provinces?
This action cannot be reverted`;
$("#alert").dialog({resizable: false, title: "Remove all provinces",
buttons: {
Remove: function() {
diff --git a/modules/ui/religions-editor.js b/modules/ui/religions-editor.js
index ee50d2a1..c4ad337b 100644
--- a/modules/ui/religions-editor.js
+++ b/modules/ui/religions-editor.js
@@ -293,15 +293,26 @@ function editReligions() {
function religionRemove() {
if (customization) return;
const religion = +this.parentNode.dataset.id;
- relig.select("#religion"+religion).remove();
- debug.select("#religionsCenter"+religion).remove();
- pack.cells.religion.forEach((r, i) => {if(r === religion) pack.cells.religion[i] = 0;});
- pack.religions[religion].removed = true;
- const origin = pack.religions[religion].origin;
- pack.religions.forEach(r => {if(r.origin === religion) r.origin = origin;});
+ alertMessage.innerHTML = "Are you sure you want to remove the religion?
This action cannot be reverted";
+ $("#alert").dialog({resizable: false, title: "Remove religion",
+ buttons: {
+ Remove: function() {
+ relig.select("#religion"+religion).remove();
+ relig.select("#religion-gap"+religion).remove();
+ debug.select("#religionsCenter"+religion).remove();
- refreshReligionsEditor();
+ pack.cells.religion.forEach((r, i) => {if(r === religion) pack.cells.religion[i] = 0;});
+ pack.religions[religion].removed = true;
+ const origin = pack.religions[religion].origin;
+ pack.religions.forEach(r => {if(r.origin === religion) r.origin = origin;});
+
+ refreshReligionsEditor();
+ $(this).dialog("close");
+ },
+ Cancel: function() {$(this).dialog("close");}
+ }
+ });
}
function drawReligionCenters() {