Fixing bugs

This commit is contained in:
ZioPao
2023-11-06 19:22:56 +01:00
parent 4254d123bf
commit ae51634be4
6 changed files with 37 additions and 23 deletions

View File

@@ -2,6 +2,8 @@ local BaseHandler = require("UI/TOC_HealthPanelBaseHandler")
local CutLimbAction = require("TimedActions/TOC_CutLimbAction")
---@class CutLimbHandler
---@field panel any
---@field bodyPart any
local CutLimbHandler = BaseHandler:derive("CutLimbHandler")

View File

@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local CutLimbHandler = require("UI/TOC_CutLimbHandler")
-- TODO Use this to replace the sprites once a limb is cut
@@ -22,7 +23,9 @@ local og_ISHealthPanel_doBodyPartContextMenu = ISHealthPanel.doBodyPartContextMe
function ISHealthPanel:doBodyPartContextMenu(bodyPart, x, y)
og_ISHealthPanel_doBodyPartContextMenu(self, bodyPart, x, y)
local playerNum = self.otherPlayer and self.otherPlayer:getPlayerNum() or self.character:getPlayerNum()
local context = getPlayerContextMenu(playerNum) -- To not recreate it but reuse the one that has been created in the original method
-- 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)
cutLimbHandler:addToMenu(context)
end
@@ -30,6 +33,7 @@ end
--* Modification to handle visible amputation on the health menu *--
-- TODO We need male variations
local handL = getTexture("media/ui/Hand_L.png")
local forearmL = getTexture("media/ui/ForeArm_L.png")