From ff6c008d7884975f3dc0295a75b9383fd2c3a2ed Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 6 Nov 2021 11:44:14 -0400 Subject: feat(gs/xanthous): Default to the current save file When saving, default to the save file that was loaded for the game if any. To support this, this also makes text prompts support a default, which will be used if no value is input. Change-Id: I72a826499d6e987b939e3465a2d29167e53416be Reviewed-on: https://cl.tvl.fyi/c/depot/+/3801 Reviewed-by: grfn Tested-by: BuildkiteCI --- users/grfn/xanthous/src/Xanthous/Game/Draw.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'users/grfn/xanthous/src/Xanthous/Game/Draw.hs') diff --git a/users/grfn/xanthous/src/Xanthous/Game/Draw.hs b/users/grfn/xanthous/src/Xanthous/Game/Draw.hs index 25b1b92e215c..b9590ba40438 100644 --- a/users/grfn/xanthous/src/Xanthous/Game/Draw.hs +++ b/users/grfn/xanthous/src/Xanthous/Game/Draw.hs @@ -43,8 +43,12 @@ drawPromptState :: GamePromptState m -> Widget ResourceName drawPromptState NoPrompt = emptyWidget drawPromptState (WaitingPrompt msg (Prompt _ pt ps pri _)) = case (pt, ps, pri) of - (SStringPrompt, StringPromptState edit, _) -> - txtWrap msg <+> txt " " <+> renderEditor (txt . fold) True edit + (SStringPrompt, StringPromptState edit, mDef) -> + txtWrap msg + <+> txt " " + <+> txt (maybe "" (\def -> "(default: " <> def <> ")") mDef) + <+> txt " " + <+> renderEditor (txt . fold) True edit (SDirectionPrompt, DirectionPromptState, _) -> txtWrap msg (SMenu, _, menuItems) -> txtWrap msg -- cgit 1.4.1