This commit is contained in:
2023-05-15 11:57:54 +01:00
parent c4ec84c0f9
commit ddb72690b1
3 changed files with 12 additions and 12 deletions
+10 -6
View File
@@ -27,7 +27,7 @@ updateWheelEvent yi w = case w ^. hud . hudElement of
-- this lock can be sensibly applied, perhaps
| w ^?! cWorld . lWorld . creatures . ix 0 . crInvLock -> w
| rbDown -> case (yourItem w ^? _Just . itUse . heldScroll, _rbOptions w) of
(_, EquipOptions{}) -> w & rbOptions %~ scrollRBOption yi
(_, EquipOptions{}) -> w & rbOptions . opSel %~ scrollRBOption yi rbscrollmax
(Nothing, _) -> closeObjScrollDir y w
(Just f, _) -> doHeldScroll f y (you w) w
| lbDown -> w & wCam . camZoom +~ y
@@ -42,6 +42,10 @@ updateWheelEvent yi w = case w ^. hud . hudElement of
DisplayInventory{_subInventory = DisplayTerminal tmid} -> terminalWheelEvent yi tmid w
_ -> w
where
rbscrollmax = fromMaybe 1 $ do
invid <- you w ^? crManipulation . manObject . inInventory . ispItem
esite <- you w ^? crInv . ix invid . itUse . equipEffect . eeSite
return $ length $ equipSiteToPositions esite
y = fromIntegral yi
numLocs = (fst . IM.findMax $ (w ^. cWorld . lWorld . seenLocations)) + 1
rbDown = ButtonRight `M.member` _mouseButtons (_input w)
@@ -97,11 +101,11 @@ terminalWheelEvent yi tmid w
tc = scrollCommands tm !! i
arg = getArguments' tc tm w !! j
scrollRBOption :: Int -> RightButtonOptions -> RightButtonOptions
scrollRBOption y w
| y < 0 = w & opSel %~ (min (length (_opEquip w) -1) . subtract y)
| y > 0 = w & opSel %~ (max 0 . subtract y)
| otherwise = w
scrollRBOption :: Int -> Int -> Int -> Int
scrollRBOption dy ymax
| dy < 0 = (min (ymax -1) . subtract dy)
| dy > 0 = (max 0 . subtract dy)
| otherwise = id
moveTweakSel :: Int -> World -> World
moveTweakSel i w = case yourItem w ^? _Just . itTweaks . tweakParams of