Start unifying drawn cursors

This commit is contained in:
2022-11-03 10:00:41 +00:00
parent 0872a2dd40
commit e6e5427f44
9 changed files with 129 additions and 44 deletions
+8 -5
View File
@@ -68,6 +68,7 @@ import qualified Data.Text as T
updateUniverse :: Universe -> Universe
updateUniverse u =
updateUniverseLast
. advanceScrollAmount
. maybeOpenTerminal
. over (uvWorld . input . textInput) (const mempty)
. updateUniverseMid
@@ -91,7 +92,7 @@ gotoTerminal w = case _uvScreenLayers w of
updateUseInput :: Universe -> Universe
updateUseInput u = case u ^? uvScreenLayers . _head of
Just (InputScreen thetext _) -> doInputScreenInput thetext u
Just OptionScreen{_scOptions = mos, _scDefaultEff = defeff} ->
Just OptionScreen{_scOptions = mos, _scDefaultEff = defeff} -> menuWheelEvents $
foldl' (\u' scode -> optionListToEffects defeff scode mos u') u (M.keys $ M.filter (== InitialPress) pkeys)
Just ColumnsScreen{} -> u & uvScreenLayers %~ tail
_ -> case u ^? uvWorld . cWorld . lWorld . hud . hudElement . subInventory of
@@ -121,10 +122,7 @@ updateUniverseMid u = case _uvScreenLayers u of
. updateClouds
)
(_ : _) -> u
[] -> functionalUpdate'' u
functionalUpdate'' :: Universe -> Universe
functionalUpdate'' = advanceScrollAmount . functionalUpdate'
[] -> functionalUpdate' u
functionalUpdate' :: Universe -> Universe
functionalUpdate' u = case u ^. uvWorld . cWorld . timeFlow of
@@ -234,6 +232,11 @@ functionalUpdate w =
. over uvWorld updateWheelEvents
$ over uvWorld updatePastWorlds w
menuWheelEvents :: Universe -> Universe
menuWheelEvents u = u & uvScreenLayers . _head . scSelPos . _Just -~ y
where
y = u ^. uvWorld . input . scrollAmount
updateWheelEvents :: World -> World
updateWheelEvents w = foldr ($) w (replicate (abs y) (updateWheelEvent (signum y)))
where