79 lines
1.7 KiB
Lua
79 lines
1.7 KiB
Lua
local uiCtrl = require_ex('UI/Panels/Base/UICtrl')
|
|
local PANEL_ID = PanelId.WeeklyRaidEnter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WeeklyRaidEnterCtrl = HL.Class('WeeklyRaidEnterCtrl', uiCtrl.UICtrl)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WeeklyRaidEnterCtrl.s_messages = HL.StaticField(HL.Table) << {
|
|
[MessageConst.INTERRUPT_MAIN_HUD_ACTION_QUEUE] = "OnToastInterrupted",
|
|
}
|
|
|
|
|
|
WeeklyRaidEnterCtrl.ShowWeeklyRaidEnter = HL.StaticMethod() << function()
|
|
LuaSystemManager.mainHudActionQueue:AddRequest('WeeklyRaidEnter', function(isResume)
|
|
if isResume then
|
|
local isOpen, ctrl = UIManager:IsOpen(PANEL_ID)
|
|
if isOpen and ctrl then
|
|
ctrl.animationWrapper:PlayInAnimation()
|
|
coroutine.start(function()
|
|
coroutine.wait(2)
|
|
if not UIManager:IsOpen(PANEL_ID) then
|
|
return
|
|
end
|
|
self:PlayAnimationOutAndClose()
|
|
Notify(MessageConst.ON_ONE_MAIN_HUD_ACTION_FINISHED, "WeeklyRaidEnter")
|
|
end)
|
|
return
|
|
end
|
|
end
|
|
UIManager:AutoOpen(PANEL_ID)
|
|
end)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
WeeklyRaidEnterCtrl.OnCreate = HL.Override(HL.Any) << function(self, arg)
|
|
self.animationWrapper:PlayInAnimation()
|
|
coroutine.start(function()
|
|
coroutine.wait(2)
|
|
if not UIManager:IsOpen(PANEL_ID) then
|
|
return
|
|
end
|
|
self:PlayAnimationOutAndClose()
|
|
Notify(MessageConst.ON_ONE_MAIN_HUD_ACTION_FINISHED, "WeeklyRaidEnter")
|
|
end)
|
|
end
|
|
|
|
|
|
|
|
WeeklyRaidEnterCtrl.OnToastInterrupted = HL.Method() << function(self)
|
|
|
|
self.animationWrapper:ClearTween(false)
|
|
self:Close()
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HL.Commit(WeeklyRaidEnterCtrl)
|