refactor: cleaning

This commit is contained in:
ZioPao
2025-09-29 01:04:08 +02:00
parent a511ac777a
commit 89a28e846a
5 changed files with 25 additions and 35 deletions

View File

@@ -17,7 +17,6 @@ ItemsController.Player = {}
---@return number
---@private
function ItemsController.Player.GetAmputationTexturesIndex(playerObj, isCicatrized)
-- FIX Broken
local textureString = playerObj:getHumanVisual():getSkinTexture()
local isHairy = textureString:sub(-1) == "a"

View File

@@ -143,26 +143,6 @@ function ISHealthPanel:render()
end
-- local og_ISHealthPanel_update = ISHealthPanel.update
-- function ISHealthPanel:update()
-- og_ISHealthPanel_update(self)
-- -- TODO Listen for changes on other player side instead of looping this
-- -- FIX Re-enable it, just for test
-- if self.character then
-- local locPlUsername = getPlayer():getUsername()
-- local remPlUsername = self.character:getUsername()
-- if locPlUsername ~= remPlUsername and self:isReallyVisible() then
-- -- Request update for TOC DATA
-- local key = CommandsData.GetKey(remPlUsername)
-- --ModData.request(key)
-- end
-- end
-- end
-- We need to override this to force the alpha to 1
local og_ISCharacterInfoWindow_render = ISCharacterInfoWindow.prerender
function ISCharacterInfoWindow:prerender()

View File

@@ -33,15 +33,17 @@ function BaseHandler:checkItems()
local containers = ISInventoryPaneContextMenu.getContainers(self:getDoctor())
local done = {}
local childContainers = {}
for i=1,containers:size() do
local container = containers:get(i-1)
done[container] = true
table.wipe(childContainers)
self:checkContainerItems(container, childContainers)
for _,container2 in ipairs(childContainers) do
if not done[container2] then
done[container2] = true
self:checkContainerItems(container2, nil)
if containers ~= nil then
for i=1, containers:size() do
local container = containers:get(i-1)
done[container] = true
table.wipe(childContainers)
self:checkContainerItems(container, childContainers)
for _,container2 in ipairs(childContainers) do
if not done[container2] then
done[container2] = true
self:checkContainerItems(container2, nil)
end
end
end
end
@@ -101,7 +103,7 @@ function BaseHandler:getItemOfTag(items, type)
end
function BaseHandler:getAllItemsOfType(items, type)
local items = {}
items = {}
for _,item in ipairs(items) do
if item:getFullType() == type then
table.insert(items, item)

View File

@@ -13,10 +13,12 @@ end
---Print debug
---@param string string
function TOC_DEBUG.print(string)
--if isDebugEnabled() then
local runningFile = TOC_DEBUG.getRunningFile()
print("[TOC]" .. "[" .. runningFile .. "] " .. tostring(string))
--end
if isDebugEnabled() then
local runningFile = TOC_DEBUG.getRunningFile()
print("[TOC]" .. "[" .. runningFile .. "] " .. tostring(string))
else
print(string)
end
end
---Horrendous but I don't really care about performance for this

7
mod.info Normal file
View File

@@ -0,0 +1,7 @@
name=The Only Cure
poster=poster.png
description=You've been bitten. You have only two choices.
id=TheOnlyCure
icon=icon.png
url=https://github.com/ZioPao/The-Only-Cure
modversion=2.1.7