Add a previous message command
Add a "previous message" command, triggered via ctrl+p. I attempted here to get the message area to still take up a row of space post-hiding the message, but failed - should revisit that at some point
This commit is contained in:
parent
adb3b74c0c
commit
18551cdf30
5 changed files with 31 additions and 6 deletions
|
|
@ -35,7 +35,8 @@ startEvent = say ["welcome"]
|
|||
handleEvent :: BrickEvent Name () -> AppM (Next GameState)
|
||||
handleEvent (VtyEvent (EvKey k mods))
|
||||
| Just command <- commandFromKey k mods
|
||||
= handleCommand command
|
||||
= do messageHistory %= hideMessage
|
||||
handleCommand command
|
||||
handleEvent _ = continue
|
||||
|
||||
handleCommand :: Command -> AppM (Next GameState)
|
||||
|
|
@ -43,4 +44,7 @@ handleCommand Quit = halt
|
|||
handleCommand (Move dir) = do
|
||||
characterPosition %= move dir
|
||||
continue
|
||||
handleCommand _ = error "unimplemented"
|
||||
|
||||
handleCommand PreviousMessage = do
|
||||
messageHistory %= popMessage
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue