Clean up the project a little

This commit is contained in:
2025-03-30 18:28:07 +02:00
parent e463b84bf6
commit 788a0bfe4d
7 changed files with 17 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
-- luacheck: globals MyModGlobal Character SERVER Keys LuaUserData Hook Descriptors
if SERVER then return end if SERVER then return end
-- Docs: https://evilfactory.github.io/LuaCsForBarotrauma/lua-docs/manual/common-questions/ -- Docs: https://evilfactory.github.io/LuaCsForBarotrauma/lua-docs/manual/common-questions/

View File

@@ -1,3 +1,4 @@
-- luacheck: globals Character MyModGlobal
local quickstack = require("Cyka.quickstack") local quickstack = require("Cyka.quickstack")
local utils = require("Cyka.utils") local utils = require("Cyka.utils")
@@ -153,7 +154,8 @@ local function tryStackCursorItem()
-- -- MyModGlobal.debugPrint(string.format("Enqueued %d items from the inventory slot", #itemsToMove)) -- -- MyModGlobal.debugPrint(string.format("Enqueued %d items from the inventory slot", #itemsToMove))
-- MyModGlobal.DumpTable(itemTree) -- MyModGlobal.DumpTable(itemTree)
local errors = quickstack.tryMoveItems(itemsToMove, itemTree, true) quickstack.tryMoveItems(itemsToMove, itemTree, true)
-- local errors = quickstack.tryMoveItems(itemsToMove, itemTree, true)
-- for _, error in ipairs(errors) do -- for _, error in ipairs(errors) do
-- MyModGlobal.debugPrint(string.format("Error moving item: %s", error)) -- MyModGlobal.debugPrint(string.format("Error moving item: %s", error))
-- end -- end

View File

@@ -1,3 +1,4 @@
-- luacheck: globals Character Game MyModGlobal
local utils = require("Cyka.utils") local utils = require("Cyka.utils")
---@return {item: Barotrauma.Item, fabricator: Barotrauma.FabricatorComponent}, string? ---@return {item: Barotrauma.Item, fabricator: Barotrauma.FabricatorComponent}, string?

View File

@@ -1,3 +1,4 @@
-- luacheck: globals Character
---@return Barotrauma.Item|nil, Barotrauma.Items.Components.Repairable|nil ---@return Barotrauma.Item|nil, Barotrauma.Items.Components.Repairable|nil
local function getRepairableObjectInFocus() local function getRepairableObjectInFocus()
-- Make sure we have a controlled character -- Make sure we have a controlled character
@@ -52,12 +53,13 @@ local function clickRepairButton()
end end
local function tryRepair() local function tryRepair()
local success = clickRepairButton() clickRepairButton()
if success then -- local success = clickRepairButton()
-- MyModGlobal.debugPrint("Successfully clicked repair button") -- if success then
else -- -- MyModGlobal.debugPrint("Successfully clicked repair button")
-- MyModGlobal.debugPrint("Failed to click repair button") -- else
end -- -- MyModGlobal.debugPrint("Failed to click repair button")
-- end
end end
return { return {

View File

@@ -1,3 +1,4 @@
-- luacheck: globals Game MyModGlobal
---@return Barotrauma.Location.StoreInfo[], string? ---@return Barotrauma.Location.StoreInfo[], string?
local function getCurrentStore() local function getCurrentStore()
if not Game or not Game.GameSession or not Game.GameSession.Campaign then if not Game or not Game.GameSession or not Game.GameSession.Campaign then

View File

@@ -1,3 +1,4 @@
-- luacheck: globals MyModGlobal Character
local utils = require("Cyka.utils") local utils = require("Cyka.utils")
---@class ItemLocation ---@class ItemLocation

View File

@@ -1,3 +1,4 @@
-- luacheck: globals Character Timer Hook
local amountExperience = 6000 local amountExperience = 6000
local passiveExperienceDelay = 20 local passiveExperienceDelay = 20
local passiveExperienceTimer = 0 local passiveExperienceTimer = 0
@@ -5,7 +6,7 @@ local passiveExperienceTimer = 0
Hook.Add("think", "examples.passiveExperience", function() Hook.Add("think", "examples.passiveExperience", function()
if Timer.GetTime() < passiveExperienceTimer then return end if Timer.GetTime() < passiveExperienceTimer then return end
for k, v in pairs(Character.CharacterList) do for _, v in pairs(Character.CharacterList) do
if not v.IsDead and v.Info ~= nil then if not v.IsDead and v.Info ~= nil then
v.Info.GiveExperience(amountExperience) v.Info.GiveExperience(amountExperience)
end end