From 13516911366a484ee5484166520133e056010515 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 23 Dec 2019 18:10:22 -0500 Subject: Don't send the welcome message when loading Don't re-send the welcome message when loading the game if it's already been sent. This is done by just tracking whether or not we've sent it as a boolean in the game state, which may be a bit of a hack but should be fine --- src/Xanthous/App.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Xanthous/App.hs') diff --git a/src/Xanthous/App.hs b/src/Xanthous/App.hs index 2029be6f108f..2bdf6142f9fd 100644 --- a/src/Xanthous/App.hs +++ b/src/Xanthous/App.hs @@ -77,8 +77,12 @@ startEvent = do Nothing -> prompt_ @'StringPrompt ["character", "namePrompt"] Uncancellable $ \(StringResult s) -> do character . characterName ?= s - say ["welcome"] =<< use character - Just n -> say ["welcome"] $ object [ "characterName" A..= n ] + whenM (uses sentWelcome not) $ say ["welcome"] =<< use character + sentWelcome .= True + Just n -> + whenM (uses sentWelcome not) $ do + say ["welcome"] $ object [ "characterName" A..= n ] + sentWelcome .= True initLevel :: AppM () initLevel = do -- cgit 1.4.1