Improve jump to hotkey

This commit is contained in:
2025-06-01 09:44:03 +01:00
parent 39753755af
commit 59e1207b46
3 changed files with 20 additions and 7 deletions
+3 -2
View File
@@ -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