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).
This commit is contained in:
Griffin Smith 2019-10-05 16:18:11 -04:00
parent 272ff5b3e6
commit 5c6ba40019
7 changed files with 84 additions and 28 deletions

View file

@ -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