Fixes to CutLimbHandler

This commit is contained in:
ZioPao
2023-11-13 23:46:35 +01:00
parent 4fb19ae5a6
commit 56da8583b0
9 changed files with 109 additions and 38 deletions

View File

@@ -17,6 +17,8 @@ ISHealthBodyPartPanel = ISBodyPartPanel:derive("ISHealthBodyPartPanel")
local og_ISHealthPanel_dropItemsOnBodyPart = ISHealthPanel.dropItemsOnBodyPart
function ISHealthPanel:dropItemsOnBodyPart(bodyPart, items)
og_ISHealthPanel_dropItemsOnBodyPart(self, bodyPart, items)
TOC_DEBUG.print("override to dropItemsOnBodyPart running")
local cutLimbHandler = CutLimbHandler:new(self, bodyPart)
for _,item in ipairs(items) do
cutLimbHandler:checkItem(item)
@@ -35,10 +37,34 @@ function ISHealthPanel:doBodyPartContextMenu(bodyPart, x, y)
-- To not recreate it but reuse the one that has been created in the original method
local context = getPlayerContextMenu(playerNum)
local cutLimbHandler = CutLimbHandler:new(self, bodyPart)
self:checkItems({cutLimbHandler})
cutLimbHandler:addToMenu(context)
end
--* Modifications to handle visible amputation on the health menu *--
local og_ISHealthPanel_initialise = ISHealthPanel.initialise