【优化】设置物品显示的方法改为通用方法

dev_chengFeng
gaoxin 2021-11-26 14:27:24 +08:00
parent 62097d4d05
commit bb685191dd
21 changed files with 24 additions and 24 deletions

View File

@ -114,7 +114,7 @@ function this:FormationAdapter()
this.LiveGO = poolManager:LoadLive(this.LiveName, this.live2dRoot.transform, this.LiveGO = poolManager:LoadLive(this.LiveName, this.live2dRoot.transform,
Vector3.one * heroConfig.Scale, Vector3.New(heroConfig.Position[1],heroConfig.Position[2],0)) Vector3.one * heroConfig.Scale, Vector3.New(heroConfig.Position[1],heroConfig.Position[2],0))
end end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,5,1,sortingOrder,false,rewardData) ResetItemView(this.root,this.root.transform,itemList,5,1,sortingOrder,false,rewardData)
end end
function this:OnClose() function this:OnClose()
if fun then if fun then

View File

@ -122,7 +122,7 @@ function this:FormationAdapter()
end end
end end
end end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,5,1,sortingOrder,false,rewardData) ResetItemView(this.root,this.root.transform,itemList,5,1,sortingOrder,false,rewardData)
end end
function this.OnSortingOrderChange() function this.OnSortingOrderChange()

View File

@ -183,7 +183,7 @@ function this:FormationAdapter()
heroListGo[i]:SetActive(false) heroListGo[i]:SetActive(false)
end end
end end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,5,1,sortingOrder,false,rewardData) ResetItemView(this.root,this.root.transform,itemList,5,1,sortingOrder,false,rewardData)
end end
function this.OnSortingOrderChange() function this.OnSortingOrderChange()

View File

@ -194,7 +194,7 @@ function this:FormationAdapter()
heroListGo[i]:SetActive(false) heroListGo[i]:SetActive(false)
end end
end end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,5,1,sortingOrder,false,rewardData) ResetItemView(this.root,this.root.transform,itemList,5,1,sortingOrder,false,rewardData)
end end
function this.OnSortingOrderChange() function this.OnSortingOrderChange()

View File

