【修行】名字颜色修改

dev_chengFeng
ZhangBiao 2021-05-17 17:28:37 +08:00
parent 8d2a0a86aa
commit 8e1b42c0ac
11 changed files with 42 additions and 13 deletions

View File

@ -2847,7 +2847,7 @@ MonoBehaviour:
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1

View File

@ -24,6 +24,7 @@ CHATINFO_FREQUENCY_FIELD = protobuf.FieldDescriptor();
CHATINFO_SPEED_FIELD = protobuf.FieldDescriptor();
CHATINFO_MULTIPLE_FIELD = protobuf.FieldDescriptor();
CHATINFO_USERTITLE_FIELD = protobuf.FieldDescriptor();
CHATINFO_PRACTICELEVEL_FIELD = protobuf.FieldDescriptor();
GETCHATMESSAGEINFOREQUEST = protobuf.Descriptor();
GETCHATMESSAGEINFOREQUEST_CHATTYPE_FIELD = protobuf.FieldDescriptor();
GETCHATMESSAGEINFOREQUEST_MESSAGEID_FIELD = protobuf.FieldDescriptor();
@ -239,11 +240,21 @@ CHATINFO_USERTITLE_FIELD.default_value = 0
CHATINFO_USERTITLE_FIELD.type = 5
CHATINFO_USERTITLE_FIELD.cpp_type = 1
CHATINFO_PRACTICELEVEL_FIELD.name = "practiceLevel"
CHATINFO_PRACTICELEVEL_FIELD.full_name = ".rpc.protocols.ChatInfo.practiceLevel"
CHATINFO_PRACTICELEVEL_FIELD.number = 23
CHATINFO_PRACTICELEVEL_FIELD.index = 20
CHATINFO_PRACTICELEVEL_FIELD.label = 1
CHATINFO_PRACTICELEVEL_FIELD.has_default_value = false
CHATINFO_PRACTICELEVEL_FIELD.default_value = 0
CHATINFO_PRACTICELEVEL_FIELD.type = 5
CHATINFO_PRACTICELEVEL_FIELD.cpp_type = 1
CHATINFO.name = "ChatInfo"
CHATINFO.full_name = ".rpc.protocols.ChatInfo"
CHATINFO.nested_types = {}
CHATINFO.enum_types = {}
CHATINFO.fields = {CHATINFO_SENDERID_FIELD, CHATINFO_SENDERNAME_FIELD, CHATINFO_SENDERLEVEL_FIELD, CHATINFO_SENDERVIP_FIELD, CHATINFO_TIMES_FIELD, CHATINFO_MSG_FIELD, CHATINFO_HEAD_FIELD, CHATINFO_FRAME_FIELD, CHATINFO_SOULVAL_FIELD, CHATINFO_MESSAGEID_FIELD, CHATINFO_MESSAGETYPE_FIELD, CHATINFO_ITEMID_FIELD, CHATINFO_TYPE_FIELD, CHATINFO_STARTTIME_FIELD, CHATINFO_ENDTIME_FIELD, CHATINFO_PRIORITYLEVEL_FIELD, CHATINFO_FREQUENCY_FIELD, CHATINFO_SPEED_FIELD, CHATINFO_MULTIPLE_FIELD, CHATINFO_USERTITLE_FIELD}
CHATINFO.fields = {CHATINFO_SENDERID_FIELD, CHATINFO_SENDERNAME_FIELD, CHATINFO_SENDERLEVEL_FIELD, CHATINFO_SENDERVIP_FIELD, CHATINFO_TIMES_FIELD, CHATINFO_MSG_FIELD, CHATINFO_HEAD_FIELD, CHATINFO_FRAME_FIELD, CHATINFO_SOULVAL_FIELD, CHATINFO_MESSAGEID_FIELD, CHATINFO_MESSAGETYPE_FIELD, CHATINFO_ITEMID_FIELD, CHATINFO_TYPE_FIELD, CHATINFO_STARTTIME_FIELD, CHATINFO_ENDTIME_FIELD, CHATINFO_PRIORITYLEVEL_FIELD, CHATINFO_FREQUENCY_FIELD, CHATINFO_SPEED_FIELD, CHATINFO_MULTIPLE_FIELD, CHATINFO_USERTITLE_FIELD, CHATINFO_PRACTICELEVEL_FIELD}
CHATINFO.is_extendable = false
CHATINFO.extensions = {}
GETCHATMESSAGEINFOREQUEST_CHATTYPE_FIELD.name = "chatType"

View File

