Fix bug in creature death drop/destruction ordering

This commit is contained in:
2024-10-03 11:19:53 +01:00
parent 1953fb2d0c
commit 3c9941923d
6 changed files with 17 additions and 102 deletions
+7 -7
View File
@@ -20,7 +20,7 @@ import SDL
updateWheelEvent :: Int -> World -> World
updateWheelEvent yi w = case w ^. hud . hudElement of
DisplayCarte
| rbDown -> w & hud . carteZoom %~ min 0.75 . max 0.05 . ((1 + y * 0.1) *)
| bdown ButtonRight -> w & hud . carteZoom %~ min 0.75 . max 0.05 . ((1 + y * 0.1) *)
| otherwise -> w & cWorld . lWorld . selLocation %~ (`mod` numLocs) . (+ yi)
DisplayInventory{_subInventory = NoSubInventory}
-- functions that modify the inventory should be centralised so that
@@ -30,14 +30,15 @@ updateWheelEvent yi w = case w ^. hud . hudElement of
-- (_,EquipOptions{}) -> w & rbOptions . opSel %~ scrollRBOption yi rbscrollmax
-- (Nothing, _) -> w
-- (Just (invid,hs), _) -> doHeldScroll invid hs y w
| rbDown -> case _rbOptions w of
| bdown ButtonRight -> case _rbOptions w of
EquipOptions{} -> w & rbOptions . opSel %~ scrollRBOption yi rbscrollmax
NoRightButtonOptions -> w
| lbDown -> w & wCam . camZoom +~ y
| bdown ButtonLeft -> w & wCam . camZoom +~ y
| invKeyDown -> changeSwapSel yi w
| otherwise -> scrollAugInvSel yi w
--DisplayInventory{_subInventory = ExamineInventory mi} -> w
DisplayInventory{_subInventory = ExamineInventory} -> w
DisplayInventory{_subInventory = ExamineInventory}
| invKeyDown -> scrollAugInvSel yi w
| otherwise -> w
-- | invKeyDown && rbDown -> w & moveTweakSel yi
-- | invKeyDown -> scrollAugInvSel yi w
-- | rbDown -> w & changeTweakParam mi yi
@@ -52,8 +53,7 @@ updateWheelEvent yi w = case w ^. hud . hudElement of
return $ length $ equipSiteToPositions esite
y = fromIntegral yi
numLocs = (fst . IM.findMax $ (w ^. cWorld . lWorld . seenLocations)) + 1
rbDown = ButtonRight `M.member` _mouseButtons (_input w)
lbDown = ButtonLeft `M.member` _mouseButtons (_input w)
bdown b = b `M.member` _mouseButtons (_input w)
invKeyDown = ScancodeCapsLock `M.member` _pressedKeys (_input w)
moveCombineSel :: Int -> World -> World