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
|
|
@ -8,7 +8,6 @@ import Brick hiding (loc)
|
|||
import Brick.Widgets.Border
|
||||
import Brick.Widgets.Border.Style
|
||||
import Brick.Widgets.Edit
|
||||
import Data.List.NonEmpty(NonEmpty((:|)))
|
||||
--------------------------------------------------------------------------------
|
||||
import Xanthous.Data (Position(Position), x, y, loc)
|
||||
import Xanthous.Data.EntityMap (EntityMap, atPosition)
|
||||
|
|
@ -34,9 +33,7 @@ import Xanthous.Orphans ()
|
|||
--------------------------------------------------------------------------------
|
||||
|
||||
drawMessages :: MessageHistory -> Widget Name
|
||||
drawMessages NoMessageHistory = emptyWidget
|
||||
drawMessages (MessageHistory _ False) = str " "
|
||||
drawMessages (MessageHistory (lastMessage :| _) True) = txt lastMessage
|
||||
drawMessages = txt . (<> " ") . unwords . oextract
|
||||
|
||||
drawPromptState :: GamePromptState m -> Widget Name
|
||||
drawPromptState NoPrompt = emptyWidget
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue