PGRData/Script/matrix/xentity/xguilddorm/furniture/events/XGDFCheckGuildWarOpen.lua
2024-09-01 22:49:41 +02:00

28 lines
No EOL
833 B
Lua

local XGDFBaseEvent = require("XEntity/XGuildDorm/Furniture/Events/XGDFBaseEvent")
---@class XGDFCheckGuildWarOpen : XGDFBaseEvent
local XGDFCheckGuildWarOpen = XClass(XGDFBaseEvent, "XGDFCheckGuildWarOpen")
function XGDFCheckGuildWarOpen:Init()
self:StartEntryBtnListener()
end
function XGDFCheckGuildWarOpen:CheckOnce()
self:Trigger(XDataCenter.GuildWarManager.CheckRoundIsInTime())
end
function XGDFCheckGuildWarOpen:StartEntryBtnListener()
if self.EntryBtnTimeId then return end
self.EntryBtnTimeId = XScheduleManager.ScheduleForever(
function()
CheckOnce()
end,1000
)
end
function XGDFCheckGuildWarOpen:Dispose()
if not self.EntryBtnTimeId then return end
XScheduleManager.UnSchedule(self.EntryBtnTimeId)
self.EntryBtnTimeId = nil
end
return XGDFCheckGuildWarOpen