From defaf6c8200b410253430fa2661499297c6b0de3 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Sat, 22 Feb 2025 05:16:17 +0000 Subject: [PATCH] add functionality for cancel button in options-update.sml --- fcore/options/options-update.sml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fcore/options/options-update.sml b/fcore/options/options-update.sml index 439a837..89fcfbf 100644 --- a/fcore/options/options-update.sml +++ b/fcore/options/options-update.sml @@ -276,6 +276,12 @@ struct } end + fun cancelAndGoToTitle userKeys = + { mode = GameType.TITLE TitleType.initial + , userKeys = userKeys + , saveKeys = false + } + fun update (options, input: FrameInputType.t, userKeys, time) = case #focus options of LEFT_KEY => @@ -355,7 +361,7 @@ struct default (options, userKeys) | CANCEL_BUTTON => if CoreKey.containsAttack (userKeys, #newKeys input) then - select (options, userKeys) + cancelAndGoToTitle userKeys else if #upHeld input then moveFocusUp (options, SAVE_BUTTON, userKeys, time) else if #downHeld input then