From 6ba16b06fb10c6f646ef524b879bcd3e2fd100ff Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 6 Jan 2025 12:23:59 +0000 Subject: [PATCH] Cleanup --- src/Dodge/Inventory/SelectionList.hs | 2 +- src/Dodge/Payload.hs | 4 ++-- src/Dodge/Update/Input/InGame.hs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Dodge/Inventory/SelectionList.hs b/src/Dodge/Inventory/SelectionList.hs index 405fb654b..04cca30fb 100644 --- a/src/Dodge/Inventory/SelectionList.hs +++ b/src/Dodge/Inventory/SelectionList.hs @@ -51,7 +51,7 @@ itemDisplay w cr ci = f f xs _ = xs g (x:xs) (y:_) = (rightPad 15 ' ' x ++ y) : xs g xs _ = xs - anyextra = maybe [] (:[]) (anyhotkey <> anyequippos) + anyextra = maybeToList (anyhotkey <> anyequippos) anyhotkey = fmap hotkeyToString (w ^? cWorld . lWorld . imHotkeys . unNIntMap . ix itid) anyequippos = fmap diff --git a/src/Dodge/Payload.hs b/src/Dodge/Payload.hs index 6a7df2623..4ec0e35f9 100644 --- a/src/Dodge/Payload.hs +++ b/src/Dodge/Payload.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE LambdaCase #-} module Dodge.Payload ( usePayload, ) where @@ -15,7 +16,7 @@ import Geometry.Data import LensHelp usePayload :: Payload -> Point2 -> Point2 -> World -> World -usePayload payload = case payload of +usePayload = \case ExplosionPayload -> makeExplosionAt ShrapnelBomb -> makeShrapnelAt DudPayload -> const (const id) @@ -29,7 +30,6 @@ makeShrapnelAt p v w = & makeShockwaveAt [] p 50 5 0 white & cWorld . lWorld . bullets .++~ buls where --- speed = magV v vs = replicateM 75 (randInCirc 10) & evalState $ _randGen w drags :: [Float] drags = replicateM 75 (state $ randomR (0.85,0.9)) & evalState $ _randGen w diff --git a/src/Dodge/Update/Input/InGame.hs b/src/Dodge/Update/Input/InGame.hs index f440fcd92..edd11b343 100644 --- a/src/Dodge/Update/Input/InGame.hs +++ b/src/Dodge/Update/Input/InGame.hs @@ -212,7 +212,7 @@ updateMouseClickInGame cfig w = case w ^. input . mouseContext of & hud . hudElement . diCloseFilter .~ Nothing OverInvSelect x | ScancodeLShift `M.member` (w ^. input . pressedKeys) - && (isGroupSelectableSection $ fst x) -> + && isGroupSelectableSection (fst x) -> w & input . mouseContext .~ OverInvDragSelect x (Just $ snd x) OverInvSelect x -> startDrag x cfig w OverTerminalReturn tmid -> terminalReturnEffect tmid w