【ID1007787】

【优化】心魔试炼高级阶段奖励没有展示,添加层数奖励
dev_chengFeng
jiaoyangna 2021-01-15 10:50:27 +08:00
parent 7d217556af
commit 7666faad78
3 changed files with 17 additions and 15 deletions

View File

@ -109,6 +109,7 @@ function this:BindEvent()
PopupTipPanel.ShowTip("正在行走 不可点击!")
return
end
MonsterCampManager.preType = 1
UIManager.OpenPanel(UIName.TrialRewardPopup,MapTrialManager.SetRewardData(),function(id,rewardFunc)
NetManager.RequestLevelReward(id, function(msg)
MapTrialManager.SetTrialRewardInfo(id) --本地记录已领奖励信息

View File

@ -4,7 +4,7 @@ local this = MonsterCampPanel
local orginLayer
local monsterGroup = ConfigManager.GetConfig(ConfigName.MonsterGroup)
local monsterConfig = ConfigManager.GetConfig(ConfigName.MonsterConfig)
this.preType = 0
--初始化组件(用于子类重写)
function MonsterCampPanel:InitComponent()
orginLayer = 0
@ -106,6 +106,7 @@ function MonsterCampPanel:BindEvent()
this.InitShow()
end)
Util.AddClick(this.btnReward, function ()
MonsterCampManager.preType = 2
UIManager.OpenPanel(UIName.TrialRewardPopup,MonsterCampManager.SetRewardData(),function(id,rewardFunc)
NetManager.DemonsTrialRewardRequest(id, function(msg)
MonsterCampManager.SetRewardWave({id}) --本地记录已领奖励信息

View File

@ -8,6 +8,7 @@ local sortingOrder=0
local getFunc = {}
local pres = {}
local curType = 0
local scrollView = nil
function TrialRewardPopup:InitComponent()
this.panel=Util.GetGameObject(this.gameObject,"Panel")
this.backBtn=Util.GetGameObject(this.panel,"BackBtn")
@ -38,38 +39,37 @@ function TrialRewardPopup:OnOpen(...)
local arg = {...}
rewardConfig = arg[1]
getFunc = arg[2]
curType = arg[3]
this.pre = pres[curType]
end
function TrialRewardPopup:OnShow()
this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scroll.transform,this.pre, nil,
scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scroll.transform,pres[MonsterCampManager.preType], nil,
Vector2.New(this.scroll.transform.rect.width,this.scroll.transform.rect.height),1,1,Vector2.New(0,5))
this.scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0)
this.scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
this.scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
this.scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
this.scrollView.moveTween.MomentumAmount = 1
this.scrollView.moveTween.Strength = 2
scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0)
scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
scrollView.moveTween.MomentumAmount = 1
scrollView.moveTween.Strength = 2
this.RefreshPanel()
sortingOrder = self.sortingOrder
end
function TrialRewardPopup:OnClose()
SubUIManager.Close(this.scrollView)
GameObject.DestroyImmediate(scrollView.gameObject)
itemList = {}
end
function TrialRewardPopup:OnDestroy()
this.scrollView=nil
scrollView=nil
end
--刷新
function this.RefreshPanel()
this.scrollView:SetData(rewardConfig,function(index,root)
scrollView:SetData(rewardConfig,function(index,root)
this.SetScrollPre(root,rewardConfig[index])
end)
this.scrollView:SetIndex(1)
scrollView:SetIndex(1)
end
--设置每条数据
@ -82,7 +82,7 @@ function this.SetScrollPre(root,data)
local pregress = Util.GetGameObject(root,"getRewardProgress")
if pregress then
if curType == 2 then
pregress:GetComponent("Text").text = "("..MonsterCampManager.monsterWave.."/"..data.Id..")"
pregress:GetComponent("Text").text = "("..(MonsterCampManager.monsterWave - 1).."/"..data.Id..")"
end
end
info.text=data.info --string.format( Language[11616],data.Count,MapTrialManager.GetKilCount(),data.Count)