Commit before making hotkeys attach to item ids, not inv ids
This commit is contained in:
@@ -11,7 +11,7 @@ import Dodge.Data.World
|
||||
import Dodge.DoubleTree
|
||||
import Dodge.Euse
|
||||
import Dodge.HeldUse
|
||||
import Dodge.Hotkey
|
||||
--import Dodge.Hotkey
|
||||
import Dodge.Inventory
|
||||
import Dodge.Item.Grammar
|
||||
import Dodge.Item.Location
|
||||
@@ -71,7 +71,7 @@ toggleEquipmentAt invid cr w = case getEquipmentAllocation w of
|
||||
& crpoint . crEquipment . at newp ?~ invid
|
||||
& crpoint . crInv . ix invid . itLocation . ilEquipSite ?~ newp
|
||||
& onequip itm cr
|
||||
& cWorld . lWorld %~ assignNewHotkey invid
|
||||
-- & cWorld . lWorld %~ assignNewHotkey invid
|
||||
MoveEquipment{_allocNewPos = newp, _allocOldPos = oldp} ->
|
||||
w
|
||||
& crpoint . crEquipment . at newp ?~ invid
|
||||
@@ -90,14 +90,14 @@ toggleEquipmentAt invid cr w = case getEquipmentAllocation w of
|
||||
& crpoint . crInv . ix rid . itLocation . ilEquipSite .~ Nothing
|
||||
& onremove (itmat rid) cr
|
||||
& onequip itm cr
|
||||
& cWorld . lWorld %~ removeHotkey rid
|
||||
& cWorld . lWorld %~ assignNewHotkey invid
|
||||
-- & cWorld . lWorld %~ removeHotkey rid
|
||||
-- & cWorld . lWorld %~ assignNewHotkey invid
|
||||
RemoveEquipment{_allocOldPos = oldp} ->
|
||||
w
|
||||
& crpoint . crEquipment . at oldp .~ Nothing
|
||||
& crpoint . crInv . ix invid . itLocation . ilEquipSite .~ Nothing
|
||||
& onremove itm cr
|
||||
& cWorld . lWorld %~ 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