Simplifield health panel logic
This commit is contained in:
@@ -407,8 +407,6 @@ end
|
|||||||
---A recreation of the original method, but with amputations in mind
|
---A recreation of the original method, but with amputations in mind
|
||||||
---@param dcInst DataController
|
---@param dcInst DataController
|
||||||
function ISEquipWeaponAction:performWithAmputation(dcInst)
|
function ISEquipWeaponAction:performWithAmputation(dcInst)
|
||||||
|
|
||||||
-- TODO Simplify this
|
|
||||||
local hand = nil
|
local hand = nil
|
||||||
local otherHand = nil
|
local otherHand = nil
|
||||||
local getMethodFirst = nil
|
local getMethodFirst = nil
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ function SetHealthPanelTOC()
|
|||||||
isReady = true
|
isReady = true
|
||||||
end
|
end
|
||||||
|
|
||||||
--function OverrideHealthPanelForTOC()
|
|
||||||
|
|
||||||
-- We're overriding ISHealthPanel to add custom textures to the body panel.
|
-- We're overriding ISHealthPanel to add custom textures to the body panel.
|
||||||
-- By doing so we can show the player which limbs have been cut without having to use another menu
|
-- By doing so we can show the player which limbs have been cut without having to use another menu
|
||||||
@@ -61,30 +60,6 @@ end
|
|||||||
|
|
||||||
--* Modifications and additional methods to handle visible amputation on the health menu *--
|
--* Modifications and additional methods to handle visible amputation on the health menu *--
|
||||||
|
|
||||||
local og_ISHealthPanel_initialise = ISHealthPanel.initialise
|
|
||||||
function ISHealthPanel:initialise()
|
|
||||||
if self.character:isFemale() then
|
|
||||||
self.sexPl = "Female"
|
|
||||||
else
|
|
||||||
self.sexPl = "Male"
|
|
||||||
end
|
|
||||||
|
|
||||||
local username = self.character:getUsername()
|
|
||||||
if username ~= "Bob" then
|
|
||||||
--CachedDataHandler.CalculateHighestAmputatedLimbs(username)
|
|
||||||
self.highestAmputations = CachedDataHandler.GetHighestAmputatedLimbs(username)
|
|
||||||
end
|
|
||||||
|
|
||||||
og_ISHealthPanel_initialise(self)
|
|
||||||
end
|
|
||||||
|
|
||||||
local og_ISHealthPanel_setOtherPlayer = ISHealthPanel.setOtherPlayer
|
|
||||||
---@param playerObj IsoPlayer
|
|
||||||
function ISHealthPanel:setOtherPlayer(playerObj)
|
|
||||||
og_ISHealthPanel_setOtherPlayer(self, playerObj)
|
|
||||||
--CachedDataHandler.CalculateAmputatedLimbs(self.character:getUsername())
|
|
||||||
end
|
|
||||||
|
|
||||||
---Get a value between 1 and 0.1 for the cicatrization time
|
---Get a value between 1 and 0.1 for the cicatrization time
|
||||||
---@param cicTime integer
|
---@param cicTime integer
|
||||||
---@return integer
|
---@return integer
|
||||||
@@ -112,13 +87,7 @@ end
|
|||||||
local cicTime = DataController.GetInstance(username):getCicatrizationTime(limbName)
|
local cicTime = DataController.GetInstance(username):getCicatrizationTime(limbName)
|
||||||
redColor = GetColorFromCicatrizationTime(cicTime, limbName)
|
redColor = GetColorFromCicatrizationTime(cicTime, limbName)
|
||||||
|
|
||||||
local sexPl
|
local sexPl = self.character:isFemale() and "Female" or "Male"
|
||||||
if self.character:isFemale() then
|
|
||||||
sexPl = "Female"
|
|
||||||
else
|
|
||||||
sexPl = "Male"
|
|
||||||
end
|
|
||||||
|
|
||||||
texture = StaticData.HEALTH_PANEL_TEXTURES[sexPl][limbName]
|
texture = StaticData.HEALTH_PANEL_TEXTURES[sexPl][limbName]
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -129,22 +98,14 @@ end
|
|||||||
function ISHealthPanel:render()
|
function ISHealthPanel:render()
|
||||||
og_ISHealthPanel_render(self)
|
og_ISHealthPanel_render(self)
|
||||||
local username = self.character:getUsername()
|
local username = self.character:getUsername()
|
||||||
|
|
||||||
--CachedDataHandler.CalculateHighestAmputatedLimbs(username)
|
|
||||||
local highestAmputations = CachedDataHandler.GetHighestAmputatedLimbs(username)
|
local highestAmputations = CachedDataHandler.GetHighestAmputatedLimbs(username)
|
||||||
|
|
||||||
-- TODO Client should send update to other client somehow
|
|
||||||
|
|
||||||
if highestAmputations ~= nil then
|
if highestAmputations ~= nil then
|
||||||
-- Left Texture
|
-- Left Texture
|
||||||
self:tryDrawHighestAmputation(highestAmputations, "L", username)
|
self:tryDrawHighestAmputation(highestAmputations, "L", username)
|
||||||
|
|
||||||
-- Right Texture
|
-- Right Texture
|
||||||
self:tryDrawHighestAmputation(highestAmputations, "R", username)
|
self:tryDrawHighestAmputation(highestAmputations, "R", username)
|
||||||
-- else
|
|
||||||
-- -- Request caching data
|
|
||||||
-- TOC_DEBUG.print("highest amputated limbs was nil, calculating and getting it now for " .. username)
|
|
||||||
-- CachedDataHandler.CalculateHighestAmputatedLimbs(username)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -267,5 +228,3 @@ end
|
|||||||
return og_ISHealthPanel_getDamagedParts(self)
|
return og_ISHealthPanel_getDamagedParts(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--end
|
|
||||||
Reference in New Issue
Block a user