xiyou_sanguo
parent
8cfeea7702
commit
9c1123143f
|
|
@ -158,6 +158,7 @@ ConfigName = {
|
|||
HeroSacrifice = "HeroSacrifice",
|
||||
GuildCheckpointConfig = "GuildCheckpointConfig",
|
||||
GuildCheckpointRank = "GuildCheckpointRank",
|
||||
GuildWarRewardConfig = "GuildWarRewardConfig",
|
||||
ThemeActivityTaskConfig = "ThemeActivityTaskConfig",
|
||||
ExchangeRate = "ExchangeRate",
|
||||
CustomEventConfig = "CustomEventConfig",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
----- 公会十绝阵奖励弹窗 -----
|
||||
require("Base/BasePanel")
|
||||
local DeathPosRewardPopup = Inherit(BasePanel)
|
||||
local guildWarRewardConfig = ConfigManager.GetConfig(ConfigName.GuildWarRewardConfig)
|
||||
local this = DeathPosRewardPopup
|
||||
local itemViewList = {}
|
||||
local tempData = {}
|
||||
|
||||
local itemList = {} --优化itemView使用
|
||||
function DeathPosRewardPopup:InitComponent()
|
||||
this.spLoader = SpriteLoader.New()
|
||||
this.panel = Util.GetGameObject(this.gameObject, "Panel")
|
||||
|
|
@ -24,6 +25,14 @@ function DeathPosRewardPopup:InitComponent()
|
|||
|
||||
this.empty = Util.GetGameObject(this.panel, "Empty")
|
||||
this.timeTip = Util.GetGameObject(this.panel, "TimeTip"):GetComponent("Text")
|
||||
this.Tip = Util.GetGameObject(this.panel, "Bg/Tip"):GetComponent("Text")
|
||||
this.rewardScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,
|
||||
this.scroll.transform,
|
||||
Util.GetGameObject(self.gameObject, "Panel/Scroll/RewardShowPre"), nil,
|
||||
Vector2.New(this.scroll.transform.rect.width, this.scroll.transform.rect.height), 1, 1,
|
||||
Vector2.New(10, 10))
|
||||
this.rewardScrollView.moveTween.MomentumAmount = 1
|
||||
this.rewardScrollView.moveTween.Strength = 1
|
||||
end
|
||||
|
||||
function DeathPosRewardPopup:BindEvent()
|
||||
|
|
@ -71,6 +80,8 @@ end
|
|||
function DeathPosRewardPopup:OnDestroy()
|
||||
this.spLoader:Destroy()
|
||||
this.scrollView = nil
|
||||
this.rewardScrollView = nil
|
||||
itemList = {}
|
||||
end
|
||||
|
||||
--其他玩家点击领取奖励的indication推送
|
||||
|
|
@ -116,7 +127,48 @@ function this.RefreshPanel(data, isI)
|
|||
this.SetScrollPre(root, tempData[index], index)
|
||||
end)
|
||||
this.scrollView:SetIndex(1)
|
||||
this.empty:SetActive(#tempData <= 0)
|
||||
this.empty:SetActive(false)
|
||||
if #tempData <= 0 then
|
||||
this.Tip.text = "宝箱在十绝阵结束后产生,每个成员根据名次可获得不同宝箱!"
|
||||
this.rewardScrollView.gameObject:SetActive(true)
|
||||
_guildWarRewardConfig = {}
|
||||
for _, configInfo in ConfigPairs(guildWarRewardConfig) do
|
||||
table.insert(_guildWarRewardConfig, configInfo)
|
||||
end
|
||||
this.rewardScrollView:SetData(_guildWarRewardConfig, function(index, go)
|
||||
this.ActivityRewardSingleShow(go, _guildWarRewardConfig[index], index)
|
||||
end)
|
||||
else
|
||||
this.Tip.text = "十绝阵已经结束,每个成员可开启1次宝箱,试试手气吧!"
|
||||
this.rewardScrollView.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
|
||||
--排名奖励
|
||||
function this.ActivityRewardSingleShow(activityRewardGo, rewardData, index)
|
||||
local sortNumTabs = {}
|
||||
for i = 1, 4 do
|
||||
sortNumTabs[i] = Util.GetGameObject(activityRewardGo, "SortNum/SortNum (" .. i .. ")")
|
||||
sortNumTabs[i]:SetActive(i == rewardData.Section or (i == 4 and rewardData.Section > 4))
|
||||
end
|
||||
if not itemList[activityRewardGo.name] then
|
||||
itemList[activityRewardGo.name] = {}
|
||||
end
|
||||
for i = 1, #itemList[activityRewardGo.name] do
|
||||
itemList[activityRewardGo.name][i].gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, #rewardData.Reward do
|
||||
if itemList[activityRewardGo.name][i] then
|
||||
itemList[activityRewardGo.name][i]:OnOpen(false, rewardData.Reward[i], 0.75, false, false, false,
|
||||
sorting)
|
||||
else
|
||||
itemList[activityRewardGo.name][i] = SubUIManager.Open(SubUIConfig.ItemView,
|
||||
Util.GetGameObject(activityRewardGo, "Grid").transform)
|
||||
itemList[activityRewardGo.name][i]:OnOpen(false, rewardData.Reward[i], 0.75, true, false, false,
|
||||
sorting)
|
||||
end
|
||||
itemList[activityRewardGo.name][i].gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
||||
--设置每个预设
|
||||
|
|
|
|||
Loading…
Reference in New Issue