diff --git a/dev_stuff/black_white_from_blood.blw b/dev_stuff/black_white_from_blood.blw new file mode 100644 index 0000000..aa667a6 Binary files /dev/null and b/dev_stuff/black_white_from_blood.blw differ diff --git a/dev_stuff/healthpanelPatternTest.psd b/dev_stuff/healthpanelPatternTest.psd new file mode 100644 index 0000000..6847c36 Binary files /dev/null and b/dev_stuff/healthpanelPatternTest.psd differ diff --git a/media/lua/client/TOC/Handlers/PlayerHandler.lua b/media/lua/client/TOC/Handlers/PlayerHandler.lua index f78214f..b9508dc 100644 --- a/media/lua/client/TOC/Handlers/PlayerHandler.lua +++ b/media/lua/client/TOC/Handlers/PlayerHandler.lua @@ -221,7 +221,7 @@ function PlayerHandler.UpdateCicatrization() TOC_DEBUG.print("updating cicatrization for " .. tostring(limbName)) if cicTime > 0 then - cicTime = cicTime - 1 + cicTime = cicTime - (SandboxVars.TOC.CicatrizationSpeed) modDataHandler:setCicatrizationTime(limbName, cicTime) TOC_DEBUG.print("new cicatrization time: " .. tostring(cicTime)) if cicTime < 0 then diff --git a/media/lua/client/TOC/UI/HealthPanel.lua b/media/lua/client/TOC/UI/HealthPanel.lua index 1a11cfe..644d275 100644 --- a/media/lua/client/TOC/UI/HealthPanel.lua +++ b/media/lua/client/TOC/UI/HealthPanel.lua @@ -73,7 +73,7 @@ end ---Get a value between 1 and 0.1 for the cicatrization time ---@param cicTime integer ---@return integer -local function GetScaledCicatrizationTime(cicTime) +local function GetColorFromCicatrizationTime(cicTime) return math.max(math.min(cicTime/100, 1), 0.1) end @@ -81,12 +81,21 @@ end ---@param side string L or R ---@param username string function ISHealthPanel:tryDrawHighestAmputation(side, username) - if self.highestAmputations[side] == nil then return end + local redColor + local texture - local cicTime = ModDataHandler.GetInstance(username):getCicatrizationTime(self.highestAmputations[side]) - local scaledCicTIme = GetScaledCicatrizationTime(cicTime) - local texture = StaticData.HEALTH_PANEL_TEXTURES[self.sexPl][self.highestAmputations[side]] - self:drawTexture(texture, self.healthPanel.x/2 - 2, self.healthPanel.y/2, 1, scaledCicTIme, 1, 1) + if TOC_DEBUG.enableHealthPanelDebug then + redColor = 1 + texture = getTexture("media/ui/test_pattern.png") + else + if self.highestAmputations[side] == nil then return end + + local cicTime = ModDataHandler.GetInstance(username):getCicatrizationTime(self.highestAmputations[side]) + redColor = GetColorFromCicatrizationTime(cicTime) + texture = StaticData.HEALTH_PANEL_TEXTURES[self.sexPl][self.highestAmputations[side]] + end + + self:drawTexture(texture, self.healthPanel.x, self.healthPanel.y, 1, redColor, 0, 0) end local og_ISHealthPanel_render = ISHealthPanel.render diff --git a/media/lua/shared/TOC/Debug.lua b/media/lua/shared/TOC/Debug.lua index 648d68f..7d321e1 100644 --- a/media/lua/shared/TOC/Debug.lua +++ b/media/lua/shared/TOC/Debug.lua @@ -1,11 +1,15 @@ TOC_DEBUG = {} TOC_DEBUG.disablePaneMod = false +TOC_DEBUG.enableHealthPanelDebug = false - -function TOC_DEBUG.togglePaneMod() +function TOC_DEBUG.TogglePaneMod() TOC_DEBUG.disablePaneMod = not TOC_DEBUG.disablePaneMod end +function TOC_DEBUG.ToggleHealthPanelDebug() + TOC_DEBUG.enableHealthPanelDebug = not TOC_DEBUG.enableHealthPanelDebug +end + ---Print debug ---@param string string function TOC_DEBUG.print(string) diff --git a/media/lua/shared/Translate/EN/Sandbox_EN.txt b/media/lua/shared/Translate/EN/Sandbox_EN.txt new file mode 100644 index 0000000..c4f8b7f --- /dev/null +++ b/media/lua/shared/Translate/EN/Sandbox_EN.txt @@ -0,0 +1,5 @@ +Sandbox_EN = { + Sandbox_TOC = "The Only Cure", + Sandbox_TOC_CicatrizationSpeed = "Cicatrization Speed", + +} \ No newline at end of file diff --git a/media/sandbox-options.txt b/media/sandbox-options.txt new file mode 100644 index 0000000..3ce581c --- /dev/null +++ b/media/sandbox-options.txt @@ -0,0 +1,11 @@ +VERSION = 1, +option TOC.CicatrizationSpeed +{ + type = integer, + min = 1, + max = 10, + default = 1, + page = TOC, + translation = TOC_CicatrizationSpeed, + +} \ No newline at end of file diff --git a/media/ui/Male/ForeArm_L.png b/media/ui/Male/ForeArm_L.png index 7bef931..1030bbf 100644 Binary files a/media/ui/Male/ForeArm_L.png and b/media/ui/Male/ForeArm_L.png differ diff --git a/media/ui/Male/ForeArm_R.png b/media/ui/Male/ForeArm_R.png index dc71e57..77d0045 100644 Binary files a/media/ui/Male/ForeArm_R.png and b/media/ui/Male/ForeArm_R.png differ diff --git a/media/ui/Male/Hand_L.png b/media/ui/Male/Hand_L.png index 276cc24..fc3ac08 100644 Binary files a/media/ui/Male/Hand_L.png and b/media/ui/Male/Hand_L.png differ diff --git a/media/ui/Male/Hand_R.png b/media/ui/Male/Hand_R.png index 17b214e..c0c1998 100644 Binary files a/media/ui/Male/Hand_R.png and b/media/ui/Male/Hand_R.png differ diff --git a/media/ui/Male/UpperArm_L.png b/media/ui/Male/UpperArm_L.png index 9a33c84..ebc4b6c 100644 Binary files a/media/ui/Male/UpperArm_L.png and b/media/ui/Male/UpperArm_L.png differ diff --git a/media/ui/Male/UpperArm_R.png b/media/ui/Male/UpperArm_R.png index 3424f10..646605d 100644 Binary files a/media/ui/Male/UpperArm_R.png and b/media/ui/Male/UpperArm_R.png differ diff --git a/media/ui/test_pattern.png b/media/ui/test_pattern.png new file mode 100644 index 0000000..51b85d4 Binary files /dev/null and b/media/ui/test_pattern.png differ