【优化】心魔试炼高级阶段奖励没有展示,添加层数奖励

dev_chengFeng
jiaoyangna 2021-01-14 15:24:51 +08:00
parent a382146703
commit 3a7324883e
4 changed files with 1056 additions and 21 deletions

View File

@ -120,7 +120,7 @@ function this:BindEvent()
CheckRedPointStatus(RedPointType.Trial)
end)
end)
end)
end,1)
end)
missionView.BindEvent()

View File

@ -116,7 +116,7 @@ function MonsterCampPanel:BindEvent()
CheckRedPointStatus(RedPointType.EpicExplore)
end)
end)
end)
end,2)
end)
end
@ -134,7 +134,7 @@ end
--界面打开时调用(用于子类重写)
function MonsterCampPanel:OnOpen(...)
SoundManager.PlayMusic(SoundConfig.BGM_Carbon)
CheckRedPointStatus(RedPointType.EpicExplore)
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.MonsterCamp })
-- 初始化界面数据
this.InitShow()

View File

@ -6,20 +6,15 @@ local rewardConfig
local itemList={} --预设容器
local sortingOrder=0
local getFunc = {}
local pres = {}
local curType = 0
function TrialRewardPopup:InitComponent()
this.panel=Util.GetGameObject(this.gameObject,"Panel")
this.backBtn=Util.GetGameObject(this.panel,"BackBtn")
this.scroll=Util.GetGameObject(this.panel,"Scroll")
this.pre=Util.GetGameObject(this.panel,"Scroll/Pre")
this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scroll.transform,this.pre, nil,
Vector2.New(this.scroll.transform.rect.width,this.scroll.transform.rect.height),1,1,Vector2.New(0,10))
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
pres[1]=Util.GetGameObject(this.panel,"Scroll/Pre")
pres[2]=Util.GetGameObject(this.panel,"Scroll/Pre3")
end
function TrialRewardPopup:BindEvent()
@ -43,19 +38,29 @@ 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,
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
this.RefreshPanel()
sortingOrder = self.sortingOrder
end
function TrialRewardPopup:OnClose()
SubUIManager.Close(this.scrollView)
end
function TrialRewardPopup:OnDestroy()
this.scrollView=nil
itemList={}
end
@ -74,7 +79,12 @@ function this.SetScrollPre(root,data)
local goBtn=Util.GetGameObject(root,"GoBtn")
local getBtn=Util.GetGameObject(root,"GetBtn")
local mask=Util.GetGameObject(root,"mask")
local pregress = Util.GetGameObject(root,"getRewardProgress")
if pregress then
if curType == 2 then
pregress:GetComponent("Text").text = "("..MonsterCampManager.monsterWave.."/"..data.Id..")"
end
end
info.text=data.info --string.format( Language[11616],data.Count,MapTrialManager.GetKilCount(),data.Count)
--ResetItemView(root,grid.transform,itemList,#data.BoxReward,0.9,sortingOrder,false,data.BoxReward)
if not itemList[root] then
@ -91,11 +101,6 @@ function this.SetScrollPre(root,data)
itemList[root][i]:OnOpen(false, data.BoxReward[i], 0.9,false,false,false,sortingOrder)
itemList[root][i].gameObject:SetActive(true)
end
--按钮状态
--local s=MapTrialManager.GetTrialRewardState(data.Id)
goBtn:GetComponent("Button").interactable=data.state~=0
if data.state==0 then
-- goText.text=Language[10350]
mask:SetActive(true)
@ -123,8 +128,6 @@ function this.SetScrollPre(root,data)
getBtn:SetActive(false)
this.ChangeState(data.Id)
this.RefreshPanel()
CheckRedPointStatus(RedPointType.TrialReward)
CheckRedPointStatus(RedPointType.Trial)
end)
end
end)