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
+13 -2
View File
@@ -62,8 +62,12 @@ itemToBreakLists ::
([(ItemStructuralFunction, ComposeLinkType)], [(ItemStructuralFunction, ComposeLinkType)])
itemToBreakLists itm itmf = case (itm ^. itType, itmf) of
(HELD TORCH, _) -> (getAmmoLinks itm, [])
(ATTACH UNDERBARRELSLOT, _) -> ([(UnderBarrelPlatformSF, UnderBarrelPlatformLink)], [])
(_, HeldPlatformSF) ->
( getAmmoLinks itm
<> extraWeaponLinksBelow itm
--( extraWeaponLinksBelow itm
-- <>getAmmoLinks itm
, [(WeaponTargetingSF, WeaponTargetingLink), (WeaponScopeSF, WeaponScopeLink)]
<> getAutoSpringLinks itm
<> extraWeaponLinks itm
@@ -113,6 +117,12 @@ extraWeaponLinks itm = case itm ^. itType of
where
launcherlinks = [(ProjectileStabiliserSF,ProjectileStabiliserLink)]
extraWeaponLinksBelow :: Item -> [(ItemStructuralFunction, ComposeLinkType)]
extraWeaponLinksBelow itm
| Just TwoHandUnder <- itm ^? itUse . heldAim . aimStance
= [(UnderBarrelSlotSF,UnderBarrelSlotLink)]
| otherwise = []
getAmmoLinks :: Item -> [(ItemStructuralFunction, ComposeLinkType)]
getAmmoLinks itm =
map
@@ -123,7 +133,7 @@ itemToFunction :: Item -> ItemStructuralFunction
itemToFunction itm = case itm ^. itType of
HELD LASER -> WeaponTargetingSF
HELD{} -> case itm ^? itUseCondition of
Just MustBeHeld -> HeldPlatformSF
Just UseableWhenAimed -> HeldPlatformSF
--Just MustBeHeld -> UnloadedWeaponSF
_ -> GadgetPlatformSF
_
@@ -139,7 +149,7 @@ itemToFunction itm = case itm ^. itType of
ATTACH ZOOMSCOPE -> WeaponScopeSF
ATTACH HOMINGMODULE -> AmmoTargetingSF LauncherAmmo
ATTACH AUGMENTEDHUD -> AugmentedHUDSF
-- BULLETMOD BulletModTrajectory{} -> AmmoTargetingSF BulletAmmo
ATTACH UNDERBARRELSLOT -> UnderBarrelSlotSF
BULLETMOD BulletModPayload{} -> AmmoPayloadSF BulletAmmo
BULLETMOD BulletModEffect{} -> AmmoEffectSF BulletAmmo
TARGETING{} -> WeaponTargetingSF
@@ -154,6 +164,7 @@ structureToPotentialFunction ::
structureToPotentialFunction ldt = case ldt ^. ldtValue . _1 . itType of
ATTACH GIMBAL -> S.singleton ProjectileStabiliserSF
ATTACH GYROSCOPE -> S.singleton ProjectileStabiliserSF
HELD GLAUNCHER -> S.singleton UnderBarrelPlatformSF
_ -> S.singleton (ldt ^. ldtValue . _2)
baseCI :: Item -> ComposedItem