Move held item scrolling into dedicated datatype

This commit is contained in:
2022-07-20 15:17:56 +01:00
parent 2755a4ffdd
commit 2c6e5e818a
10 changed files with 79 additions and 58 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ the simulation step; in particular see 'updatePressedButtons'.
module Dodge.Event
( handleEvent
) where
import Dodge.HeldScroll
import Dodge.InputFocus
import Dodge.Combine
import Dodge.Event.Keyboard
@@ -110,7 +111,7 @@ wheelEvent y w = case _hudElement $ _hud w of
| rbDown -> case (yourItem w ^? _Just . itUse . heldScroll,_rbOptions w) of
(_,EquipOptions{}) -> scrollRBOption y w
(Nothing,_) -> closeObjScrollDir y w
(Just f,_) -> w & creatures . ix 0 . crInv . ix (crSel $ you w) %~ f y (you w)
(Just f,_) -> w & creatures . ix 0 . crInv . ix (crSel $ you w) %~ doHeldScroll f y (you w)
| lbDown -> w & cameraZoom +~ y
| invKeyDown -> changeSwapInvSel yi w
| otherwise -> stopSoundFrom (CrReloadSound 0) $ changeAugInvSel yi w