2023-07-14 19:35:33 +00:00
|
|
|
|
local XUiBattleRoleRoomDefaultProxy = require("XUi/XUiNewRoomSingle/XUiBattleRoleRoomDefaultProxy")
|
|
|
|
|
local XUiPanelBabelTowerRoom = require("XUi/XUiFubenBabelTower/Room/XUiPanelBabelTowerRoom")
|
2024-09-01 20:49:41 +00:00
|
|
|
|
---@class XUiBabelTowerBattleRoleRoom : XUiBattleRoleRoomDefaultProxy
|
2023-07-14 19:35:33 +00:00
|
|
|
|
local XUiBabelTowerBattleRoleRoom = XClass(XUiBattleRoleRoomDefaultProxy, "XUiBabelTowerBattleRoleRoom")
|
|
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
|
---@param team XTeam
|
2023-07-14 19:35:33 +00:00
|
|
|
|
function XUiBabelTowerBattleRoleRoom:Ctor(team, stageId)
|
2024-09-01 20:49:41 +00:00
|
|
|
|
self.Team = team
|
2023-07-14 19:35:33 +00:00
|
|
|
|
self.StageId = stageId
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function XUiBabelTowerBattleRoleRoom:GetRoleDetailProxy()
|
|
|
|
|
return require("XUi/XUiFubenBabelTower/Room/XUiBabelTowerBattleRoomRoleDetail")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function XUiBabelTowerBattleRoleRoom:GetChildPanelData()
|
|
|
|
|
return {
|
|
|
|
|
assetPath = XUiConfigs.GetComponentUrl("PanelBabel"),
|
|
|
|
|
proxy = XUiPanelBabelTowerRoom,
|
|
|
|
|
proxyArgs = { "StageId", "Team" }
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function XUiBabelTowerBattleRoleRoom:EnterFight(team, stageId, challengeCount, isAssist)
|
|
|
|
|
self.RootUi:Close()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- return : bool 是否开启自动关闭检查, number 自动关闭的时间戳(秒), function 每秒更新的回调 function(isClose) isClose标志是否到达结束时间
|
|
|
|
|
function XUiBabelTowerBattleRoleRoom:GetAutoCloseInfo()
|
|
|
|
|
local activityType = XDataCenter.FubenBabelTowerManager.GetActivityTypeByStageId(self.StageId)
|
|
|
|
|
local endTime = XDataCenter.FubenBabelTowerManager.GetEndTime(activityType)
|
|
|
|
|
return true, endTime, function(isClose)
|
|
|
|
|
if isClose then
|
|
|
|
|
XDataCenter.FubenBabelTowerManager.HandleActivityEndTime(activityType)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
|
-- 过滤预设队伍实体Id
|
|
|
|
|
-- teamData : 旧系统的队伍数据
|
|
|
|
|
-- 注意:不能直接使用XTool.Clone克隆teamData数据,会出现无线套娃的现象
|
|
|
|
|
-- 主要原因是teamData里有PartnerPrefab,PartnerPrefab里又有teamData
|
|
|
|
|
function XUiBabelTowerBattleRoleRoom:FilterPresetTeamEntitiyIds(teamData)
|
|
|
|
|
-- 根据巴别塔锁角色机制处理
|
|
|
|
|
local tempTeamData = {}
|
|
|
|
|
local entitiyIds = {}
|
|
|
|
|
local isTip = false
|
|
|
|
|
for pos, characterId in ipairs(teamData.TeamData) do
|
|
|
|
|
local isLock = XDataCenter.FubenBabelTowerManager.IsCharacterLockByStageId(characterId, self.StageId, self.Team:GetId())
|
|
|
|
|
entitiyIds[pos] = not isLock and characterId or 0
|
|
|
|
|
if isLock then
|
|
|
|
|
isTip = true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
tempTeamData.TeamData = entitiyIds
|
|
|
|
|
tempTeamData.CaptainPos = teamData.CaptainPos
|
|
|
|
|
tempTeamData.FirstFightPos = teamData.FirstFightPos
|
|
|
|
|
tempTeamData.TeamName = teamData.TeamName
|
|
|
|
|
if isTip then
|
|
|
|
|
XUiManager.TipText("BabelTowerPresetTeamEntitiyIdLockTip")
|
|
|
|
|
end
|
|
|
|
|
return tempTeamData
|
|
|
|
|
end
|
|
|
|
|
|
2023-07-14 19:35:33 +00:00
|
|
|
|
--######################## AOP ########################
|
|
|
|
|
function XUiBabelTowerBattleRoleRoom:AOPOnStartBefore(rootUi)
|
|
|
|
|
self.RootUi = rootUi
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function XUiBabelTowerBattleRoleRoom:AOPOnStartAfter(rootUi)
|
|
|
|
|
rootUi.BtnEnterFight:SetNameByGroup(0, CSXTextManagerGetText("BabelTowerNewRoomBtnName"))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return XUiBabelTowerBattleRoleRoom
|