Make hotkeys assignable to any item, use item id

This commit is contained in:
2024-12-31 09:20:53 +00:00
parent 1e7dcbfded
commit e12e4777b2
8 changed files with 37 additions and 59 deletions
+7 -7
View File
@@ -66,10 +66,10 @@ rmInvItem cid invid w =
& pointcid . crInv %~ f -- important
& removeAnySlotEquipment
& pointcid . crEquipment . each %~ g
& removeanyactivation
& cWorld . lWorld . hotkeys . each %~ g
& cWorld . lWorld . imHotkeys %~ IM.delete invid
& cWorld . lWorld . imHotkeys %~ IM.mapKeys g
-- & removeanyactivation
-- & cWorld . lWorld . hotkeys . each %~ g
-- & cWorld . lWorld . imHotkeys %~ IM.delete invid
-- & cWorld . lWorld . imHotkeys %~ IM.mapKeys g
& updateselection
& updateselectionextra
& pointcid %~ updateRootItemID
@@ -96,9 +96,9 @@ rmInvItem cid invid w =
epos <- w ^? cWorld . lWorld . creatures . ix cid . crInv . ix invid
. itLocation . ilEquipSite . _Just
return $ pointcid . crEquipment . at epos .~ Nothing
removeanyactivation = fromMaybe id $ do
epos <- w ^? cWorld . lWorld . imHotkeys . ix invid
return $ cWorld . lWorld . hotkeys . at epos .~ Nothing
-- removeanyactivation = fromMaybe id $ do
-- epos <- w ^? cWorld . lWorld . imHotkeys . ix invid
-- return $ cWorld . lWorld . hotkeys . at epos .~ Nothing
maxk = fmap fst $ IM.lookupMax $ cr ^. crInv
f inv =
let (xs, ys) = IM.split invid inv