miduo_client/Assets/ManagedResources/~Lua/Modules/Arena/View/ArenaView.lua

447 lines
19 KiB
Lua
Raw Normal View History

2021-04-21 13:12:04 +08:00
local ArenaView = {}
2020-05-09 13:31:21 +08:00
local this = ArenaView
2020-07-07 13:29:40 +08:00
local rewardBoxBtn = {}
2020-10-19 18:52:36 +08:00
local myRank
2020-07-20 16:01:16 +08:00
local arenaBattleReward = ConfigManager.GetConfig(ConfigName.ArenaBattleReward)
2020-10-19 18:52:36 +08:00
local arenaReward = ConfigManager.GetConfig(ConfigName.ArenaReward)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
2020-05-09 13:31:21 +08:00
--初始化组件(用于子类重写)
function ArenaView:InitComponent()
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2020-10-19 18:52:36 +08:00
this.DailyReward = Util.GetGameObject(self.gameObject, "finalTarget/Reward/dailyReward"):GetComponent("Text")
this.SeasonReward = Util.GetGameObject(self.gameObject, "finalTarget/Reward/seasonReward"):GetComponent("Text")
this.content = Util.GetGameObject(self.gameObject, "content")
this.ArenaName = Util.GetGameObject(self.gameObject, "nameImg/name")
this.ArenaTime = Util.GetGameObject(self.gameObject, "timelab")
this.Integral = Util.GetGameObject(self.gameObject, "myScore/integral")
2020-05-09 13:31:21 +08:00
2020-07-20 11:28:19 +08:00
this.FormationBtn = Util.GetGameObject(self.gameObject, "formationBtn")
2020-07-07 13:29:40 +08:00
--this.DiffDemons = {}
--for i = 1, 3 do
-- table.insert(this.DiffDemons, Util.GetGameObject(self.gameObject, "diffdemons/icon_"..i))
--end
2020-05-09 13:31:21 +08:00
this.Demons = {}
for i = 1, 6 do
2020-07-07 13:29:40 +08:00
table.insert(this.Demons, Util.GetGameObject(self.gameObject, "defendbox/Demons/heroPro (" .. i .. ")"))
2020-05-09 13:31:21 +08:00
end
this.Enemys = {}
2020-10-16 19:36:21 +08:00
for i = 1, 4 do
2020-05-09 13:31:21 +08:00
table.insert(this.Enemys, Util.GetGameObject(self.gameObject, "challengebox/enemy_"..i))
end
2020-10-19 18:52:36 +08:00
this.RecordBtn = Util.GetGameObject(self.gameObject, "rightUp/record")
this.RefreshBtn = Util.GetGameObject(self.gameObject, "refresh")
2020-10-19 18:52:36 +08:00
this.RewardBtn = Util.GetGameObject(self.gameObject, "rightUp/reward")
this.StoreBtn = Util.GetGameObject(self.gameObject, "rightUp/store")
this.sortBtn = Util.GetGameObject(self.gameObject, "rightUp/sortBtn")
this.helpBtn = Util.GetGameObject(self.gameObject, "rightUp/helpBtn")
2020-05-09 13:31:21 +08:00
this.helpPosition=this.helpBtn:GetComponent("RectTransform").localPosition
this.myRank=Util.GetGameObject(self.gameObject,"MyRank")
this.rank=Util.GetGameObject(this.myRank,"Rank"):GetComponent("Text")
this.power=Util.GetGameObject(this.myRank,"Power"):GetComponent("Text")
--this.formationPower=Util.GetGameObject(self.gameObject,"defendbox/FormationPower/Text"):GetComponent("Text")
2020-07-07 13:29:40 +08:00
this.effect = Util.GetGameObject(self.gameObject, "bg/UI_effect_ArenaMainPanel_particle")
--宝箱部分
this.progressImage = Util.GetGameObject(self.gameObject, "finalTarget/progressbar/progress"):GetComponent("Image")
2020-07-20 11:28:19 +08:00
this.progressTipText = Util.GetGameObject(self.gameObject, "finalTarget/Text (1)"):GetComponent("Text")
2020-07-07 13:29:40 +08:00
rewardBoxBtn = {}
2020-10-19 20:10:53 +08:00
for i = 1, 5 do
2020-07-07 13:29:40 +08:00
rewardBoxBtn[i] = Util.GetGameObject(self.gameObject, "finalTarget/rewardProgress/rewardBoxBtn (" .. i .. ")")
2020-07-20 16:01:16 +08:00
rewardBoxBtn[i].transform.localPosition = Vector3.New(arenaBattleReward[i].Position[1], arenaBattleReward[i].Position[2] ,0)
2020-07-07 13:29:40 +08:00
end
this.freeTimes = Util.GetGameObject(self.gameObject, "count/text"):GetComponent("Text")
2020-05-09 13:31:21 +08:00
end
--绑定事件(用于子类重写)
function ArenaView:BindEvent()
-- 防守编队
Util.AddClick(this.FormationBtn, function()
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ARENA) then
2021-03-12 14:31:52 +08:00
PopupTipPanel.ShowTip(Language[10075])
2020-05-09 13:31:21 +08:00
return
end
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.ARENA_DEFEND)
end)
-- 挑战按钮
for i, enemy in ipairs(this.Enemys) do
local challengeBtn = Util.GetGameObject(enemy, "challenge")
Util.AddClick(challengeBtn, function()
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ARENA) then
2021-03-12 14:31:52 +08:00
PopupTipPanel.ShowTip(Language[10075])
2020-05-09 13:31:21 +08:00
return
end
-- 只在活动时间范围内可点
if ArenaManager.GetLeftTime() > 0 then
-- 添加次数限制
local leftTimes = ArenaManager.GetArenaChallengeTimes()
if leftTimes <= 0 then
local itemId, needNum = ArenaManager.GetArenaChallengeCost()
local haveNum = BagManager.GetItemCountById(itemId)
if haveNum < needNum then
UIManager.OpenPanel(UIName.QuickPurchasePanel, { type = UpViewRechargeType.ChallengeTicket })
2021-03-12 14:31:52 +08:00
PopupTipPanel.ShowTip(Language[10078])
2020-05-09 13:31:21 +08:00
return
end
end
-- 敌方数据获取
local EnemyList = ArenaManager.GetEnemyList()
if EnemyList[i] then
2020-07-07 13:29:40 +08:00
--直接主线阵容进战斗
-- 请求开始挑战
local isSkip = 0--ArenaManager.IsSkipFight() and 1 or 0
ArenaManager.RequestArenaChallenge(i, isSkip)
2020-05-09 13:31:21 +08:00
end
else
2021-03-12 14:31:52 +08:00
PopupTipPanel.ShowTip(Language[10092])
2020-05-09 13:31:21 +08:00
end
end)
end
2020-07-20 11:28:19 +08:00
--排行
Util.AddClick(this.sortBtn, function()
2020-07-20 15:34:30 +08:00
UIManager.OpenPanel(UIName.RankingSingleListPanel,rankKingList[6])
2020-07-20 11:28:19 +08:00
end)
2020-05-09 13:31:21 +08:00
-- 刷新按钮
Util.AddClick(this.RefreshBtn, function()
2020-09-25 21:19:01 +08:00
PlaySoundWithoutClick("UI_refresh")
2020-05-09 13:31:21 +08:00
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ARENA) then
2021-03-12 14:31:52 +08:00
PopupTipPanel.ShowTip(Language[10075])
2020-05-09 13:31:21 +08:00
return
end
ArenaManager.RequestNewArenaEnemy()
end)
-- 记录按钮
Util.AddClick(this.RecordBtn, function()
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ARENA) then
2021-03-12 14:31:52 +08:00
PopupTipPanel.ShowTip(Language[10075])
2020-05-09 13:31:21 +08:00
return
end
UIManager.OpenPanel(UIName.ArenaRecordPopup)
ResetServerRedPointStatus(RedPointType.Arena_Record)
end)
-- 帮助按钮
Util.AddClick(this.helpBtn, function()
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.Arena,this.helpPosition.x,this.helpPosition.y)
end)
2020-10-16 19:36:21 +08:00
-- 奖励按钮
Util.AddClick(this.RewardBtn, function()
2020-10-19 18:52:36 +08:00
UIManager.OpenPanel(UIName.GeneralRankRewardPanel,3,myRank)
2020-10-16 19:36:21 +08:00
end)
--商店按钮
Util.AddClick(this.StoreBtn, function()
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ARENA) then
2021-03-12 14:31:52 +08:00
PopupTipPanel.ShowTip(Language[10075])
2020-10-16 19:36:21 +08:00
return
end
2020-10-19 18:52:36 +08:00
JumpManager.GoJump(20010)
2020-10-16 19:36:21 +08:00
end)
2020-05-09 13:31:21 +08:00
end
--添加事件监听(用于子类重写)
function ArenaView:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Formation.OnFormationChange, this.RefreshDefendFormation)
Game.GlobalEvent:AddEvent(GameEvent.Arena.OnBaseDataChange, this.RefreshBaseData)
Game.GlobalEvent:AddEvent(GameEvent.Arena.OnBaseDataChange, this.RefreshEnemyData)
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.RefreshEnemyData)
Game.GlobalEvent:AddEvent(GameEvent.Arena.OnRankDataChange, this.RefreshRankInfo)
-- 绑定红点
BindRedPointObject(RedPointType.Arena_Record, Util.GetGameObject(self.gameObject, "record/redpot"))
end
--移除事件监听(用于子类重写)
function ArenaView:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Formation.OnFormationChange, this.RefreshDefendFormation)
Game.GlobalEvent:RemoveEvent(GameEvent.Arena.OnBaseDataChange, this.RefreshBaseData)
Game.GlobalEvent:RemoveEvent(GameEvent.Arena.OnBaseDataChange, this.RefreshEnemyData)
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.RefreshEnemyData)
Game.GlobalEvent:RemoveEvent(GameEvent.Arena.OnRankDataChange, this.RefreshRankInfo)
-- 清除红点
ClearRedPointObject(RedPointType.Arena_Record)
end
--界面打开时调用(用于子类重写)
function ArenaView:OnOpen( sortingOrder,_parent)
2020-09-25 21:19:01 +08:00
this.sortingOrder = sortingOrder or 0
this.parent = _parent
2020-09-25 21:19:01 +08:00
2020-05-09 13:31:21 +08:00
this.RefreshBaseData()
this.RefreshEnemyData()
this.RefreshDefendFormation()
this.StartCountTime()
this.RefreshRankInfo()
2020-07-07 13:29:40 +08:00
this.ShowRewardBoxProgressData()
2020-05-09 13:31:21 +08:00
-- 延迟刷新一遍数据,避免来回切换页签,向服务器不停发数据
if this.delayRefresh then return end
--
NetManager.RequestBaseArenaData()
-- 刷新排名数据
ArenaManager.RequestNextPageRank(true)
this.delayRefresh = Timer.New(function()
this.delayRefresh = nil
end, 1)
this.delayRefresh:Start()
2020-10-19 18:52:36 +08:00
this.RefreshReward()
2020-05-09 13:31:21 +08:00
end
-- 刷新排名信息
function this.RefreshRankInfo()
local _, myRankInfo = ArenaManager.GetRankInfo()
2020-10-19 18:52:36 +08:00
myRank = myRankInfo.personInfo.rank
2020-05-09 13:31:21 +08:00
if myRank<0 then
2021-03-12 14:31:52 +08:00
myRank=Language[10036]
2020-05-09 13:31:21 +08:00
end
2021-03-12 14:31:52 +08:00
this.rank.text=Language[10093]..myRank
2020-10-19 18:52:36 +08:00
this.power.text=myRankInfo.personInfo.totalForce
2020-10-20 02:49:25 +08:00
-- 刷新奖励显示
this.RefreshReward()
2020-10-19 18:52:36 +08:00
end
-- 刷新奖励信息
function this.RefreshReward()
if tonumber(myRank) and tonumber(myRank) > 0 then
2020-10-19 19:34:48 +08:00
for k,value in ConfigPairs(arenaReward) do
2020-10-19 18:52:36 +08:00
if myRank <= 3 then
2021-03-12 14:31:52 +08:00
this.DailyReward.text = Language[10094]..GetLanguageStrById(itemConfig[arenaReward[myRank].DailyReward[1][1]].Name).."<color=green>+"..arenaReward[myRank].DailyReward[1][2].."</color>"..
2021-01-26 17:08:39 +08:00
GetLanguageStrById(itemConfig[arenaReward[myRank].DailyReward[2][1]].Name).."<color=green>+"..arenaReward[myRank].DailyReward[2][2].."</color>"
2021-03-12 14:31:52 +08:00
this.SeasonReward.text = Language[10095]..GetLanguageStrById(itemConfig[arenaReward[myRank].SeasonReward[1][1]].Name).."<color=green>+"..arenaReward[myRank].SeasonReward[1][2].."</color>"..
2021-01-26 17:08:39 +08:00
GetLanguageStrById(itemConfig[arenaReward[myRank].SeasonReward[2][1]].Name).."<color=green>+"..arenaReward[myRank].SeasonReward[2][2].."</color>"
2020-10-19 18:52:36 +08:00
else
2020-10-19 19:34:48 +08:00
-- LogRed("myrank"..myRank.." value.MinRank:"..tostring(value.MinRank).." value.MinRank:"..tostring(value.MaxRank))
2020-10-19 18:52:36 +08:00
if myRank>=value.MinRank and myRank <= value.MaxRank then
2021-03-12 14:31:52 +08:00
this.DailyReward.text = Language[10094]..GetLanguageStrById(itemConfig[value.DailyReward[1][1]].Name).."<color=green>+"..value.DailyReward[1][2].."</color>"..GetLanguageStrById(itemConfig[value.DailyReward[2][1]].Name).."<color=green>+"..value.DailyReward[2][2].."</color>"
this.SeasonReward.text = Language[10095]..GetLanguageStrById(itemConfig[value.SeasonReward[1][1]].Name).."<color=green>+"..value.SeasonReward[1][2].."</color>"..GetLanguageStrById(itemConfig[value.SeasonReward[2][1]].Name).."<color=green>+"..value.SeasonReward[2][2].."</color>"
2020-10-19 18:52:36 +08:00
end
end
end
else
2021-03-12 14:31:52 +08:00
this.DailyReward.text = Language[10096]
this.SeasonReward.text = Language[10097]
2020-10-19 18:52:36 +08:00
end
2020-05-09 13:31:21 +08:00
end
-- 刷新防守编队显示
function this.RefreshDefendFormation()
local formation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ARENA_DEFEND)
for i, demon in ipairs(this.Demons) do
2021-04-21 13:12:04 +08:00
Util.GetGameObject(demon, "frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetQuantityImageByquality(1))
2020-07-07 13:29:40 +08:00
Util.GetGameObject(demon, "hero"):SetActive(false)
end
for i, hero in ipairs(formation.teamHeroInfos) do
local heroData = HeroManager.GetSingleHeroData(hero.heroId)
local heroGo = Util.GetGameObject(this.Demons[hero.position], "hero")
heroGo:SetActive(true)
Util.GetGameObject(heroGo, "lvbg/levelText"):GetComponent("Text").text = heroData.lv
2021-04-21 13:12:04 +08:00
SetHeroStars(this.spLoader, Util.GetGameObject(heroGo, "starGrid"), heroData.star,1)
2020-07-07 13:29:40 +08:00
local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, heroData.id)
2021-04-21 13:12:04 +08:00
Util.GetGameObject(this.Demons[hero.position], "frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetQuantityImageByquality(heroConfig.Quality, heroData.star))
Util.GetGameObject(heroGo, "icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(heroData.icon)
Util.GetGameObject(heroGo, "proIcon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName))
2020-05-09 13:31:21 +08:00
end
end
-- 刷新基础数据显示
function this.RefreshBaseData()
this.ArenaName:GetComponent("Text").text = ArenaManager.GetArenaName()
local baseData = ArenaManager.GetArenaBaseData()
local allNums = baseData.successNums + baseData.failNums
local rate = 0
if allNums ~= 0 then
rate = math.floor(baseData.successNums / allNums * 100)
end
2021-03-12 14:31:52 +08:00
this.Integral:GetComponent("Text").text = Language[10098]..baseData.score
2020-05-09 13:31:21 +08:00
end
-- 开始计时
function this.StartCountTime()
2020-10-19 18:52:36 +08:00
local dayText = Util.GetGameObject(this.ArenaTime,"day"):GetComponent("Text")
local hourText = Util.GetGameObject(this.ArenaTime,"hour"):GetComponent("Text")
local minText = Util.GetGameObject(this.ArenaTime,"min"):GetComponent("Text")
local secText = Util.GetGameObject(this.ArenaTime,"sec"):GetComponent("Text")
local second = ArenaManager.GetLeftTime()
2020-05-09 13:31:21 +08:00
if this.TimeCounter then return end
local function _TimeUpdate()
2020-10-19 18:52:36 +08:00
local day = math.floor(second / (24 * 3600))
local minute = math.floor(second / 60) % 60
local sec = second % 60
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
dayText.text = day
minText.text = minute
secText.text = sec
hourText.text = hour
second = second -1
2021-04-30 11:49:45 +08:00
if second <= 0 then
if this.parent then
this.parent:ClosePanel()
else
UIManager.OpenPanel(UIName.MainPanel)
end
if this.TimeCounter then
this.TimeCounter:Stop()
this.TimeCounter = nil
end
end
2020-05-09 13:31:21 +08:00
end
_TimeUpdate()
this.TimeCounter = Timer.New(_TimeUpdate, 1, -1, true)
this.TimeCounter:Start()
end
-- 刷新敌人列表
function this.RefreshEnemyData()
2020-09-25 21:19:01 +08:00
local prefab = {}
2020-05-09 13:31:21 +08:00
local leftTimes = ArenaManager.GetArenaChallengeTimes()
this.freeTimes.text = string.format("%s次", math.max(leftTimes, 0))
2020-05-09 13:31:21 +08:00
local EnemyList = ArenaManager.GetEnemyList()
2020-09-25 21:19:01 +08:00
table.sort(EnemyList, function(a,b) return a.personInfo.score > b.personInfo.score end)
2020-05-09 13:31:21 +08:00
for i, node in ipairs(this.Enemys) do
2020-09-25 21:19:01 +08:00
node:SetActive(false)
if EnemyList[i] then
table.insert(prefab,node)
2020-05-09 13:31:21 +08:00
local lv_name = Util.GetGameObject(node, "name")
2021-02-25 13:47:04 +08:00
local integral = Util.GetGameObject(node, "integralTip")
-- Util.GetGameObject(node, "power"):SetActive(false)
-- Util.GetGameObject(node, "integral"):SetActive(false)
2021-02-25 13:47:04 +08:00
local power = Util.GetGameObject(node, "powerTip")
2020-05-09 13:31:21 +08:00
local headroot = Util.GetGameObject(node, "headroot")
local bg = Util.GetGameObject(node, "bg")
local btnText = Util.GetGameObject(node, "challenge/Text"):GetComponent("Text")
local btnItem = Util.GetGameObject(node, "challenge/item"):GetComponent("Image")
local btnItemNum = Util.GetGameObject(node, "challenge/item/num"):GetComponent("Text")
2021-05-17 15:48:41 +08:00
lv_name:GetComponent("Text").text = PracticeManager.SetNameColor(JingJiShouWeiToEn(EnemyList[i].personInfo.name),EnemyList[i].personInfo.practiceLevel)
2021-03-12 14:31:52 +08:00
integral:GetComponent("Text").text = Language[11693].. EnemyList[i].personInfo.score
power:GetComponent("Text").text = Language[12179]..EnemyList[i].personInfo.totalForce
2020-05-09 13:31:21 +08:00
btnText.gameObject:SetActive(leftTimes > 0)
2021-03-12 14:31:52 +08:00
btnText.text = Language[10099]
2020-05-09 13:31:21 +08:00
btnItem.gameObject:SetActive(leftTimes <= 0)
if leftTimes <= 0 then
local itemId, needNum = ArenaManager.GetArenaChallengeCost()
local haveNum = BagManager.GetItemCountById(itemId)
2021-04-21 13:12:04 +08:00
btnItem.sprite = SetIcon(this.spLoader, itemId)
2020-05-09 13:31:21 +08:00
btnItemNum.text = "×"..needNum
btnItemNum.color = haveNum < needNum and UIColor.NOT_ENOUGH_RED or UIColor.BTN_TEXT
end
if not this.HeadList then
this.HeadList = {}
end
if not this.HeadList[i] then
this.HeadList[i] = SubUIManager.Open(SubUIConfig.PlayerHeadView, headroot.transform)
end
this.HeadList[i]:Reset()
this.HeadList[i]:SetHead(EnemyList[i].personInfo.head)
this.HeadList[i]:SetFrame(EnemyList[i].personInfo.headFrame)
this.HeadList[i]:SetLevel(EnemyList[i].personInfo.level)
this.HeadList[i]:SetScale(Vector3.one*0.8)
2020-09-25 21:19:01 +08:00
this.HeadList[i]:SetLayer(this.sortingOrder)
this.HeadList[i]:SetEffectScale(0.85)
2020-05-09 13:31:21 +08:00
Util.AddOnceClick(bg, function()
UIManager.OpenPanel(UIName.PlayerInfoPopup, EnemyList[i].personInfo.uid, PLAYER_INFO_VIEW_TYPE.ARENA)
2020-09-25 21:19:01 +08:00
end)
end
2020-05-09 13:31:21 +08:00
end
2020-09-25 21:19:01 +08:00
SecTorPlayAnim(prefab)
2020-05-09 13:31:21 +08:00
end
2020-07-07 13:29:40 +08:00
--显示上边积分奖励
function this.ShowRewardBoxProgressData()
local baseData = ArenaManager.GetArenaBaseData()
local allNums = baseData.successNums + baseData.failNums
local allBoxGetState = ArenaManager.GetHadTakeBoxData()
local maxNum = 0
for _, configInfo in ConfigPairs(ConfigManager.GetConfig(ConfigName.ArenaBattleReward)) do
if configInfo.BattleTimes > maxNum then
maxNum = configInfo.BattleTimes
end
end
for i = 1, #rewardBoxBtn do
if arenaBattleReward[i] then
local state = 1--1 未完成 2 未领取 3 已完成allNums >= arenaBattleReward[i].BattleTimes and false
if allNums < arenaBattleReward[i].BattleTimes then
state = 1
elseif allNums >= arenaBattleReward[i].BattleTimes and not allBoxGetState[i] then
state = 2
else
state = 3
end
Util.GetGameObject(rewardBoxBtn[i], "redPoint"):SetActive(state == 2)
2021-03-12 14:31:52 +08:00
Util.GetGameObject(rewardBoxBtn[i], "Text"):GetComponent("Text").text = arenaBattleReward[i].BattleTimes..Language[10048]
2020-07-07 13:29:40 +08:00
Util.GetGameObject(rewardBoxBtn[i], "getFinish"):SetActive(state == 3)
Util.AddOnceClick(rewardBoxBtn[i], function()
if state == 1 then
2021-03-12 14:31:52 +08:00
UIManager.OpenPanel(UIName.BoxRewardShowPopup,arenaBattleReward[i].Reward,rewardBoxBtn[i].transform.localPosition.x,-400,arenaBattleReward[i].BattleTimes .. Language[10100])
2020-07-07 13:29:40 +08:00
return
elseif state == 3 then
2021-03-12 14:31:52 +08:00
PopupTipPanel.ShowTip(Language[10101])
2020-07-07 13:29:40 +08:00
return
elseif state == 2 then
NetManager.TakeArenaBattleRewardRequest(i, function(msg)
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1,function ()
this.ShowRewardBoxProgressData()
CheckRedPointStatus(RedPointType.Arena_Reward)
2020-07-07 13:29:40 +08:00
end)
end)
end
end)
end
end
this.progressImage.fillAmount = allNums/maxNum
2021-03-12 14:31:52 +08:00
this.progressTipText.text = Language[10102]..allNums..Language[10048]
2020-07-07 13:29:40 +08:00
end
2020-05-09 13:31:21 +08:00
-- 层级改变回调
local orginLayer = 0
function ArenaView:OnSortingOrderChange(sort)
Util.AddParticleSortLayer(this.effect, sort - orginLayer)
2020-09-25 21:19:01 +08:00
--
for i, node in ipairs(this.Enemys) do
if this.HeadList and this.HeadList[i] then
this.HeadList[i]:SetLayer(sort)
end
end
2020-05-09 13:31:21 +08:00
orginLayer = sort
end
--界面关闭时调用(用于子类重写)
function ArenaView:OnClose()
if this.TimeCounter then
this.TimeCounter:Stop()
this.TimeCounter = nil
end
end
function ArenaView:OnDestroy()
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
2020-05-09 13:31:21 +08:00
for _, head in ipairs(this.HeadList) do
head:Recycle()
end
this.HeadList= nil
end
2021-04-21 13:12:04 +08:00
return ArenaView