diff --git a/media/lua/client/TOC/Controllers/ItemsController.lua b/media/lua/client/TOC/Controllers/ItemsController.lua index bf80a0a..ea06424 100644 --- a/media/lua/client/TOC/Controllers/ItemsController.lua +++ b/media/lua/client/TOC/Controllers/ItemsController.lua @@ -62,7 +62,6 @@ function ItemsController.Player.DeleteOldAmputationItem(playerObj, limbName) local othLimbName = partName .. "_" .. side local othClothingItemName = StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. othLimbName - -- TODO FindAndReturn could return an ArrayList. We need to check for that local othClothingItem = playerObj:getInventory():FindAndReturn(othClothingItemName) diff --git a/media/lua/client/TOC/UI/HealthPanel.lua b/media/lua/client/TOC/UI/HealthPanel.lua index 699f2fd..1c79456 100644 --- a/media/lua/client/TOC/UI/HealthPanel.lua +++ b/media/lua/client/TOC/UI/HealthPanel.lua @@ -80,7 +80,7 @@ end ---Try to draw the highest amputation in the health panel, based on the cicatrization time ---@param side string L or R ---@param username string -function ISHealthPanel:tryDrawHighestAmputation(highestAmputations, side, username) +function ISHealthPanel:tryDrawAmputation(highestAmputations, side, username) local redColor local texture @@ -101,6 +101,13 @@ function ISHealthPanel:tryDrawHighestAmputation(highestAmputations, side, userna self:drawTexture(texture, self.healthPanel.x, self.healthPanel.y, 1, redColor, 0, 0) end +function ISHealthPanel:tryDrawProsthesis(highestAmputations, side, username) + local dc = DataController.GetInstance(username) -- TODO CACHE PROSTHESIS!!! Don't use DC here + local limbName = highestAmputations[side] + if limbName and dc:getIsProstEquipped(limbName) then + self:drawTexture(StaticData.HEALTH_PANEL_TEXTURES.ProstArm[side], self.healthPanel.x, self.healthPanel.y, 1, 1, 1, 1) + end +end local og_ISHealthPanel_render = ISHealthPanel.render function ISHealthPanel:render() @@ -109,12 +116,21 @@ function ISHealthPanel:render() local highestAmputations = CachedDataHandler.GetHighestAmputatedLimbs(username) if highestAmputations ~= nil then + -- Left Texture - self:tryDrawHighestAmputation(highestAmputations, "L", username) + self:tryDrawAmputation(highestAmputations, "L", username) + self:tryDrawProsthesis(highestAmputations, "L", username) -- Right Texture - self:tryDrawHighestAmputation(highestAmputations, "R", username) + self:tryDrawAmputation(highestAmputations, "R", username) + self:tryDrawProsthesis(highestAmputations, "R", username) end + + + + + + end -- We need to override this to force the alpha to 1 diff --git a/media/lua/client/TOC/Zombies/ZombiesAmputation.lua b/media/lua/client/TOC/Zombies/ZombiesAmputation.lua index 9040709..97f6c75 100644 --- a/media/lua/client/TOC/Zombies/ZombiesAmputation.lua +++ b/media/lua/client/TOC/Zombies/ZombiesAmputation.lua @@ -104,7 +104,6 @@ Events.OnInitGlobalModData.Add(SetupZombiesModData) local function ReapplyAmputation(zombie) local pID = GetZombieID(zombie) - -- TODO Remove already checked zombies if localOnlyZombiesMD[pID] ~= nil then -- check if zombie has amputation local zombiesAmpData = localOnlyZombiesMD[pID] diff --git a/media/lua/shared/TOC/StaticData.lua b/media/lua/shared/TOC/StaticData.lua index 224225e..629050c 100644 --- a/media/lua/shared/TOC/StaticData.lua +++ b/media/lua/shared/TOC/StaticData.lua @@ -202,6 +202,11 @@ StaticData.HEALTH_PANEL_TEXTURES = { Hand_R = getTexture("media/ui/Male/Hand_R.png"), ForeArm_R = getTexture("media/ui/Male/ForeArm_R.png"), UpperArm_R = getTexture("media/ui/Male/UpperArm_R.png") + }, + + ProstArm = { + L = getTexture("media/ui/ProstArm_L.png"), + R = getTexture("media/ui/ProstArm_R.png") } } diff --git a/media/ui/ProstArm_L.png b/media/ui/ProstArm_L.png new file mode 100644 index 0000000..d3e8faa Binary files /dev/null and b/media/ui/ProstArm_L.png differ diff --git a/media/ui/ProstArm_R.png b/media/ui/ProstArm_R.png new file mode 100644 index 0000000..cf176a5 Binary files /dev/null and b/media/ui/ProstArm_R.png differ