Distinguish between selected item and root-selected item
This commit is contained in:
+10
-4
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user