mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v1.22.20
This commit is contained in:
parent
614aaae733
commit
d1b249ae79
6 changed files with 82 additions and 58 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
// fit full-screen map if window is resized
|
||||
$(window).resize(function(e) {
|
||||
if (localStorage.getItem("mapWidth") && localStorage.getItem("mapHeight")) return;
|
||||
mapWidthInput.value = window.innerWidth;
|
||||
mapHeightInput.value = window.innerHeight;
|
||||
changeMapSize();
|
||||
|
|
|
|||
|
|
@ -134,8 +134,8 @@ function mapSizeInputChange() {
|
|||
|
||||
// change svg size on manual size change or window resize, do not change graph size
|
||||
function changeMapSize() {
|
||||
const svgWidth = Math.min(+mapWidthInput.value, window.innerWidth);
|
||||
const svgHeight = Math.min(+mapHeightInput.value, window.innerHeight);
|
||||
svgWidth = Math.min(+mapWidthInput.value, window.innerWidth);
|
||||
svgHeight = Math.min(+mapHeightInput.value, window.innerHeight);
|
||||
svg.attr("width", svgWidth).attr("height", svgHeight);
|
||||
|
||||
const maxWidth = Math.max(+mapWidthInput.value, graphWidth);
|
||||
|
|
|
|||
|
|
@ -275,10 +275,24 @@ function editStates() {
|
|||
}
|
||||
|
||||
function applyNameChange(s) {
|
||||
s.name = document.getElementById("stateNameEditorShort").value;
|
||||
s.formName = document.getElementById("stateNameEditorSelectForm").value;
|
||||
s.fullName = document.getElementById("stateNameEditorFull").value;
|
||||
if (stateNameEditorUpdateLabel.checked) BurgsAndStates.drawStateLabels([s.i]);
|
||||
const nameInput = document.getElementById("stateNameEditorShort");
|
||||
const formSelect = document.getElementById("stateNameEditorSelectForm");
|
||||
const fullNameInput = document.getElementById("stateNameEditorFull");
|
||||
|
||||
const nameChanged = nameInput.value !== s.name;
|
||||
const formChanged = formSelect.value !== s.formName;
|
||||
const fullNameChanged = fullNameInput.value !== s.fullName;
|
||||
const changed = nameChanged || formChanged || fullNameChanged;
|
||||
|
||||
if (formChanged) {
|
||||
const form = formSelect.selectedOptions[0].dataset.form || null;
|
||||
if (form) s.form = form;
|
||||
}
|
||||
|
||||
s.name = nameInput.value;
|
||||
s.formName = formSelect.value;
|
||||
s.fullName = fullNameInput.value;
|
||||
if (changed && stateNameEditorUpdateLabel.checked) BurgsAndStates.drawStateLabels([s.i]);
|
||||
refreshStatesEditor();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue