Cleanup, hlints

This commit is contained in:
2025-07-12 21:35:35 +01:00
parent 5544e891c5
commit dc631263da
9 changed files with 58 additions and 74 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ itemEquipPict cr itmtree
, Just attachpos <- equipAttachPos <$> itm ^? itType . ibtEquip
= equipPosition esite cr attachpos (itemSPic itm)
| itm ^? itLocation . ilInvID == cr ^? crManipulation . manObject . imRootSelectedItem
= overPosSP (Q.prePos $ handHandleOrient (loc) cr) (itemTreeSPic $ itmtree)
= overPosSP (Q.prePos $ handHandleOrient loc cr) (itemTreeSPic itmtree)
| otherwise = mempty
where
itm = itmtree ^. dtValue . _1
+8 -22
View File
@@ -1,15 +1,12 @@
{-# LANGUAGE TupleSections #-}
module Dodge.Item.Grammar (
invDT,
-- invLDT,
invDT',
invAdj,
invRootMap,
-- invRootTrees,
invIMDT,
baseCI,
invIndents,
-- allInvLocs,
) where
import Dodge.Item.Orientation
@@ -52,15 +49,6 @@ tryAttachItems = leftRightCombine leftIsParentCombine rightIsParentCombine
-- [(JoystickSF, JoystickLink)]
-- _ -> []
--itemToBreakLists ::
-- Item ->
-- ItemStructuralFunction ->
-- ([(ItemStructuralFunction, ItemLink)], [(ItemStructuralFunction, ItemLink)])
--itemToBreakLists itm itmf = (fmap f l, fmap f r)
-- where
-- f x = (x, SFLink x)
-- (l,r) = itemToBreakLists' itm itmf
itemToBreakLists ::
Item ->
ItemStructuralFunction ->
@@ -71,7 +59,7 @@ itemToBreakLists itm itmf = case (itm ^. itType, itmf) of
(_, HeldPlatformSF) ->
( getAmmoLinks itm
<> extraWeaponLinksBelow itm
, [(WeaponTargetingSF), (WeaponScopeSF)]
, [WeaponTargetingSF, WeaponScopeSF]
<> getAutoSpringLinks itm
<> extraWeaponLinks itm
)
@@ -79,23 +67,23 @@ itemToBreakLists itm itmf = case (itm ^. itType, itmf) of
( getAmmoLinks itm,[])
(DETECTOR {}, _) ->
( getAmmoLinks itm
, [(ARHUDSF),(TriggerSF),(MapperSF)]
, [ARHUDSF,TriggerSF,MapperSF]
)
(CRAFT TRANSFORMER, _) -> ([],[(LaserWeaponSF)])
(CRAFT TRANSFORMER, _) -> ([],[LaserWeaponSF])
(MAPPER, _) ->
( []
, [(ARHUDSF)]
, [ARHUDSF]
)
(_, GadgetPlatformSF) ->
( getAmmoLinks itm
, [(TriggerSF), (WeaponTargetingSF), (WeaponScopeSF)]
, [TriggerSF, WeaponTargetingSF, WeaponScopeSF]
)
(_, AmmoMagSF{}) -> fromMaybe ([], []) $ do
atype <- magAmmoType itm
let screenanddet = case atype of
LauncherAmmo ->
[ (RemoteScreenSF)
, (RemoteDetonatorSF)
[ RemoteScreenSF
, RemoteDetonatorSF
]
_ -> []
return
@@ -133,9 +121,7 @@ extraWeaponLinks itm = case itm ^. itType of
extraWeaponLinksBelow :: Item -> [(ItemStructuralFunction)]
extraWeaponLinksBelow itm
-- | Just TwoHandUnder <- itm ^? itUse . heldAim . aimStance
| TwoHandUnder <- itemBaseStance itm
= [(UnderBarrelSlotSF)]
| TwoHandUnder <- itemBaseStance itm = [(UnderBarrelSlotSF)]
| otherwise = []
getAmmoLinks :: Item -> [(ItemStructuralFunction)]