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
-- 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 utils = require("Cyka.utils")
@@ -153,7 +154,8 @@ local function tryStackCursorItem()
-- -- MyModGlobal.debugPrint(string.format("Enqueued %d items from the inventory slot", #itemsToMove))
-- 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
-- MyModGlobal.debugPrint(string.format("Error moving item: %s", error))
-- end

View File

@@ -1,3 +1,4 @@
-- luacheck: globals Character Game MyModGlobal
local utils = require("Cyka.utils")
---@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
local function getRepairableObjectInFocus()
-- Make sure we have a controlled character
@@ -52,12 +53,13 @@ local function clickRepairButton()
end
local function tryRepair()
local success = clickRepairButton()
if success then
-- MyModGlobal.debugPrint("Successfully clicked repair button")
else
-- MyModGlobal.debugPrint("Failed to click repair button")
end
clickRepairButton()
-- local success = clickRepairButton()
-- if success then
-- -- MyModGlobal.debugPrint("Successfully clicked repair button")
-- else
-- -- MyModGlobal.debugPrint("Failed to click repair button")
-- end
end
return {

View File

@@ -1,3 +1,4 @@
-- luacheck: globals Game MyModGlobal
---@return Barotrauma.Location.StoreInfo[], string?
local function getCurrentStore()
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")
---@class ItemLocation

View File

@@ -1,3 +1,4 @@
-- luacheck: globals Character Timer Hook
local amountExperience = 6000
local passiveExperienceDelay = 20
local passiveExperienceTimer = 0
@@ -5,7 +6,7 @@ local passiveExperienceTimer = 0
Hook.Add("think", "examples.passiveExperience", function()
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
v.Info.GiveExperience(amountExperience)
end