Figured out placing textures + male textures

This commit is contained in:
ZioPao
2023-11-17 13:17:19 +01:00
parent ebd128c710
commit 38141bc5db
14 changed files with 38 additions and 9 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -0,0 +1,5 @@
Sandbox_EN = {
Sandbox_TOC = "The Only Cure",
Sandbox_TOC_CicatrizationSpeed = "Cicatrization Speed",
}

11
media/sandbox-options.txt Normal file
View File

@@ -0,0 +1,11 @@
VERSION = 1,
option TOC.CicatrizationSpeed
{
type = integer,
min = 1,
max = 10,
default = 1,
page = TOC,
translation = TOC_CicatrizationSpeed,
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 947 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 946 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
media/ui/test_pattern.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B