From 685eaa3a04b4be3e0ddca24bc034f78d90ee71d7 Mon Sep 17 00:00:00 2001 From: justin Date: Tue, 8 Oct 2024 16:05:37 +0100 Subject: [PATCH] Update inventory every tick (for close objects) --- ghcidOutput | 2 +- src/Dodge/Inventory/CloseObject.hs | 5 ++++- src/Dodge/Update.hs | 9 +++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ghcidOutput b/ghcidOutput index 2da8bb592..3d9dd7799 100644 --- a/ghcidOutput +++ b/ghcidOutput @@ -1 +1 @@ -All good (597 modules, at 15:48:24) +All good (597 modules, at 16:02:38) diff --git a/src/Dodge/Inventory/CloseObject.hs b/src/Dodge/Inventory/CloseObject.hs index 65bf43855..af42a1cd1 100644 --- a/src/Dodge/Inventory/CloseObject.hs +++ b/src/Dodge/Inventory/CloseObject.hs @@ -1,4 +1,7 @@ -module Dodge.Inventory.CloseObject where +module Dodge.Inventory.CloseObject ( + closeObjPos, + closeObjEq, +) where import Dodge.Data.Button import Dodge.Data.FloorItem diff --git a/src/Dodge/Update.hs b/src/Dodge/Update.hs index bcccc5d7d..a92932669 100644 --- a/src/Dodge/Update.hs +++ b/src/Dodge/Update.hs @@ -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