Add battery shape/picture

This commit is contained in:
2024-10-04 00:25:44 +01:00
parent 127d85e7ce
commit ac550bc6a4
14 changed files with 241 additions and 271 deletions
+7 -10
View File
@@ -137,7 +137,6 @@ updateScopeZoom' i w
where
wppointer = cWorld . lWorld . creatures . ix 0 . crInv . ix i . itUse . uScope
resetscope (OpticScope _ _ defz) = OpticScope (V2 0 0) defz defz
resetscope otherAtt = otherAtt
doScopeZoom :: Int -> Point2 -> Scope -> Scope
doScopeZoom scrollamount mp sc = case scrollamount of
@@ -169,11 +168,11 @@ zoomOutLongGun sc = fromMaybe sc $ do
sc & opticPos %~ (\p -> p +.+ (zoomSpeed - 1) / curzoom *.* p)
& opticZoom *~ zoomSpeed
ifConfigWallRotate :: Configuration -> World -> World
ifConfigWallRotate cfig w
| _gameplay_rotate_to_wall cfig && not (SDL.ButtonRight `M.member` _mouseButtons (_input w)) =
rotateToOverlappingWall w
| otherwise = w
ifConfigWallRotate :: Configuration -> M.Map MouseButton Int -> World -> World
ifConfigWallRotate cfig mbs
| _gameplay_rotate_to_wall cfig && not (SDL.ButtonRight `M.member` mbs) =
rotateToOverlappingWall
| otherwise = id
rotateToOverlappingWall :: World -> World
rotateToOverlappingWall w =
@@ -205,13 +204,11 @@ rotateCamera cfig w
| keydown SDL.ScancodeQ && keydown SDL.ScancodeE = w
| keydown SDL.ScancodeQ = rotateCameraBy 0.025 w
| keydown SDL.ScancodeE = rotateCameraBy (-0.025) w
| otherwise = ifConfigWallRotate cfig w
| otherwise = ifConfigWallRotate cfig (w ^. input . mouseButtons) w
where
keydown scode = scode `M.member` _pressedKeys (_input w) && not (inInputFocus w)
zoomFromItem ::
ItZoom ->
Float
zoomFromItem :: ItZoom -> Float
zoomFromItem ItZoom{_izMax = zMax, _izMin = zMin, _izFac = zFac} =
min zMax $ max zMin zFac