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

@ -892,10 +892,15 @@ function unfog(id) {
if (!defs.selectAll("#fog path").size()) fogging.style("display", "none");
}
function getFileName(dataType) {
function getFileName(dataType, customName = null, includeTimestamp = true) {
const formatTime = time => (time < 10 ? "0" + time : time);
const name = mapName.value;
const name = customName || mapName.value;
const type = dataType ? dataType + " " : "";
if (!includeTimestamp) {
return name + (type ? " " + type.trim() : "");
}
const date = new Date();
const year = date.getFullYear();
const month = formatTime(date.getMonth() + 1);