Fix rb scrolling
This commit is contained in:
+5
-11
@@ -1,13 +1,12 @@
|
||||
module Dodge.Reloading (
|
||||
crCancelReloading,
|
||||
crToggleReloading,
|
||||
crHoldReloading,
|
||||
stepReloading,
|
||||
tryStartLoading,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Dodge.Data.World
|
||||
import Dodge.Data.Creature
|
||||
import Dodge.Hammer
|
||||
|
||||
crCancelReloading :: Creature -> Creature
|
||||
@@ -38,15 +37,10 @@ tryNextLoadAction cr = case cr ^? crInv . ix (crSel cr) . itUse . heldConsumptio
|
||||
cr & crInvSel . iselAction . actionProgress .~ _actionTime la
|
||||
& crInvSel . iselAction . reloadAction .~ la
|
||||
|
||||
crToggleReloading :: Creature -> World -> World
|
||||
crToggleReloading cr w = case cr ^. crInvSel . iselAction of
|
||||
ReloadAction{} -> w & cWorld . lWorld . creatures . ix (_crID cr) . crInvSel . iselAction .~ NoInvSelAction
|
||||
_ -> w & cWorld . lWorld . creatures . ix (_crID cr) %~ tryStartLoading
|
||||
|
||||
crHoldReloading :: Creature -> World -> World
|
||||
crHoldReloading cr w =
|
||||
w
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crInvSel . iselAction . actionHammer .~ HasHammer HammerDown
|
||||
crToggleReloading :: Creature -> Creature
|
||||
crToggleReloading cr = case cr ^? crInvSel . iselAction of
|
||||
Just ReloadAction{} -> cr & crInvSel . iselAction .~ NoInvSelAction
|
||||
_ -> cr & tryStartLoading
|
||||
|
||||
tryStartLoading :: Creature -> Creature
|
||||
tryStartLoading cr = case cr ^? crInv . ix (crSel cr) . itUse . heldConsumption of
|
||||
|
||||
Reference in New Issue
Block a user