Tweak scrolling, move onto reloading

This commit is contained in:
2023-01-07 23:50:54 +00:00
parent d4122b2d6f
commit f8d9b54586
7 changed files with 27 additions and 35 deletions
+12 -9
View File
@@ -95,12 +95,18 @@ updateScopeZoom w
doScopeZoom :: Point2 -> Scope -> Scope
doScopeZoom mp sc = case sc ^? scopeZoomChange of
Just x
| x > 10 -> (zoomInLongGun mp . zoomInLongGun mp . zoomInLongGun mp) sc
| x > 5 -> (zoomInLongGun mp . zoomInLongGun mp) sc
| x > 0 -> (zoomInLongGun mp) sc
| x < -10 -> (zoomOutLongGun . zoomOutLongGun . zoomOutLongGun) sc
| x < -5 -> (zoomOutLongGun . zoomOutLongGun) sc
| x < 0 -> zoomOutLongGun sc
| x > 10 -> (zoomInLongGun mp . zoomInLongGun mp . zoomInLongGun mp) $ sc
& scopeZoomChange -~ 2
| x > 5 -> (zoomInLongGun mp . zoomInLongGun mp) $ sc
& scopeZoomChange -~ 1
| x > 0 -> zoomInLongGun mp $ sc
& scopeZoomChange -~ 1
| x < -10 -> (zoomOutLongGun . zoomOutLongGun . zoomOutLongGun) $ sc
& scopeZoomChange +~ 2
| x < -5 -> (zoomOutLongGun . zoomOutLongGun) $ sc
& scopeZoomChange +~ 1
| x < 0 -> zoomOutLongGun $ sc
& scopeZoomChange +~ 1
| otherwise -> sc
_ -> sc
@@ -113,7 +119,6 @@ zoomInLongGun mousep sc
sc
& scopePos .+.+~ (1 - zoomSpeed) / newzoom *.* mousep
& scopeZoom %~ (/ zoomSpeed)
& scopeZoomChange -~ 1
| otherwise = sc & scopeZoomChange .~ 0
where
Just currentZoom = sc ^? scopeZoom
@@ -126,7 +131,6 @@ zoomOutLongGun sc
& scopePos %~ (\p -> p +.+ (zoomSpeed-1) / currentzoom *.* p)
-- & scopePos .*.*~ 1 - ((newzoom * 2) ** zoomSpeed)
& scopeZoom *~ zoomSpeed
& scopeZoomChange +~ 1
| otherwise = sc & scopeZoomChange .~ 0
& scopePos .~ V2 0 0
where
@@ -204,7 +208,6 @@ setViewDistance cfig w =
w & camViewDistance
.~ sqrt (halfWidth cfig ** 2 + halfHeight cfig ** 2) / (w ^. camZoom)
farWallDistDirection :: Point2 -> World -> Maybe (Float, Float, Float, Float)
farWallDistDirection p w =
boundPoints $