diff options
author | Griffin Smith <root@gws.fyi> | 2019-12-01T03·43-0500 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-12-01T03·43-0500 |
commit | 65b1352ef2e463393d0504c32b73bdcf7c99491a (patch) | |
tree | 9bbd627db18babdeff099d7a248103e2148a93f8 /src/Xanthous/Game/State.hs | |
parent | 71b628c604556bc2d829f12980db99c9a526ec84 (diff) |
Add a very basic inventory panel
Add a very basic inventory panel to the game opened by pressing `i`, which displays the contents of the player's inventory in a basic list.
Diffstat (limited to 'src/Xanthous/Game/State.hs')
-rw-r--r-- | src/Xanthous/Game/State.hs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/Xanthous/Game/State.hs b/src/Xanthous/Game/State.hs index 5ddb7de7e9b8..3b401d366d10 100644 --- a/src/Xanthous/Game/State.hs +++ b/src/Xanthous/Game/State.hs @@ -10,6 +10,7 @@ module Xanthous.Game.State , revealedPositions , messageHistory , randomGen + , activePanel , promptState , characterEntityID , GamePromptState(..) @@ -383,6 +384,7 @@ instance -------------------------------------------------------------------------------- + data DebugState = DebugState { _allRevealed :: !Bool } @@ -402,8 +404,12 @@ data GameState = GameState , _characterEntityID :: !EntityID , _messageHistory :: !MessageHistory , _randomGen :: !StdGen + + -- | The active panel displayed in the UI, if any + , _activePanel :: !(Maybe Panel) + , _promptState :: !(GamePromptState AppM) - , _debugState :: DebugState + , _debugState :: !DebugState } deriving stock (Show, Generic) deriving anyclass (NFData) @@ -437,14 +443,3 @@ instance (MonadIO m) => MonadIO (AppT m) where -------------------------------------------------------------------------------- makeLenses ''DebugState - --------------------------------------------------------------------------------- - --- saveGame :: GameState -> LByteString --- saveGame = Zlib.compress . JSON.encode - --- loadGame :: LByteString -> Maybe GameState --- loadGame = JSON.decode . Zlib.decompress - --- saved :: Prism' LByteString GameState --- saved = prism' saveGame loadGame |