111
parent
75f1909fd1
commit
456fb83d83
|
@ -2,8 +2,8 @@
|
||||||
local ArenaTypePanel = Inherit(BasePanel)
|
local ArenaTypePanel = Inherit(BasePanel)
|
||||||
local this = ArenaTypePanel
|
local this = ArenaTypePanel
|
||||||
|
|
||||||
local state=0
|
local state = 0
|
||||||
local tipStr=nil
|
local tipStr = nil
|
||||||
--初始化组件(用于子类重写)
|
--初始化组件(用于子类重写)
|
||||||
function ArenaTypePanel:InitComponent()
|
function ArenaTypePanel:InitComponent()
|
||||||
this.spLoader = SpriteLoader.New()
|
this.spLoader = SpriteLoader.New()
|
||||||
|
@ -11,24 +11,37 @@ function ArenaTypePanel:InitComponent()
|
||||||
|
|
||||||
this.btnArena = Util.GetGameObject(self.gameObject, "content/btnArena")
|
this.btnArena = Util.GetGameObject(self.gameObject, "content/btnArena")
|
||||||
this.btnTopMatch = Util.GetGameObject(self.gameObject, "content/btnTopMatch")
|
this.btnTopMatch = Util.GetGameObject(self.gameObject, "content/btnTopMatch")
|
||||||
|
this.btnYXLD = Util.GetGameObject(self.gameObject, "content/btnYXLD")
|
||||||
|
|
||||||
|
this.yxld_Name = Util.GetGameObject(this.btnYXLD, "Name"):GetComponent("Text")
|
||||||
|
this.yxld_normal = Util.GetGameObject(this.btnYXLD, "normal")
|
||||||
|
this.yxld_lock = Util.GetGameObject(this.btnYXLD, "lock")
|
||||||
|
this.yxld_lockTip = Util.GetGameObject(this.yxld_lock, "Tip"):GetComponent("Text")
|
||||||
|
this.yxld_Season = Util.GetGameObject(this.yxld_normal, "Season"):GetComponent("Text")
|
||||||
|
this.yxld_SeasonTime = Util.GetGameObject(this.yxld_normal, "Season/Time"):GetComponent("Text")
|
||||||
|
this.yxld_Score = Util.GetGameObject(this.yxld_normal, "Score/Text"):GetComponent("Text")
|
||||||
|
this.yxld_Rank = Util.GetGameObject(this.yxld_normal, "Rank/Text"):GetComponent("Text")
|
||||||
|
this.yxld_RankNane = Util.GetGameObject(this.yxld_normal, "Rank"):GetComponent("Text")
|
||||||
|
this.yxld_Redpot = Util.GetGameObject(this.btnYXLD, "bg/redpot")
|
||||||
|
|
||||||
this.Arena_Name = Util.GetGameObject(this.btnArena, "Name"):GetComponent("Text")
|
this.Arena_Name = Util.GetGameObject(this.btnArena, "Name"):GetComponent("Text")
|
||||||
this.Arena_Season = Util.GetGameObject(this.btnArena, "Season/Text"):GetComponent("Text")
|
this.Arena_Season = Util.GetGameObject(this.btnArena, "Season"):GetComponent("Text")
|
||||||
this.Arena_SeasonTime = Util.GetGameObject(this.btnArena, "Season/Time"):GetComponent("Text")
|
this.Arena_SeasonTime = Util.GetGameObject(this.btnArena, "Season/Time"):GetComponent("Text")
|
||||||
this.Arena_Score = Util.GetGameObject(this.btnArena, "Score/Text"):GetComponent("Text")
|
this.Arena_Score = Util.GetGameObject(this.btnArena, "Score"):GetComponent("Text")
|
||||||
this.Arena_Rank = Util.GetGameObject(this.btnArena, "Rank/Text"):GetComponent("Text")
|
this.Arena_Rank = Util.GetGameObject(this.btnArena, "Rank"):GetComponent("Text")
|
||||||
this.Arena_RankNane = Util.GetGameObject(this.btnArena, "RankName"):GetComponent("Text")
|
this.Arena_RankNane = Util.GetGameObject(this.btnArena, "RankName"):GetComponent("Text")
|
||||||
|
|
||||||
this.TopMatch_Normal = Util.GetGameObject(this.btnTopMatch, "normal")
|
this.TopMatch_Normal = Util.GetGameObject(this.btnTopMatch, "normal")
|
||||||
this.TopMatch_NormalBG = Util.GetGameObject(this.btnTopMatch, "nBg")
|
this.TopMatch_NormalBG = Util.GetGameObject(this.btnTopMatch, "nBg")
|
||||||
this.TopMatch_Name = Util.GetGameObject(this.btnTopMatch, "Name"):GetComponent("Text")
|
this.TopMatch_Name = Util.GetGameObject(this.btnTopMatch, "Name"):GetComponent("Text")
|
||||||
this.TopMatch_SeasonState=Util.GetGameObject(this.TopMatch_Normal, "Season"):GetComponent("Text")
|
this.TopMatch_SeasonState = Util.GetGameObject(this.TopMatch_Normal, "Season"):GetComponent("Text")
|
||||||
this.TopMatch_Season = Util.GetGameObject(this.TopMatch_Normal, "Season/Text"):GetComponent("Text")
|
this.TopMatch_Season = Util.GetGameObject(this.TopMatch_Normal, "Season"):GetComponent("Text")
|
||||||
this.TopMatch_SeasonTime = Util.GetGameObject(this.TopMatch_Normal, "Season/Time"):GetComponent("Text")
|
this.TopMatch_SeasonTime = Util.GetGameObject(this.TopMatch_Normal, "Season/Time"):GetComponent("Text")
|
||||||
this.TopMatch_StageObj = Util.GetGameObject(this.TopMatch_Normal, "Stage")
|
this.TopMatch_StageObj = Util.GetGameObject(this.TopMatch_Normal, "Stage")
|
||||||
this.TopMatch_BestRankObj = Util.GetGameObject(this.TopMatch_Normal, "BestRank")
|
this.TopMatch_BestRankObj = Util.GetGameObject(this.TopMatch_Normal, "BestRank")
|
||||||
this.TopMatch_Stage = Util.GetGameObject(this.TopMatch_Normal, "Stage/Text"):GetComponent("Text")
|
this.TopMatch_Stage = Util.GetGameObject(this.TopMatch_Normal, "Stage"):GetComponent("Text")
|
||||||
this.TopMatch_Rank = Util.GetGameObject(this.TopMatch_Normal, "MyRank/Text"):GetComponent("Text")
|
this.TopMatch_Rank = Util.GetGameObject(this.TopMatch_Normal, "MyRank"):GetComponent("Text")
|
||||||
this.TopMatch_BestRank = Util.GetGameObject(this.TopMatch_Normal, "BestRank/Text"):GetComponent("Text")
|
this.TopMatch_BestRank = Util.GetGameObject(this.TopMatch_Normal, "BestRank"):GetComponent("Text")
|
||||||
this.TopMatch_Red = Util.GetGameObject(this.btnTopMatch, "bg/redpot")
|
this.TopMatch_Red = Util.GetGameObject(this.btnTopMatch, "bg/redpot")
|
||||||
this.TopMatch_Lock = Util.GetGameObject(this.btnTopMatch, "lock")
|
this.TopMatch_Lock = Util.GetGameObject(this.btnTopMatch, "lock")
|
||||||
this.TopMatch_LockBg = Util.GetGameObject(this.btnTopMatch, "lBg")
|
this.TopMatch_LockBg = Util.GetGameObject(this.btnTopMatch, "lBg")
|
||||||
|
@ -47,28 +60,39 @@ function ArenaTypePanel:BindEvent()
|
||||||
JumpManager.GoJump(8001)
|
JumpManager.GoJump(8001)
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.btnTopMatch, function()
|
Util.AddClick(this.btnTopMatch, function()
|
||||||
|
|
||||||
-- local isOpen = ActTimeCtrlManager.IsSwitchOpen(FUNCTION_OPEN_TYPE.TOP_MATCH)
|
-- local isOpen = ActTimeCtrlManager.IsSwitchOpen(FUNCTION_OPEN_TYPE.TOP_MATCH)
|
||||||
-- if not isOpen then
|
-- if not isOpen then
|
||||||
-- PopupTipPanel.ShowTip("巅峰赛暂未开放")
|
-- PopupTipPanel.ShowTip("巅峰赛暂未开放")
|
||||||
-- return
|
-- return
|
||||||
-- end
|
-- end
|
||||||
--UIManager.OpenPanel(UIName.ArenaTopMatchPanel)
|
--UIManager.OpenPanel(UIName.ArenaTopMatchPanel)
|
||||||
if state<1 or state==2 or state==4 then
|
if state < 1 or state == 2 or state == 4 then
|
||||||
PopupTipPanel.ShowTip(tipStr)
|
PopupTipPanel.ShowTip(GetLanguageStrById(tipStr))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if JumpServerManager.stage==1 or JumpServerManager.stage==3 then
|
if JumpServerManager.stage == 1 or JumpServerManager.stage == 3 then
|
||||||
UIManager.OpenPanel(UIName.JumpServerHightLadderPanel)
|
UIManager.OpenPanel(UIName.JumpServerHightLadderPanel)
|
||||||
end
|
end
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Util.AddClick(this.btnYXLD, function()
|
||||||
|
local isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.JumpServer_YuXu)
|
||||||
|
if isOpen then
|
||||||
|
NetManager.CrossYuXuLunDaoGetInfoRequest(1, function(msg)
|
||||||
|
UIManager.OpenPanel(UIName.WorldArenaMainPanel, msg)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
local tip = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.JumpServer_YuXu)
|
||||||
|
PopupTipPanel.ShowTip(tip)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
Util.AddClick(this.btnBack, function()
|
Util.AddClick(this.btnBack, function()
|
||||||
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
||||||
if PlayerPrefs.HasKey("ArenaTypePanel"..PlayerManager.uid) then
|
if PlayerPrefs.HasKey("ArenaTypePanel" .. PlayerManager.uid) then
|
||||||
DynamicActivityManager.isopenJingjishilian = false
|
DynamicActivityManager.isopenJingjishilian = false
|
||||||
else
|
else
|
||||||
PlayerPrefs.SetInt("ArenaTypePanel"..PlayerManager.uid,1)
|
PlayerPrefs.SetInt("ArenaTypePanel" .. PlayerManager.uid, 1)
|
||||||
DynamicActivityManager.isopenJingjishilian = true
|
DynamicActivityManager.isopenJingjishilian = true
|
||||||
end
|
end
|
||||||
this:ClosePanel()
|
this:ClosePanel()
|
||||||
|
@ -76,7 +100,7 @@ function ArenaTypePanel:BindEvent()
|
||||||
|
|
||||||
BindRedPointObject(RedPointType.Arena_Type_Normal, this.btnArenaRedpot)
|
BindRedPointObject(RedPointType.Arena_Type_Normal, this.btnArenaRedpot)
|
||||||
BindRedPointObject(RedPointType.JumpServer_HightLadder, this.TopMatch_Red)
|
BindRedPointObject(RedPointType.JumpServer_HightLadder, this.TopMatch_Red)
|
||||||
|
BindRedPointObject(RedPointType.WorldArena_reward, this.yxld_Redpot)
|
||||||
end
|
end
|
||||||
|
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
|
@ -105,26 +129,27 @@ end
|
||||||
-- 打开,重新打开时回调
|
-- 打开,重新打开时回调
|
||||||
function ArenaTypePanel:OnShow()
|
function ArenaTypePanel:OnShow()
|
||||||
-- 竞技场
|
-- 竞技场
|
||||||
if ArenaManager.resetData==nil then
|
if ArenaManager.resetData == nil then
|
||||||
NetManager.NewArenaResetRequest()
|
NetManager.NewArenaResetRequest()
|
||||||
end
|
end
|
||||||
LogError("ArenaManager.resetData.isFirst=="..ArenaManager.resetData.isFirst.." #ArenaManager.resetData.drop=="..#ArenaManager.resetData.drop)
|
LogError("ArenaManager.resetData.isFirst==" ..
|
||||||
if ArenaManager.resetData and (ArenaManager.resetData.isFirst==1 or #ArenaManager.resetData.drop>0) then
|
ArenaManager.resetData.isFirst .. " #ArenaManager.resetData.drop==" .. #ArenaManager.resetData.drop)
|
||||||
UIManager.OpenPanel(UIName.ArenaNewUpRankPanel,ArenaManager.resetData)
|
if ArenaManager.resetData and (ArenaManager.resetData.isFirst == 1 or #ArenaManager.resetData.drop > 0) then
|
||||||
ArenaManager.resetData=nil
|
UIManager.OpenPanel(UIName.ArenaNewUpRankPanel, ArenaManager.resetData)
|
||||||
|
ArenaManager.resetData = nil
|
||||||
end
|
end
|
||||||
NetManager.GetNewArenaInfoRequest(function()
|
NetManager.GetNewArenaInfoRequest(function()
|
||||||
-- NetManager.RequestArenaRankData(1, function()
|
-- NetManager.RequestArenaRankData(1, function()
|
||||||
this.RefreshArenaShow()
|
this.RefreshArenaShow()
|
||||||
-- end)
|
-- end)
|
||||||
end)
|
end)
|
||||||
--罗浮争锋
|
--罗浮争锋
|
||||||
--this.RefreshTopMatchShow()
|
--this.RefreshTopMatchShow()
|
||||||
local isOpen=CheckFunctionOpen(FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
local isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
||||||
if isOpen then
|
if isOpen then
|
||||||
NetManager.QueryLuofuRegisterInfoRequest(function ()
|
NetManager.QueryLuofuRegisterInfoRequest(function()
|
||||||
if JumpServerManager.stage==1 or JumpServerManager.stage==3 then
|
if JumpServerManager.stage == 1 or JumpServerManager.stage == 3 then
|
||||||
JumpServerManager.GetWorldArenaInfoRequest(JumpServerManager.arenaType,function()
|
JumpServerManager.GetWorldArenaInfoRequest(JumpServerManager.arenaType, function()
|
||||||
this.RefreshTopMatchShow()
|
this.RefreshTopMatchShow()
|
||||||
-- 计时器
|
-- 计时器
|
||||||
if this.TimeCounter then return end
|
if this.TimeCounter then return end
|
||||||
|
@ -139,8 +164,23 @@ function ArenaTypePanel:OnShow()
|
||||||
else
|
else
|
||||||
this.RefreshTopMatchShow()
|
this.RefreshTopMatchShow()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.JumpServer_YuXu)
|
||||||
|
if isOpen then
|
||||||
|
LogError("玉虚论道已开启=======================================")
|
||||||
|
NetManager.CrossYuXuLunDaoGetInfoRequest(1, function(msg)
|
||||||
|
--UIManager.OpenPanel(UIName.WorldArenaMainPanel,msg)
|
||||||
|
this.RefreshYXLDShow(msg)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
this.RefreshYXLDShow()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 巅峰战
|
-- 巅峰战
|
||||||
-- ArenaTopMatchManager.RequestTopMatchBaseInfo(function()
|
-- ArenaTopMatchManager.RequestTopMatchBaseInfo(function()
|
||||||
-- this.RefreshTopMatchShow()
|
-- this.RefreshTopMatchShow()
|
||||||
|
@ -149,25 +189,58 @@ function ArenaTypePanel:OnShow()
|
||||||
-- this.TimeCounter = Timer.New(this.TimeUpdate, 1, -1, true)
|
-- this.TimeCounter = Timer.New(this.TimeUpdate, 1, -1, true)
|
||||||
-- this.TimeCounter:Start()
|
-- this.TimeCounter:Start()
|
||||||
-- this.TimeUpdate()
|
-- this.TimeUpdate()
|
||||||
-- end)
|
-- end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 刷新竞技场显示
|
-- 刷新竞技场显示
|
||||||
function this.RefreshArenaShow()
|
function this.RefreshArenaShow()
|
||||||
this.Arena_Name.text = "天下第一武道会"--ArenaManager.GetArenaName()
|
this.Arena_Name.text = ArenaManager.GetArenaName()
|
||||||
local baseData = ArenaManager.GetArenaBaseData()
|
local baseData = ArenaManager.GetArenaBaseData()
|
||||||
this.Arena_Score.text = baseData.score
|
this.Arena_Score.text = GetLanguageStrById("我的积分:") .. baseData.score
|
||||||
local _, myRankInfo = ArenaManager.GetRankInfo()
|
local _, myRankInfo = ArenaManager.GetRankInfo()
|
||||||
local myRank = myRankInfo.personInfo.rank
|
local myRank = myRankInfo.personInfo.rank
|
||||||
if myRank < 0 then
|
if myRank < 0 then
|
||||||
myRank = Language[10036]
|
myRank = Language[10036]
|
||||||
end
|
end
|
||||||
this.Arena_Rank.text = myRank
|
this.Arena_Rank.text = GetLanguageStrById("我的排名:") .. myRank
|
||||||
this.Arena_RankNane.text=ConfigManager.GetConfigData(ConfigName.ArenaRoom,baseData.roomId).ArenaRoomName --baseData.rankName
|
this.Arena_RankNane.text = GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.ArenaRoom, baseData.roomId)
|
||||||
|
.ArenaRoomName) --baseData.rankName
|
||||||
local serData = ActTimeCtrlManager.GetSerDataByTypeId(FUNCTION_OPEN_TYPE.ARENA)
|
local serData = ActTimeCtrlManager.GetSerDataByTypeId(FUNCTION_OPEN_TYPE.ARENA)
|
||||||
local startDate = os.date("%m.%d", serData.startTime)
|
local startDate = os.date("%m.%d", serData.startTime)
|
||||||
local endDate = os.date("%m.%d", serData.endTime)
|
local endDate = os.date("%m.%d", serData.endTime)
|
||||||
this.Arena_Season.text = string.format("%s-%s", startDate, endDate)
|
this.Arena_Season.text = GetLanguageStrById("当前赛季:") .. string.format("%s-%s", startDate, endDate)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 刷新竞技场显示
|
||||||
|
function this.RefreshYXLDShow(_msg)
|
||||||
|
this.yxld_Name.text = Language[10087]
|
||||||
|
local yxTip = ""
|
||||||
|
if not CheckFunctionOpen(FUNCTION_OPEN_TYPE.JumpServer_YuXu) then
|
||||||
|
this.yxld_lock:SetActive(true)
|
||||||
|
this.yxld_normal:SetActive(false)
|
||||||
|
this.yxld_lockTip.text = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.JumpServer_YuXu)
|
||||||
|
else
|
||||||
|
this.yxld_lock:SetActive(false)
|
||||||
|
this.yxld_normal:SetActive(true)
|
||||||
|
local myRank = 0
|
||||||
|
if _msg then
|
||||||
|
this.yxld_Score.text = GetLanguageStrById("我的积分:") .. _msg.newMyscore
|
||||||
|
myRank = _msg.myRank
|
||||||
|
else
|
||||||
|
this.yxld_Score.text = GetLanguageStrById("我的积分:") .. WorldArenaManager.GetNewScore()
|
||||||
|
myRank = WorldArenaManager.GetMyRank()
|
||||||
|
end
|
||||||
|
|
||||||
|
if myRank <= 0 then
|
||||||
|
myRank = Language[10036]
|
||||||
|
end
|
||||||
|
this.yxld_Rank.text = GetLanguageStrById("我的排名:") .. myRank
|
||||||
|
--this.yxld_RankNane.text=ConfigManager.GetConfigData(ConfigName.ArenaRoom,baseData.roomId).ArenaRoomName --baseData.rankName
|
||||||
|
local serData = ActTimeCtrlManager.GetSerDataByTypeId(FUNCTION_OPEN_TYPE.JumpServer_YuXu)
|
||||||
|
local startDate = os.date("%m.%d", serData.startTime)
|
||||||
|
local endDate = os.date("%m.%d", serData.endTime)
|
||||||
|
this.yxld_Season.text = GetLanguageStrById("当前赛季:") .. string.format("%s-%s", startDate, endDate)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 刷新巅峰战显示
|
-- 刷新巅峰战显示
|
||||||
|
@ -184,13 +257,13 @@ function this.RefreshTopMatchShow()
|
||||||
-- else
|
-- else
|
||||||
-- this.TopMatch_Season.text = "暂未开放"
|
-- this.TopMatch_Season.text = "暂未开放"
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
-- local tmData = ArenaTopMatchManager.GetBaseData()
|
-- local tmData = ArenaTopMatchManager.GetBaseData()
|
||||||
-- local titleName, stageName = ArenaTopMatchManager.GetCurTopMatchName()
|
-- local titleName, stageName = ArenaTopMatchManager.GetCurTopMatchName()
|
||||||
-- this.TopMatch_Name.text = titleName
|
-- this.TopMatch_Name.text = titleName
|
||||||
-- this.TopMatch_Stage.text = stageName
|
-- this.TopMatch_Stage.text = stageName
|
||||||
-- this.TopMatch_Rank.text = tmData.myrank <= 0 and Language[10036] or ArenaTopMatchManager.GetRankNameByRank(tmData.myrank)
|
-- this.TopMatch_Rank.text = tmData.myrank <= 0 and "未上榜" or ArenaTopMatchManager.GetRankNameByRank(tmData.myrank)
|
||||||
-- this.TopMatch_BestRank.text = tmData.maxRank <= 0 and Language[10086] or this.GetRankName(tmData.maxRank)
|
-- this.TopMatch_BestRank.text = tmData.maxRank <= 0 and "无" or this.GetRankName(tmData.maxRank)
|
||||||
-- else
|
-- else
|
||||||
-- this.TopMatch_Normal:SetActive(false)
|
-- this.TopMatch_Normal:SetActive(false)
|
||||||
-- this.TopMatch_Lock:SetActive(true)
|
-- this.TopMatch_Lock:SetActive(true)
|
||||||
|
@ -201,111 +274,108 @@ function this.RefreshTopMatchShow()
|
||||||
-- this.TopMatch_Lock_Title.text = string.format("%s解锁", ActTimeCtrlManager.GetSwitchOpenTip(FUNCTION_OPEN_TYPE.TOP_MATCH))
|
-- this.TopMatch_Lock_Title.text = string.format("%s解锁", ActTimeCtrlManager.GetSwitchOpenTip(FUNCTION_OPEN_TYPE.TOP_MATCH))
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
this.TopMatch_Name.text = "沙鲁大赛"
|
this.TopMatch_Name.text = Language[10088]
|
||||||
--判断功能是否开启
|
--判断功能是否开启
|
||||||
if not CheckFunctionOpen(FUNCTION_OPEN_TYPE.JumpServer_HightLadder) then
|
if not CheckFunctionOpen(FUNCTION_OPEN_TYPE.JumpServer_HightLadder) then
|
||||||
state=-6
|
state = -6
|
||||||
tipStr = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
tipStr = GetFunctionOpenTip(FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
||||||
else
|
else
|
||||||
if not ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.JumpServer_HightLadder) then
|
if not ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.JumpServer_HightLadder) then
|
||||||
state = -1
|
state = -1
|
||||||
tipStr = ActTimeCtrlManager.GetFuncTip( FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
tipStr = ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--判断世界等级是否够
|
--判断世界等级是否够
|
||||||
local conFigWorldLevel = ConfigManager.GetConfigData(ConfigName.MServerArenaSetting,1).WorldLevel
|
local conFigWorldLevel = ConfigManager.GetConfigData(ConfigName.MServerArenaSetting, 1).WorldLevel
|
||||||
if PlayerManager.worldLeve < conFigWorldLevel then --如果世界等级不足
|
if PlayerManager.worldLeve < conFigWorldLevel then --如果世界等级不足
|
||||||
state = -2
|
state = -2
|
||||||
tipStr = string.format("世界等级到达%s后开启!",conFigWorldLevel)
|
tipStr = string.format(Language[10089], conFigWorldLevel)
|
||||||
|
|
||||||
end
|
end
|
||||||
--判断是否在赛季中
|
--判断是否在赛季中
|
||||||
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.JumpServer_HightLadder) == false then --如果未解锁
|
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.JumpServer_HightLadder) == false then --如果未解锁
|
||||||
state = -3
|
state = -3
|
||||||
tipStr = "赛季过渡中!"
|
tipStr = Language[10090]
|
||||||
end
|
end
|
||||||
if not JumpServerManager.GetHightLadderDataIsStart() then
|
if not JumpServerManager.GetHightLadderDataIsStart() then
|
||||||
state = -4
|
state = -4
|
||||||
tipStr = string.format("开服第%s周开放!",ConfigManager.GetConfigData(ConfigName.MServerArenaSetting,1).OpenWeek)
|
tipStr = string.format(Language[10091],
|
||||||
|
ConfigManager.GetConfigData(ConfigName.MServerArenaSetting, 1).OpenWeek)
|
||||||
elseif not JumpServerManager.GetHightLadderDataIsGroup() then
|
elseif not JumpServerManager.GetHightLadderDataIsGroup() then
|
||||||
state = -5
|
state = -5
|
||||||
tipStr = "未划分跨服分组,无法参与!"
|
tipStr = Language[10092]
|
||||||
else
|
else
|
||||||
state = 1
|
state = 1
|
||||||
tipStr = ""
|
tipStr = ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if state<1 or state==2 or state==4 then
|
if state < 1 or state == 2 or state == 4 then
|
||||||
this.TopMatch_Normal:SetActive(false)
|
this.TopMatch_Normal:SetActive(false)
|
||||||
this.TopMatch_Lock:SetActive(true)
|
this.TopMatch_Lock:SetActive(true)
|
||||||
--this.TopMatch_Name.text = "未达到开启条件"
|
--this.TopMatch_Name.text = "未达到开启条件"
|
||||||
this.TopMatch_Lock_Title.text = tipStr
|
this.TopMatch_Lock_Title.text = tipStr
|
||||||
this.TopMatch_Lock_Time.text = "未达到开启条件"
|
this.TopMatch_Lock_Time.text = Language[10093]
|
||||||
else
|
else
|
||||||
local serData = ActTimeCtrlManager.GetSerDataByTypeId(FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
local serData = ActTimeCtrlManager.GetSerDataByTypeId(FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
||||||
if serData then
|
if serData then
|
||||||
local startDate = os.date("%m.%d", serData.startTime)
|
local startDate = os.date("%m.%d", serData.startTime)
|
||||||
local endDate = os.date("%m.%d", serData.endTime)
|
local endDate = os.date("%m.%d", serData.endTime)
|
||||||
local state=JumpServerManager.stage
|
local state = JumpServerManager.stage
|
||||||
local str=""
|
local str = ""
|
||||||
if state==JumpServer_Stage.NoStar then
|
if state == JumpServer_Stage.NoStar then
|
||||||
str="赛季报名期:"
|
str = Language[10094]
|
||||||
elseif state==JumpServer_Stage.RankInit then
|
elseif state == JumpServer_Stage.RankInit then
|
||||||
str="战斗初始化:"
|
str = Language[10095]
|
||||||
elseif state==JumpServer_Stage.Attack then
|
elseif state == JumpServer_Stage.Attack then
|
||||||
str="赛季对战期:"
|
str = Language[10096]
|
||||||
elseif state==JumpServer_Stage.End then
|
elseif state == JumpServer_Stage.End then
|
||||||
str="赛季结算中:"
|
str = Language[10097]
|
||||||
end
|
end
|
||||||
this.TopMatch_SeasonState.text=str
|
this.TopMatch_SeasonState.text = str
|
||||||
this.TopMatch_Season.text = string.format("%s-%s", startDate, endDate)
|
this.TopMatch_Season.text = GetLanguageStrById("当前赛季:") .. string.format("%s-%s", startDate, endDate)
|
||||||
this.TopMatch_StageObj:SetActive(false)
|
this.TopMatch_StageObj:SetActive(false)
|
||||||
this.TopMatch_BestRankObj:SetActive(false)
|
this.TopMatch_BestRankObj:SetActive(false)
|
||||||
local rank=JumpServerManager.GetHightLadderDataMyRank() <= 1000 and JumpServerManager.GetHightLadderDataMyRank() or "1000+"
|
local rank = JumpServerManager.GetHightLadderDataMyRank() <= 1000 and
|
||||||
this.TopMatch_Rank.text=rank
|
JumpServerManager.GetHightLadderDataMyRank() or "1000+"
|
||||||
|
this.TopMatch_Rank.text = GetLanguageStrById("我的排名:") .. rank
|
||||||
else
|
else
|
||||||
this.TopMatch_Season.text = "暂未开放"
|
this.TopMatch_Season.text = GetLanguageStrById("当前赛季:") .. Language[10098]
|
||||||
end
|
end
|
||||||
this.TopMatch_Normal:SetActive(true)
|
this.TopMatch_Normal:SetActive(true)
|
||||||
this.TopMatch_NormalBG:SetActive(true)
|
|
||||||
this.TopMatch_Lock:SetActive(false)
|
this.TopMatch_Lock:SetActive(false)
|
||||||
this.TopMatch_LockBg:SetActive(false)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取我得排名信息
|
-- 获取我得排名信息
|
||||||
function this.GetRankName(rank)
|
function this.GetRankName(rank)
|
||||||
if rank == 1 then
|
if rank == 1 then
|
||||||
return Language[10087]
|
return Language[10099]
|
||||||
elseif rank == 2 then
|
elseif rank == 2 then
|
||||||
return Language[10088]
|
return Language[10100]
|
||||||
else
|
else
|
||||||
local maxTurn = ArenaTopMatchManager.GetEliminationMaxRound()
|
local maxTurn = ArenaTopMatchManager.GetEliminationMaxRound()
|
||||||
for i = 1, maxTurn do
|
for i = 1, maxTurn do
|
||||||
if i == maxTurn then
|
if i == maxTurn then
|
||||||
local config = ConfigManager.GetConfigData(ConfigName.ChampionshipSetting, 1)
|
local config = ConfigManager.GetConfigData(ConfigName.ChampionshipSetting, 1)
|
||||||
return config.ChampionshipPlayer..Language[10089]
|
return config.ChampionshipPlayer .. Language[10101]
|
||||||
end
|
end
|
||||||
if rank > math.pow(2, i) and rank <= math.pow(2, i+1) then
|
if rank > math.pow(2, i) and rank <= math.pow(2, i + 1) then
|
||||||
return (i+1)..Language[10089]
|
return (i + 1) .. Language[10101]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
function this.TimeUpdate()
|
function this.TimeUpdate()
|
||||||
local leftTime = ArenaManager.GetLeftTime()
|
local leftTime = ArenaManager.GetLeftTime()
|
||||||
if leftTime <= 0 then
|
if leftTime <= 0 then
|
||||||
this.RefreshArenaShow()
|
this.RefreshArenaShow()
|
||||||
end
|
end
|
||||||
this.Arena_SeasonTime.text = string.format(Language[10090], TimeToHMS(leftTime))
|
this.Arena_SeasonTime.text = string.format(Language[10102], TimeToHMS(leftTime))
|
||||||
|
|
||||||
local isOpen = ActTimeCtrlManager.IsSwitchOpen(FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
local isOpen = ActTimeCtrlManager.IsSwitchOpen(FUNCTION_OPEN_TYPE.JumpServer_HightLadder)
|
||||||
if isOpen then
|
if isOpen then
|
||||||
|
@ -316,7 +386,7 @@ function this.TimeUpdate()
|
||||||
-- if leftTime <= 0 then
|
-- if leftTime <= 0 then
|
||||||
-- this.RefreshTopMatchShow()
|
-- this.RefreshTopMatchShow()
|
||||||
-- end
|
-- end
|
||||||
-- this.TopMatch_SeasonTime.text = string.format(Language[10090], TimeToHMS(leftTime))
|
-- this.TopMatch_SeasonTime.text = string.format("(剩余时间:%s)", TimeToHMS(leftTime))
|
||||||
-- else
|
-- else
|
||||||
-- if startTime then
|
-- if startTime then
|
||||||
-- local leftTime = startTime - GetTimeStamp()
|
-- local leftTime = startTime - GetTimeStamp()
|
||||||
|
@ -324,18 +394,18 @@ function this.TimeUpdate()
|
||||||
-- this.RefreshTopMatchShow()
|
-- this.RefreshTopMatchShow()
|
||||||
-- this.TopMatch_SeasonTime.text = ""
|
-- this.TopMatch_SeasonTime.text = ""
|
||||||
-- else
|
-- else
|
||||||
-- this.TopMatch_SeasonTime.text = string.format(Language[10091], TimeToHMS(leftTime))
|
-- this.TopMatch_SeasonTime.text = string.format("(即将开始:%s)", TimeToHMS(leftTime))
|
||||||
-- end
|
-- end
|
||||||
-- else
|
-- else
|
||||||
-- this.RefreshTopMatchShow()
|
-- this.RefreshTopMatchShow()
|
||||||
-- this.TopMatch_SeasonTime.text = ""
|
-- this.TopMatch_SeasonTime.text = ""
|
||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
local leftTime=JumpServerManager.GetHightLadderDataEndTime() - GetTimeStamp()
|
local leftTime = JumpServerManager.GetHightLadderDataEndTime() - GetTimeStamp()
|
||||||
if leftTime <= 0 then
|
if leftTime <= 0 then
|
||||||
this.RefreshTopMatchShow()
|
this.RefreshTopMatchShow()
|
||||||
end
|
end
|
||||||
this.TopMatch_SeasonTime.text = string.format(Language[10090], TimeToHMS(leftTime))
|
this.TopMatch_SeasonTime.text = string.format(Language[10102], TimeToHMS(leftTime))
|
||||||
else
|
else
|
||||||
-- local startTime, endTime = ArenaTopMatchManager.GetTopMatchTime()
|
-- local startTime, endTime = ArenaTopMatchManager.GetTopMatchTime()
|
||||||
-- if startTime then
|
-- if startTime then
|
||||||
|
@ -345,7 +415,14 @@ function this.TimeUpdate()
|
||||||
-- this.TopMatch_Lock_Time.text = ""
|
-- this.TopMatch_Lock_Time.text = ""
|
||||||
-- end
|
-- end
|
||||||
-- this.TopMatch_Lock_Time.gameObject:SetActive(false)
|
-- this.TopMatch_Lock_Time.gameObject:SetActive(false)
|
||||||
|
end
|
||||||
|
|
||||||
|
local isOpen = ActTimeCtrlManager.IsSwitchOpen(FUNCTION_OPEN_TYPE.JumpServer_YuXu)
|
||||||
|
if isOpen then
|
||||||
|
local yuxuLeft = WorldArenaManager.GetLeftTime()
|
||||||
|
this.yxld_SeasonTime.text = string.format(Language[10102], TimeToHMS(yuxuLeft))
|
||||||
|
else
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -358,6 +435,8 @@ function ArenaTypePanel:OnDestroy()
|
||||||
this.spLoader:Destroy()
|
this.spLoader:Destroy()
|
||||||
ClearRedPointObject(RedPointType.Arena_Type_Normal, this.btnArenaRedpot)
|
ClearRedPointObject(RedPointType.Arena_Type_Normal, this.btnArenaRedpot)
|
||||||
ClearRedPointObject(RedPointType.JumpServer_HightLadder, this.TopMatch_Red)
|
ClearRedPointObject(RedPointType.JumpServer_HightLadder, this.TopMatch_Red)
|
||||||
|
ClearRedPointObject(RedPointType.WorldArena_reward, this.yxld_Redpot)
|
||||||
|
|
||||||
-- SubUIManager.Close(this.UpView)
|
-- SubUIManager.Close(this.UpView)
|
||||||
if this.TimeCounter then
|
if this.TimeCounter then
|
||||||
this.TimeCounter:Stop()
|
this.TimeCounter:Stop()
|
||||||
|
@ -365,4 +444,4 @@ function ArenaTypePanel:OnDestroy()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return ArenaTypePanel
|
return ArenaTypePanel
|
||||||
|
|
Loading…
Reference in New Issue