心愿奖励预览提交
parent
3301f19f00
commit
d1c46a2b4e
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f985b592ef89c21408a01f1be3c38f76
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -4,6 +4,7 @@ local TrialRewardPopup = Inherit(BasePanel)
|
|||
local this = TrialRewardPopup
|
||||
local rewardConfig
|
||||
local itemList={} --预设容器
|
||||
local type=0
|
||||
local sortingOrder=0
|
||||
local getFunc = {}
|
||||
local pres = {}
|
||||
|
@ -18,10 +19,7 @@ function TrialRewardPopup:InitComponent()
|
|||
|
||||
this.scroll=Util.GetGameObject(this.panel,"Scroll")
|
||||
pres[1]=Util.GetGameObject(this.panel,"Scroll/Pre")
|
||||
pres[2]=Util.GetGameObject(this.panel,"Scroll/Pre3")
|
||||
pres[4]=Util.GetGameObject(this.panel,"Scroll/Pre4")
|
||||
pres[5]=Util.GetGameObject(this.panel,"Scroll/Pre3")
|
||||
scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scroll.transform,pres[MonsterCampManager.preType], nil,
|
||||
scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scroll.transform,pres[1], nil,
|
||||
Vector2.New(this.scroll.transform.rect.width,this.scroll.transform.rect.height),1,1,Vector2.New(0,5))
|
||||
scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0)
|
||||
scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
||||
|
@ -55,9 +53,9 @@ end
|
|||
|
||||
function TrialRewardPopup:OnOpen(...)
|
||||
local arg = {...}
|
||||
rewardConfig = arg[1]
|
||||
getFunc = arg[2]
|
||||
curType = arg[3]
|
||||
type = arg[1]
|
||||
--getFunc = arg[2]
|
||||
--curType = arg[3]
|
||||
end
|
||||
|
||||
function TrialRewardPopup:OnShow()
|
||||
|
@ -82,26 +80,20 @@ local sortIndex = {
|
|||
}
|
||||
--刷新
|
||||
function this.RefreshPanel(isTop,isAni)
|
||||
if curType ~= 4 then
|
||||
table.sort(rewardConfig,function(a,b)
|
||||
if sortIndex[a.state] == sortIndex[b.state] then
|
||||
return a.Id < b.Id
|
||||
end
|
||||
return sortIndex[a.state] > sortIndex[b.state]
|
||||
end)
|
||||
scrollView:SetData(rewardConfig,function(index,root)
|
||||
this.SetScrollPre(root,rewardConfig[index])
|
||||
end,not isTop,not isAni)
|
||||
else--踏碎凌霄-仅供展示
|
||||
scrollView:SetData(rewardConfig,function(index,root)
|
||||
this.SetScrollPre2(root,rewardConfig[index])
|
||||
end,not isTop,not isAni)
|
||||
end
|
||||
|
||||
this.title.text = "奖 励"
|
||||
if curType == 5 then
|
||||
this.title.text = "任 务"
|
||||
LogError("type============="..type)
|
||||
local configs=ConfigManager.TryGetAllConfigsDataByKey(ConfigName.WishConfig,"LotteryType",type)
|
||||
table.sort(configs,function(a,b)
|
||||
return a.Id < b.Id
|
||||
end)
|
||||
scrollView:SetData(configs,function(index,root)
|
||||
this.SetScrollPre(root,configs[index])
|
||||
end,not isTop,not isAni)
|
||||
if type==1 then
|
||||
this.title.text = "神将心愿奖励"
|
||||
elseif type==4 then
|
||||
this.title.text = "法宝心愿奖励"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--设置每条数据
|
||||
|
@ -110,66 +102,58 @@ function this.SetScrollPre(root,data)
|
|||
local grid=Util.GetGameObject(root,"Grid")
|
||||
local goBtn=Util.GetGameObject(root,"GoBtn")
|
||||
local getBtn=Util.GetGameObject(root,"GetBtn")
|
||||
goBtn:SetActive(false)
|
||||
getBtn:SetActive(false)
|
||||
local mask=Util.GetGameObject(root,"mask")
|
||||
local pregress = Util.GetGameObject(root,"getRewardProgress")
|
||||
if pregress then
|
||||
if curType == 2 then
|
||||
pregress.gameObject:SetActive(true)
|
||||
pregress:GetComponent("Text").text = "("..(MonsterCampManager.monsterWave - 1).."/"..data.Id..")"
|
||||
else
|
||||
pregress.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
info.text=data.info --string.format( Language[11483],data.Count,MapTrialManager.GetKilCount(),data.Count)
|
||||
--ResetItemView(root,grid.transform,itemList,#data.BoxReward,0.9,sortingOrder,false,data.BoxReward)
|
||||
info.text="宝箱"..data.Level.."级奖励"
|
||||
if not itemList[root] then
|
||||
itemList[root] = {}
|
||||
end
|
||||
for k,v in ipairs(itemList[root]) do
|
||||
v.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1 , #data.BoxReward do
|
||||
for i = 1 , #data.Reward do
|
||||
if not itemList[root][i] then
|
||||
itemList[root][i] = SubUIManager.Open(SubUIConfig.ItemView,grid.transform)
|
||||
itemList[root][i].gameObject:SetActive(false)
|
||||
end
|
||||
itemList[root][i]:OnOpen(false, data.BoxReward[i], 0.9,false,false,false,sortingOrder)
|
||||
itemList[root][i]:OnOpen(false, data.Reward[i], 0.9,false,false,false,sortingOrder)
|
||||
itemList[root][i].gameObject:SetActive(true)
|
||||
end
|
||||
if data.state==0 then
|
||||
-- goText.text="已领取"
|
||||
mask:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_slbz_yilingqu_zh")
|
||||
mask:SetActive(true)
|
||||
goBtn:SetActive(false)
|
||||
getBtn:SetActive(false)
|
||||
elseif data.state==1 then
|
||||
-- goText.text="领取"
|
||||
mask:SetActive(false)
|
||||
goBtn:SetActive(false)
|
||||
getBtn:SetActive(true)
|
||||
elseif data.state==2 then
|
||||
-- goText.text="前往"
|
||||
mask:SetActive(false)
|
||||
goBtn:SetActive(true)
|
||||
getBtn:SetActive(false)
|
||||
end
|
||||
-- if data.state==0 then
|
||||
-- -- goText.text="已领取"
|
||||
-- mask:GetComponent("Image").sprite = this.spLoader:LoadSprite("s_slbz_yilingqu_zh")
|
||||
-- mask:SetActive(true)
|
||||
-- goBtn:SetActive(false)
|
||||
-- getBtn:SetActive(false)
|
||||
-- elseif data.state==1 then
|
||||
-- -- goText.text="领取"
|
||||
-- mask:SetActive(false)
|
||||
-- goBtn:SetActive(false)
|
||||
-- getBtn:SetActive(true)
|
||||
-- elseif data.state==2 then
|
||||
-- -- goText.text="前往"
|
||||
-- mask:SetActive(false)
|
||||
-- goBtn:SetActive(true)
|
||||
-- getBtn:SetActive(false)
|
||||
-- end
|
||||
|
||||
Util.AddOnceClick(goBtn,function()
|
||||
this:ClosePanel()
|
||||
if data.jump and data.jump > 0 then
|
||||
JumpManager.GoJump(data.jump)
|
||||
end
|
||||
end)
|
||||
Util.AddOnceClick(getBtn,function()
|
||||
if getFunc then
|
||||
getFunc(data.Id,function()
|
||||
mask:SetActive(true)
|
||||
getBtn:SetActive(false)
|
||||
this.ChangeState(data.Id)
|
||||
this.RefreshPanel(false,false)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
-- Util.AddOnceClick(goBtn,function()
|
||||
-- this:ClosePanel()
|
||||
-- if data.jump and data.jump > 0 then
|
||||
-- JumpManager.GoJump(data.jump)
|
||||
-- end
|
||||
-- end)
|
||||
-- Util.AddOnceClick(getBtn,function()
|
||||
-- if getFunc then
|
||||
-- getFunc(data.Id,function()
|
||||
-- mask:SetActive(true)
|
||||
-- getBtn:SetActive(false)
|
||||
-- this.ChangeState(data.Id)
|
||||
-- this.RefreshPanel(false,false)
|
||||
-- end)
|
||||
-- end
|
||||
-- end)
|
||||
end
|
||||
|
||||
--设置每条数据
|
||||
|
|
|
@ -102,8 +102,9 @@ function RecruitEquipPanelNew:BindEvent()
|
|||
--self.UI_effect_RecruitPanel_box_normal:SetActive(true)
|
||||
if RecruitManager.isCanOpenBox then
|
||||
LogError("getid=========="..getId)
|
||||
|
||||
ActivityGiftManager.GetActivityRewardRequest(11901,getId)
|
||||
else
|
||||
UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[1][1])
|
||||
end
|
||||
end)
|
||||
--奖池预览按钮
|
||||
|
|
|
@ -102,13 +102,14 @@ function RecruitPanelNew:BindEvent()
|
|||
--self.UI_effect_RecruitPanel_box_normal:SetActive(true)
|
||||
if RecruitManager.isCanOpenBox then
|
||||
LogError("getid=========="..getId)
|
||||
|
||||
ActivityGiftManager.GetActivityRewardRequest(11701,getId)
|
||||
else
|
||||
UIManager.OpenPanel(UIName.WishHeroRewardPopup,self.config.ShopData[4][1])
|
||||
end
|
||||
end)
|
||||
--奖池预览按钮
|
||||
Util.AddClick(self.previewBtn, function()
|
||||
UIManager.OpenPanel(UIName.HeroPreviewNewPanel,true,true,self.config.ShopData[4][1])
|
||||
UIManager.OpenPanel(UIName.HeroPreviewNewPanel,true,true,self.config.ShopData[1][1])
|
||||
end)
|
||||
|
||||
-- --心愿抽卡界面
|
||||
|
|
Loading…
Reference in New Issue