mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
fix: religions and cultures are not highlightable from editor
This commit is contained in:
parent
9215a01548
commit
182c6d558d
6 changed files with 30 additions and 26 deletions
|
|
@ -189,7 +189,7 @@ function culturesEditorAddLines() {
|
|||
}
|
||||
|
||||
lines += /* html */ `<div
|
||||
class="states cultures"
|
||||
class="states"
|
||||
data-id="${c.i}"
|
||||
data-name="${c.name}"
|
||||
data-color="${c.color}"
|
||||
|
|
@ -242,19 +242,21 @@ function culturesEditorAddLines() {
|
|||
byId("culturesFooterPopulation").dataset.population = totalPopulation;
|
||||
|
||||
// add listeners
|
||||
$body.querySelectorAll("div.cultures").forEach(el => el.on("mouseenter", cultureHighlightOn));
|
||||
$body.querySelectorAll("div.cultures").forEach(el => el.on("mouseleave", cultureHighlightOff));
|
||||
$body.querySelectorAll("div.states").forEach(el => el.on("click", selectCultureOnLineClick));
|
||||
$body.querySelectorAll("fill-box").forEach(el => el.on("click", cultureChangeColor));
|
||||
$body.querySelectorAll("div > input.cultureName").forEach(el => el.on("input", cultureChangeName));
|
||||
$body.querySelectorAll("div > span.icon-cw").forEach(el => el.on("click", cultureRegenerateName));
|
||||
$body.querySelectorAll("div > input.cultureExpan").forEach(el => el.on("input", cultureChangeExpansionism));
|
||||
$body.querySelectorAll("div > select.cultureType").forEach(el => el.on("change", cultureChangeType));
|
||||
$body.querySelectorAll("div > select.cultureBase").forEach(el => el.on("change", cultureChangeBase));
|
||||
$body.querySelectorAll("div > select.cultureEmblems").forEach(el => el.on("change", cultureChangeEmblemsShape));
|
||||
$body.querySelectorAll("div > div.culturePopulation").forEach(el => el.on("click", changePopulation));
|
||||
$body.querySelectorAll("div > span.icon-arrows-cw").forEach(el => el.on("click", cultureRegenerateBurgs));
|
||||
$body.querySelectorAll("div > span.icon-trash-empty").forEach(el => el.on("click", cultureRemovePrompt));
|
||||
$body.querySelectorAll(":scope > div").forEach($line => {
|
||||
$line.on("mouseenter", cultureHighlightOn);
|
||||
$line.on("mouseleave", cultureHighlightOff);
|
||||
$line.on("click", selectCultureOnLineClick);
|
||||
});
|
||||
$body.querySelectorAll("fill-box").forEach($el => $el.on("click", cultureChangeColor));
|
||||
$body.querySelectorAll("div > input.cultureName").forEach($el => $el.on("input", cultureChangeName));
|
||||
$body.querySelectorAll("div > span.icon-cw").forEach($el => $el.on("click", cultureRegenerateName));
|
||||
$body.querySelectorAll("div > input.cultureExpan").forEach($el => $el.on("input", cultureChangeExpansionism));
|
||||
$body.querySelectorAll("div > select.cultureType").forEach($el => $el.on("change", cultureChangeType));
|
||||
$body.querySelectorAll("div > select.cultureBase").forEach($el => $el.on("change", cultureChangeBase));
|
||||
$body.querySelectorAll("div > select.cultureEmblems").forEach($el => $el.on("change", cultureChangeEmblemsShape));
|
||||
$body.querySelectorAll("div > div.culturePopulation").forEach($el => $el.on("click", changePopulation));
|
||||
$body.querySelectorAll("div > span.icon-arrows-cw").forEach($el => $el.on("click", cultureRegenerateBurgs));
|
||||
$body.querySelectorAll("div > span.icon-trash-empty").forEach($el => $el.on("click", cultureRemovePrompt));
|
||||
|
||||
const $culturesHeader = byId("culturesHeader");
|
||||
$culturesHeader.querySelector("div[data-sortby='emblems']").style.display = selectShape ? "inline-block" : "none";
|
||||
|
|
|
|||
|
|
@ -229,9 +229,11 @@ function religionsEditorAddLines() {
|
|||
byId("religionsFooterPopulation").dataset.population = totalPopulation;
|
||||
|
||||
// add listeners
|
||||
$body.querySelectorAll("div.religions").forEach(el => el.on("mouseenter", religionHighlightOn));
|
||||
$body.querySelectorAll("div.religions").forEach(el => el.on("mouseleave", religionHighlightOff));
|
||||
$body.querySelectorAll("div.states").forEach(el => el.on("click", selectReligionOnLineClick));
|
||||
$body.querySelectorAll(":scope > div").forEach($line => {
|
||||
$line.on("mouseenter", religionHighlightOn);
|
||||
$line.on("mouseleave", religionHighlightOff);
|
||||
$line.on("click", selectReligionOnLineClick);
|
||||
});
|
||||
$body.querySelectorAll("fill-box").forEach(el => el.on("click", religionChangeColor));
|
||||
$body.querySelectorAll("div > input.religionName").forEach(el => el.on("input", religionChangeName));
|
||||
$body.querySelectorAll("div > select.religionType").forEach(el => el.on("change", religionChangeType));
|
||||
|
|
|
|||
|
|
@ -303,10 +303,10 @@ function statesEditorAddLines() {
|
|||
byId("statesFooterPopulation").dataset.population = totalPopulation;
|
||||
|
||||
// add listeners
|
||||
$body.querySelectorAll("div.states").forEach(el => {
|
||||
el.on("click", selectStateOnLineClick);
|
||||
el.on("mouseenter", stateHighlightOn);
|
||||
el.on("mouseleave", stateHighlightOff);
|
||||
$body.querySelectorAll(":scope > div").forEach($line => {
|
||||
$line.on("mouseenter", stateHighlightOn);
|
||||
$line.on("mouseleave", stateHighlightOff);
|
||||
$line.on("click", selectStateOnLineClick);
|
||||
});
|
||||
|
||||
if ($body.dataset.type === "percentage") {
|
||||
|
|
|
|||
|
|
@ -1176,18 +1176,18 @@ function refreshAllEditors() {
|
|||
// dynamically loaded editors
|
||||
async function editStates() {
|
||||
if (customization) return;
|
||||
const Editor = await import("../dynamic/editors/states-editor.js?v=06062022");
|
||||
const Editor = await import("../dynamic/editors/states-editor.js?v=08062022");
|
||||
Editor.open();
|
||||
}
|
||||
|
||||
async function editCultures() {
|
||||
if (customization) return;
|
||||
const Editor = await import("../dynamic/editors/cultures-editor.js?v=06062022");
|
||||
const Editor = await import("../dynamic/editors/cultures-editor.js?v=08062022");
|
||||
Editor.open();
|
||||
}
|
||||
|
||||
async function editReligions() {
|
||||
if (customization) return;
|
||||
const Editor = await import("../dynamic/editors/religions-editor.js?v=08062022");
|
||||
const Editor = await import("../dynamic/editors/religions-editor.js?v=080620222");
|
||||
Editor.open();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue