Improve jump to hotkey
This commit is contained in:
@@ -40,7 +40,8 @@ yourControl _ w
|
||||
handleHotkeys :: World -> World
|
||||
handleHotkeys w
|
||||
| ispressed SDL.ScancodeLShift || ispressed SDL.ScancodeRShift
|
||||
, Just hk <- listToMaybe . mapMaybe scancodeToHotkey . M.keys $ w ^. input . pressedKeys
|
||||
, Just hk <-
|
||||
listToMaybe . mapMaybe scancodeToHotkey . M.keys $ w ^. input . pressedKeys
|
||||
, Just invid <- lw ^? creatures . ix 0 . crManipulation . manObject . imSelectedItem
|
||||
, Just itid <- lw ^? creatures . ix 0 . crInv . ix invid . itID =
|
||||
w & cWorld . lWorld %~ assignHotkey itid hk
|
||||
@@ -50,7 +51,7 @@ handleHotkeys w
|
||||
w ^. input . pressedKeys
|
||||
, Just itid <- lw ^? hotkeys . ix hk . unNInt
|
||||
, Just invid <- lw ^? itemLocations . ix itid . ilInvID =
|
||||
w & augInvDirectSelect (0, invid, mempty)
|
||||
w & invSetSelectionPos 0 invid
|
||||
| otherwise =
|
||||
M.foldl'
|
||||
useHotkey
|
||||
|
||||
Reference in New Issue
Block a user