Prefill save dialog with the selected painting name

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-07-01 21:52:46 +02:00
1 parent 5149544afe
commit 96528524a6
1 file changed
+4 -1
+4 -1
View File
@@ -187,7 +187,10 @@ public partial class PaintHud
private void OnSaveClicked()
{
if (!painter || !_saveDialog) return;
if (_nameInput) _nameInput.text = "";
// Pre-fill the currently selected painting's name so "Save" defaults to overwriting it (empty when
// nothing is selected). The field is focused below; TMP's focus-select then highlights it so the
// first keystroke replaces it for a fresh name.
if (_nameInput) _nameInput.text = _selectedPainting ?? "";
if (_saveInfo) _saveInfo.text = "";
_saveDialog.SetActive(true);
_saveDialog.transform.SetAsLastSibling(); // a dragged panel may have moved itself in front; stay on top