2021-11-15 18:24:39 +08:00
|
|
|
|
require("Base/BasePanel")
|
|
|
|
|
TailsmanSoulMainPanel = Inherit(BasePanel)
|
|
|
|
|
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
2021-11-16 09:33:10 +08:00
|
|
|
|
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
2024-01-02 10:54:50 +08:00
|
|
|
|
local specialConfig=ConfigManager.GetConfigData(ConfigName.SpecialConfig,177)
|
2021-11-15 18:24:39 +08:00
|
|
|
|
local sortOrder = 0
|
2024-01-02 10:54:50 +08:00
|
|
|
|
local pro=tonumber(specialConfig.Value)/10000
|
|
|
|
|
local addLv=0
|
2021-11-15 18:24:39 +08:00
|
|
|
|
local curData = {}
|
|
|
|
|
function TailsmanSoulMainPanel:InitComponent()
|
|
|
|
|
self.spLoader = SpriteLoader.New()
|
|
|
|
|
self.help = Util.GetGameObject(self.transform, "help")
|
|
|
|
|
self.helpPos = self.help:GetComponent("RectTransform").localPosition
|
|
|
|
|
self.btnBack = Util.GetGameObject(self.transform, "btnBack")
|
|
|
|
|
|
|
|
|
|
self.tailsmainSoul = Util.GetGameObject(self.gameObject, "tailsmainSoul")
|
|
|
|
|
self.tailsmainSoulDi = Util.GetGameObject(self.tailsmainSoul, "di"):GetComponent("Image")
|
|
|
|
|
self.icon = Util.GetGameObject(self.tailsmainSoul, "icon"):GetComponent("Image")
|
|
|
|
|
|
2024-01-02 10:54:50 +08:00
|
|
|
|
--self.starGray = Util.GetGameObject(self.transform,"proMainLayout/starGrid/starGray")
|
|
|
|
|
--self.starLight = Util.GetGameObject(self.transform,"proMainLayout/starGrid/starLight")
|
|
|
|
|
self.starGrid = Util.GetGameObject(self.transform,"proMainLayout/starGrid")
|
2021-11-15 18:24:39 +08:00
|
|
|
|
self.upLvBtn = Util.GetGameObject(self.transform, "proMainLayout/upLvBtn")
|
|
|
|
|
self.upLvBtnText = Util.GetGameObject(self.upLvBtn, "Text"):GetComponent("Text")
|
2021-11-16 09:33:10 +08:00
|
|
|
|
self.upLvBtnRed = Util.GetGameObject(self.upLvBtn, "red")
|
2021-11-19 18:48:18 +08:00
|
|
|
|
self.costLayout = Util.GetGameObject(self.transform, "proMainLayout/layout")
|
2021-11-19 16:52:15 +08:00
|
|
|
|
self.costIconParent = Util.GetGameObject(self.transform, "proMainLayout/layout/iconDi")
|
|
|
|
|
self.costIcon = Util.GetGameObject(self.costIconParent, "icon"):GetComponent("Image")
|
2021-11-15 18:24:39 +08:00
|
|
|
|
self.costNum = Util.GetGameObject(self.transform, "proMainLayout/layout/num"):GetComponent("Text")
|
|
|
|
|
self.pro = Util.GetGameObject(self.transform, "proMainLayout/pro")
|
|
|
|
|
self.proGrid = Util.GetGameObject(self.transform, "proMainLayout/proScrollRect/proScroll")
|
|
|
|
|
self.proList = {}
|
|
|
|
|
|
|
|
|
|
self.select = Util.GetGameObject(self.transform, "select")
|
|
|
|
|
self.tailsGrid = Util.GetGameObject(self.transform, "tailsScroll")
|
|
|
|
|
self.tailsPre = Util.GetGameObject(self.transform, "tailsPre")
|
|
|
|
|
self.tailsList = {}
|
|
|
|
|
for i = 1, self.tailsGrid.transform.childCount do
|
|
|
|
|
if not self.tailsList[i] then
|
|
|
|
|
self.tailsList[i] = {}
|
|
|
|
|
self.tailsList[i].go = self.tailsGrid.transform:GetChild(i-1)
|
2021-11-19 16:52:15 +08:00
|
|
|
|
self.tailsList[i].card = Util.GetGameObject(self.tailsList[i].go,"ItemView")
|
|
|
|
|
self.tailsList[i].bg = Util.GetGameObject(self.tailsList[i].card.transform,"item/frame"):GetComponent("Image")
|
|
|
|
|
self.tailsList[i].icon = Util.GetGameObject(self.tailsList[i].card.transform,"item/icon"):GetComponent("Image")
|
|
|
|
|
self.tailsList[i].starGray = Util.GetGameObject(self.tailsList[i].card.transform,"item/starGrid/starGray")
|
2021-11-15 18:24:39 +08:00
|
|
|
|
self.tailsList[i].starLight = Util.GetGameObject(self.tailsList[i].card.transform,"starGrid/starLight")
|
2021-11-19 16:52:15 +08:00
|
|
|
|
self.tailsList[i].name = Util.GetGameObject(self.tailsList[i].card.transform,"name"):GetComponent("Text")
|
|
|
|
|
self.tailsList[i].red = Util.GetGameObject(self.tailsList[i].card.transform,"redPoint")
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self.skillPro = Util.GetGameObject(self.transform, "skillLayout/pro")
|
|
|
|
|
self.skillGrid = Util.GetGameObject(self.transform, "skillLayout/proScrolllRect/proScroll")
|
2021-11-16 15:24:17 +08:00
|
|
|
|
self.skillGridPos = self.skillGrid:GetComponent("RectTransform").anchoredPosition3D
|
2021-11-15 18:24:39 +08:00
|
|
|
|
self.skillList = {}
|
2021-11-19 14:35:42 +08:00
|
|
|
|
|
|
|
|
|
self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
|
2021-11-19 18:32:22 +08:00
|
|
|
|
|
2023-10-31 14:38:02 +08:00
|
|
|
|
--self.effect = Util.GetGameObject(self.transform, "Effect")
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
2021-11-16 15:24:17 +08:00
|
|
|
|
|
2021-11-15 18:24:39 +08:00
|
|
|
|
function TailsmanSoulMainPanel:BindEvent()
|
2021-11-19 18:32:22 +08:00
|
|
|
|
Util.AddClick(self.costIcon.gameObject, function()
|
|
|
|
|
local costId,num = TailsManSoulManager.GetTailsmanCost(self.data.id,self.data.lv)
|
|
|
|
|
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,costId,nil)
|
|
|
|
|
end)
|
2021-11-15 18:24:39 +08:00
|
|
|
|
Util.AddClick(self.btnBack, function()
|
|
|
|
|
self:ClosePanel()
|
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(self.help, function()
|
|
|
|
|
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.tailsmainSoul,self.helpPos.x, self.helpPos.y)
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
--逍遥游
|
|
|
|
|
Util.AddClick(self.upLvBtn,function()
|
2021-11-16 09:33:10 +08:00
|
|
|
|
local costId,num = TailsManSoulManager.GetTailsmanCost(self.data.id,self.data.lv)
|
|
|
|
|
local curNum = BagManager.GetItemCountById(costId)
|
|
|
|
|
local isEnough = false,false
|
|
|
|
|
if num and num > 0 then
|
|
|
|
|
if curNum >= num then
|
2021-11-16 15:24:17 +08:00
|
|
|
|
local oldPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
|
2021-11-16 09:33:10 +08:00
|
|
|
|
NetManager.FaBaoSoulUpLvRequest(self.data.id,self.data.lv + 1, function()
|
|
|
|
|
self:OnShow()
|
2021-11-16 15:24:17 +08:00
|
|
|
|
if self.data.lv < 2 then
|
|
|
|
|
PopupTipPanel.ShowTip(string.format("%s激活成功!",self.data.config.Name))
|
|
|
|
|
else
|
|
|
|
|
PopupTipPanel.ShowTip(string.format("%s强化成功!",self.data.config.Name))
|
|
|
|
|
end
|
|
|
|
|
local newPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
|
|
|
|
|
if newPower - oldPower > 0 then
|
|
|
|
|
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldPower,newValue = newPower})
|
|
|
|
|
end
|
2021-11-16 09:33:10 +08:00
|
|
|
|
end)
|
|
|
|
|
else
|
|
|
|
|
PopupTipPanel.ShowTip(string.format("%s不足",ItemConfig[costId].Name))
|
|
|
|
|
end
|
|
|
|
|
else
|
2021-11-16 15:24:17 +08:00
|
|
|
|
PopupTipPanel.ShowTip("已达上限")
|
2021-11-16 09:33:10 +08:00
|
|
|
|
end
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
|
function TailsmanSoulMainPanel:AddListener()
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--移除事件监听(用于子类重写)
|
|
|
|
|
function TailsmanSoulMainPanel:RemoveListener()
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:OnSortingOrderChange()
|
2024-01-02 10:54:50 +08:00
|
|
|
|
-- Util.SetParticleSortLayer(self.effect,self.sortingOrder + 1)
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:OnOpen(curCompId)
|
|
|
|
|
self.curCompId = curCompId
|
|
|
|
|
self.index = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:OnShow()
|
2021-11-19 14:35:42 +08:00
|
|
|
|
self.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
2021-11-15 18:24:39 +08:00
|
|
|
|
self.trumpList,self.compMaxLv,self.complv,self.skillDataList = TailsManSoulManager.GetTailsmanSoulDataById(self.curCompId)
|
|
|
|
|
self:SetTailsManList(self.trumpList,self.tailsGrid,self.tailsPre)
|
|
|
|
|
self:ChangeTailsMan()
|
|
|
|
|
local data1 = self:GetSkillDataList(self.skillDataList)
|
2021-11-16 15:24:17 +08:00
|
|
|
|
self:SetProList(data1,self.skillList,self.skillGrid,self.skillPro)
|
|
|
|
|
self:SetSkillGridPos(data1)
|
2023-10-31 14:38:02 +08:00
|
|
|
|
--Util.SetParticleSortLayer(self.effect,self.sortingOrder + 1)
|
2021-11-16 15:24:17 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:SetSkillGridPos()
|
2021-11-22 15:48:54 +08:00
|
|
|
|
-- local pos = self.skillGrid:GetComponent("RectTransform").anchoredPosition3D
|
|
|
|
|
-- for i = 1,#self.skillList do
|
|
|
|
|
-- if self.complv > i then
|
|
|
|
|
-- pos.y = self.skillGridPos.y + GetPreferredHeight(self.skillList[i].go.transform)
|
|
|
|
|
-- end
|
|
|
|
|
-- end
|
|
|
|
|
-- self.skillGrid:GetComponent("RectTransform").anchoredPosition3D = pos
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:GetSkillDataList()
|
2021-11-16 15:24:17 +08:00
|
|
|
|
local datas = {}
|
2024-01-02 10:54:50 +08:00
|
|
|
|
|
2021-11-16 15:24:17 +08:00
|
|
|
|
for k,v in pairs(self.skillDataList) do
|
|
|
|
|
local str = v
|
2021-11-22 15:25:26 +08:00
|
|
|
|
if self.complv == k then
|
2024-01-02 10:54:50 +08:00
|
|
|
|
str = string.format("<color=#00FF00>%s %s</color>",str,"羁绊基础属性提升"..pro*100*k.."%")
|
2021-11-22 15:48:54 +08:00
|
|
|
|
elseif self.complv < k then
|
2024-01-02 10:54:50 +08:00
|
|
|
|
str = string.format("<color=#BFBFBF>%s %s</color>",str,"羁绊聚灵基础属性提升"..pro*100*k.."%")
|
2021-11-15 18:24:39 +08:00
|
|
|
|
else
|
2024-01-02 10:54:50 +08:00
|
|
|
|
str = string.format("<color=#FFCF9E>%s %s</color>",str,"羁绊聚灵基础属性提升"..pro*100*k.."%")
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
2021-11-16 15:24:17 +08:00
|
|
|
|
datas[k] = str
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
2021-11-16 15:24:17 +08:00
|
|
|
|
return datas
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:ChangeTailsMan()
|
|
|
|
|
self.data = self.trumpList[self.index]
|
|
|
|
|
self.icon.sprite = self.spLoader:LoadSprite(GetResourcePath(self.data.config.Icon))
|
2023-10-31 14:38:02 +08:00
|
|
|
|
--self.tailsmainSoulDi.sprite = self.spLoader:LoadSprite(GetTailsmanDiImage[self.data.config.Quality])
|
2024-01-02 10:54:50 +08:00
|
|
|
|
--获取技能加成等级
|
|
|
|
|
addLv=0
|
|
|
|
|
for i=1,5 do
|
|
|
|
|
local curData = TailsManSoulManager.GetTailsmanSoulDatasByPro(i)
|
|
|
|
|
for j=1,#curData do
|
|
|
|
|
--LogError("curData.lv=========="..curData[j].lv)
|
|
|
|
|
if curData[j].lv>0 then
|
|
|
|
|
addLv=addLv+curData[j].lv
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
2021-11-15 18:24:39 +08:00
|
|
|
|
local data1 = self:GetProData()
|
2024-01-02 10:54:50 +08:00
|
|
|
|
|
2021-11-15 18:24:39 +08:00
|
|
|
|
self:SetProList(data1,self.proList,self.proGrid,self.pro)
|
|
|
|
|
self:SetSelect()
|
|
|
|
|
self:SetCostItem()
|
2024-01-02 10:54:50 +08:00
|
|
|
|
--self:SetStar(self.starGray,self.data.config.LvMax)
|
|
|
|
|
--self:SetStar(self.starLight,self.data.lv)
|
|
|
|
|
SetHeroStars(self.spLoader,self.starGrid,self.data.lv)
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:GetProData()
|
|
|
|
|
local proData = {}
|
|
|
|
|
local curData = ConfigManager.GetConfigDataByDoubleKey(ConfigName.TrumpLevelupPool,"PoolId",self.data.config.LvupPool,"Level",self.data.lv).LvupProps
|
|
|
|
|
local nextProData = {}
|
2021-11-16 15:24:17 +08:00
|
|
|
|
local tempdata = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.TrumpLevelupPool,"PoolId",self.data.config.LvupPool,"Level",self.data.lv + 1)
|
2021-11-15 18:24:39 +08:00
|
|
|
|
local isMax = 0
|
|
|
|
|
if not tempdata then
|
|
|
|
|
isMax = 1
|
|
|
|
|
else
|
|
|
|
|
nextProData = self:SetProData(tempdata.LvupProps)
|
|
|
|
|
end
|
|
|
|
|
local str = ""
|
|
|
|
|
for i = 1,#curData do
|
2024-01-02 10:54:50 +08:00
|
|
|
|
--LogError("addlv======================"..addLv.." pro========="..pro)
|
|
|
|
|
local value=math.floor(curData[i][2]*(1+addLv*pro)+0.5)
|
|
|
|
|
str = string.format("<color=#ecdfc8>%s:%s</color>",propertyConfig[curData[i][1]].Info,GetPropertyFormatStrOne(propertyConfig[curData[i][1]].Style,value) )
|
2021-11-15 18:24:39 +08:00
|
|
|
|
if nextProData[curData[i][1]] then
|
2024-01-02 10:54:50 +08:00
|
|
|
|
str = str..string.format("<color=#00FF00>(+%s)</color>",GetPropertyFormatStrOne(propertyConfig[curData[i][1]].Style,nextProData[curData[i][1]] - value))
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
|
|
|
|
table.insert(proData,str)
|
|
|
|
|
end
|
|
|
|
|
return proData
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:SetProData(proData)
|
|
|
|
|
local proList = {}
|
|
|
|
|
for i = 1,#proData do
|
|
|
|
|
if not proList[proData[i][1]] then
|
|
|
|
|
proList[proData[i][1]] = 0
|
|
|
|
|
end
|
|
|
|
|
proList[proData[i][1]] = proList[proData[i][1]] + proData[i][2]
|
|
|
|
|
end
|
2024-01-02 10:54:50 +08:00
|
|
|
|
for k, v in pairs(proList) do
|
|
|
|
|
proList[k]=math.floor(v*(1+addLv*pro)+0.5)
|
|
|
|
|
end
|
2021-11-15 18:24:39 +08:00
|
|
|
|
return proList
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:SetProList(data,preList,grid,pre)
|
|
|
|
|
for i = 1,math.max(#data,#preList) do
|
|
|
|
|
if not data[i] then
|
|
|
|
|
preList[i].go.gameObject:SetActive(false)
|
|
|
|
|
else
|
|
|
|
|
if not preList[i] then
|
|
|
|
|
preList[i] = {}
|
2021-11-19 16:52:15 +08:00
|
|
|
|
preList[i].go = newObjToParent(pre.gameObject,grid.gameObject)
|
2021-11-15 18:24:39 +08:00
|
|
|
|
preList[i].goText = preList[i].go:GetComponent("Text")
|
|
|
|
|
end
|
|
|
|
|
preList[i].go.gameObject:SetActive(true)
|
|
|
|
|
preList[i].goText.text = data[i]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
ForceRebuildLayout(grid.transform)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:SetCostItem()
|
|
|
|
|
local costId,num = TailsManSoulManager.GetTailsmanCost(self.data.id,self.data.lv)
|
|
|
|
|
local curNum = BagManager.GetItemCountById(costId)
|
2021-11-19 16:52:15 +08:00
|
|
|
|
local colo = curNum >= num and "#FF0000" or "#Ffeac6"
|
2021-11-19 18:48:18 +08:00
|
|
|
|
local ismax = false
|
2021-11-16 15:24:17 +08:00
|
|
|
|
if num and num > 0 then
|
2021-11-19 18:48:18 +08:00
|
|
|
|
self.costLayout.gameObject:SetActive(true)
|
2021-11-16 15:24:17 +08:00
|
|
|
|
self.costIcon.sprite = self.spLoader:LoadSprite(GetSpriteNameByItemId(costId))
|
2021-11-15 18:24:39 +08:00
|
|
|
|
self.costNum.text = string.format("<color=#%s>%s/%s</color>",colo,curNum,num)
|
2021-11-16 09:33:10 +08:00
|
|
|
|
if curNum > num then
|
|
|
|
|
self.upLvBtnRed.gameObject:SetActive(true)
|
|
|
|
|
else
|
|
|
|
|
self.upLvBtnRed.gameObject:SetActive(false)
|
|
|
|
|
end
|
2021-11-16 15:24:17 +08:00
|
|
|
|
Util.SetGray(self.upLvBtn,false)
|
2021-11-19 18:48:18 +08:00
|
|
|
|
ismax = false
|
2021-11-15 18:24:39 +08:00
|
|
|
|
else
|
2021-11-19 18:54:16 +08:00
|
|
|
|
self.upLvBtnRed.gameObject:SetActive(false)
|
2021-11-19 18:48:18 +08:00
|
|
|
|
self.costLayout.gameObject:SetActive(false)
|
2021-11-16 15:24:17 +08:00
|
|
|
|
Util.SetGray(self.upLvBtn,true)
|
2021-11-19 18:48:18 +08:00
|
|
|
|
ismax = true
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
|
|
|
|
if self.data.lv < 1 then
|
|
|
|
|
self.upLvBtnText.text = "激活"
|
2021-11-19 18:48:18 +08:00
|
|
|
|
elseif ismax then
|
|
|
|
|
self.upLvBtnText.text = "已达上限"
|
2021-11-15 18:24:39 +08:00
|
|
|
|
else
|
|
|
|
|
self.upLvBtnText.text = "强化"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:SetSelect()
|
2021-11-19 16:52:15 +08:00
|
|
|
|
self.select.transform:SetParent(self.tailsList[self.index].go.transform)
|
|
|
|
|
self.select.transform.localPosition = Vector3.New(-0.84,20.73,0)
|
2021-11-15 18:24:39 +08:00
|
|
|
|
self.select.transform.localScale = Vector3.one
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:SetTailsManList(data,grid,pre)
|
|
|
|
|
for i = 1,math.max(#data,#self.tailsList) do
|
|
|
|
|
if not data[i] then
|
|
|
|
|
self.tailsList[i].go.gameObject:SetActive(false)
|
|
|
|
|
else
|
|
|
|
|
if not self.tailsList[i] then
|
|
|
|
|
self.tailsList[i] = {}
|
2021-11-19 16:52:15 +08:00
|
|
|
|
self.tailsList[i].go = newObjToParent(pre.gameObject,grid.gameObject)
|
|
|
|
|
self.tailsList[i].card = Util.GetGameObject(self.tailsList[i].go,"ItemView")
|
|
|
|
|
self.tailsList[i].bg = Util.GetGameObject(self.tailsList[i].card.transform,"item/frame"):GetComponent("Image")
|
|
|
|
|
self.tailsList[i].icon = Util.GetGameObject(self.tailsList[i].card.transform,"item/icon"):GetComponent("Image")
|
2024-01-02 10:54:50 +08:00
|
|
|
|
--self.tailsList[i].starGray = Util.GetGameObject(self.tailsList[i].card.transform,"item/starGrid/starGray")
|
|
|
|
|
--self.tailsList[i].starLight = Util.GetGameObject(self.tailsList[i].card.transform,"starGrid/starLight")
|
|
|
|
|
self.tailsList[i].starGrid = Util.GetGameObject(self.tailsList[i].card.transform,"starGrid")
|
2021-11-19 16:52:15 +08:00
|
|
|
|
self.tailsList[i].name = Util.GetGameObject(self.tailsList[i].card.transform,"name"):GetComponent("Text")
|
|
|
|
|
self.tailsList[i].red = Util.GetGameObject(self.tailsList[i].card.transform,"redPoint")
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
|
|
|
|
self.tailsList[i].go.gameObject:SetActive(true)
|
2021-11-19 16:52:15 +08:00
|
|
|
|
self.tailsList[i].bg.sprite = self.spLoader:LoadSprite(GetQuantityImageByquality(data[i].config.Quality))
|
2021-11-15 18:24:39 +08:00
|
|
|
|
self.tailsList[i].icon.sprite = self.spLoader:LoadSprite(GetResourcePath(data[i].config.Icon))
|
|
|
|
|
self.tailsList[i].name.text = data[i].config.Name
|
2024-01-02 10:54:50 +08:00
|
|
|
|
--self:SetStar(self.tailsList[i].starGray,data[i].config.LvMax)
|
|
|
|
|
--self:SetStar(self.tailsList[i].starLight,data[i].lv)
|
|
|
|
|
SetHeroStars(self.spLoader,self.tailsList[i].starGrid,data[i].lv)
|
2021-11-16 09:33:10 +08:00
|
|
|
|
local costId,num = TailsManSoulManager.GetTailsmanCost(data[i].id,data[i].lv)
|
|
|
|
|
local curNum = BagManager.GetItemCountById(costId)
|
|
|
|
|
if num and num > 0 and curNum >= num then
|
|
|
|
|
self.tailsList[i].red.gameObject:SetActive(true)
|
|
|
|
|
else
|
|
|
|
|
self.tailsList[i].red.gameObject:SetActive(false)
|
|
|
|
|
end
|
2021-11-19 16:52:15 +08:00
|
|
|
|
Util.AddOnceClick(self.tailsList[i].go,function()
|
2021-11-15 18:24:39 +08:00
|
|
|
|
self.index = i
|
|
|
|
|
self:ChangeTailsMan()
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:SetStar(grid,star)
|
|
|
|
|
for i = 1, grid.transform.childCount do
|
|
|
|
|
if star >= i then
|
|
|
|
|
grid.transform:GetChild(i-1).gameObject:SetActive(true)
|
|
|
|
|
else
|
|
|
|
|
grid.transform:GetChild(i-1).gameObject:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TailsmanSoulMainPanel:OnClose()
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
|
function TailsmanSoulMainPanel:OnDestroy()
|
|
|
|
|
self.proList = {}
|
|
|
|
|
self.skillList = {}
|
2021-11-19 14:35:42 +08:00
|
|
|
|
SubUIManager.Close(self.UpView)
|
2021-11-15 18:24:39 +08:00
|
|
|
|
end
|
|
|
|
|
return TailsmanSoulMainPanel
|