TCX_LongZhu
parent
f4ff177ee5
commit
6ca72f2364
|
|
@ -32,7 +32,9 @@ function PracticeImprint:InitComponent()
|
|||
|
||||
self.doBtn = Util.GetGameObject(self.ImprintInfo, "Content/Btn")
|
||||
self.doBtnText = Util.GetGameObject(self.doBtn, "Text"):GetComponent("Text")
|
||||
|
||||
self.needs = Util.GetGameObject(self.ImprintInfo, "Needs")
|
||||
self.needPre = Util.GetGameObject(self.needs, "pre")
|
||||
self.itemList = {}
|
||||
self.sizeDelta = {
|
||||
[1] = Vector2.New(UIManager.UIWidth,UIManager.UIHeight-100),
|
||||
[2] = Vector2.New(UIManager.UIWidth,UIManager.UIHeight-710),
|
||||
|
|
@ -82,7 +84,7 @@ function PracticeImprint:Refresh(isTop,isAni,func)
|
|||
v.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, #self.allImprintData do
|
||||
local data = self.allImprintData[i]
|
||||
--local data = self.allImprintData[i]
|
||||
if not self.ImprintList[i] then
|
||||
self.ImprintList[i] = newObject(self.ImprintPre)
|
||||
self.ImprintList[i].transform.name = "ImprintPre"..i
|
||||
|
|
@ -100,16 +102,17 @@ end
|
|||
|
||||
--设置每一期的三个神印
|
||||
function PracticeImprint:SetPre(index,_go,_data)
|
||||
local title = Util.GetGameObject(_go, "title/Image"):GetComponent("Image")
|
||||
title.sprite = self.spLoader:LoadSprite(_data.NamePic1)
|
||||
for i = 1, 3 do
|
||||
--local title = Util.GetGameObject(_go, "title/Image"):GetComponent("Image")
|
||||
--title.sprite = self.spLoader:LoadSprite(_data.NamePic1)
|
||||
for i = 1, 4 do
|
||||
local Imprint = Util.GetGameObject(_go, "Content/Imprint"..i)
|
||||
self:SetSingleImprint(Imprint,_data.TeamSkill[i])
|
||||
self:SetSingleImprint(Imprint,_data[i])
|
||||
end
|
||||
end
|
||||
|
||||
--设置单个神印信息
|
||||
function PracticeImprint:SetSingleImprint(_go,_imprintId)
|
||||
function PracticeImprint:SetSingleImprint(_go,_data)
|
||||
local _imprintId = _data.Id
|
||||
local serverData,configData = PracticeManager.GetSingleImprintData(_imprintId)--获取神印信息
|
||||
local maskBtn = Util.GetGameObject(_go, "mask")
|
||||
local heroImg = Util.GetGameObject(_go, "hero"):GetComponent("Image")
|
||||
|
|
@ -160,7 +163,7 @@ function PracticeImprint:SetSingleImprint(_go,_imprintId)
|
|||
end
|
||||
else
|
||||
if not serverData then
|
||||
PopupTipPanel.ShowTip(string.format("%s解锁",configData.Unlock))
|
||||
--PopupTipPanel.ShowTip(string.format("%s解锁",configData.Consume[2]))
|
||||
return
|
||||
end
|
||||
end
|
||||
|
|
@ -194,8 +197,34 @@ function PracticeImprint:ShowSingleImprintInfoLayout(_serverData,_configData)
|
|||
--右侧部分状态和按钮显示
|
||||
if not _serverData then
|
||||
self.rightInfo:SetActive(false)
|
||||
self.doBtnText.text = string.format("%s解锁",_configData.Unlock)
|
||||
self.doBtnText.text = "解锁"
|
||||
if not self.itemList then
|
||||
self.itemList = {}
|
||||
end
|
||||
for k,v in ipairs(self.itemList) do
|
||||
v.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, #_configData.Consume do
|
||||
local data = _configData.Consume[i]
|
||||
if not self.itemList[i] then
|
||||
self.itemList[i] = newObject(self.needPre)
|
||||
self.itemList[i].transform:SetParent(self.needs.transform)
|
||||
self.itemList[i].transform.localScale = Vector3.one
|
||||
self.itemList[i].transform.localPosition = Vector3.zero
|
||||
end
|
||||
local icon = Util.GetGameObject(self.itemList[i],"icon"):GetComponent("Image")
|
||||
local num = Util.GetGameObject(self.itemList[i],"num"):GetComponent("Text")
|
||||
icon.sprite = self.spLoader:LoadSprite(GetSpriteNameByItemId(data[1]))
|
||||
num.text = data[2]
|
||||
if BagManager.GetTotalItemNum(data[1]) < data[2] then
|
||||
num.text = string.format("<color=red>%s</color>",data[2])
|
||||
end
|
||||
self.itemList[i]:SetActive(true)
|
||||
end
|
||||
|
||||
self.needs:SetActive(true)
|
||||
else
|
||||
self.needs:SetActive(false)
|
||||
if _configData.Type == 0 then
|
||||
self.rightInfo:SetActive(false)
|
||||
elseif _configData.Type == 1 then
|
||||
|
|
@ -344,6 +373,7 @@ function PracticeImprint:OnDestroy()
|
|||
self.UpView = nil
|
||||
self.ImprintList = {}
|
||||
self.SelectList = {}
|
||||
self.itemList = {}
|
||||
end
|
||||
|
||||
return PracticeImprint
|
||||
|
|
@ -304,9 +304,19 @@ end
|
|||
--获取所有神印信息
|
||||
function this.GetAllImprintData()
|
||||
local AllImprintList = {}
|
||||
for i, v in ConfigPairs(XiuXianConfig) do
|
||||
if v.TeamSkill then
|
||||
table.insert(AllImprintList,v)
|
||||
--for i, v in ConfigPairs(XiuXianConfig) do
|
||||
--if v.TeamSkill then
|
||||
--table.insert(AllImprintList,v)
|
||||
--end
|
||||
--end
|
||||
for i, v in ConfigPairs(XiuXianSkillConfig) do
|
||||
if v.SkillTtype == 1 then
|
||||
if AllImprintList[v.SkillSet] then
|
||||
table.insert(AllImprintList[v.SkillSet],v)
|
||||
else
|
||||
AllImprintList[v.SkillSet] = {}
|
||||
table.insert(AllImprintList[v.SkillSet],v)
|
||||
end
|
||||
end
|
||||
end
|
||||
return AllImprintList
|
||||
|
|
|
|||
Loading…
Reference in New Issue