【玩家信息】增加额外属性
parent
455cdcd19c
commit
36b475ee15
File diff suppressed because it is too large
Load Diff
|
@ -90,6 +90,21 @@ local _ViewConfig = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local InfoBtns = {
|
||||||
|
[1] = {
|
||||||
|
name = "紫府神印",
|
||||||
|
gridName = "imprintInfo",
|
||||||
|
},
|
||||||
|
[2] = {
|
||||||
|
name = "身外化身",
|
||||||
|
gridName = "huashenInfo",
|
||||||
|
},
|
||||||
|
[3] = {
|
||||||
|
name = "四象心法",
|
||||||
|
gridName = "fourElementInfo",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
local curPlayerName = ""
|
local curPlayerName = ""
|
||||||
local _PlayerHead = nil
|
local _PlayerHead = nil
|
||||||
--初始化组件(用于子类重写)
|
--初始化组件(用于子类重写)
|
||||||
|
@ -110,7 +125,6 @@ function PlayerInfoPopup:InitComponent()
|
||||||
this.memPower = Util.GetGameObject(self.transform, "tipImage/panel/defendbox/power"):GetComponent("Text")
|
this.memPower = Util.GetGameObject(self.transform, "tipImage/panel/defendbox/power"):GetComponent("Text")
|
||||||
this.formationTip = Util.GetGameObject(self.transform, "tipImage/panel/defendbox/tip"):GetComponent("Text")
|
this.formationTip = Util.GetGameObject(self.transform, "tipImage/panel/defendbox/tip"):GetComponent("Text")
|
||||||
|
|
||||||
this.attackCount = Util.GetGameObject(self.transform, "tipImage/attackCount"):GetComponent("Text")
|
|
||||||
this.demonsHeroList=Util.GetGameObject(self.gameObject, "tipImage/panel/defendbox/demons")
|
this.demonsHeroList=Util.GetGameObject(self.gameObject, "tipImage/panel/defendbox/demons")
|
||||||
this.diffDemonsHeroList=Util.GetGameObject(self.gameObject, "tipImage/panel/defendbox/diffdemons")
|
this.diffDemonsHeroList=Util.GetGameObject(self.gameObject, "tipImage/panel/defendbox/diffdemons")
|
||||||
this.Demons = {}
|
this.Demons = {}
|
||||||
|
@ -141,10 +155,17 @@ function PlayerInfoPopup:InitComponent()
|
||||||
this.btnList[2] = Util.GetGameObject(this.btnBox, "btn2")
|
this.btnList[2] = Util.GetGameObject(this.btnBox, "btn2")
|
||||||
this.btnList[3] = Util.GetGameObject(this.btnBox, "btn3")
|
this.btnList[3] = Util.GetGameObject(this.btnBox, "btn3")
|
||||||
--神印信息
|
--神印信息
|
||||||
this.imprintObj = Util.GetGameObject(self.transform, "tipImage/panel/imprintInfo")
|
-- this.imprintObj = Util.GetGameObject(self.transform, "tipImage/panel/imprintInfo")
|
||||||
this.imprintGrid = Util.GetGameObject(this.imprintObj, "Imprints")
|
-- this.imprintGrid = Util.GetGameObject(this.imprintObj, "Imprints")
|
||||||
this.imprintPre = Util.GetGameObject(self.transform, "imprintPre")
|
-- this.imprintPre = Util.GetGameObject(self.transform, "imprintPre")
|
||||||
this.imprintItemList = {}
|
--所有信息Obj的PreList
|
||||||
|
this.InfoBtns = Util.GetGameObject(self.transform, "tipImage/panel/InfoBtns")
|
||||||
|
this.InfoBtnsGrid = Util.GetGameObject(this.InfoBtns, "Grid")
|
||||||
|
this.InfoContent = Util.GetGameObject(self.transform, "tipImage/panel/InfoGrids")
|
||||||
|
this.infoBtnPre = Util.GetGameObject(self.transform, "btnPre")--按钮的Pre
|
||||||
|
this.imprintPre = Util.GetGameObject(self.transform, "imprintPre")--神印的Pre
|
||||||
|
this.InfoBtnsList = {}
|
||||||
|
this.ItemPreList = {}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -328,6 +349,7 @@ end
|
||||||
|
|
||||||
-- 编队数据匹配
|
-- 编队数据匹配
|
||||||
function this.FormationAdapter(teamInfo)
|
function this.FormationAdapter(teamInfo)
|
||||||
|
--====================编队信息======================
|
||||||
this.formationTip.text = _ViewConfig[this._ViewType].tip
|
this.formationTip.text = _ViewConfig[this._ViewType].tip
|
||||||
-- 战斗力
|
-- 战斗力
|
||||||
this.memPower.text = teamInfo.totalForce
|
this.memPower.text = teamInfo.totalForce
|
||||||
|
@ -387,8 +409,8 @@ function this.FormationAdapter(teamInfo)
|
||||||
else
|
else
|
||||||
this.pokemonObj:SetActive(false)
|
this.pokemonObj:SetActive(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
--队伍灵兽
|
--====================队伍灵兽信息======================
|
||||||
for i, hero in ipairs(teamInfo.PokemonInfos) do
|
for i, hero in ipairs(teamInfo.PokemonInfos) do
|
||||||
local demonId = teamInfo.PokemonInfos[i].heroTid
|
local demonId = teamInfo.PokemonInfos[i].heroTid
|
||||||
this.Pokemons[i].gameObject:SetActive(true)
|
this.Pokemons[i].gameObject:SetActive(true)
|
||||||
|
@ -410,39 +432,48 @@ function this.FormationAdapter(teamInfo)
|
||||||
end
|
end
|
||||||
|
|
||||||
--神印信息
|
--神印信息
|
||||||
if teamInfo.sealShow and #teamInfo.sealShow > 0 then
|
-- if teamInfo.sealShow and #teamInfo.sealShow > 0 then
|
||||||
this.imprintObj:SetActive(true)
|
-- this.imprintObj:SetActive(true)
|
||||||
if not this.imprintItemList then
|
-- if not this.imprintItemList then
|
||||||
this.imprintItemList = {}
|
-- this.imprintItemList = {}
|
||||||
end
|
-- end
|
||||||
for i = 1, #this.imprintItemList do
|
-- for i = 1, #this.imprintItemList do
|
||||||
this.imprintItemList[i].gameObject:SetActive(false)
|
-- this.imprintItemList[i].gameObject:SetActive(false)
|
||||||
end
|
-- end
|
||||||
for i = 1, #teamInfo.sealShow do
|
-- for i = 1, #teamInfo.sealShow do
|
||||||
local item = this.imprintItemList[i]
|
-- local item = this.imprintItemList[i]
|
||||||
local value = teamInfo.sealShow[i]
|
-- local value = teamInfo.sealShow[i]
|
||||||
if not item then
|
-- if not item then
|
||||||
item = newObject(this.imprintPre)
|
-- item = newObject(this.imprintPre)
|
||||||
item.name = "imprintPre_"..i
|
-- item.name = "imprintPre_"..i
|
||||||
item.transform:SetParent(this.imprintGrid.transform)
|
-- item.transform:SetParent(this.imprintGrid.transform)
|
||||||
item.transform.localScale = Vector3.one
|
-- item.transform.localScale = Vector3.one
|
||||||
item.transform.localPosition = Vector3.zero
|
-- item.transform.localPosition = Vector3.zero
|
||||||
this.imprintItemList[i] = item
|
-- this.imprintItemList[i] = item
|
||||||
end
|
-- end
|
||||||
|
-- item.gameObject:SetActive(true)
|
||||||
|
-- local icon = Util.GetGameObject(item,"icon"):GetComponent("Image")
|
||||||
|
-- icon.sprite = this.spLoader:LoadSprite(GetResourcePath(XiuXianSkillConfig[value.id].Icon))
|
||||||
|
-- Util.AddOnceClick(item.gameObject,function ()
|
||||||
|
-- UIManager.OpenPanel(UIName.GeneralInfoPopup,GENERALINFO_TYPE.Imprint,value.id,value.heroTId)
|
||||||
|
-- end)
|
||||||
|
-- end
|
||||||
|
-- else
|
||||||
|
-- this.imprintObj:SetActive(false)
|
||||||
|
-- end
|
||||||
|
--====================其他信息按钮显示======================
|
||||||
|
for index, value in ipairs(InfoBtns) do
|
||||||
|
local item = this.InfoBtnsList[index]
|
||||||
|
if not item then
|
||||||
|
item = newObjToParent(this.infoBtnPre,this.InfoBtnsGrid.transform)
|
||||||
|
this.InfoBtnsList[index] = item
|
||||||
item.gameObject:SetActive(true)
|
item.gameObject:SetActive(true)
|
||||||
local icon = Util.GetGameObject(item,"icon"):GetComponent("Image")
|
|
||||||
icon.sprite = this.spLoader:LoadSprite(GetResourcePath(XiuXianSkillConfig[value.id].Icon))
|
|
||||||
Util.AddOnceClick(item.gameObject,function ()
|
|
||||||
UIManager.OpenPanel(UIName.GeneralInfoPopup,GENERALINFO_TYPE.Imprint,value.id,value.heroTId)
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
else
|
Util.GetGameObject(item,"btnName"):GetComponent("Text").text = value.name
|
||||||
this.imprintObj:SetActive(false)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 刷新按钮显示
|
--============================底部按钮显示===========================
|
||||||
function this.RefreshBtnShow()
|
function this.RefreshBtnShow()
|
||||||
this.btnBox:SetActive(true)
|
this.btnBox:SetActive(true)
|
||||||
|
|
||||||
|
@ -479,7 +510,7 @@ function this.RefreshBtnShow()
|
||||||
--一些按钮需要特殊显示
|
--一些按钮需要特殊显示
|
||||||
this.SpecialBtnShow()
|
this.SpecialBtnShow()
|
||||||
end
|
end
|
||||||
|
--按钮特殊显示
|
||||||
function this.SpecialBtnShow()
|
function this.SpecialBtnShow()
|
||||||
if this._ViewType == PLAYER_INFO_VIEW_TYPE.LINGMAIMIJING then
|
if this._ViewType == PLAYER_INFO_VIEW_TYPE.LINGMAIMIJING then
|
||||||
this.btnBox:SetActive(true)
|
this.btnBox:SetActive(true)
|
||||||
|
@ -579,6 +610,7 @@ function this.LingMaiQieCuo()
|
||||||
sdata.headFrame = this.curPlayerData.headFrame
|
sdata.headFrame = this.curPlayerData.headFrame
|
||||||
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING, sdata,true)
|
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.LINGMAIMIJING, sdata,true)
|
||||||
end
|
end
|
||||||
|
--=====================================按钮事件结束======================================
|
||||||
|
|
||||||
--界面关闭时调用(用于子类重写)
|
--界面关闭时调用(用于子类重写)
|
||||||
function PlayerInfoPopup:OnClose()
|
function PlayerInfoPopup:OnClose()
|
||||||
|
@ -601,7 +633,9 @@ function PlayerInfoPopup:OnDestroy()
|
||||||
end
|
end
|
||||||
titleLive = nil
|
titleLive = nil
|
||||||
titleLiveStr = nil
|
titleLiveStr = nil
|
||||||
this.imprintItemList = {}
|
-- this.imprintItemList = {}
|
||||||
|
this.InfoBtnsList = {}
|
||||||
|
this.ItemPreList = {}
|
||||||
this.Demons = {}
|
this.Demons = {}
|
||||||
if this.extraInfo then
|
if this.extraInfo then
|
||||||
this.extraInfo.OnDestroy()
|
this.extraInfo.OnDestroy()
|
||||||
|
|
Loading…
Reference in New Issue