mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
Implement improved save functionality with custom filename, timestamp toggle, and overwrite protection
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
This commit is contained in:
parent
ba837ab6f8
commit
df15f74d95
4 changed files with 113 additions and 18 deletions
|
|
@ -738,10 +738,24 @@ function showSavePane() {
|
|||
const sharableLinkContainer = byId("sharableLinkContainer");
|
||||
sharableLinkContainer.style.display = "none";
|
||||
|
||||
// Initialize the custom filename input with current map name
|
||||
const customFileNameInput = byId("customFileName");
|
||||
const includeTimestampCheckbox = byId("includeTimestamp");
|
||||
|
||||
if (customFileNameInput) {
|
||||
customFileNameInput.value = mapName.value || "Fantasy Map";
|
||||
// Store default state
|
||||
customFileNameInput.dataset.defaultValue = customFileNameInput.value;
|
||||
}
|
||||
|
||||
if (includeTimestampCheckbox) {
|
||||
includeTimestampCheckbox.checked = true;
|
||||
}
|
||||
|
||||
$("#saveMapData").dialog({
|
||||
title: "Save map",
|
||||
resizable: false,
|
||||
width: "25em",
|
||||
width: "32em",
|
||||
position: {my: "center", at: "center", of: "svg"},
|
||||
buttons: {
|
||||
Close: function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue