Start keeping track of item equip status internally (partially done)
This commit is contained in:
@@ -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 =>
|
||||
|
||||
Reference in New Issue
Block a user