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:
copilot-swe-agent[bot] 2025-08-29 15:31:48 +00:00
parent ba837ab6f8
commit df15f74d95
4 changed files with 113 additions and 18 deletions

View file

@ -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 () {