Tweak scrolling, particularly zooming

This commit is contained in:
2023-01-07 19:50:44 +00:00
parent 6b259fa200
commit d4122b2d6f
7 changed files with 42 additions and 37 deletions
+1 -11
View File
@@ -14,21 +14,11 @@ import Dodge.Item.Weapon.ZoomScope
doHeldScroll :: HeldScroll -> Float -> Creature -> World -> World
doHeldScroll hs = case hs of
HeldScrollDoNothing -> const . const id
HeldScrollZoom -> overYourItem zoomLongGun
HeldScrollZoom -> overYourItem (const . zoomLongGun)
HeldScrollCharMode{} -> overYourItem $ \x _ -> itUse . heldScroll . hsCharMode %~ cycleSignum x
HeldScrollTime -> doScrollTime
HeldScrollInt{} -> undefined
where
overYourItem f x cr w = w & cWorld . lWorld . creatures . ix 0 . crInv . ix (crSel $ you w) %~ f x cr
doScrollTime :: Float -> Creature -> World -> World
doScrollTime _ _ w = w
-- | x > 0 = case _futureWorlds $ _cwTime w of
-- (w':ws) -> w -- & cWorld .~ w'
-- -- & cwTime . futureWorlds %~ tail
-- -- & cwTime . rewindWorlds .:~ _cWorld w
-- _ -> w
-- | otherwise = w
cycleSignum :: Float -> Seq a -> Seq a
cycleSignum x
| x > 0 = cycleL