Move scroll smoothing to central location

This commit is contained in:
2023-03-26 22:16:03 +01:00
parent b093219153
commit e5906eefa3
6 changed files with 12 additions and 38 deletions
+1 -2
View File
@@ -7,7 +7,6 @@ import Control.Lens hiding ((<|), (|>))
import Data.Sequence
import Dodge.Data.Creature
import Dodge.Data.World
import Dodge.Item.Weapon.ZoomScope
import Data.Maybe
--import LensHelp hiding ((|>), (<|))
-- should be able to just import data.item
@@ -15,7 +14,7 @@ import Data.Maybe
doHeldScroll :: HeldScroll -> Float -> Creature -> World -> World
doHeldScroll hs = case hs of
HeldScrollDoNothing -> const . const id
HeldScrollZoom -> overYourItem (const . setZoomScopeChange)
HeldScrollZoom -> const . const id
HeldScrollCharMode{} -> overYourItem $ \x _ -> itUse . heldScroll . hsCharMode %~ cycleSignum x
where
overYourItem f x cr w = fromMaybe w $ do