Fix/ pre activation (#28)
Publish Release / build (push) Successful in 39s

fixes: #8Reviewed-on: #28

Co-authored-by: dutchie031 <timrorije@gmail.com>
This commit was merged in pull request #28.
This commit is contained in:
2026-08-18 12:50:12 +00:00
committed by dutchie031
parent c8329108dd
commit 63a1ea44db
15 changed files with 284 additions and 195 deletions
+13 -1
View File
@@ -4,7 +4,8 @@
local briefingMessageTime = nil
---@class GlobalConfig
---@field private _briefingTime number ;
---@field private _briefingTime number
---@field private _debugEnabled boolean
local GlobalConfig = {}
GlobalConfig.__index = GlobalConfig;
@@ -19,6 +20,13 @@ function GlobalConfig.New()
if SpearheadConfig.briefingMessageDuration then
self._briefingTime = SpearheadConfig.briefingMessageDuration
end
if SpearheadConfig.debugEnabled ~= nil then
self._debugEnabled = SpearheadConfig.debugEnabled
else
self._debugEnabled = false
end
end
return self
@@ -28,6 +36,10 @@ function GlobalConfig:getBriefingTime()
return self._briefingTime or 60
end
function GlobalConfig:isDebugEnabled()
return self._debugEnabled or false
end
return GlobalConfig
+18 -6
View File
@@ -9,26 +9,38 @@
--- @field AmountPreactivateStage integer
local StageConfig = {};
local Logger = require("classes.util.Logger")
local _logger = Logger.new("StageConfig", Logger.LogLevel)
---comment
---@return StageConfig
function StageConfig:new()
if SpearheadConfig == nil then SpearheadConfig = {} end
if SpearheadConfig.StageConfig == nil then SpearheadConfig.StageConfig = {} end
if SpearheadConfig == nil then
_logger:warn("SpearheadConfig is nil, creating default SpearheadConfig")
SpearheadConfig = {}
end
if SpearheadConfig.StageConfig == nil then
_logger:warn("SpearheadConfig.StageConfig is nil, creating default StageConfig")
SpearheadConfig.StageConfig = {}
end
---@type StageConfig
local o = {
isEnabled = SpearheadConfig.StageConfig.enabled or true,
isDrawStagesEnabled = SpearheadConfig.StageConfig.drawStages or true,
isAutoStages = SpearheadConfig.StageConfig.autoStages or true,
isEnabled = SpearheadConfig.StageConfig.enabled ~= false,
isDrawStagesEnabled = SpearheadConfig.StageConfig.drawStages ~= false,
isAutoStages = SpearheadConfig.StageConfig.autoStages ~= false,
startingStage = SpearheadConfig.StageConfig.startingStage or 1,
maxMissionsPerStage = SpearheadConfig.StageConfig.maxMissionStage or 10,
isDrawPreActivatedEnabled = SpearheadConfig.StageConfig.drawPreActivated or true,
isDrawPreActivatedEnabled = SpearheadConfig.StageConfig.drawPreActivated ~= false,
AmountPreactivateStage = SpearheadConfig.StageConfig.preactivateStage or 1,
}
setmetatable(o, { __index = self })
_logger:info("Successfully created StageConfig Object")
return o;
end