Bug fixes and better handling of ISHealthPanel
This commit is contained in:
@@ -50,9 +50,8 @@ function PlayerHandler.CheckInfection(character)
|
|||||||
|
|
||||||
-- This fucking event barely works. Bleeding seems to be the only thing that triggers it
|
-- This fucking event barely works. Bleeding seems to be the only thing that triggers it
|
||||||
if character ~= getPlayer() then return end
|
if character ~= getPlayer() then return end
|
||||||
|
|
||||||
local bd = character:getBodyDamage()
|
local bd = character:getBodyDamage()
|
||||||
|
if bd == nil then return end -- Not sure why sometimes we get no BodyDamage, so just return this for now
|
||||||
for i=1, #StaticData.LIMBS_STRINGS do
|
for i=1, #StaticData.LIMBS_STRINGS do
|
||||||
local limbName = StaticData.LIMBS_STRINGS[i]
|
local limbName = StaticData.LIMBS_STRINGS[i]
|
||||||
local bptEnum = StaticData.BODYPARTSTYPES_ENUM[limbName]
|
local bptEnum = StaticData.BODYPARTSTYPES_ENUM[limbName]
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ end
|
|||||||
--- Textures
|
--- Textures
|
||||||
-- TODO We need male variations
|
-- TODO We need male variations
|
||||||
StaticData.HEALTH_PANEL_TEXTURES = {
|
StaticData.HEALTH_PANEL_TEXTURES = {
|
||||||
|
|
||||||
|
Female = {
|
||||||
Hand_L = getTexture("media/ui/Hand_L.png"),
|
Hand_L = getTexture("media/ui/Hand_L.png"),
|
||||||
ForeArm_L = getTexture("media/ui/ForeArm_L.png"),
|
ForeArm_L = getTexture("media/ui/ForeArm_L.png"),
|
||||||
UpperArm_L = getTexture("media/ui/UpperArm_L.png"),
|
UpperArm_L = getTexture("media/ui/UpperArm_L.png"),
|
||||||
@@ -67,6 +69,8 @@ StaticData.HEALTH_PANEL_TEXTURES = {
|
|||||||
Hand_R = getTexture("media/ui/Hand_R.png"),
|
Hand_R = getTexture("media/ui/Hand_R.png"),
|
||||||
ForeArm_R = getTexture("media/ui/ForeArm_R.png"),
|
ForeArm_R = getTexture("media/ui/ForeArm_R.png"),
|
||||||
UpperArm_R = getTexture("media/ui/UpperArm_R.png")
|
UpperArm_R = getTexture("media/ui/UpperArm_R.png")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,16 @@ function ISHealthPanel.GetHighestAmputation()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local og_ISHealthPanel_initialise = ISHealthPanel.initialise
|
||||||
|
function ISHealthPanel:initialise()
|
||||||
|
if self.character:isFemale() then
|
||||||
|
self.sexPl = "Female"
|
||||||
|
else
|
||||||
|
self.sexPl = "Male"
|
||||||
|
end
|
||||||
|
og_ISHealthPanel_initialise(self)
|
||||||
|
end
|
||||||
|
|
||||||
local og_ISHealthPanel_render = ISHealthPanel.render
|
local og_ISHealthPanel_render = ISHealthPanel.render
|
||||||
function ISHealthPanel:render()
|
function ISHealthPanel:render()
|
||||||
og_ISHealthPanel_render(self)
|
og_ISHealthPanel_render(self)
|
||||||
@@ -60,13 +70,13 @@ function ISHealthPanel:render()
|
|||||||
if ISHealthPanel.highestAmputations then
|
if ISHealthPanel.highestAmputations then
|
||||||
-- Left Texture
|
-- Left Texture
|
||||||
if ISHealthPanel.highestAmputations["L"] then
|
if ISHealthPanel.highestAmputations["L"] then
|
||||||
local textureL = StaticData.HEALTH_PANEL_TEXTURES[ISHealthPanel.highestAmputations["L"]]
|
local textureL = StaticData.HEALTH_PANEL_TEXTURES[self.sexPl][ISHealthPanel.highestAmputations["L"]]
|
||||||
self:drawTexture(textureL, self.healthPanel.x/2 - 2, self.healthPanel.y/2, 1, 1, 0, 0)
|
self:drawTexture(textureL, self.healthPanel.x/2 - 2, self.healthPanel.y/2, 1, 1, 0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Right Texture
|
-- Right Texture
|
||||||
if ISHealthPanel.highestAmputations["R"] then
|
if ISHealthPanel.highestAmputations["R"] then
|
||||||
local textureR = StaticData.HEALTH_PANEL_TEXTURES[ISHealthPanel.highestAmputations["R"]]
|
local textureR = StaticData.HEALTH_PANEL_TEXTURES[self.sexPl][ISHealthPanel.highestAmputations["R"]]
|
||||||
self:drawTexture(textureR, self.healthPanel.x/2 + 2, self.healthPanel.y/2, 1, 1, 0, 0)
|
self:drawTexture(textureR, self.healthPanel.x/2 + 2, self.healthPanel.y/2, 1, 1, 0, 0)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user