Update inventory every tick (for close objects)

This commit is contained in:
2024-10-08 16:05:37 +01:00
parent 9679f32618
commit 685eaa3a04
3 changed files with 12 additions and 4 deletions
+4 -1
View File
@@ -1,4 +1,7 @@
module Dodge.Inventory.CloseObject where
module Dodge.Inventory.CloseObject (
closeObjPos,
closeObjEq,
) where
import Dodge.Data.Button
import Dodge.Data.FloorItem
+7 -2
View File
@@ -101,12 +101,17 @@ setClickWorldPos u = fmap
updateWorldEventFlags :: Universe -> Universe
updateWorldEventFlags u =
(uvWorld . worldEventFlags .~ mempty)
(uvWorld . worldEventFlags .~ mempty)
-- for now update inventory positioning every tick
. updateInventoryPositioning
-- the question is how often to update the close objects section, and if
-- this can be done independently of the other sections
$ foldr updateWorldEventFlag u (u ^. uvWorld . worldEventFlags)
updateWorldEventFlag :: WorldEventFlag -> Universe -> Universe
updateWorldEventFlag wef = case wef of
InventoryChange -> updateInventoryPositioning
InventoryChange -> id -- updateInventoryPositioning
-- for now update inventory positioning every tick
CombineInventoryChange -> updateCombinePositioning
maybeOpenTerminal :: Universe -> Universe