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:
parent
272ff5b3e6
commit
5c6ba40019
7 changed files with 84 additions and 28 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue