Files
Endfield-Data/LuaScripts/Phase/DungeonWeeklyRaid/PhaseDungeonWeeklyRaid.lua
2025-12-02 20:37:18 +07:00

165 lines
3.4 KiB
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
local phaseBase = require_ex('Phase/Core/PhaseBase')
local PHASE_ID = PhaseId.DungeonWeeklyRaid
PhaseDungeonWeeklyRaid = HL.Class('PhaseDungeonWeeklyRaid', phaseBase.PhaseBase)
PhaseDungeonWeeklyRaid.m_panelStack = HL.Field(HL.Forward("Stack"))
PhaseDungeonWeeklyRaid.s_messages = HL.StaticField(HL.Table) << {
[MessageConst.ON_INTERACT_WEEK_RAID_ENTRY] = { "_OnInteractWeekRaidEntry", false },
[MessageConst.ON_WEEKLY_RAID_ENTER] = { "_OnWeekRaidGameEntry", false },
[MessageConst.ON_WEEKLY_RAID_QUIT] = { "_OnWeekRaidGameQuit", false },
}
PhaseDungeonWeeklyRaid._OnInteractWeekRaidEntry = HL.StaticMethod() << function()
PhaseManager:OpenPhase(PhaseId.CharFormation, { weekRaidArg = {} })
end
PhaseDungeonWeeklyRaid._OnWeekRaidGameEntry = HL.StaticMethod() << function()
UIManager:ToggleBlockObtainWaysJump("WeeklyRaidGame", true, true)
end
PhaseDungeonWeeklyRaid._OnWeekRaidGameQuit = HL.StaticMethod() << function()
UIManager:ToggleBlockObtainWaysJump("WeeklyRaidGame", false, true)
end
PhaseDungeonWeeklyRaid._OnInit = HL.Override() << function(self)
self.m_panelStack = require_ex("Common/Utils/DataStructure/Stack")()
PhaseDungeonWeeklyRaid.Super._OnInit(self)
end
PhaseDungeonWeeklyRaid.PrepareTransition = HL.Override(HL.Number, HL.Boolean, HL.Opt(HL.Number)) << function(self, transitionType, fastMode, anotherPhaseId)
end
PhaseDungeonWeeklyRaid._DoPhaseTransitionIn = HL.Override(HL.Boolean, HL.Opt(HL.Table)) << function(self, fastMode, args)
local panelId = PanelId.RaidMain
if self.arg then
if self.arg.strPanelId then
panelId = PanelId[self.arg.strPanelId]
elseif self.arg.panelId then
panelId = self.arg.panelId
end
end
self:TryOpenPanel(panelId, self.arg)
end
PhaseDungeonWeeklyRaid._DoPhaseTransitionOut = HL.Override(HL.Boolean, HL.Opt(HL.Table)) << function(self, fastMode, args)
end
PhaseDungeonWeeklyRaid._DoPhaseTransitionBehind = HL.Override(HL.Boolean, HL.Opt(HL.Table)) << function(self, fastMode, args)
end
PhaseDungeonWeeklyRaid._DoPhaseTransitionBackToTop = HL.Override(HL.Boolean, HL.Opt(HL.Table)) << function(self, fastMode, args)
end
PhaseDungeonWeeklyRaid.TryOpenPanel = HL.Method(HL.Number, HL.Opt(HL.Table)) << function(self, panelId, args)
if self.m_panelStack:Contains(panelId) then
logger.warning("PhaseDungeonWeeklyRaid.TryOpenPanel: 面板已打开无需重复打开panelId: " .. tostring(panelId))
return
end
self:CreateOrShowPhasePanelItem(panelId, args)
self.m_panelStack:Push(panelId)
end
PhaseDungeonWeeklyRaid.TryCloseTopPanel = HL.Method() << function(self)
if self.m_panelStack:Count() == 1 then
PhaseManager:PopPhase(PHASE_ID)
local panelId = self.m_panelStack:Pop()
Notify(MessageConst.DIALOG_CLOSE_UI, {panelId, PHASE_ID, 0})
return
end
local panelId = self.m_panelStack:Pop()
local phaseItem = self:_GetPanelPhaseItem(panelId)
if phaseItem then
phaseItem.uiCtrl:PlayAnimationOutWithCallback(function()
self:RemovePhasePanelItem(phaseItem)
end)
end
end
PhaseDungeonWeeklyRaid._OnActivated = HL.Override() << function(self)
end
PhaseDungeonWeeklyRaid._OnDeActivated = HL.Override() << function(self)
end
PhaseDungeonWeeklyRaid._OnDestroy = HL.Override() << function(self)
PhaseDungeonWeeklyRaid.Super._OnDestroy(self)
end
HL.Commit(PhaseDungeonWeeklyRaid)