diff --git a/index.html b/index.html
index eb9675e9..f5031177 100644
--- a/index.html
+++ b/index.html
@@ -2602,10 +2602,11 @@
diff --git a/modules/ui/burgs-editor.js b/modules/ui/burgs-editor.js
index 5047ca6c..22c3bf37 100644
--- a/modules/ui/burgs-editor.js
+++ b/modules/ui/burgs-editor.js
@@ -60,8 +60,6 @@ function editBurgs() {
if (selectedState != -1) filtered = filtered.filter(b => b.state === selectedState); // filtered by state
if (selectedCulture != -1) filtered = filtered.filter(b => b.culture === selectedCulture); // filtered by culture
- const showState = selectedState == -1 ? "visible" : "hidden";
- document.getElementById("burgStateHeader").style.display = `${selectedState == -1 ? "inline-block" : "none"}`;
body.innerHTML = "";
let lines = "", totalPopulation = 0;
@@ -70,11 +68,15 @@ function editBurgs() {
totalPopulation += population;
const type = b.capital && b.port ? "a-capital-port" : b.capital ? "c-capital" : b.port ? "p-port" : "z-burg";
const state = pack.states[b.state].name;
+ const prov = pack.cells.province[b.cell];
+ const province = prov ? pack.provinces[prov].name : "";
const culture = pack.cultures[b.culture].name;
- lines += `
`;
}
@@ -226,7 +227,6 @@ function editBurgs() {
this.classList.add("pressed");
tip("Click on the map to create a new burg. Hold Shift to add multiple", true);
viewbox.style("cursor", "crosshair").on("click", addBurgOnClick);
- body.querySelectorAll("div > *").forEach(e => e.disabled = true);
}
function addBurgOnClick() {
@@ -246,20 +246,22 @@ function editBurgs() {
customization = 0;
restoreDefaultEvents();
clearMainTip();
- body.querySelectorAll("div > *").forEach(e => e.disabled = false);
if (addBurgTool.classList.contains("pressed")) addBurgTool.classList.remove("pressed");
if (addNewBurg.classList.contains("pressed")) addNewBurg.classList.remove("pressed");
}
function downloadBurgsData() {
- let data = "Id,Burg,State,Culture,Population,Longitude,Latitude,Elevation ("+heightUnit.value+"),Capital,Port\n"; // headers
+ let data = "Id,Burg,Province,State,Culture,Religion,Population,Longitude,Latitude,Elevation ("+heightUnit.value+"),Capital,Port\n"; // headers
const valid = pack.burgs.filter(b => b.i && !b.removed); // all valid burgs
valid.forEach(b => {
data += b.i + ",";
data += b.name + ",";
- data += pack.states[b.state].name + ",";
+ const province = pack.cells.province[b.cell];
+ data += province ? pack.provinces[province].fullName + "," : ",";
+ data += b.state ? pack.states[b.state].fullName : pack.states[b.state].name + ",";
data += pack.cultures[b.culture].name + ",";
+ data += pack.religions[pack.cells.religion[b.cell]].name + ",";
data += rn(b.population * populationRate.value * urbanization.value) + ",";
// add geography data
diff --git a/modules/ui/provinces-editor.js b/modules/ui/provinces-editor.js
index a9e7f35e..69808fc4 100644
--- a/modules/ui/provinces-editor.js
+++ b/modules/ui/provinces-editor.js
@@ -379,7 +379,7 @@ function editProvinces() {
.attr("x", d => d.x0).attr("y", d => d.y0)
.attr("width", d => d.x1 - d.x0).attr("height", d => d.y1 - d.y0);
- node.select("text").attr("opacity", 1).transition().duration(1500)
+ node.select("text").transition().duration(1500)
.attr("x", d => d.x0).attr("y", d => d.y0);
setTimeout(hideNonfittingLabels, 2000);
diff --git a/modules/ui/religions-editor.js b/modules/ui/religions-editor.js
index 7037c462..589381b8 100644
--- a/modules/ui/religions-editor.js
+++ b/modules/ui/religions-editor.js
@@ -150,8 +150,8 @@ function editReligions() {
const rural = r.rural * populationRate.value;
const urban = r.urban * populationRate.value * urbanization.value;
const population = rural + urban > 0 ? ". " + si(rn(rural + urban)) + " believers" : ". Extinct";
- const hint = ". Drag to change the origin";
- info.innerHTML = `${r.name}${type}${form}${population}${hint}`;
+ info.innerHTML = `${r.name}${type}${form}${population}`;
+ tip("Drag to change parent. Hold CTRL and click to change abbrebiation");
}
const el = body.querySelector(`div[data-id='${religion}']`);
@@ -169,6 +169,7 @@ function editReligions() {
if (info) {
d3.select("#religionHierarchy").select("g[data-id='"+religion+"'] > path").classed("selected", 0);
info.innerHTML = "";
+ tip("");
}
const el = body.querySelector(`div[data-id='${religion}']`)
@@ -318,7 +319,7 @@ function editReligions() {
function renderTree() {
treeLayout(root);
links.selectAll('path').data(root.links()).enter()
- .append('path').attr("d", d => {return "M" + d.source.x + "," + d.source.y
+ .append('path').attr("d", d => {return "M" + d.source.x + "," + d.source.y
+ "C" + d.source.x + "," + (d.source.y * 3 + d.target.y) / 4
+ " " + d.target.x + "," + (d.source.y * 2 + d.target.y) / 3
+ " " + d.target.x + "," + d.target.y;});
@@ -349,7 +350,8 @@ function editReligions() {
});
function dragToReorigin(d) {
- console.log("dragToReorigin");
+ if (d3.event.sourceEvent.ctrlKey) {changeReligionCode(d); return;}
+
const originLine = graph.append("path")
.attr("class", "dragLine").attr("d", `M${d.x},${d.y}L${d.x},${d.y}`);
@@ -371,6 +373,13 @@ function editReligions() {
showHierarchy() // update hierarchy
});
}
+
+ function changeReligionCode(d) {
+ const code = prompt(`Please provide an abbreviation for ${d.data.name}`, d.data.code);
+ if (!code) return;
+ pack.religions[d.data.i].code = code;
+ nodes.select("g[data-id='"+d.data.i+"']").select("text").text(code);
+ }
}
function toggleExtinct() {