Display root+tree selection when aiming

This commit is contained in:
2024-10-28 14:26:09 +00:00
parent 53557965d0
commit 97c3f1262b
6 changed files with 130 additions and 82 deletions
+8 -4
View File
@@ -48,7 +48,7 @@ itemToBreakLists ::
ComposedItem ->
([(ItemStructuralFunction, ComposeLinkType)], [(ItemStructuralFunction, ComposeLinkType)])
itemToBreakLists ci = case (itm ^. itType, ci ^. cItemFunction) of
(HELD TORCH,_) -> (getAmmoLinks itm,[])
(HELD TORCH, _) -> (getAmmoLinks itm, [])
(_, WeaponPlatformSF) ->
( getAmmoLinks itm
, [(WeaponTargetingSF, WeaponTargetingLink), (WeaponScopeSF, WeaponScopeLink)]
@@ -103,8 +103,11 @@ laserLinkTest :: Item -> LinkTest
laserLinkTest itm = LTest (llleft itm) (llright itm)
llleft :: Item -> PartiallyComposedItem -> Maybe LinkUpdate
llleft itm = _tryLeftLink
. uncurry useBreakL . itemToBreakLists $ CItem itm WeaponTargetingSF
llleft itm =
_tryLeftLink
. uncurry useBreakL
. itemToBreakLists
$ CItem itm WeaponTargetingSF
llright :: Item -> PartiallyComposedItem -> Maybe LinkUpdate
llright itm pci = case pci ^. _1 . itType of
@@ -179,8 +182,9 @@ invRootMap = foldMap (dtToIntMapWithRoot (^?! itLocation . ilInvID) . fmap (^. _
-- location ids
-- consider explicitly reseting the inventory ids (but this probably really
-- should be done upstream anyway in the actually creature inventory)
-- The first Int in the maybe is the root, the second the parent
invAdj :: IM.IntMap Item -> IM.IntMap (Maybe (Int, Int), [Int], [Int])
invAdj im = IM.unions . map g $ invLDT im
invAdj = IM.unions . map g . invLDT
where
g = dtToLRAdj getid . ldtToDT
getid (itm, _, _) =