From 81f9bbf6eaff6d3682d1fa38dfca86df8e6c186f Mon Sep 17 00:00:00 2001 From: ZioPao Date: Wed, 10 Jan 2024 01:38:29 +0100 Subject: [PATCH] Added prost notification in health panel --- media/lua/client/TOC/Controllers/DataController.lua | 7 ++++--- .../TOC/Controllers/LimitActionsController.lua | 5 ++--- media/lua/client/TOC/UI/HealthPanel.lua | 13 +++++++++++-- media/lua/shared/Translate/EN/IG_UI_EN.txt | 1 + 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/media/lua/client/TOC/Controllers/DataController.lua b/media/lua/client/TOC/Controllers/DataController.lua index 9a5a8a8..01927f0 100644 --- a/media/lua/client/TOC/Controllers/DataController.lua +++ b/media/lua/client/TOC/Controllers/DataController.lua @@ -251,10 +251,11 @@ function DataController:getCicatrizationTime(limbName) end ---Get isProstEquipped ----@param group string +---@param limbName string ---@return boolean -function DataController:getIsProstEquipped(group) - return self.tocData.prostheses[group].isProstEquipped +function DataController:getIsProstEquipped(limbName) + local prostGroup = StaticData.LIMBS_TO_PROST_GROUP_MATCH_IND_STR[limbName] + return self.tocData.prostheses[prostGroup].isProstEquipped end ---Get prostFactor diff --git a/media/lua/client/TOC/Controllers/LimitActionsController.lua b/media/lua/client/TOC/Controllers/LimitActionsController.lua index 6ee7c30..6ceb816 100644 --- a/media/lua/client/TOC/Controllers/LimitActionsController.lua +++ b/media/lua/client/TOC/Controllers/LimitActionsController.lua @@ -16,7 +16,7 @@ local StaticData = require("TOC/StaticData") local function CheckHandFeasibility(limbName) local dcInst = DataController.GetInstance() - return not dcInst:getIsCut(limbName) or dcInst:getIsProstEquipped(StaticData.LIMBS_TO_PROST_GROUP_MATCH_IND_STR[limbName]) + return not dcInst:getIsCut(limbName) or dcInst:getIsProstEquipped(limbName) end @@ -71,8 +71,7 @@ function ISBaseTimedAction:perform() if dcInst:getIsCut(limbName) and dcInst:getIsVisible(limbName) then local side = CommonMethods.GetSide(limbName) LocalPlayerController.playerObj:getXp():AddXP(Perks["Side_" .. side], 1) -- TODO Make it dynamic - local prostGroup = StaticData.LIMBS_TO_PROST_GROUP_MATCH_IND_STR[limbName] - if not dcInst:getIsCicatrized(limbName) and dcInst:getIsProstEquipped(prostGroup) then + if not dcInst:getIsCicatrized(limbName) and dcInst:getIsProstEquipped(limbName) then TOC_DEBUG.print("Trying for bleed, player met the criteria") LocalPlayerController.TryRandomBleed(self.character, limbName) end diff --git a/media/lua/client/TOC/UI/HealthPanel.lua b/media/lua/client/TOC/UI/HealthPanel.lua index 49d4951..699f2fd 100644 --- a/media/lua/client/TOC/UI/HealthPanel.lua +++ b/media/lua/client/TOC/UI/HealthPanel.lua @@ -183,8 +183,10 @@ function ISHealthBodyPartListBox:doDrawItem(y, item, alt) if dcInst:getIsCauterized(limbName) then self:drawText("- " .. getText("IGUI_HealthPanel_Cauterized"), x, y, 0.58, 0.75, 0.28, 1, UIFont.Small) else - self:drawText("- " .. getText("IGUI_HealthPanel_Cicatrized"), x, y, 0.28, 0.89, 0.28, 1, UIFont.Small) + self:drawText("- " .. getText("IGUI_HealthPanel_Cicatrized"), x, y, 0.28, 0.89, 0.28, 1, UIFont.Small) end + + y = y + fontHgt else local cicaTime = dcInst:getCicatrizationTime(limbName) @@ -196,8 +198,15 @@ function ISHealthBodyPartListBox:doDrawItem(y, item, alt) local scaledDirtyness = math.floor(dcInst:getWoundDirtyness(limbName) * 100) self:drawText("- " .. getText("IGUI_HealthPanel_WoundDirtyness") .. string.format(" %d", scaledDirtyness) .. "%", x, y, 0.89, 0.28, 0.28, 1, UIFont.Small) + y = y + fontHgt + end - y = y + fontHgt + + if dcInst:getIsProstEquipped(limbName) then + self:drawText("- " .. getText("IGUI_HealthPanel_ProstEquipped"), x, y, 0.28, 0.89, 0.28, 1, UIFont.Small) + y = y + fontHgt + end + end diff --git a/media/lua/shared/Translate/EN/IG_UI_EN.txt b/media/lua/shared/Translate/EN/IG_UI_EN.txt index 08a7520..a634380 100644 --- a/media/lua/shared/Translate/EN/IG_UI_EN.txt +++ b/media/lua/shared/Translate/EN/IG_UI_EN.txt @@ -13,5 +13,6 @@ IG_UI_EN = { IGUI_HealthPanel_Cicatrized = "Cicatrized", IGUI_HealthPanel_Cauterized = "Cauterized", IGUI_HealthPanel_WoundDirtyness = "Wound Dirtyness", + IGUI_HealthPanel_ProstEquipped = "Prosthesis Equipped", } \ No newline at end of file