Distinguish between selected item and root-selected item

This commit is contained in:
2024-09-21 21:59:53 +01:00
parent 2154abfb1d
commit 31b5db6e9e
33 changed files with 313 additions and 281 deletions
+10 -4
View File
@@ -3,7 +3,8 @@ module Dodge.Base.You
-- , yourScopeInvID
, yourInv
-- , yourScrollAttachment
, yourItem
, yourSelectedItem
, yourRootItem
)where
import Dodge.Data.World
@@ -17,9 +18,14 @@ import Control.Lens
you :: World -> Creature
you w = w ^?! cWorld . lWorld . creatures . ix 0
yourItem :: World -> Maybe Item
yourItem w = do
i <- you w ^? crManipulation . manObject . inInventory . ispItem
yourSelectedItem :: World -> Maybe Item
yourSelectedItem w = do
i <- you w ^? crManipulation . manObject . inInventory . imSelectedItem
_crInv (you w) IM.!? i
yourRootItem :: World -> Maybe Item
yourRootItem w = do
i <- you w ^? crManipulation . manObject . inInventory . imRootItem
_crInv (you w) IM.!? i
--yourScrollAttachment :: World -> Maybe (Int,ScrollAttachParams)