Cleanup, fix bug in floating camera zoom

This commit is contained in:
2024-12-23 16:59:55 +00:00
parent 90ec2a3738
commit 02b2f9831f
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -115,13 +115,12 @@ itemToFunction itm = case itm ^. itType of
_ -> UncomposableIsolateSF _ -> UncomposableIsolateSF
basePCI :: Item -> ComposedItem basePCI :: Item -> ComposedItem
basePCI itm = case _itType itm of basePCI itm = (itm, itemToFunction itm, itemBaseConnections itm)
_ -> (itm, itemToFunction itm, itemBaseConnections itm)
itemBaseConnections :: Item -> LinkTest itemBaseConnections :: Item -> LinkTest
itemBaseConnections itm = case _itType itm of itemBaseConnections itm = case _itType itm of
HELD LASER -> laserLinkTest itm HELD LASER -> laserLinkTest itm
CRAFT SPRING -> springLinkTest itm CRAFT SPRING -> springLinkTest
_ -> uncurry useBreakL $ itemToBreakLists itm (itemToFunction itm) _ -> uncurry useBreakL $ itemToBreakLists itm (itemToFunction itm)
laserLinkTest :: Item -> LinkTest laserLinkTest :: Item -> LinkTest
@@ -145,8 +144,8 @@ toLasgunUpdate itm =
(\(par, _, _) -> (par, HeldPlatformSF, uncurry useBreakL $ itemToBreakLists itm HeldPlatformSF)) (\(par, _, _) -> (par, HeldPlatformSF, uncurry useBreakL $ itemToBreakLists itm HeldPlatformSF))
(\(chi, _, up) -> (chi, FunctionChangeSF, up)) (\(chi, _, up) -> (chi, FunctionChangeSF, up))
springLinkTest :: Item -> LinkTest springLinkTest :: LinkTest
springLinkTest itm = LTest (const Nothing) $ springLinkTest = LTest (const Nothing) $
\ci -> case ci ^. _1 . itType of \ci -> case ci ^. _1 . itType of
CRAFT HARDWARE -> CRAFT HARDWARE ->
Just Just
+1 -1
View File
@@ -64,7 +64,7 @@ translateFloatingCameraKeys theinput = (camCenter -~ thetran) . (camViewFrom -~
zoomFloatingCamera :: Input -> Camera -> Camera zoomFloatingCamera :: Input -> Camera -> Camera
zoomFloatingCamera theinput zoomFloatingCamera theinput
| ButtonRight `M.member` (theinput ^. mouseButtons) = | ButtonRight `M.member` (theinput ^. mouseButtons) =
camZoom *~ (39/40 ^^ negate (getSmoothScrollValue theinput)) camZoom *~ ((39/40) ^^ negate (getSmoothScrollValue theinput))
| otherwise = id | otherwise = id
-- the 39/40 is taken from zoomSpeed -- the 39/40 is taken from zoomSpeed