Start moving hotkeys out from creatures into world
This commit is contained in:
@@ -53,7 +53,8 @@ toggleEquipmentAt invid cr w = case getEquipmentAllocation w of
|
||||
-- & crpoint . crInvEquipped . at invid ?~ newp
|
||||
& crpoint . crInv . ix invid . itLocation . ilEquipPosition ?~ newp
|
||||
& onequip itm cr
|
||||
& crpoint %~ assignNewHotkey invid
|
||||
-- & crpoint %~ assignNewHotkey invid
|
||||
& cWorld . lWorld %~ assignNewHotkey invid
|
||||
MoveEquipment{_allocNewPos = newp, _allocOldPos = oldp} ->
|
||||
w
|
||||
& crpoint . crEquipment . at newp ?~ invid
|
||||
@@ -77,15 +78,18 @@ toggleEquipmentAt invid cr w = case getEquipmentAllocation w of
|
||||
& crpoint . crInv . ix rid . itLocation . ilEquipPosition .~ Nothing
|
||||
& onremove (itmat rid) cr
|
||||
& onequip itm cr
|
||||
& crpoint %~ removeHotkey rid
|
||||
& crpoint %~ assignNewHotkey invid
|
||||
-- & crpoint %~ removeHotkey rid
|
||||
-- & crpoint %~ assignNewHotkey invid
|
||||
& cWorld . lWorld %~ removeHotkey rid
|
||||
& cWorld . lWorld %~ assignNewHotkey invid
|
||||
RemoveEquipment{_allocOldPos = oldp} ->
|
||||
w
|
||||
& crpoint . crEquipment . at oldp .~ Nothing
|
||||
-- & crpoint . crInvEquipped . at invid .~ Nothing
|
||||
& crpoint . crInv . ix invid . itLocation . ilEquipPosition .~ Nothing
|
||||
& onremove itm cr
|
||||
& crpoint %~ removeHotkey invid
|
||||
-- & crpoint %~ removeHotkey invid
|
||||
& cWorld . lWorld %~ removeHotkey invid
|
||||
where
|
||||
crpoint = cWorld . lWorld . creatures . ix (_crID cr)
|
||||
itmat i = _crInv cr IM.! i
|
||||
|
||||
Reference in New Issue
Block a user