Start keeping track of item equip status internally (partially done)

This commit is contained in:
2024-12-19 00:55:14 +00:00
parent 5600b29714
commit 331a9a2f9b
17 changed files with 209 additions and 202 deletions
+2 -2
View File
@@ -25,13 +25,13 @@ pointerToItemLocation _ = const pure
pointerYourSelectedItem :: Applicative a => (Item -> a Item) -> World -> a World
pointerYourSelectedItem f w = fromMaybe (pure w) $ do
itinvid <- w ^? cWorld . lWorld . creatures . ix 0 . crManipulation . manObject . imSelectedItem
Just $ pointerToItemLocation (InInv 0 itinvid True True True) f w
Just $ pointerToItemLocation (InInv 0 itinvid True True True Nothing) f w
-- note the ilIsRoot/Selected/Attached booleans are irrelevant
pointerYourRootItem :: Applicative a => (Item -> a Item) -> World -> a World
pointerYourRootItem f w = fromMaybe (pure w) $ do
itinvid <- w ^? cWorld . lWorld . creatures . ix 0 . crManipulation . manObject . imRootSelectedItem
Just $ pointerToItemLocation (InInv 0 itinvid True True True) f w
Just $ pointerToItemLocation (InInv 0 itinvid True True True Nothing) f w
pointerToItem ::
Applicative f =>