Load paintings instantly and allow overwriting saves in the paint HUD

Load now applies the selected slot immediately instead of going through a
confirmation dialog. Save keeps its OK button enabled even when the name
already exists (the warning text stays, purely informational) and writes
through with overwrite, so re-saving under the same name replaces the slot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-06-30 21:47:16 +02:00
1 parent b6d60d7a98
commit 44cea8dd15
2 files changed
+16 -14

No files matched your search

+5 -4
View File
@@ -71,14 +71,15 @@ public partial class MeshPainter
}
/// <summary>
/// Writes the current painted maps to a new named slot. Returns false without writing if the painter
/// is not ready or a slot with this name already exists (no silent overwrite).
/// Writes the current painted maps to a named slot. Returns false without writing if the painter is
/// not ready. An existing slot of the same name is overwritten only when <paramref name="overwrite"/>
/// is true; otherwise the call fails rather than clobbering it.
/// </summary>
public bool SavePaintAs(string name)
public bool SavePaintAs(string name, bool overwrite = false)
{
if (!_setupValid || string.IsNullOrWhiteSpace(name)) return false;
name = name.Trim();
if (PaintExists(name)) return false;
if (!overwrite && PaintExists(name)) return false;
try
{