Use NewIntMap InvInt for crInv
This commit is contained in:
@@ -57,7 +57,7 @@ handleHotkeys w
|
||||
w ^. input . pressedKeys
|
||||
, Just itid <- lw ^? hotkeys . ix hk . unNInt
|
||||
, Just invid <- lw ^? items . ix itid . itLocation . ilInvID =
|
||||
w & invSetSelectionPos 0 invid
|
||||
w & invSetSelectionPos 0 (_unNInt invid)
|
||||
| otherwise =
|
||||
M.foldl'
|
||||
useHotkey
|
||||
@@ -70,7 +70,7 @@ handleHotkeys w
|
||||
|
||||
useHotkey :: World -> (NewInt ItmInt, Int) -> World
|
||||
useHotkey w (NInt itid, pt) = fromMaybe w $ do
|
||||
invid <- w ^? cWorld . lWorld . items . ix itid . itLocation . ilInvID
|
||||
invid <- w ^? cWorld . lWorld . items . ix itid . itLocation . ilInvID . unNInt
|
||||
useItem invid pt w
|
||||
|
||||
hotkeyToScancode :: Hotkey -> SDL.Scancode
|
||||
@@ -231,6 +231,6 @@ tryClickUse pkeys w = fromMaybe w $ do
|
||||
^? cWorld . lWorld . creatures . ix 0
|
||||
. crManipulation
|
||||
. manObject
|
||||
. imSelectedItem of
|
||||
. imSelectedItem . unNInt of
|
||||
Just invid -> useItem invid ltime w
|
||||
Nothing -> interactWithCloseObj <$> getSelectedCloseObj w ?? w
|
||||
|
||||
Reference in New Issue
Block a user