Fix attachment of augmented hud to laser

This commit is contained in:
2024-10-08 17:36:00 +01:00
parent c0879393cd
commit d1ee0f997a
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
All good (597 modules, at 17:07:08)
All good (597 modules, at 17:30:07)
+1
View File
@@ -282,6 +282,7 @@ testInventory =
stackedInventory :: [Item]
stackedInventory =
[ torch
, augmentedHUD
, smallBattery
, makeTypeCraft TRANSFORMER
, remoteScreen
+1 -1
View File
@@ -96,7 +96,7 @@ itemNumberDisplay :: Creature -> ComposedItem -> [String]
itemNumberDisplay cr ci = case (ci ^. cItemFunction,iu) of
-- UseTargeting {_tgPos = mp} -> [maybe "" shortShow mp]
-- this could be cleaner here...
(WeaponTargetingSF,_) -> [maybe "" shortShow (itm ^? itTargeting . itTgPos . _Just)]
(WeaponTargetingSF,_) -> [maybe "" (const "!TARG!") (itm ^? itTargeting . itTgPos . _Just)]
(_,UseHeld{}) -> []
(_,UseHotkey{}) -> [showAutoRechargeProgress (_leftConsumption iu)]
(_,UseEquip{}) -> showEquipmentNumber cr itm
+2 -3
View File
@@ -61,7 +61,6 @@ itemToBreakLists ci = case (itm ^. itType,ci ^. cItemFunction) of
, (RemoteScreenSF, RemoteScreenLink)
],[])
(_,WeaponTargetingSF) -> (getAmmoLinks itm ++ [(AugmentedHUDSF,AugmentedHUDLink)],[])
-- TARGETING{} -> ([(AugmentedHUDSF,AugmentedHUDLink)],[])
_ -> ([],[])
where
itm = ci ^. cItem
@@ -99,12 +98,12 @@ laserLinkTest :: Item -> LinkTest
laserLinkTest itm = LTest (llleft itm) (llright itm)
llleft :: Item -> PartiallyComposedItem -> Maybe LinkUpdate
llleft itm pci = _tryLeftLink (uncurry useBreakL $ itemToBreakLists (CItem itm (itemToFunction itm))) pci
llleft itm pci = _tryLeftLink (uncurry useBreakL $ itemToBreakLists (CItem itm WeaponTargetingSF)) pci
llright :: Item -> PartiallyComposedItem -> Maybe LinkUpdate
llright itm pci = case pci ^. _1 . itType of
CRAFT TRANSFORMER -> Just (toLasgunUpdate itm)
_ -> _tryRightLink (uncurry useBreakL $ itemToBreakLists (CItem itm (itemToFunction itm))) pci
_ -> _tryRightLink (uncurry useBreakL $ itemToBreakLists (CItem itm WeaponPlatformSF)) pci
toLasgunUpdate :: Item -> LinkUpdate
toLasgunUpdate itm = LUpdate (ILink FunctionChangeLink orientAttachment)