Commit before making hotkeys attach to item ids, not inv ids

This commit is contained in:
2024-12-31 00:34:47 +00:00
parent 87f068f01a
commit 1e7dcbfded
15 changed files with 283 additions and 246 deletions
+9 -9
View File
@@ -15,7 +15,7 @@ import Dodge.Creature.Test
import Dodge.Data.Config
import Dodge.Data.World
--import Dodge.Equipment
import Dodge.InputFocus
--import Dodge.InputFocus
import Dodge.SmoothScroll
import Dodge.Viewpoints
import Dodge.WASD
@@ -24,7 +24,7 @@ import Geometry
--import qualified IntMapHelp as IM
import LensHelp
import SDL (MouseButton (..))
import qualified SDL
--import qualified SDL
{- Update the screen camera rotation and position, including any in rold scope/remote camera modifiers;
update where your avatar's view is from. -}
@@ -157,17 +157,17 @@ doWallRotate wl w = rotateUsing $ (argV . uncurry (-.-) $ _wlLine wl) - (w ^. wC
b = a * (4 / pi)
b' = fromIntegral (round b :: Int)
rotateCameraBy :: Float -> World -> World
rotateCameraBy x = wCam . camRot +~ x
--rotateCameraBy :: Float -> World -> World
--rotateCameraBy x = wCam . camRot +~ x
rotateCamera :: Configuration -> World -> World
rotateCamera cfig w
| keydown SDL.ScancodeQ && keydown SDL.ScancodeE = w
| keydown SDL.ScancodeQ = rotateCameraBy 0.025 w
| keydown SDL.ScancodeE = rotateCameraBy (-0.025) 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 ^. input . mouseButtons) w
where
keydown scode = scode `M.member` _pressedKeys (_input w) && not (inTextInputFocus w)
-- where
-- keydown scode = scode `M.member` _pressedKeys (_input w) && not (inTextInputFocus w)
zoomFromItem :: ItZoom -> Float
zoomFromItem ItZoom{_izMax = zMax, _izMin = zMin, _izFac = zFac} =