fix(ui): theme reset and restart confirmations

Replaced native confirmation dialogs with an in-app card using app colours, fonts, wrapped body text, and full-width Cancel/destructive buttons. Tapping outside cancels. Added UI QA coverage and a reset-dialog screenshot.
This commit is contained in:
Ratdoku Builder committed 2026-12-02 23:13:47 -06:00
1 parent bbfc35f79c
commit ea0f80664f
3 files changed
+150 -14

No files matched your search

+29
View File
@@ -101,6 +101,29 @@ func _test_settings(main, save) -> void:
toggles["double_tap_place"].button_pressed = true
_check(bool(save.get_setting("double_tap_place")), "double-tap toggle should update SaveGame")
_check(not main.settings_sheet.hold_slider.editable, "hold slider should be disabled with double-tap on")
# Themed confirmation replaces the native popup on reset.
var sheet = main.settings_sheet
sheet._on_reset()
await process_frame
_check(sheet.confirm_layer.visible, "reset confirmation should be visible")
_check(sheet.confirm_title.text == "Reset progress?", "reset confirmation title")
_check(sheet.confirm_button.text == "Reset", "reset confirmation action text")
var panel: Control = sheet.confirm_layer.get_child(0).get_child(0)
var viewport_width: int = int(ProjectSettings.get_setting("display/window/size/viewport_width"))
_check(panel.custom_minimum_size.x <= viewport_width - 16, "confirmation panel should fit the screen")
var outside := InputEventMouseButton.new()
outside.button_index = MOUSE_BUTTON_LEFT
outside.pressed = true
sheet._on_confirm_scrim_input(outside)
_check(not sheet.confirm_layer.visible, "tapping outside should dismiss confirmation")
save.data["completed_rooms"].append("room-confirm")
sheet._on_reset()
await process_frame
sheet.confirm_button.pressed.emit()
await process_frame
_check((save.data.get("completed_rooms") as Array).is_empty(), "confirming reset should clear progress")
main.close_settings()
await process_frame
_check(not main.settings_sheet.visible, "settings sheet should close from home")
@@ -112,6 +135,12 @@ func _test_settings(main, save) -> void:
_check(main.settings_sheet.resume_button.text == "Resume", "game settings should use Resume")
_check(main.settings_sheet.game_actions.visible, "game settings should show Restart/Lobby")
_check(main.game.ui_paused, "game should pause while settings are open")
main.settings_sheet._on_restart()
await process_frame
_check(main.settings_sheet.confirm_layer.visible, "restart confirmation should be visible")
_check(main.settings_sheet.confirm_title.text == "Restart room?", "restart confirmation title")
_check(main.settings_sheet.confirm_button.text == "Restart", "restart confirmation action text")
main.settings_sheet._hide_confirm()
main.close_settings()
await process_frame
_check(not main.settings_sheet.visible, "settings sheet should close from game")