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
|
||||
if character ~= getPlayer() then return end
|
||||
|
||||
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
|
||||
local limbName = StaticData.LIMBS_STRINGS[i]
|
||||
local bptEnum = StaticData.BODYPARTSTYPES_ENUM[limbName]
|
||||
|
||||
@@ -60,6 +60,8 @@ end
|
||||
--- Textures
|
||||
-- TODO We need male variations
|
||||
StaticData.HEALTH_PANEL_TEXTURES = {
|
||||
|
||||
Female = {
|
||||
Hand_L = getTexture("media/ui/Hand_L.png"),
|
||||
ForeArm_L = getTexture("media/ui/ForeArm_L.png"),
|
||||
UpperArm_L = getTexture("media/ui/UpperArm_L.png"),
|
||||
@@ -69,6 +71,8 @@ StaticData.HEALTH_PANEL_TEXTURES = {
|
||||
UpperArm_R = getTexture("media/ui/UpperArm_R.png")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
-----------------
|
||||
-- Visuals and clothing
|
||||
|
||||
@@ -51,6 +51,16 @@ function ISHealthPanel.GetHighestAmputation()
|
||||
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
|
||||
function ISHealthPanel:render()
|
||||
og_ISHealthPanel_render(self)
|
||||
@@ -60,13 +70,13 @@ function ISHealthPanel:render()
|
||||
if ISHealthPanel.highestAmputations then
|
||||
-- Left Texture
|
||||
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)
|
||||
end
|
||||
|
||||
-- Right Texture
|
||||
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)
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user