2023-07-14 19:35:33 +00:00
|
|
|
XFestivalActivityConfig = XFestivalActivityConfig or {}
|
|
|
|
|
|
|
|
local CLIENT_FESTIVAL_STAGE = "Client/Fuben/Festival/FestivalStage.tab" --庆典关卡客户端表
|
|
|
|
local SHARE_FESTIVAL = "Share/Fuben/Festival/FestivalActivity.tab"
|
|
|
|
|
|
|
|
local ShareFestival = {}
|
|
|
|
local ClientFestivalStages = {}
|
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
XFestivalActivityConfig.UiType = {
|
|
|
|
ExtralLine = 1,
|
|
|
|
Activity = 2,
|
|
|
|
}
|
|
|
|
|
2023-07-14 19:35:33 +00:00
|
|
|
--活动名称Id
|
|
|
|
XFestivalActivityConfig.ActivityId = {
|
|
|
|
Christmas = 1,
|
|
|
|
MainLine = 2,
|
|
|
|
NewYear = 3,
|
|
|
|
FoolsDay = 4,
|
|
|
|
NewYearFuben = 23,--琥虎符福
|
|
|
|
WhiteValentine = 24,--白色情人节
|
2024-09-01 20:49:41 +00:00
|
|
|
DragonBoatFestival = 25,--端午节活动
|
2023-07-14 19:35:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function XFestivalActivityConfig.Init()
|
|
|
|
ClientFestivalStages = XTableManager.ReadByIntKey(CLIENT_FESTIVAL_STAGE, XTable.XTableFestivalStage, "StageId")
|
|
|
|
ShareFestival = XTableManager.ReadAllByIntKey(SHARE_FESTIVAL, XTable.XTableFestivalActivity, "Id")
|
|
|
|
end
|
|
|
|
|
|
|
|
function XFestivalActivityConfig.GetFestivalsTemplates()
|
|
|
|
return ShareFestival
|
|
|
|
end
|
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
---@return XTableFestivalActivity
|
2023-07-14 19:35:33 +00:00
|
|
|
function XFestivalActivityConfig.GetFestivalById(id)
|
|
|
|
if not id then return end
|
|
|
|
local festivalDatas = ShareFestival[id]
|
|
|
|
if not festivalDatas then
|
|
|
|
XLog.ErrorTableDataNotFound("XFestivalActivityConfig.GetFestivalById", "FestivalActivity", SHARE_FESTIVAL, "Id", tostring(id))
|
|
|
|
return
|
|
|
|
end
|
|
|
|
return festivalDatas
|
|
|
|
end
|
|
|
|
|
|
|
|
function XFestivalActivityConfig.GetFestivalTime(id)
|
|
|
|
local config = XFestivalActivityConfig.GetFestivalById(id)
|
|
|
|
return XFunctionManager.GetTimeByTimeId(config.TimeId)
|
|
|
|
end
|
|
|
|
|
|
|
|
function XFestivalActivityConfig.IsOffLine(id)
|
|
|
|
local config = XFestivalActivityConfig.GetFestivalById(id)
|
|
|
|
return not XTool.IsNumberValid(config.TimeId)
|
|
|
|
end
|
|
|
|
|
|
|
|
--====================
|
|
|
|
--获取庆典活动关卡配置
|
|
|
|
--@param stageId:关卡ID
|
|
|
|
--@return 庆典活动关卡配置
|
|
|
|
--====================
|
|
|
|
function XFestivalActivityConfig.GetFestivalStageCfgByStageId(stageId)
|
|
|
|
if not ClientFestivalStages[stageId] then
|
|
|
|
--[[ XLog.ErrorTableDataNotFound(
|
|
|
|
"XFestivalActivityConfig.GetFestivalStageCfgByStageId",
|
|
|
|
"庆典活动关卡",
|
|
|
|
CLIENT_FESTIVAL_STAGE,
|
|
|
|
"StageId",
|
|
|
|
tostring(stageId))
|
|
|
|
]]
|
|
|
|
return nil
|
|
|
|
end
|
|
|
|
return ClientFestivalStages[stageId]
|
|
|
|
end
|