about summary refs log tree commit diff
path: root/src/Xanthous/Game/Draw.hs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-09-02T14·36-0400
committerGriffin Smith <root@gws.fyi>2019-09-02T14·52-0400
commit18551cdf30c0a13bce40fae9be829e5318612e71 (patch)
treeabb2c73133a4ae99852bd5865c78b4c301943d05 /src/Xanthous/Game/Draw.hs
parentadb3b74c0c3a3bffa0d47f52036fde3623f859f7 (diff)
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
Diffstat (limited to 'src/Xanthous/Game/Draw.hs')
-rw-r--r--src/Xanthous/Game/Draw.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Xanthous/Game/Draw.hs b/src/Xanthous/Game/Draw.hs
index 5a2f773c1b18..6527af743953 100644
--- a/src/Xanthous/Game/Draw.hs
+++ b/src/Xanthous/Game/Draw.hs
@@ -26,7 +26,13 @@ import Xanthous.Orphans ()
 drawMessages :: MessageHistory -> Widget Name
 drawMessages NoMessageHistory = emptyWidget
 drawMessages (MessageHistory _ False) = emptyWidget
-drawMessages (MessageHistory (lastMessage :| _) True) = str $ unpack lastMessage
+drawMessages (MessageHistory (lastMessage :| _) True) = txt lastMessage
+
+-- an attempt to still take up a row even when no messages
+-- drawMessages msgs = vLimit 1 . Widget Greedy Fixed . render $ case msgs of
+--   NoMessageHistory -> padTop (Pad 2) $ str " "
+--   (MessageHistory _ False) -> padTop (Pad 2) $ str " "
+--   (MessageHistory (lastMessage :| _) True) -> txt lastMessage
 
 drawEntities :: (Draw a, Show a) => EntityMap a -> Widget Name
 drawEntities em@(fromNullable . positions -> Just entityPositions)