mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
parent
7c74c3d29f
commit
e0adac3735
1 changed files with 14 additions and 4 deletions
|
|
@ -217,6 +217,15 @@ function editStates() {
|
|||
}
|
||||
|
||||
function editStateName(state) {
|
||||
|
||||
//Reset input value and close add mode
|
||||
stateNameEditorCustomForm.value = "";
|
||||
const addModeActive = stateNameEditorCustomForm.style.display === "inline-block";
|
||||
if (addModeActive) {
|
||||
stateNameEditorCustomForm.style.display = "none";
|
||||
stateNameEditorSelectForm.style.display = "inline-block";
|
||||
}
|
||||
|
||||
const s = pack.states[state];
|
||||
document.getElementById("stateNameEditor").dataset.state = state;
|
||||
document.getElementById("stateNameEditorShort").value = s.name || "";
|
||||
|
|
@ -254,10 +263,11 @@ function editStates() {
|
|||
|
||||
function addCustomForm() {
|
||||
const value = stateNameEditorCustomForm.value;
|
||||
const displayed = stateNameEditorCustomForm.style.display === "inline-block";
|
||||
stateNameEditorCustomForm.style.display = displayed ? "none" : "inline-block";
|
||||
stateNameEditorSelectForm.style.display = displayed ? "inline-block" : "none";
|
||||
if (displayed) applyOption(stateNameEditorSelectForm, value);
|
||||
const addModeActive = stateNameEditorCustomForm.style.display === "inline-block";
|
||||
stateNameEditorCustomForm.style.display = addModeActive ? "none" : "inline-block";
|
||||
stateNameEditorSelectForm.style.display = addModeActive ? "inline-block" : "none";
|
||||
if (addModeActive) applyOption(stateNameEditorSelectForm, value);
|
||||
stateNameEditorCustomForm.value = "";
|
||||
}
|
||||
|
||||
function regenerateFullName() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue