chore: cleaning and setting up stuff

This commit is contained in:
ZioPao
2025-04-17 18:23:18 +02:00
parent 8c8aa8351b
commit 4e00d8b0c9
5 changed files with 22 additions and 3 deletions

View File

@@ -19,5 +19,9 @@
".vscode", ".vscode",
"dev_stuff", "dev_stuff",
"workshop_files" "workshop_files"
],
"Lua.diagnostics.globals": [
"FHSwapHandsAction",
"timer"
] ]
} }

2
.vscode/tasks.json vendored
View File

@@ -25,7 +25,7 @@
"label": "Bump Mod Version", "label": "Bump Mod Version",
"type": "shell", "type": "shell",
"options": {"statusbar": {"label": "$(arrow-up) Bump Mod Version"}}, "options": {"statusbar": {"label": "$(arrow-up) Bump Mod Version"}},
"command": "python ${config:zomboid_user_folder}/PaosCrap/bump_version.py 42/media/lua/client/TOC/Main.lua", "command": "python ${config:zomboid_user_folder}/PaosCrap/bump_version.py common/media/lua/client/TOC/Main.lua",
}, },
{ {
"label": "Run Zomboid Debug No Steam (42)", "label": "Run Zomboid Debug No Steam (42)",

View File

@@ -94,16 +94,19 @@ end
local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform
---@diagnostic disable-next-line: duplicate-set-field
function ISClothingExtraAction:perform() function ISClothingExtraAction:perform()
TourniquetController.WrapClothingAction(self, og_ISClothingExtraAction_perform) TourniquetController.WrapClothingAction(self, og_ISClothingExtraAction_perform)
end end
local og_ISWearClothing_isValid = ISWearClothing.isValid local og_ISWearClothing_isValid = ISWearClothing.isValid
---@diagnostic disable-next-line: duplicate-set-field
function ISWearClothing:isValid() function ISWearClothing:isValid()
return TourniquetController.WrapClothingAction(self, og_ISWearClothing_isValid) return TourniquetController.WrapClothingAction(self, og_ISWearClothing_isValid)
end end
local og_ISUnequipAction_perform = ISUnequipAction.perform local og_ISUnequipAction_perform = ISUnequipAction.perform
---@diagnostic disable-next-line: duplicate-set-field
function ISUnequipAction:perform() function ISUnequipAction:perform()
return TourniquetController.WrapClothingAction(self, og_ISUnequipAction_perform) return TourniquetController.WrapClothingAction(self, og_ISUnequipAction_perform)
end end

View File

@@ -110,14 +110,15 @@ end
--* Overrides *-- --* Overrides *--
---@diagnostic disable-next-line: duplicate-set-field
local og_ISWearClothing_isValid = ISWearClothing.isValid local og_ISWearClothing_isValid = ISWearClothing.isValid
---@diagnostic disable-next-line: duplicate-set-field
function ISWearClothing:isValid() function ISWearClothing:isValid()
local isEquippable = og_ISWearClothing_isValid(self) local isEquippable = og_ISWearClothing_isValid(self)
return ProsthesisHandler.Validate(self.item, isEquippable) return ProsthesisHandler.Validate(self.item, isEquippable)
end end
local og_ISWearClothing_perform = ISWearClothing.perform local og_ISWearClothing_perform = ISWearClothing.perform
---@diagnostic disable-next-line: duplicate-set-field
function ISWearClothing:perform() function ISWearClothing:perform()
ProsthesisHandler.SearchAndSetupProsthesis(self.item, true) ProsthesisHandler.SearchAndSetupProsthesis(self.item, true)
og_ISWearClothing_perform(self) og_ISWearClothing_perform(self)
@@ -134,18 +135,26 @@ local og_ISClothingExtraAction_isValid = OverridenMethodsArchive.Save("ISClothin
function ISClothingExtraAction:isValid() function ISClothingExtraAction:isValid()
local isEquippable = og_ISClothingExtraAction_isValid(self) local isEquippable = og_ISClothingExtraAction_isValid(self)
-- self.extra is a string, not the item -- self.extra is a string, not the item
-- B42 Compatibility to add
local testItem = InventoryItemFactory.CreateItem(self.extra) local testItem = InventoryItemFactory.CreateItem(self.extra)
return ProsthesisHandler.Validate(testItem, isEquippable) return ProsthesisHandler.Validate(testItem, isEquippable)
end end
local og_ISClothingExtraAction_perform = OverridenMethodsArchive.Save("ISClothingExtraAction_perform", ISClothingExtraAction.perform) local og_ISClothingExtraAction_perform = OverridenMethodsArchive.Save("ISClothingExtraAction_perform", ISClothingExtraAction.perform)
---@diagnostic disable-next-line: duplicate-set-field
function ISClothingExtraAction:perform() function ISClothingExtraAction:perform()
-- B42 Compatibility to add
local extraItem = InventoryItemFactory.CreateItem(self.extra) local extraItem = InventoryItemFactory.CreateItem(self.extra)
ProsthesisHandler.SearchAndSetupProsthesis(extraItem, true) ProsthesisHandler.SearchAndSetupProsthesis(extraItem, true)
og_ISClothingExtraAction_perform(self) og_ISClothingExtraAction_perform(self)
end end
local og_ISUnequipAction_perform = ISUnequipAction.perform local og_ISUnequipAction_perform = ISUnequipAction.perform
---@diagnostic disable-next-line: duplicate-set-field
function ISUnequipAction:perform() function ISUnequipAction:perform()
--[[ --[[

View File

@@ -7,6 +7,9 @@ local CommonMethods = require("TOC/CommonMethods")
---@field otherPlayer IsoPlayer ---@field otherPlayer IsoPlayer
---@field bandage InventoryItem ---@field bandage InventoryItem
---@field bodyPart any ---@field bodyPart any
---@field doctorLevel number
---@field bandagedPlayerX number
---@field bandagedPlayerY number
local CleanWoundAction = ISBaseTimedAction:derive("CleanWoundAction") local CleanWoundAction = ISBaseTimedAction:derive("CleanWoundAction")
---@param doctor IsoPlayer ---@param doctor IsoPlayer
@@ -33,7 +36,7 @@ function CleanWoundAction:new(doctor, otherPlayer, bandage, bodyPart)
if doctor:isTimedActionInstant() then if doctor:isTimedActionInstant() then
o.maxTime = 1 o.maxTime = 1
end end
if doctor:getAccessLevel() ~= "None" then -- TODO Fix for B42 if doctor:getAccessLevel() ~= "None" then -- B42 Deprecated
o.doctorLevel = 10 o.doctorLevel = 10
end end
return o return o