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