@ -251,7 +251,7 @@ function this.FindFairyRecordShow(root, data)
local logoName = GuildManager.GetLogoResName(data.icon) local logoName = GuildManager.GetLogoResName(data.icon)
guildIcon.sprite = this.spLoader:LoadSprite(logoName) guildIcon.sprite = this.spLoader:LoadSprite(logoName)
end end
FindFairyManager.ResetItemView( ResetItemView(
root, root,
heroHead.transform, heroHead.transform,
this.heroItemList, this.heroItemList,
@ -274,7 +274,7 @@ function this.ScoreRewardShow(root, data)
local stateText = Util.GetGameObject(root, "StateBtn/Text"):GetComponent("Text") local stateText = Util.GetGameObject(root, "StateBtn/Text"):GetComponent("Text")
local config = ConfigManager.GetConfigData(ConfigName.ActivityRewardConfig, data.missionId) local config = ConfigManager.GetConfigData(ConfigName.ActivityRewardConfig, data.missionId)
info.text = Language[10634] .. config.Values[1][1] .. Language[10635] info.text = Language[10634] .. config.Values[1][1] .. Language[10635]
FindFairyManager.ResetItemView(root, rewardRoot, this.scoreItemList, 4, 1, this.sortingOrder, false, config.Reward) ResetItemView(root, rewardRoot, this.scoreItemList, 4, 1, this.sortingOrder, false, config.Reward)
stateBtn:GetComponent("Button").interactable = data.value >= config.Values[1][1] and data.state == 0 stateBtn:GetComponent("Button").interactable = data.value >= config.Values[1][1] and data.state == 0
@ -358,7 +358,7 @@ function this.BigRankRewardShow(root, data, index)
end end
--奖励物品根节点 --奖励物品根节点
local rewardRoot = Util.GetGameObject(root, "RewardRoot").transform local rewardRoot = Util.GetGameObject(root, "RewardRoot").transform
FindFairyManager.ResetItemView( ResetItemView(
root, root,
rewardRoot, rewardRoot,
this.bigItemList, this.bigItemList,

View File

@ -77,7 +77,7 @@ function this.SetShow(root,data)
local progress=Util.GetGameObject(root,"Progress"):GetComponent("Text") local progress=Util.GetGameObject(root,"Progress"):GetComponent("Text")
title.text=GetLanguageStrById(data.native.Name) title.text=GetLanguageStrById(data.native.Name)
FindFairyManager.ResetItemView(root,content.transform,itemList,4,0.9,sortingOrder,false,data.native.RewardShow) ResetItemView(root,content.transform,itemList,4,0.9,sortingOrder,false,data.native.RewardShow)
stateBtn:GetComponent("Button").interactable=data.server.buyTimes< data.native.Limit stateBtn:GetComponent("Button").interactable=data.server.buyTimes< data.native.Limit
if data.server.buyTimes< data.native.Limit then--未购买 if data.server.buyTimes< data.native.Limit then--未购买

View File

@ -79,7 +79,7 @@ function this:SetShow(root,data)
local config = ConfigManager.GetConfigData(ConfigName.ActivityRewardConfig,data.missionId) local config = ConfigManager.GetConfigData(ConfigName.ActivityRewardConfig,data.missionId)
title.text= GetLanguageStrById(config.ContentsShow) title.text= GetLanguageStrById(config.ContentsShow)
FindFairyManager.ResetItemView(root,content.transform,itemList,4,0.9,sortingOrder,false,config.Reward) ResetItemView(root,content.transform,itemList,4,0.9,sortingOrder,false,config.Reward)
progress.text="("..data.value.."/"..config.Values[1][1]..")" progress.text="("..data.value.."/"..config.Values[1][1]..")"
progress.enabled= data.value<config.Values[1][1] progress.enabled= data.value<config.Values[1][1]

View File

@ -356,11 +356,11 @@ function this.SetCurRankReward(myRankData)
for i = 1, #FindFairyManager.rankRewardData do for i = 1, #FindFairyManager.rankRewardData do
--前3档奖励 --前3档奖励
if myRank<=3 and i==myRank then if myRank<=3 and i==myRank then
FindFairyManager.ResetItemView(this.bottomView,this.curRewardRoot.transform, ResetItemView(this.bottomView,this.curRewardRoot.transform,
this.curRewardItemList,3,0.9,sortingOrder,false,FindFairyManager.rankRewardData[i].RankingReward) this.curRewardItemList,3,0.9,sortingOrder,false,FindFairyManager.rankRewardData[i].RankingReward)
--后续各档位奖励 --后续各档位奖励
elseif myRank>3 and myRank>=FindFairyManager.rankRewardData[i].MinRank and myRank<=FindFairyManager.rankRewardData[i].MaxRank then elseif myRank>3 and myRank>=FindFairyManager.rankRewardData[i].MinRank and myRank<=FindFairyManager.rankRewardData[i].MaxRank then
FindFairyManager.ResetItemView(this.bottomView,this.curRewardRoot.transform, ResetItemView(this.bottomView,this.curRewardRoot.transform,
this.curRewardItemList,3,0.9,sortingOrder,false,FindFairyManager.rankRewardData[i].RankingReward) this.curRewardItemList,3,0.9,sortingOrder,false,FindFairyManager.rankRewardData[i].RankingReward)
end end
end end

View File

@ -166,7 +166,7 @@ function this.SetInfo(id)
this.countText.text=redpack.Num this.countText.text=redpack.Num
this.message.text=GetLanguageStrById(redpack.SendWord) this.message.text=GetLanguageStrById(redpack.SendWord)
FindFairyManager.ResetItemView(this.rewardRoot,this.rewardRoot.transform,this.itemList,4,0.9,sortingOrder,false,recharge.BaseReward) ResetItemView(this.rewardRoot,this.rewardRoot.transform,this.itemList,4,0.9,sortingOrder,false,recharge.BaseReward)
this.sendBtn:GetComponent("Button").interactable=surplusNum>0 this.sendBtn:GetComponent("Button").interactable=surplusNum>0
Util.SetGray(this.sendBtn,surplusNum<1) Util.SetGray(this.sendBtn,surplusNum<1)

View File

@ -78,7 +78,7 @@ function this:OnShow(_parent,...)
index = index + 1 index = index + 1
end end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,4,1,sortingOrder,false,data) ResetItemView(this.root,this.root.transform,itemList,4,1,sortingOrder,false,data)
end end
function this:OnClose() function this:OnClose()

View File

@ -55,7 +55,7 @@ function this:OnShow(_parent,...)
this.titleText.text=Language[11541] this.titleText.text=Language[11541]
this.numImage.sprite = SetIcon(this.spLoader, 14) this.numImage.sprite = SetIcon(this.spLoader, 14)
this.numImage2.sprite = SetIcon(this.spLoader, 1258) this.numImage2.sprite = SetIcon(this.spLoader, 1258)
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[3]) ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[3])
end end
function this:OnClose() function this:OnClose()

View File

@ -31,7 +31,7 @@ function this:OnShow(_parent,...)
sortingOrder = _parent.sortingOrder sortingOrder = _parent.sortingOrder
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参 --不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
local args = {...} local args = {...}
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1.2,sortingOrder,false,ConfigManager.GetConfigData(ConfigName.GuildHelpConfig,1).Reward) ResetItemView(this.root,this.root.transform,itemList,10,1.2,sortingOrder,false,ConfigManager.GetConfigData(ConfigName.GuildHelpConfig,1).Reward)
end end
function this:OnClose() function this:OnClose()