@ -28,6 +28,7 @@ FAMILYUSERINFO_USERSKIN_FIELD = protobuf.FieldDescriptor();
FAMILYUSERINFO_USERTITLE_FIELD = protobuf.FieldDescriptor();
FAMILYUSERINFO_USERMOUNT_FIELD = protobuf.FieldDescriptor();
FAMILYUSERINFO_SEX_FIELD = protobuf.FieldDescriptor();
FAMILYUSERINFO_PRACTICELEVEL_FIELD = protobuf.FieldDescriptor();
CARDELAYPROGRESSINDICATION = protobuf.Descriptor();
CARDELAYPROGRESSINDICATION_PROGRESS_FIELD = protobuf.FieldDescriptor();
CARDELAYPROGRESSINDICATION_ENDTIME_FIELD = protobuf.FieldDescriptor();
@ -595,11 +596,21 @@ FAMILYUSERINFO_SEX_FIELD.default_value = 0
FAMILYUSERINFO_SEX_FIELD.type = 5
FAMILYUSERINFO_SEX_FIELD.cpp_type = 1
FAMILYUSERINFO_PRACTICELEVEL_FIELD.name = "practiceLevel"
FAMILYUSERINFO_PRACTICELEVEL_FIELD.full_name = ".rpc.protocols.FamilyUserInfo.practiceLevel"
FAMILYUSERINFO_PRACTICELEVEL_FIELD.number = 24
FAMILYUSERINFO_PRACTICELEVEL_FIELD.index = 23
FAMILYUSERINFO_PRACTICELEVEL_FIELD.label = 1
FAMILYUSERINFO_PRACTICELEVEL_FIELD.has_default_value = false
FAMILYUSERINFO_PRACTICELEVEL_FIELD.default_value = 0
FAMILYUSERINFO_PRACTICELEVEL_FIELD.type = 5
FAMILYUSERINFO_PRACTICELEVEL_FIELD.cpp_type = 1
FAMILYUSERINFO.name = "FamilyUserInfo"
FAMILYUSERINFO.full_name = ".rpc.protocols.FamilyUserInfo"
FAMILYUSERINFO.nested_types = {}
FAMILYUSERINFO.enum_types = {}
FAMILYUSERINFO.fields = {FAMILYUSERINFO_ROLEUID_FIELD, FAMILYUSERINFO_USERNAME_FIELD, FAMILYUSERINFO_USERLEVEL_FIELD, FAMILYUSERINFO_POSITION_FIELD, FAMILYUSERINFO_CONTRIBUTE_FIELD, FAMILYUSERINFO_SECONDS_FIELD, FAMILYUSERINFO_CONTRIBUTETODAY_FIELD, FAMILYUSERINFO_SOULFORCE_FIELD, FAMILYUSERINFO_HEAD_FIELD, FAMILYUSERINFO_FRAME_FIELD, FAMILYUSERINFO_MAXBOSSHURT_FIELD, FAMILYUSERINFO_LASTHURT_FIELD, FAMILYUSERINFO_TAKEFETEREWARD_FIELD, FAMILYUSERINFO_LASTFETEGUILDID_FIELD, FAMILYUSERINFO_LASTFETETYPE_FIELD, FAMILYUSERINFO_GUILDHELPTIME_FIELD, FAMILYUSERINFO_ISTAKEGUILDHELPREWARD_FIELD, FAMILYUSERINFO_GUILDHELPINFO_FIELD, FAMILYUSERINFO_LASTHELPSENDTIME_FIELD, FAMILYUSERINFO_USERSKIN_FIELD, FAMILYUSERINFO_USERTITLE_FIELD, FAMILYUSERINFO_USERMOUNT_FIELD, FAMILYUSERINFO_SEX_FIELD}
FAMILYUSERINFO.fields = {FAMILYUSERINFO_ROLEUID_FIELD, FAMILYUSERINFO_USERNAME_FIELD, FAMILYUSERINFO_USERLEVEL_FIELD, FAMILYUSERINFO_POSITION_FIELD, FAMILYUSERINFO_CONTRIBUTE_FIELD, FAMILYUSERINFO_SECONDS_FIELD, FAMILYUSERINFO_CONTRIBUTETODAY_FIELD, FAMILYUSERINFO_SOULFORCE_FIELD, FAMILYUSERINFO_HEAD_FIELD, FAMILYUSERINFO_FRAME_FIELD, FAMILYUSERINFO_MAXBOSSHURT_FIELD, FAMILYUSERINFO_LASTHURT_FIELD, FAMILYUSERINFO_TAKEFETEREWARD_FIELD, FAMILYUSERINFO_LASTFETEGUILDID_FIELD, FAMILYUSERINFO_LASTFETETYPE_FIELD, FAMILYUSERINFO_GUILDHELPTIME_FIELD, FAMILYUSERINFO_ISTAKEGUILDHELPREWARD_FIELD, FAMILYUSERINFO_GUILDHELPINFO_FIELD, FAMILYUSERINFO_LASTHELPSENDTIME_FIELD, FAMILYUSERINFO_USERSKIN_FIELD, FAMILYUSERINFO_USERTITLE_FIELD, FAMILYUSERINFO_USERMOUNT_FIELD, FAMILYUSERINFO_SEX_FIELD, FAMILYUSERINFO_PRACTICELEVEL_FIELD}
FAMILYUSERINFO.is_extendable = false
FAMILYUSERINFO.extensions = {}
CARDELAYPROGRESSINDICATION_PROGRESS_FIELD.name = "progress"

View File

