Partial inventory display update

This commit is contained in:
2023-01-27 22:47:45 +00:00
parent ce25157738
commit 5f7d662454
6 changed files with 179 additions and 16 deletions
+7
View File
@@ -6,6 +6,7 @@ Description : Simulation update
-}
module Dodge.Update (updateUniverse) where
import Dodge.DisplayInventory
import Dodge.ScrollValue
import Color
import Control.Applicative
@@ -72,6 +73,7 @@ updateUniverse u =
. over (uvWorld . input . textInput) (const mempty)
. updateUniverseMid
. updateUseInput
. updateInventoryDisplay
. over uvWorld (updateCamera cfig)
. over (uvWorld . input) updateScrollTestValue
. over (uvWorld . cWorld . cClock) (+ 1)
@@ -79,6 +81,11 @@ updateUniverse u =
where
cfig = u ^. uvConfig
updateInventoryDisplay :: Universe -> Universe
updateInventoryDisplay u = u & uvWorld . hud . hudElement . diSections %~ const di
where
di = makeDisplayInventory (_uvWorld u) (_uvConfig u)
maybeOpenTerminal :: Universe -> Universe
maybeOpenTerminal u = case u ^. uvWorld . input . pressedKeys . at ScancodeSemicolon of
Just InitialPress -> gotoTerminal u