【七界试炼】排行奖励
parent
1693300255
commit
6ec532f769
File diff suppressed because it is too large
Load Diff
|
@ -18,6 +18,13 @@ local ConfigList = {
|
|||
[1] = ConfigManager.GetConfig(ConfigName.ActivityRankingReward),--一般奖励表
|
||||
[2] = ConfigManager.GetConfig(ConfigName.GodSacrificeConfig),--社稷大典奖励表
|
||||
[3] = ConfigManager.GetConfig(ConfigName.ArenaReward),--竞技场奖励表
|
||||
[4] = ConfigManager.GetConfig(ConfigName.QijieRanking),--七界试炼
|
||||
}
|
||||
|
||||
local vec = {
|
||||
[2] = Vector2.New(916,1002.7),
|
||||
[3] = Vector2.New(916,841.6),
|
||||
[4] = Vector2.New(916,944.9),
|
||||
}
|
||||
|
||||
-- Tab管理器
|
||||
|
@ -38,23 +45,26 @@ local _TabData2 = {
|
|||
--初始化组件(用于子类重写)
|
||||
function GeneralRankRewardPanel:InitComponent()
|
||||
this.spLoader = SpriteLoader.New()
|
||||
this.arenaBottom = Util.GetGameObject(self.gameObject, "ArenaBottom")
|
||||
this.tabbox = Util.GetGameObject(self.gameObject, "ArenaBottom/tabbox")
|
||||
this.btnBack = Util.GetGameObject(self.gameObject, "btnBack")
|
||||
this.Title = Util.GetGameObject(self.gameObject, "Title"):GetComponent("Text")
|
||||
this.tipText = Util.GetGameObject(self.gameObject, "content1/tipText"):GetComponent("Text")
|
||||
this.myRank = Util.GetGameObject(self.gameObject, "content1/myRank")
|
||||
this.myRankNum = Util.GetGameObject(self.gameObject, "content1/myRank/num"):GetComponent("Text")
|
||||
this.bottom = Util.GetGameObject(self.gameObject, "bgImage/Bottom")
|
||||
this.tabbox = Util.GetGameObject(this.bottom, "tabbox")
|
||||
this.myRank = Util.GetGameObject(this.bottom, "MyRank")
|
||||
this.myRankNum = Util.GetGameObject(this.myRank, "num"):GetComponent("Text")
|
||||
this.myInfo = Util.GetGameObject(this.bottom, "MyInfo")
|
||||
this.norank = Util.GetGameObject(this.bottom, "MyInfo/myrank")
|
||||
|
||||
this.text = Util.GetGameObject(this.arenaBottom, "tips/Text"):GetComponent("Text")
|
||||
this.text2 = Util.GetGameObject(this.arenaBottom, "tips/Text2"):GetComponent("Text")
|
||||
this.tips = Util.GetGameObject(this.bottom, "Tips")
|
||||
this.text = Util.GetGameObject(this.bottom, "Tips/Text"):GetComponent("Text")
|
||||
this.text2 = Util.GetGameObject(this.bottom, "Tips/Text2"):GetComponent("Text")
|
||||
|
||||
local v2 = Util.GetGameObject(self.gameObject, "content1/scrollRect"):GetComponent("RectTransform").rect
|
||||
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(self.gameObject, "content1/scrollRect").transform,
|
||||
Util.GetGameObject(self.gameObject, "content1/itemPre"), nil, Vector2.New(-v2.x*2, -v2.y*2), 1, 1, Vector2.New(10,10))
|
||||
this.scrollRect = Util.GetGameObject(self.gameObject, "bgImage/content1/scrollRect")
|
||||
this.rankPre = Util.GetGameObject(self.gameObject, "itemPre")
|
||||
|
||||
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, this.scrollRect.transform,
|
||||
this.rankPre, nil, Vector2.New(this.scrollRect.transform.sizeDelta.x, this.scrollRect.transform.sizeDelta.y), 1, 1, Vector2.New(10,10))
|
||||
this.ScrollView.moveTween.MomentumAmount = 1
|
||||
this.ScrollView.moveTween.Strength = 1
|
||||
|
||||
this.ScrollView.elastic = false
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
|
@ -99,7 +109,7 @@ function this.OnTabChange(index)
|
|||
this.text2.text = string.format("前10名奖励需个人贡献值达到%s分才能获取", 2500)
|
||||
this.text2.color = UIColor.RED
|
||||
end
|
||||
elseif curRankType == 3 then
|
||||
elseif curRankType == 3 or curRankType == 4 then
|
||||
this.ShowRewardInfo()
|
||||
this.text.text = Language[10758]
|
||||
this.RefreshMyInfo()
|
||||
|
@ -119,27 +129,37 @@ function GeneralRankRewardPanel:OnOpen(Type,myRank,activityId)
|
|||
curRankType = Type
|
||||
ActivityId = activityId or nil
|
||||
myrank = tonumber(myRank)
|
||||
this.arenaBottom:SetActive(false)--如果是竞技场的话显示一堆零碎
|
||||
RewardConfig = ConfigList[Type]
|
||||
this.ShowRewardInfo()
|
||||
this.SetMyRank()
|
||||
|
||||
--竞技场和社稷大典的特殊处理
|
||||
if curRankType == 3 then
|
||||
this.arenaBottom:SetActive(true)
|
||||
if curRankType == 2 then--社稷大典的特殊处理
|
||||
-- this.arenaBottom:SetActive(true)
|
||||
this.tabbox:SetActive(true)
|
||||
this.TabCtrl:Init(this.tabbox, _TabData2)
|
||||
this.myRank:SetActive(true)
|
||||
this.myInfo:SetActive(false)
|
||||
this.tips:SetActive(false)
|
||||
this.scrollRect.transform.sizeDelta = vec[curRankType]
|
||||
this.ScrollView.transform.sizeDelta = vec[curRankType]
|
||||
this.SetMyRank()
|
||||
elseif curRankType == 3 then--竞技场特殊处理
|
||||
this.tabbox:SetActive(true)
|
||||
this.TabCtrl:Init(this.tabbox, _TabData)
|
||||
Util.GetGameObject(this.arenaBottom, "mask"):SetActive(true)
|
||||
Util.GetGameObject(this.arenaBottom, "Image1"):SetActive(true)
|
||||
Util.GetGameObject(this.arenaBottom, "myInfo"):SetActive(true)
|
||||
this.myRank:SetActive(false)
|
||||
this.myInfo:SetActive(true)
|
||||
this.tips:SetActive(true)
|
||||
this.scrollRect.transform.sizeDelta = vec[curRankType]
|
||||
this.ScrollView.transform.sizeDelta = vec[curRankType]
|
||||
this.RefreshMyInfo()
|
||||
elseif curRankType == 4 then
|
||||
this.tabbox:SetActive(false)
|
||||
this.myRank:SetActive(false)
|
||||
this.myInfo:SetActive(true)
|
||||
this.tips:SetActive(true)
|
||||
this.scrollRect.transform.sizeDelta = vec[curRankType]
|
||||
this.ScrollView.transform.sizeDelta = vec[curRankType]
|
||||
this.RefreshMyInfo()
|
||||
end
|
||||
if curRankType == 2 then
|
||||
this.arenaBottom:SetActive(true)
|
||||
this.TabCtrl:Init(this.tabbox, _TabData2)
|
||||
Util.GetGameObject(this.arenaBottom, "mask"):SetActive(false)
|
||||
Util.GetGameObject(this.arenaBottom, "Image1"):SetActive(false)
|
||||
Util.GetGameObject(this.arenaBottom, "myInfo"):SetActive(false)
|
||||
end
|
||||
this.ShowRewardInfo()
|
||||
end
|
||||
|
||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||
|
@ -174,11 +194,9 @@ end
|
|||
function this.RefreshMyInfo()
|
||||
local sortNumTabs = {}
|
||||
local rewardList = {}
|
||||
local myInfo = Util.GetGameObject(this.arenaBottom, "myInfo")
|
||||
local norank = Util.GetGameObject(this.arenaBottom, "myInfo/myrank")
|
||||
norank:SetActive(false)
|
||||
this.norank:SetActive(false)
|
||||
for i = 1, 4 do
|
||||
sortNumTabs[i] = Util.GetGameObject(myInfo, "sortNum/sortNum ("..i..")")
|
||||
sortNumTabs[i] = Util.GetGameObject(this.myInfo, "sortNum/sortNum ("..i..")")
|
||||
sortNumTabs[i]:SetActive(false)
|
||||
end
|
||||
if myrank and myrank > 0 then
|
||||
|
@ -198,12 +216,12 @@ function this.RefreshMyInfo()
|
|||
|
||||
--获取奖励
|
||||
if curRankType == 3 then--竞技场
|
||||
for k,value in ConfigPairs(arenaReward) do
|
||||
for k,value in ConfigPairs(ConfigList[curRankType]) do
|
||||
if myrank <= 3 then
|
||||
if tabNum == 1 then
|
||||
rewardList = arenaReward[myrank].DailyReward
|
||||
rewardList = ConfigList[curRankType][myrank].DailyReward
|
||||
elseif tabNum == 2 then
|
||||
rewardList = arenaReward[myrank].SeasonReward
|
||||
rewardList = ConfigList[curRankType][myrank].SeasonReward
|
||||
end
|
||||
elseif myrank > 3 then
|
||||
if myrank >= value.MinRank and myrank <= value.MaxRank then
|
||||
|
@ -227,6 +245,16 @@ function this.RefreshMyInfo()
|
|||
end
|
||||
end
|
||||
end
|
||||
elseif curRankType == 4 then--七界试炼
|
||||
for k,value in ConfigPairs(ConfigList[curRankType]) do
|
||||
if myrank <= 3 then
|
||||
rewardList = ConfigList[curRankType][myrank].RankingReward
|
||||
elseif myrank > 3 then
|
||||
if myrank >= value.MinRank and myrank <= value.MaxRank then
|
||||
rewardList = value.RankingReward
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -235,14 +263,14 @@ function this.RefreshMyInfo()
|
|||
if itemList2[i] then
|
||||
itemList2[i]:OnOpen(false, rewardList[i], 0.75,false,false,false,sorting)
|
||||
else
|
||||
itemList2[i] = SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(myInfo, "content").transform)
|
||||
itemList2[i] = SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(this.myInfo, "content").transform)
|
||||
itemList2[i]:OnOpen(false, rewardList[i], 0.75,false,false,false,sorting)
|
||||
end
|
||||
itemList2[i].gameObject:SetActive(true)
|
||||
end
|
||||
else
|
||||
norank:SetActive(true)
|
||||
norank:GetComponent("Text").text = Language[10036]
|
||||
this.norank:SetActive(true)
|
||||
this.norank:GetComponent("Text").text = Language[10036]
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -260,7 +288,7 @@ function this.ShowRewardInfo()
|
|||
this.ActivityRewardSingleShow(go, RewardList[index],index)
|
||||
end)
|
||||
|
||||
elseif curRankType == 3 then--非活动类的排行榜(竞技场)
|
||||
elseif curRankType == 3 or curRankType == 4 then--非活动类的排行榜(竞技场)
|
||||
for _, configInfo in ConfigPairs(RewardConfig) do
|
||||
table.insert(RewardList,configInfo)
|
||||
end
|
||||
|
|
|
@ -92,7 +92,7 @@ function QiJieShiLianPanel:BindEvent()
|
|||
PopupTipPanel.ShowTip("七界秘宝!")
|
||||
end)
|
||||
Util.AddClick(self.rewardBtn,function()
|
||||
PopupTipPanel.ShowTip("奖励!")
|
||||
UIManager.OpenPanel(UIName.GeneralRankRewardPanel,4,1)--需要活动id,和我的排名
|
||||
end)
|
||||
Util.AddClick(self.sortBtn,function()
|
||||
PopupTipPanel.ShowTip("排行!")
|
||||
|
|
Loading…
Reference in New Issue