View File

@ -92,7 +92,7 @@ function this:OnShow(_parent,...)
for i=1,#dropList do for i=1,#dropList do
_data[i]={dropList[i].id,dropList[i].num} _data[i]={dropList[i].id,dropList[i].num}
end end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,8,1,sortingOrder,false,_data) ResetItemView(this.root,this.root.transform,itemList,8,1,sortingOrder,false,_data)
end end
function this:OnClose() function this:OnClose()

View File

@ -71,7 +71,7 @@ function this:OnShow(_parent,...)
else else
this.infoTxt.text=string.format(Language[12214],coin,GetLanguageStrById(itemConfig[id].Name),GetLanguageStrById(lingshouConfig.Name),"%") this.infoTxt.text=string.format(Language[12214],coin,GetLanguageStrById(itemConfig[id].Name),GetLanguageStrById(lingshouConfig.Name),"%")
end end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[2]) ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[2])
end end
function this:OnClose() function this:OnClose()

View File

@ -51,7 +51,7 @@ function this:OnShow(_parent,...)
--this.num.text = args[1] --this.num.text = args[1]
fun = args[2] fun = args[2]
this.infoTxt.text=Language[11576] this.infoTxt.text=Language[11576]
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[1]) ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,args[1])
end end
function this:OnClose() function this:OnClose()

View File

@ -75,7 +75,7 @@ function this:OnShow(_parent,...)
for i, v in pairs(dropList) do for i, v in pairs(dropList) do
data[i]={v.id,v.num} data[i]={v.id,v.num}
end end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,data) ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,data)
end end
function this:OnClose() function this:OnClose()

View File

@ -98,7 +98,7 @@ function this:OnShow(_parent,...)
index = index + 1 index = index + 1
end end
LogBlue(#data) LogBlue(#data)
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,60,1,sortingOrder,false,data) ResetItemView(this.root,this.root.transform,itemList,60,1,sortingOrder,false,data)
end end
function this:OnClose() function this:OnClose()

View File

@ -101,7 +101,7 @@ function this:OnShow(_parent,...)
return itemConfig[a[1]].ItemType > itemConfig[b[1]].ItemType return itemConfig[a[1]].ItemType > itemConfig[b[1]].ItemType
end end
end) end)
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,8,1,sortingOrder,false,_data) ResetItemView(this.root,this.root.transform,itemList,8,1,sortingOrder,false,_data)
--英雄消耗道具数量 --英雄消耗道具数量

View File

@ -83,7 +83,7 @@ function this:OnShow(_parent,...)
for i=1,#dropList do for i=1,#dropList do
_data[i] = {dropList[i].id,dropList[i].num,nil,dropList[i].star} _data[i] = {dropList[i].id,dropList[i].num,nil,dropList[i].star}
end end
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,8,1,sortingOrder,false,_data) ResetItemView(this.root,this.root.transform,itemList,8,1,sortingOrder,false,_data)
end end
function this:OnClose() function this:OnClose()

View File

@ -51,7 +51,7 @@ function this:OnShow(_parent,...)
fun = _args[3] fun = _args[3]
this.titleText.text=Language[11541] this.titleText.text=Language[11541]
this.numImage.sprite = SetIcon(this.spLoader, 14) this.numImage.sprite = SetIcon(this.spLoader, 14)
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,_args[2]) ResetItemView(this.root,this.root.transform,itemList,10,1,sortingOrder,false,_args[2])
end end
function this:OnClose() function this:OnClose()

View File

@ -103,7 +103,7 @@ function QiJieShiLianMonsterInfo:FormationAdapter()
heroListGo[i]:SetActive(false) heroListGo[i]:SetActive(false)
end end
end end
FindFairyManager.ResetItemView(self.root,self.root.transform,itemList,5,1,sortingOrder,false,rewardData) ResetItemView(self.root,self.root.transform,itemList,5,1,sortingOrder,false,rewardData)
end end
function QiJieShiLianMonsterInfo:OnSortingOrderChange() function QiJieShiLianMonsterInfo:OnSortingOrderChange()