【称号】修复主界面称号偶现没有特效的问题,聊天界面称号逻辑修改
parent
548f3f9f00
commit
4eea852340
|
@ -16,6 +16,8 @@ local _TabData = {
|
|||
}
|
||||
-- 当前所在的聊天通道
|
||||
this._CurChannel = 1
|
||||
-- 称号
|
||||
local titleList={}
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
function ChatPanel:InitComponent()
|
||||
|
@ -91,6 +93,14 @@ end
|
|||
function ChatPanel:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Chat.OnChatDataChanged, this.OnChatDataChanged)
|
||||
end
|
||||
|
||||
function ChatPanel:OnSortingOrderChange()
|
||||
if titleList then
|
||||
for node, playerTitle in pairs(titleList) do
|
||||
playerTitle:SetLayer(this.sortingOrder)
|
||||
end
|
||||
end
|
||||
end
|
||||
--界面打开时调用(用于子类重写)
|
||||
function ChatPanel:OnOpen(...)
|
||||
-- 参数保存
|
||||
|
@ -142,6 +152,14 @@ function ChatPanel:OnDestroy()
|
|||
ClearRedPointObject(v.rpType)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if titleList then
|
||||
for node, playerTitle in pairs(titleList) do
|
||||
SubUIManager.Close(playerTitle)
|
||||
end
|
||||
end
|
||||
titleList = {}
|
||||
end
|
||||
|
||||
-- tab节点自定义设置
|
||||
|
@ -312,8 +330,6 @@ function this.GetScrollView(index)
|
|||
end
|
||||
end
|
||||
|
||||
local titleList={}
|
||||
local titleStrList={}
|
||||
-- 好友节点数据匹配
|
||||
function this.FriendItemAdapter(node, data)
|
||||
-- 获取节点
|
||||
|
@ -333,30 +349,14 @@ function this.FriendItemAdapter(node, data)
|
|||
head.sprite = GetPlayerHeadSprite(this.spLoader, fdata.head)
|
||||
frame.sprite = GetPlayerHeadFrameSprite(this.spLoader, fdata.frame)
|
||||
redpot:SetActive(FriendChatManager.IsFriendNewChat(data.friendId))
|
||||
|
||||
if titleList[node] then
|
||||
poolManager:UnLoadAsset(titleStrList[node],titleList[node], PoolManager.AssetType.GameObject)
|
||||
titleStrList[node] = nil
|
||||
titleList[node] = nil
|
||||
end
|
||||
|
||||
local title=fdata.userTitle
|
||||
if title and title>0 then
|
||||
local title = fdata.userTitle
|
||||
if title and title > 0 then
|
||||
titlePar:SetActive(true)
|
||||
local curPlayerRole = ConfigManager.GetConfigData(ConfigName.PlayerRole,title)
|
||||
local curArtResourcesConfig = ConfigManager.GetConfigData(ConfigName.ArtResourcesConfig,curPlayerRole.LiveAnimName)
|
||||
local titleLiveStr = curArtResourcesConfig.Name
|
||||
local titleLive = poolManager:LoadAsset(titleLiveStr, PoolManager.AssetType.GameObject)
|
||||
titleLive.transform:SetParent(titlePar.transform)
|
||||
titleLive.transform.localPosition = Vector3.New(0,0,0)
|
||||
titleLive.transform.localScale = Vector3.New(0.4,0.4,0.4)
|
||||
local sortingorder=0
|
||||
if this.sortingOrder then
|
||||
Util.SetParticleSortLayer(titleLive,this.sortingOrder)
|
||||
-- sortingorder = this.sortingOrder
|
||||
if not titleList[node] then
|
||||
titleList[node] = SubUIManager.Open(SubUIConfig.PlayerTitle, titlePar.transform)
|
||||
end
|
||||
titleStrList[node]=titleLiveStr
|
||||
titleList[node]=titleLive
|
||||
titleList[node]:SetShow(title, Vector3.zero, 0.4, 0.4, this.sortingOrder)
|
||||
else
|
||||
titlePar:SetActive(false)
|
||||
end
|
||||
|
@ -442,13 +442,6 @@ function this.ChatItemAdapter(node, data, isShowTime)
|
|||
timeLab.text = TimeStampToDateStr(tonumber(data.times)/1000)
|
||||
end
|
||||
|
||||
if titleList[node] then
|
||||
poolManager:UnLoadAsset(titleStrList[node],titleList[node], PoolManager.AssetType.GameObject)
|
||||
titleStrList[node] = nil
|
||||
titleList[node] = nil
|
||||
end
|
||||
|
||||
|
||||
local contentStr = ""
|
||||
if this._CurChannel == CHAT_CHANNEL.GLOBAL then
|
||||
local chat = ChatManager.AnalysisGlobalChat(data.msg)
|
||||
|
@ -531,20 +524,10 @@ function this.ChatItemAdapter(node, data, isShowTime)
|
|||
end
|
||||
if title and title>0 then
|
||||
titlePar:SetActive(true)
|
||||
local curPlayerRole = ConfigManager.GetConfigData(ConfigName.PlayerRole,title)
|
||||
local curArtResourcesConfig = ConfigManager.GetConfigData(ConfigName.ArtResourcesConfig,curPlayerRole.LiveAnimName)
|
||||
local titleLiveStr = curArtResourcesConfig.Name
|
||||
local titleLive = poolManager:LoadAsset(titleLiveStr, PoolManager.AssetType.GameObject)
|
||||
titleLive.transform:SetParent(titlePar.transform)
|
||||
titleLive.transform.localPosition = Vector3.New(0,0,0)
|
||||
titleLive.transform.localScale = Vector3.New(0.4,0.4,0.4)
|
||||
local sortingorder=0
|
||||
if this.sortingOrder then
|
||||
Util.SetParticleSortLayer(titleLive,this.sortingOrder)
|
||||
-- sortingorder = this.sortingOrder
|
||||
if not titleList[node] then
|
||||
titleList[node] = SubUIManager.Open(SubUIConfig.PlayerTitle, titlePar.transform)
|
||||
end
|
||||
titleStrList[node]=titleLiveStr
|
||||
titleList[node]=titleLive
|
||||
titleList[node]:SetShow(title, Vector3.zero, 0.4, 0.4, this.sortingOrder)
|
||||
else
|
||||
titlePar:SetActive(false)
|
||||
end
|
||||
|
|
|
@ -691,7 +691,7 @@ function this:OnSortingOrderChange()
|
|||
Util.GetGameObject(self.sceneTran.gameObject, "layer7"):GetComponent("Canvas").sortingOrder = self.sortingOrder - 3
|
||||
this.npcRoot:GetComponent("Canvas").sortingOrder = self.sortingOrder - 2
|
||||
this.decorateRoot:GetComponent("Canvas").sortingOrder = self.sortingOrder - 1
|
||||
Util.AddParticleSortLayer(this.btnClickMove, self.sortingOrder - orginLayer)
|
||||
-- Util.AddParticleSortLayer(this.btnClickMove, self.sortingOrder - orginLayer)
|
||||
Util.AddParticleSortLayer(this.sceneTran.gameObject, self.sortingOrder - orginLayer)
|
||||
Util.AddParticleSortLayer(this.mountainTran.gameObject, self.sortingOrder - orginLayer)
|
||||
Util.AddParticleSortLayer(Util.GetGameObject(this.decorateRoot, "effect"), self.sortingOrder - orginLayer)
|
||||
|
|
Loading…
Reference in New Issue