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