From 5c6ba40019ea23660cfab80864593b398567f223 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 5 Oct 2019 16:18:11 -0400 Subject: Display multiple messages per turn When tracking message history, save messages associated with the turn they were displayed on, which allows us to have the notion of the "current turn's" messages (provided via a MonoComonad instance). --- src/Xanthous/App.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Xanthous/App.hs') diff --git a/src/Xanthous/App.hs b/src/Xanthous/App.hs index 02f6f0987d..72c9a3f553 100644 --- a/src/Xanthous/App.hs +++ b/src/Xanthous/App.hs @@ -103,7 +103,7 @@ handleEvent ev = use promptState >>= \case handleNoPromptEvent :: BrickEvent Name () -> AppM (Next GameState) handleNoPromptEvent (VtyEvent (EvKey k mods)) | Just command <- commandFromKey k mods - = do messageHistory %= hideMessage + = do messageHistory %= nextTurn handleCommand command handleNoPromptEvent _ = continue @@ -135,7 +135,7 @@ handleCommand PickUp = do continue handleCommand PreviousMessage = do - messageHistory %= popMessage + messageHistory %= previousMessage continue handleCommand Open = do -- cgit 1.4.1