miduo_client/Assets/ManagedResources/~Lua/Modules/Popup/RewardItemPopup.lua

498 lines
20 KiB
Lua
Raw Normal View History

2020-08-25 15:46:38 +08:00
require("Base/BasePanel")
2020-05-09 13:31:21 +08:00
RewardItemPopup = Inherit(BasePanel)
local this = RewardItemPopup
local userLevelData = ConfigManager.GetConfig(ConfigName.PlayerLevelConfig)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
2021-04-27 20:48:45 +08:00
local itemListPrefab = {}
2021-04-25 17:40:49 +08:00
-- local itemListPrefabMax
2020-05-09 13:31:21 +08:00
local func
2020-05-15 16:52:35 +08:00
local bagType=0 --1 正常背包 2 临时背包 3 公会车迟显示
2020-05-09 13:31:21 +08:00
--需要显示的小组件类型
-- 1 -- > 界面显示升级
-- 2 -- > 显示地图自由探索按钮
local compShowType = 0
local sortingOrderNum = 0
local callList = Stack.New()
local isPopGetSSR = false
local isOpenGeiSSRAvtivity = 0--五星成长礼拍脸
local isOpenGeiSSRAvtivityTime
local isPlayerAniEnd = true
local itemDataList
2020-07-16 10:49:01 +08:00
local showHero = 1
2021-01-06 16:12:54 +08:00
local isBackBattle = false
2020-05-09 13:31:21 +08:00
--初始化组件(用于子类重写)
--此界面无奈做了两套显示逻辑一个是掉落小于等于25时背景根据元素数量做拉伸状态 另一个是元素大于25做界面做可滑动
function RewardItemPopup:InitComponent()
this.btnBack = Util.GetGameObject(self.gameObject, "btnBack")
this.dropPrefab = Util.GetGameObject(self.gameObject, "frame")
--第一种显示
this.ScrollView = Util.GetGameObject(self.gameObject, "ScrollView")
2021-04-25 17:40:49 +08:00
this.dropGrid= Util.GetGameObject(self.gameObject, "ScrollView/Content/grid")
2021-04-27 13:48:17 +08:00
this.dropGridArena= Util.GetGameObject(self.gameObject, "ScrollView/Content/grid2")
this.dropGrid2= Util.GetGameObject(self.gameObject, "ScrollView/Content/grid2/scorll/grid")
2020-05-09 13:31:21 +08:00
--关卡等级经验
2021-04-25 17:40:49 +08:00
this.lvAndExpGo=Util.GetGameObject(self.gameObject, "ScrollView/Content/bottom/lvAndExpGo")
this.lv=Util.GetGameObject(self.gameObject, "ScrollView/Content/bottom/lvAndExpGo/lv"):GetComponent("Text")
this.exp=Util.GetGameObject(self.gameObject, "ScrollView/Content/bottom/lvAndExpGo/exp"):GetComponent("Slider")
this.expText=Util.GetGameObject(self.gameObject, "ScrollView/Content/bottom/lvAndExpGo/exp/Text"):GetComponent("Text")
this.lvUpImage=Util.GetGameObject(self.gameObject, "ScrollView/Content/bottom/lvAndExpGo/lvUpImage")
2020-05-09 13:31:21 +08:00
-- 地图探索按钮
2021-04-25 17:40:49 +08:00
this.btnMapBack = Util.GetGameObject(self.gameObject, "ScrollView/Content/bottom/btnBack")
2020-05-09 13:31:21 +08:00
-- 战斗结果按钮
2021-04-25 17:40:49 +08:00
this.btnResult = Util.GetGameObject(self.gameObject, "ScrollView/Content/bottom/btnResult")
this.btnBattleBack = Util.GetGameObject(self.gameObject, "ScrollView/Content/bottom/btnBattleBack")
2020-12-30 18:08:44 +08:00
-- 战斗回放按钮
2020-05-09 13:31:21 +08:00
-- 任意位置继续
this.btnGoOn = Util.GetGameObject(self.gameObject, "btnBack/Image")
2020-05-15 16:52:35 +08:00
--车迟斗法 显示
2021-04-25 17:40:49 +08:00
this.guildCarDelay = Util.GetGameObject(self.gameObject, "ScrollView/Content/Show/guildCarDelay")
2020-05-15 16:52:35 +08:00
this.guildCarDelaysoreNum = Util.GetGameObject(this.guildCarDelay.gameObject, "soreNum"):GetComponent("Text")
this.guildCarDelayhurtNum = Util.GetGameObject(this.guildCarDelay.gameObject, "hurtNum"):GetComponent("Text")
--公会十绝阵显示
2021-04-25 17:40:49 +08:00
this.guildDeathPos=Util.GetGameObject(self.gameObject,"ScrollView/Content/Show/guildDeathPos")
2020-05-15 16:52:35 +08:00
this.guildDeathPos_CurScore=Util.GetGameObject(this.guildDeathPos,"curScore/num"):GetComponent("Text")
this.guildDeathPos_State=Util.GetGameObject(this.guildDeathPos,"curScore/state"):GetComponent("Image")
this.guildDeathPos_MaxScore=Util.GetGameObject(this.guildDeathPos,"maxScore/num"):GetComponent("Text")
2020-06-18 20:39:29 +08:00
--大闹天功显示
2021-04-25 17:40:49 +08:00
this.expeditionGo=Util.GetGameObject(self.gameObject,"ScrollView/Content/Show/expeditionGo")
2020-08-20 20:05:38 +08:00
--公会副本
2021-04-25 17:40:49 +08:00
this.guildTranscript=Util.GetGameObject(self.gameObject,"ScrollView/Content/Show/guildTranscript")
2020-08-20 20:05:38 +08:00
this.guildTranscript_CurScore=Util.GetGameObject(this.guildTranscript,"curScore/num"):GetComponent("Text")
2021-04-25 17:40:49 +08:00
--踏碎凌霄
this.tasuilingxiao=Util.GetGameObject(self.gameObject,"ScrollView/Content/Show/tasuilingxiao")
this.tasuilingxiao_CurScore=Util.GetGameObject(this.tasuilingxiao,"curScore/num"):GetComponent("Text")
this.tasuilingxiao_State=Util.GetGameObject(this.tasuilingxiao,"curScore/state"):GetComponent("Image")
this.tasuilingxiao_MaxScore=Util.GetGameObject(this.tasuilingxiao,"maxScore/num"):GetComponent("Text")
2021-04-27 21:28:48 +08:00
this.noRewardText = Util.GetGameObject(this.tasuilingxiao,"Text")
2020-05-09 13:31:21 +08:00
end
--绑定事件(用于子类重写)
function RewardItemPopup:BindEvent()
Util.AddClick(this.btnBack, function()
if isPlayerAniEnd then
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
if PlayerManager.IsGetFiveStarHero then--and OperatingManager.IsShowFiveStarPatch then
Game.GlobalEvent:DispatchEvent(GameEvent.PatFace.PatFaceSend, FacePanelType.GrowGift, 5)
PlayerManager.IsGetFiveStarHero = false
end
2020-05-09 13:31:21 +08:00
end
end)
Util.AddClick(this.btnMapBack, function ()
self:ClosePanel()
end)
Util.AddClick(this.btnResult, function ()
UIManager.OpenPanel(UIName.DamageResultPanel, 1)
end)
2020-12-30 18:08:44 +08:00
Util.AddClick(this.btnBattleBack, function ()
2021-01-06 16:12:54 +08:00
isBackBattle = true
2020-12-30 18:08:44 +08:00
BattleManager.BattleBackFun()
end)
2020-05-09 13:31:21 +08:00
end
--界面打开时调用(用于子类重写)
--bagType 1 正常背包 2 地图临时背包
--drop 后端掉落原始数据
--func 回调
2020-07-16 10:49:01 +08:00
2020-05-09 13:31:21 +08:00
function RewardItemPopup:OnOpen(...)
2021-04-27 20:48:45 +08:00
if #itemListPrefab > 0 then
for i = 1, #itemListPrefab do
destroy(itemListPrefab[i].gameObject)
end
end
itemListPrefab = {}
itemDataList = {}
2021-01-06 16:12:54 +08:00
isBackBattle = false
2020-05-09 13:31:21 +08:00
isPlayerAniEnd = true
isOpenGeiSSRAvtivity = 0
sortingOrderNum = self.sortingOrder
local args = {...}
local drop = args[1]
bagType=args[2]
func = args[3]
2020-07-16 10:49:01 +08:00
2020-05-09 13:31:21 +08:00
if args[4] then
compShowType = args[4]
end
2020-07-16 10:49:01 +08:00
if args[7] then
showHero = false
else
showHero = true
end
2020-05-09 13:31:21 +08:00
local haveRecord = BattleRecordManager.isHaveRecord()
this.btnResult:SetActive(haveRecord and args[5])
2021-04-26 17:12:39 +08:00
this.btnBattleBack:SetActive(haveRecord and args[5] and BattleManager.GetLastBattleType() ~= BATTLE_TYPE.MAP_FIGHT and not GuideManager.IsInMainGuide() and not MapManager.Mapping and BattleManager.GetLastBattleType() ~= BATTLE_TYPE.TASUILINGXIAO)
2021-01-18 15:11:27 +08:00
this.expeditionGo:SetActive(compShowType == 5)
2021-04-25 17:40:49 +08:00
this.guildDeathPos:SetActive(compShowType == 4)--十绝阵
2021-01-18 15:11:27 +08:00
this.guildTranscript:SetActive(compShowType == 6)
this.guildCarDelay:SetActive(compShowType == 3)
2021-04-25 17:40:49 +08:00
this.tasuilingxiao:SetActive(compShowType == 7)--踏碎凌霄
2021-04-27 21:28:48 +08:00
this.dropGrid:SetActive(false)
this.dropGridArena:SetActive(false)
2020-05-09 13:31:21 +08:00
-- 设置背景遮罩的显隐
2020-06-13 11:47:13 +08:00
local isHideBG = args[6]
2020-05-09 13:31:21 +08:00
this.btnBack:GetComponent("Image").color = Color.New(0, 0, 0, isHideBG and 0 or 0.8)
2020-05-15 16:52:35 +08:00
this.btnGoOn:SetActive(not isHideBG)
2021-04-27 13:48:17 +08:00
if compShowType == 3 then
2020-05-15 16:52:35 +08:00
this.GuildCarDelayShow()
this.guildCarDelay:SetActive(compShowType == 3)
2021-04-27 13:48:17 +08:00
elseif compShowType == 4 then
2020-05-15 16:52:35 +08:00
this.GuildDeathPosShow()
2021-04-27 13:48:17 +08:00
elseif compShowType == 6 then
2020-08-20 20:05:38 +08:00
this.GuildTranscriptShow()
2021-04-27 13:48:17 +08:00
elseif compShowType == 7 then--踏碎凌霄
this.TaSuiLingXiaoShow()
2020-08-20 20:05:38 +08:00
end
2021-04-27 13:48:17 +08:00
--如果没有掉落就return
if not drop or (#drop.itemlist < 1 and #drop.equipId < 1 and #drop.Hero < 1 and #drop.soulEquip < 1 and #drop.pokemon < 1) then
2021-04-27 13:48:17 +08:00
return
2021-04-25 15:07:36 +08:00
end
2021-04-27 13:48:17 +08:00
2020-05-09 13:31:21 +08:00
local starItemDataList=BagManager.GetItemListFromTempBag(drop)
2020-05-15 16:52:35 +08:00
-- LogError("获取宝物的数量:".. LengthOfTable(starItemDataList))
2020-05-09 13:31:21 +08:00
--做装备叠加特殊组拼数据
local equips = {}
for i = 1, #starItemDataList do
this.SetItemData2(starItemDataList[i])
if starItemDataList[i].itemType == 2 then--装备叠加
if equips[starItemDataList[i].sId] then
equips[starItemDataList[i].sId].num = equips[starItemDataList[i].sId].num + 1
else
equips[starItemDataList[i].sId] = starItemDataList[i]
equips[starItemDataList[i].sId].num = 1
end
end
end
itemDataList = {}
for i, v in pairs(equips) do
table.insert(itemDataList, v)
end
for i, v in pairs(starItemDataList) do
if starItemDataList[i].itemType ~= 2 then
table.insert(itemDataList, v)
end
end
2021-04-27 13:48:17 +08:00
LogGreen("Init #itemDataList:"..tostring(#itemDataList))
this.InitGrid()
2020-05-09 13:31:21 +08:00
if #itemDataList < 1 then
self:ClosePanel()
self:SelectCanPopUpBagMaxMessage()
2021-04-25 17:40:49 +08:00
else
2020-05-09 13:31:21 +08:00
self:SetItemShow(drop)
end
2021-04-27 13:48:17 +08:00
this.SetComPShowState(compShowType)--一些特殊显隐
2020-05-09 13:31:21 +08:00
SoundManager.PlaySound(SoundConfig.Sound_Reward)
this.ShowLvAndExp()
self:SelectCanPopUpBagMaxMessage()
end
2021-04-27 13:48:17 +08:00
function this.InitGrid()
2021-04-27 20:48:45 +08:00
this.dropGrid:SetActive(#itemDataList <= 25 )
this.dropGridArena:SetActive(#itemDataList > 25 )
-- LogYellow("itemListPrefab "..#itemListPrefab)
-- LogYellow("itemDataList "..#itemDataList)
for i = 1, #itemListPrefab do
itemListPrefab[i].gameObject:SetActive(false)
end
if #itemDataList <= 25 then
2021-04-27 13:48:17 +08:00
for i = 1, #itemDataList do --初始缓存<= 20
2021-04-27 20:48:45 +08:00
if not itemListPrefab[i] then
local view = SubUIManager.Open(SubUIConfig.ItemView, this.dropGrid.transform)
view.gameObject.name = "frame"..i
itemListPrefab[i] = view
end
2021-04-27 13:48:17 +08:00
end
else
for i = 1, #itemDataList do --初始缓存> 20
2021-04-27 20:48:45 +08:00
if not itemListPrefab[i] then
local view = SubUIManager.Open(SubUIConfig.ItemView, this.dropGrid2.transform)
view.gameObject.name = "frame"..i
itemListPrefab[i] = view
end
2021-04-27 13:48:17 +08:00
end
end
end
2020-05-09 13:31:21 +08:00
--一些元素的显隐
function this.SetComPShowState(type)
this.btnBack:GetComponent("Button").enabled = type ~= 2
2021-04-25 17:40:49 +08:00
this.ScrollView:SetActive(#itemDataList >= 1 )
2020-05-09 13:31:21 +08:00
this.lvAndExpGo:SetActive(type == 1)
this.btnMapBack:SetActive(type == 2)
2020-05-15 16:52:35 +08:00
this.guildCarDelay:SetActive(type == 3)
this.guildDeathPos:SetActive(type == 4)
2020-08-20 20:05:38 +08:00
this.guildTranscript:SetActive(type == 6)
2021-04-25 17:40:49 +08:00
this.tasuilingxiao:SetActive(type == 7)
2021-04-27 21:28:48 +08:00
if type == 7 then
this.noRewardText:SetActive(#itemDataList < 1)
end
2020-05-15 16:52:35 +08:00
end
function this.GuildCarDelayShow()
if GuildCarDelayManager.score and GuildCarDelayManager.hurt then
this.guildCarDelaysoreNum.text =GuildCarDelayManager.score
this.guildCarDelayhurtNum.text = GuildCarDelayManager.hurt
end
2020-05-09 13:31:21 +08:00
end
2020-05-15 16:52:35 +08:00
--十绝阵 挑战奖励掉落弹窗表现
function this.GuildDeathPosShow()
if DeathPosManager.damage and DeathPosManager.historyMax then
this.guildDeathPos_CurScore.text =DeathPosManager.damage
this.guildDeathPos_MaxScore.text = DeathPosManager.historyMax
2020-05-09 13:31:21 +08:00
2020-05-15 16:52:35 +08:00
local b=DeathPosManager.damage>DeathPosManager.historyMax or DeathPosManager.damage<DeathPosManager.historyMax
this.guildDeathPos_State.gameObject:SetActive(b)
if DeathPosManager.damage>DeathPosManager.historyMax then
this.guildDeathPos_State.sprite=Util.LoadSprite("r_hero_zhanlishangsheng_png")
elseif DeathPosManager.damage<DeathPosManager.historyMax then
this.guildDeathPos_State.sprite=Util.LoadSprite("r_hero_zhanlixiajiang_png")
2021-04-25 15:07:36 +08:00
end
end
end
--踏碎凌霄 挑战奖励掉落弹窗表现
2021-04-27 13:48:17 +08:00
function this.TaSuiLingXiaoShow()
2021-04-25 15:07:36 +08:00
if CommonActPageManager.TaSuiLingXiaoMsg then
local curDmg = CommonActPageManager.TaSuiLingXiaoMsg.damageVal
2021-04-26 16:46:03 +08:00
local maxDmg = CommonActPageManager.TaSuiLingXiaoHistoryDmg
2021-04-25 17:40:49 +08:00
this.tasuilingxiao_CurScore.text = curDmg
this.tasuilingxiao_MaxScore.text = maxDmg
2021-04-27 21:28:48 +08:00
this.noRewardText:SetActive(true)
2021-04-25 15:07:36 +08:00
local b = curDmg > maxDmg or curDmg < maxDmg
2021-04-25 17:40:49 +08:00
this.tasuilingxiao_State.gameObject:SetActive(b)
2021-04-25 15:07:36 +08:00
if curDmg > maxDmg then
2021-04-25 17:40:49 +08:00
this.tasuilingxiao_State.sprite=Util.LoadSprite("r_hero_zhanlishangsheng_png")
2021-04-25 15:07:36 +08:00
elseif curDmg < maxDmg then
2021-04-25 17:40:49 +08:00
this.tasuilingxiao_State.sprite=Util.LoadSprite("r_hero_zhanlixiajiang_png")
2020-05-15 16:52:35 +08:00
end
end
end
2020-08-20 20:05:38 +08:00
--公会副本
function this.GuildTranscriptShow()
if GuildTranscriptManager.damage then
this.guildTranscript_CurScore.text = GuildTranscriptManager.damage
end
end
2020-05-09 13:31:21 +08:00
--当前背包是否已满
function RewardItemPopup:SelectCanPopUpBagMaxMessage()
if(IndicationManager.canPopUpBagMaxMessage) then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[11507])
2020-05-09 13:31:21 +08:00
IndicationManager.canPopUpBagMaxMessage=false
elseif(IndicationManager.getRewardFromMailMessage)then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[11508])
2020-05-09 13:31:21 +08:00
IndicationManager.getRewardFromMailMessage=false
end
end
function RewardItemPopup:OnSortingOrderChange()
2021-04-27 17:50:26 +08:00
if not itemDataList or #itemDataList < 0 then
2020-05-09 13:31:21 +08:00
return
end
2021-04-27 16:46:39 +08:00
if #itemListPrefab > 0 then
for i = 1, #itemListPrefab do
2021-04-27 17:50:26 +08:00
if itemListPrefab[i] and itemDataList[i] then
2021-04-27 16:46:39 +08:00
local view = itemListPrefab[i]
local curItemData=itemDataList[i]
2021-04-27 20:48:45 +08:00
-- view:OnOpen(true,curItemData,1.15,true,true,false,self.sortingOrder)
view:SetEffectLayer(self.sortingOrder)
2021-04-27 16:46:39 +08:00
end
end
2020-05-09 13:31:21 +08:00
end
end
-- 根据物品列表数据显示物品
function RewardItemPopup:SetItemShow(drop)
BagManager.OnShowTipDropNumZero(drop)
if drop==nil then return end
for i = 1, #itemDataList do
itemDataList[i].itemConfig = itemConfig[itemDataList[i].sId]
end
self:ItemDataListSort(itemDataList)
2021-04-27 20:48:45 +08:00
-- for i = 1, math.max(#itemDataList, #itemListPrefab) do
-- local go = itemListPrefab[i]
-- if not go then
-- go = SubUIManager.Open(SubUIConfig.ItemView, this.dropGrid.transform)
-- go.gameObject.name = "frame"..i
-- itemListPrefab[i] = go
-- end
-- go.gameObject:SetActive(false)
-- end
if #itemDataList <= 25 then
callList:Clear()
2020-05-09 13:31:21 +08:00
callList:Push(function ()
2021-04-27 20:48:45 +08:00
if isOpenGeiSSRAvtivityTime then
isOpenGeiSSRAvtivityTime:Stop()
isOpenGeiSSRAvtivityTime = nil
2020-05-09 13:31:21 +08:00
end
2021-04-27 20:48:45 +08:00
isOpenGeiSSRAvtivityTime = Timer.New(function ()
isPlayerAniEnd = true
if isOpenGeiSSRAvtivity > 0 then
HeroManager.DetectionOpenFiveStarActivity(isOpenGeiSSRAvtivity)
end
end, 0.5):Start()
--在关卡界面获得装备 刷新下btview成员红点
-- Game.GlobalEvent:DispatchEvent(GameEvent.Equip.EquipChange)
2020-05-09 13:31:21 +08:00
end)
2021-04-27 20:48:45 +08:00
for i = #itemDataList, 1, -1 do
isPlayerAniEnd = false
local view = itemListPrefab[i]
local curItemData=itemDataList[i]
view:OnOpen(true,curItemData,1.15,true,true,false,self.sortingOrder)
view.gameObject:SetActive(false)
callList:Push(function ()
local func = function()
view.gameObject:SetActive(true)
local btn = Util.GetGameObject(view.gameObject, "item/frame"):GetComponent("Button")
btn.enabled = false
PlayUIAnim(view.gameObject, function()
btn.enabled = true
end)
--改为后端更新
--this.SetItemData2(itemDataList[i])
Timer.New(function ()
isPopGetSSR = false
callList:Pop()()
end, 0.05):Start()
end
if curItemData.configData and curItemData.itemType==3 and curItemData.configData.Quality == 5 then
HeroManager.DetectionOpenFiveStarActivity(curItemData.configData.Star)
end
if curItemData.configData and curItemData.itemType==3 and curItemData.configData.Quality == 5 and showHero then
isPopGetSSR = true
isOpenGeiSSRAvtivity = curItemData.configData.Star
UIManager.OpenPanel(UIName.DropGetSSRHeroShopPanel,curItemData.backData, func)
elseif curItemData.configData and curItemData.itemType==1 and
(curItemData.configData.ItemType == ItemType.Title or curItemData.configData.ItemType == ItemType.Ride) then--皮肤 坐骑
-- isPopGetSSR = true
-- UIManager.OpenPanel(UIName.DropGetPlayerDecorateShopPanel,curItemData.backData, func)
func()
else
func()
end
end)
end
callList:Pop()()
else
for i = 1, #itemDataList do
local view = itemListPrefab[i]
local curItemData=itemDataList[i]
view:OnOpen(true,curItemData,1.15,true,true,false,self.sortingOrder)
view.gameObject:SetActive(true)
end
2020-05-09 13:31:21 +08:00
end
2021-04-27 20:48:45 +08:00
2020-05-09 13:31:21 +08:00
end
--存储本地
function this.SetItemData2(itemdata)
if itemdata.itemType==1 then
--后端更新
elseif itemdata.itemType==2 then
if bagType==1 then
EquipManager.UpdateEquipData(itemdata.backData)
elseif bagType==2 then
EquipManager.InitMapShotTimeEquipBagData(itemdata.backData)
end
elseif itemdata.itemType==3 then
if bagType==1 then
HeroManager.UpdateHeroDatas(itemdata.backData)
elseif bagType==2 then
HeroManager.InitMapShotTimeHeroBagData(itemdata.backData)
end
elseif itemdata.itemType==4 then
if bagType==1 then
TalismanManager.InitUpdateSingleTalismanData(itemdata.backData)
elseif bagType==2 then
TalismanManager.InitMapShotTimeTalismanBagData(itemdata.backData)
end
elseif itemdata.itemType==5 then
if bagType==1 then
--SoulPrintManager.InitServerData(itemdata.data)
EquipTreasureManager.InitSingleTreasureData(itemdata.backData)
elseif bagType==2 then
--SoulPrintManager.InitMapShotTimeSoulPrintBagData(itemdata.backData)
--SoulPrintManager.StoreData(itemdata.data)
end
elseif itemdata.itemType==6 then
if bagType==1 then
PokemonManager.UpdatePokemonDatas(itemdata.backData,true)
elseif bagType==2 then
end
2020-05-09 13:31:21 +08:00
end
end
--关卡通关掉落时展示经验等级信息
function this.ShowLvAndExp()
--this.lvAndExpGo:SetActive(compShowType == 1)
if compShowType == 1 then
2021-04-27 13:48:17 +08:00
this.exp.value=PlayerManager.exp/userLevelData[PlayerManager.level].Exp
this.expText.text=PlayerManager.exp.."/"..userLevelData[PlayerManager.level].Exp
this.lv.text= PlayerManager.level
this.lvUpImage:SetActive(FightPointPassManager.oldLevel<PlayerManager.level)
2020-05-09 13:31:21 +08:00
end
end
--掉落物品排序
function RewardItemPopup:ItemDataListSort(itemDataList)
table.sort(itemDataList, function(a, b)
if a.itemConfig.Quantity == b.itemConfig.Quantity then
if a.itemConfig.ItemType == b.itemConfig.ItemType then
return a.itemConfig.Id < b.itemConfig.Id
else
return a.itemConfig.ItemType < b.itemConfig.ItemType
end
else
return a.itemConfig.Quantity > b.itemConfig.Quantity
end
end)
end
--界面关闭时调用(用于子类重写)
function RewardItemPopup:OnClose()
BagManager.SetDropIsSHowEquipPrint(true)
2020-05-09 13:31:21 +08:00
local fightConFigData = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, FightPointPassManager.curOpenFight)
if compShowType == 1 then
compShowType = 0
if FightPointPassManager.oldLevel<PlayerManager.level then
if fightConFigData and fightConFigData.PicShow == 1 and FightPointPassManager.isOpenNewChapter then
UIManager.OpenPanel(UIName.FightEndLvUpPanel,FightPointPassManager.oldLevel,PlayerManager.level,function ()
2021-01-06 16:12:54 +08:00
func(isBackBattle)
2020-05-09 13:31:21 +08:00
end)
else
UIManager.OpenPanel(UIName.FightEndLvUpPanel,FightPointPassManager.oldLevel,PlayerManager.level,func)
end
return
end
end
compShowType = 0
if func and not isPopGetSSR then
if fightConFigData and fightConFigData.PicShow == 1 and FightPointPassManager.isOpenNewChapter then
2021-01-06 16:12:54 +08:00
func(isBackBattle)
2020-05-09 13:31:21 +08:00
else
2021-01-06 16:12:54 +08:00
func(isBackBattle)
2020-05-09 13:31:21 +08:00
end
end
-- 展示完以后结束章节解锁状态
FightPointPassManager.isOpenNewChapter = false
if isOpenGeiSSRAvtivityTime then
isOpenGeiSSRAvtivityTime:Stop()
isOpenGeiSSRAvtivityTime = nil
end
2020-06-13 11:47:13 +08:00
--检测是否需要弹每日任务飘窗
TaskManager.RefreshShowDailyMissionTipPanel()
2021-04-27 20:48:45 +08:00
end
--界面销毁时调用(用于子类重写)
function RewardItemPopup:OnDestroy()
2021-04-27 16:37:03 +08:00
if #itemListPrefab > 0 then
for i = 1, #itemListPrefab do
destroy(itemListPrefab[i].gameObject)
end
2021-04-27 13:48:17 +08:00
end
itemListPrefab = {}
2021-04-27 16:37:03 +08:00
itemDataList = {}
2020-05-09 13:31:21 +08:00
end
2020-06-23 18:36:24 +08:00
return RewardItemPopup