@ -87,7 +87,8 @@ end
-- 公会聊天数据由服务器推送
function this.ReceiveFamilyChat(msg)
if msg.type ~= 2 then return end
this.ChatDataAdapter(CHAT_CHANNEL.FAMILY, {chatInfo = {msg.chatInfo}})
local info = msg.chatInfo
this.ChatDataAdapter(CHAT_CHANNEL.FAMILY, {chatInfo = {info}})
end

View File

@ -516,7 +516,7 @@ function this.ChatItemAdapter(node, data, isShowTime)
local title=0
if data.senderId == PlayerManager.uid then
lv.text = PlayerManager.level
name.text = PlayerManager.nickName
name.text = PracticeManager.SetNameColor(PlayerManager.nickName,PracticeManager.PracticeLevel)
head.sprite = GetPlayerHeadSprite(PlayerManager.head)
headKuang.sprite = GetPlayerHeadFrameSprite(HeadManager.GetCurFrameId())
title=PlayerManager.GetPlayerDesignation()

View File

@ -149,7 +149,7 @@ function this.ChatItemAdapter(node, data, isShowTime)
end
if data.senderId == PlayerManager.uid then
lv.text = PlayerManager.level
name.text = PlayerManager.nickName
name.text = PracticeManager.SetNameColor(PlayerManager.nickName,PracticeManager.PracticeLevel)
head.sprite = GetPlayerHeadSprite(PlayerManager.head)
headKuang.sprite = GetPlayerHeadFrameSprite(HeadManager.GetCurFrameId())
title=PlayerManager.GetPlayerDesignation()

View File

@ -320,7 +320,6 @@ function this.FriendSearchRequest(name)
this.friendSearchData = {}
this.friendSearchData[msg.Friends.id] = msg.Friends
this.friendSearchData[msg.Friends.id].name = PracticeManager.SetNameColor(msg.Friends.name,msg.Friends.practiceLevel)
--.name = PracticeManager.SetNameColor(msg.Friends[i].name,msg.Friends[i].practiceLevel)--msg.Friends[i].name
Game.GlobalEvent:DispatchEvent(GameEvent.Friend.OnFriendSearch, false,false) --this.friendSearchData)
end)
end

View File

@ -57,6 +57,9 @@ end
function MyGuildManager.SetMyMemInfo(msg)
-- 成员数据
this.MyMemInfo = msg.familyUserInfo
for i = 1, #this.MyMemInfo do
this.MyMemInfo[i].userName = PracticeManager.SetNameColor(msg.familyUserInfo[i].userName,msg.familyUserInfo[i].practiceLevel)
end
-- 发送数据更新事件
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.DataUpdate)
end
@ -128,6 +131,9 @@ end
function MyGuildManager.RequestMyGuildMembers(func)
NetManager.RequestMyGuildMembers(function(msg)
this.MyGuildMemList = msg.familyUserInfo
for i = 1, #this.MyGuildMemList do
this.MyGuildMemList[i].userName = PracticeManager.SetNameColor(msg.familyUserInfo[i].userName,msg.familyUserInfo[i].practiceLevel)
end
table.sort(this.MyGuildMemList, function(a, b)
if a.seconds == b.seconds then
return a.position < b.position

View File

@ -295,6 +295,9 @@ function this.ReceiveFriendChat(buffer)
local data = buffer:DataByte()
local msg = ChatProto_pb.SendChatInfoIndication()
msg:ParseFromString(data)
for i = 1, #msg.chatInfo do
msg.chatInfo[i].senderName = PracticeManager.SetNameColor(msg.chatInfo[i].senderName,msg.chatInfo[i].practiceLevel)
end
if msg.type == 1 then
FriendChatManager.ReceiveFriendChat(msg)
elseif msg.type == 2 then

View File

@ -1367,11 +1367,6 @@ function this.RequestBaseArenaData(func)
local msg = ArenaInfoProto_pb.GetArenaInfoResponse()
msg:ParseFromString(data)
ArenaManager.ReceiveBaseArenaData(msg)
-- for i = 1, #msg.arenaInfo.arenaEnemys do
-- local v= msg.arenaInfo.arenaEnemys[i]
-- LogPink("name:"..tostring(v.personInfo.name).." 等级:"..tostring(v.personInfo.practiceLevel))
-- v.personInfo.name = PracticeManager.SetNameColor(v.personInfo.name,v.personInfo.practiceLevel)
-- end
if func then
func(msg)
end
@ -1924,6 +1919,9 @@ function this.RequestChatMsg(type, msgId, func)
local data = buffer:DataByte()
local msg = ChatProto_pb.GetChatMessageInfoResponse()
msg:ParseFromString(data)
for i = 1, #msg.chatInfo do
msg.chatInfo[i].senderName = PracticeManager.SetNameColor(msg.chatInfo[i].senderName,msg.chatInfo[i].practiceLevel)
end
if func then
func(msg)
end

View File

@ -215,7 +215,7 @@ function this.SetNameColor(name,level)
end
local clr = ""
clr = XiuXianConfig[level].NameFontColor
LogYellow("name:"..tostring(name).." clr:"..tostring(clr))
-- LogYellow("name:"..tostring(name).." clr:"..tostring(clr))
return "<color=#"..clr..">"..name.."</color>"
end