PGRData/Script/matrix/xredpoint/xredpointconditions/XRedPointConditionMemorySaveAllRedPoint.lua

33 lines
1.1 KiB
Lua
Raw Permalink Normal View History

local Event = nil
local SubCondition = nil
local XRedPointConditionMemorySaveAllRedPoint = {} -- 活动入口红点
function XRedPointConditionMemorySaveAllRedPoint.GetSubConditions()
SubCondition = SubCondition or {
XRedPointConditions.Types.CONDITION_MEMORYSAVE_CHAPTER_REWARD,
XRedPointConditions.Types.CONDITION_MEMORYSAVE_CHAPTER_REWARD_NEW_CHAPTER,
}
return SubCondition
end
function XRedPointConditionMemorySaveAllRedPoint.Check()
if not XFunctionManager.JudgeCanOpen(XFunctionManager.FunctionName.MemorySave) then
return false
end
if not XDataCenter.MemorySaveManager.IsOpen() then
return false
end
local chapterIds = XDataCenter.MemorySaveManager.GetActivityChapterIds()
for _, chapterId in ipairs(chapterIds) do
if XRedPointConditionMemorySaveChapterRewardNewChapter.Check(chapterId) then
return true
end
if XRedPointConditionMemorySaveChapterReward.Check(chapterId) then
return true
end
end
return false
end
return XRedPointConditionMemorySaveAllRedPoint