【页签优化】部分页签设定按照玩家等级开启

dev_chengFeng
ZhangBiao 2020-09-02 18:33:17 +08:00
parent 58540f1556
commit 3c0c8e3f15
5 changed files with 76 additions and 2 deletions

View File

@ -7769,7 +7769,7 @@ MonoBehaviour:
m_Right: 0 m_Right: 0
m_Top: 0 m_Top: 0
m_Bottom: 0 m_Bottom: 0
m_ChildAlignment: 2 m_ChildAlignment: 1
m_Spacing: -2.41 m_Spacing: -2.41
m_ChildForceExpandWidth: 0 m_ChildForceExpandWidth: 0
m_ChildForceExpandHeight: 0 m_ChildForceExpandHeight: 0

View File

@ -508,9 +508,28 @@ function BagPanel:OnShow()
SoundManager.PlayMusic(SoundConfig.BGM_Main) SoundManager.PlayMusic(SoundConfig.BGM_Main)
BagManager.isBagPanel = true BagManager.isBagPanel = true
this.SetBottomBarIsActive()
this.FreshPlayerInfo() this.FreshPlayerInfo()
this.SetPlayerHead() this.SetPlayerHead()
end end
--特殊的开启条件
function this.SetBottomBarIsActive()
local ConfigData = ConfigManager.GetConfig(ConfigName.SpecialConfig)
for i = 1, #tabs1 do
--为宝物定开启规则
if i == 5 then
local string = ConfigData[40].Value
local num = string.split(string.split(string,"|")[1],"#")[2]
tabs1[i]:SetActive(PlayerManager.level >= tonumber(num))
end
--为魂印定开启规则
if i == 6 then
local string = ConfigData[37].Value
local num = string.split(string,"#")[1]
tabs1[i]:SetActive(PlayerManager.level >= tonumber(num))
end
end
end
-- 刷新玩家信息显示 -- 刷新玩家信息显示
function this.FreshPlayerInfo() function this.FreshPlayerInfo()

View File

@ -92,6 +92,8 @@ function CompoundPanel:OnShow()
this.TabCtrl:Init(this.tabBox, _TabData, curIndex) this.TabCtrl:Init(this.tabBox, _TabData, curIndex)
end end
function CompoundPanel:OnSortingOrderChange() function CompoundPanel:OnSortingOrderChange()
this.sortingOrder = self.sortingOrder this.sortingOrder = self.sortingOrder
for i = 1, #this.contents do for i = 1, #this.contents do
@ -105,7 +107,24 @@ function this.TabAdapter(tab, index, status)
Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = Util.LoadSprite(_TabData[index][status]) Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = Util.LoadSprite(_TabData[index][status])
tabLab:GetComponent("Text").text = _TabData[index].name tabLab:GetComponent("Text").text = _TabData[index].name
tabLab:GetComponent("Text").color = _TabFontColor[status] tabLab:GetComponent("Text").color = _TabFontColor[status]
this.SetBottomBarIsActive(tab, index)
end end
--特殊的开启条件
function this.SetBottomBarIsActive(tab, index)
local ConfigData = ConfigManager.GetConfig(ConfigName.SpecialConfig)
if index == 2 then
local string = ConfigData[40].Value
local num = string.split(string.split(string,"|")[1],"#")[2]
tab:SetActive(PlayerManager.level >= tonumber(num))
end
if index == 3 then
local string = ConfigData[89].Value
tab:SetActive(PlayerManager.level >= tonumber(string))
end
end
--切换视图 --切换视图
function this.SwitchView(index) function this.SwitchView(index)
--先执行上一面板关闭逻辑 --先执行上一面板关闭逻辑

View File

@ -186,6 +186,18 @@ function this.TabAdapter(tab, index, status)
Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = Util.LoadSprite(_TabData[index][status]) Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = Util.LoadSprite(_TabData[index][status])
tabLab:GetComponent("Text").text = _TabData[index].name tabLab:GetComponent("Text").text = _TabData[index].name
tabLab:GetComponent("Text").color = _TabFontColor[status] tabLab:GetComponent("Text").color = _TabFontColor[status]
this.SetBottomBarIsActive(tab, index)
end
--特殊的开启条件
function this.SetBottomBarIsActive(tab, index)
local ConfigData = ConfigManager.GetConfig(ConfigName.SpecialConfig)
if index == 4 then
local string = ConfigData[40].Value
local num = string.split(string.split(string,"|")[1],"#")[2]
tab:SetActive(PlayerManager.level >= tonumber(num))
end
end end
function this.RewardGridGoMov(isSha,fun) function this.RewardGridGoMov(isSha,fun)

View File

@ -3,6 +3,7 @@ require("Base/BasePanel")
SoulPrintHandBook = Inherit(BasePanel) SoulPrintHandBook = Inherit(BasePanel)
local this = SoulPrintHandBook local this = SoulPrintHandBook
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig) local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local ConfigData = ConfigManager.GetConfig(ConfigName.SpecialConfig)
local orginLayer=0--层级 local orginLayer=0--层级
local allSoulPrintData={}--所有魂印数据 local allSoulPrintData={}--所有魂印数据
local curIndex = 0--当前选择索引 local curIndex = 0--当前选择索引
@ -82,6 +83,18 @@ end
function SoulPrintHandBook:OnShow() function SoulPrintHandBook:OnShow()
curIndex=0 curIndex=0
this.OnRefresh(curIndex) this.OnRefresh(curIndex)
this.SetBottomBarIsActive()
end
--特殊的开启条件
function this.SetBottomBarIsActive()
for i = 1, #tabs do
--为白金魂印定开启规则
if i == 4 then
local num = ConfigData[89].Value
tabs[i]:SetActive(PlayerManager.level >= tonumber(num))
end
end
end end
function SoulPrintHandBook:OnClose() function SoulPrintHandBook:OnClose()
@ -96,8 +109,18 @@ local orginLayer2=0
--打开页面时,页面数据刷新 --打开页面时,页面数据刷新
function this.OnRefresh(index) function this.OnRefresh(index)
local tempData={} local tempData={}
local num = ConfigData[89].Value
if index==0 then if index==0 then
tempData=allSoulPrintData if PlayerManager.level >= tonumber(num) then--达到80级才显示白色魂印
tempData=allSoulPrintData
else
for i,v in ipairs(allSoulPrintData) do
if v.Quality ~= 7 then
table.insert(tempData, v)
end
end
end
else else
for i,v in ipairs(allSoulPrintData) do for i,v in ipairs(allSoulPrintData) do
if v.Quality==(index+3) then if v.Quality==(index+3) then
@ -105,6 +128,7 @@ function this.OnRefresh(index)
end end
end end
end end
--预设容器 --预设容器
list={} list={}
this.scrollView:SetData(tempData,function(index,root) this.scrollView:SetData(tempData,function(index,root)