mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
Fixed CS:GO chat colors.
This commit is contained in:
parent
f999073ee2
commit
cf1fce9bc3
@ -339,23 +339,21 @@ public Action Hook_SayText2(UserMsg msg_id, any msg, const int[] players, int pl
|
|||||||
|
|
||||||
if(gB_Protobuf)
|
if(gB_Protobuf)
|
||||||
{
|
{
|
||||||
Protobuf pbmsg = msg;
|
Protobuf pbmsg = UserMessageToProtobuf(msg);
|
||||||
client = pbmsg.ReadInt("ent_idx");
|
client = pbmsg.ReadInt("ent_idx");
|
||||||
pbmsg.ReadString("msg_name", sMessage, 32);
|
pbmsg.ReadString("msg_name", sMessage, 32);
|
||||||
pbmsg.ReadString("params", sOriginalName, MAXLENGTH_NAME, 0);
|
pbmsg.ReadString("params", sOriginalName, MAXLENGTH_NAME, 0);
|
||||||
pbmsg.ReadString("params", sOriginalText, MAXLENGTH_TEXT, 1);
|
pbmsg.ReadString("params", sOriginalText, MAXLENGTH_TEXT, 1);
|
||||||
delete pbmsg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BfRead bfmsg = msg;
|
BfRead bfmsg = UserMessageToBfRead(msg);
|
||||||
client = bfmsg.ReadByte();
|
client = bfmsg.ReadByte();
|
||||||
bfmsg.ReadByte(); // chat parameter
|
bfmsg.ReadByte(); // chat parameter
|
||||||
bfmsg.ReadString(sMessage, 32);
|
bfmsg.ReadString(sMessage, 32);
|
||||||
bfmsg.ReadString(sOriginalName, MAXLENGTH_NAME);
|
bfmsg.ReadString(sOriginalName, MAXLENGTH_NAME);
|
||||||
bfmsg.ReadString(sOriginalText, MAXLENGTH_TEXT);
|
bfmsg.ReadString(sOriginalText, MAXLENGTH_TEXT);
|
||||||
delete bfmsg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(client == 0)
|
if(client == 0)
|
||||||
@ -493,7 +491,10 @@ void Frame_SendText(DataPack pack)
|
|||||||
|
|
||||||
if(gB_Protobuf)
|
if(gB_Protobuf)
|
||||||
{
|
{
|
||||||
Protobuf pbmsg = view_as<Protobuf>(hSayText2);
|
// show colors in cs:go
|
||||||
|
Format(sText, MAXLENGTH_BUFFER, " %s", sText);
|
||||||
|
|
||||||
|
Protobuf pbmsg = UserMessageToProtobuf(hSayText2);
|
||||||
pbmsg.SetInt("ent_idx", client);
|
pbmsg.SetInt("ent_idx", client);
|
||||||
pbmsg.SetBool("chat", true);
|
pbmsg.SetBool("chat", true);
|
||||||
pbmsg.SetString("msg_name", sText);
|
pbmsg.SetString("msg_name", sText);
|
||||||
@ -503,17 +504,14 @@ void Frame_SendText(DataPack pack)
|
|||||||
{
|
{
|
||||||
pbmsg.AddString("params", "");
|
pbmsg.AddString("params", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
delete pbmsg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BfWrite bfmsg = view_as<BfWrite>(hSayText2);
|
BfWrite bfmsg = UserMessageToBfWrite(hSayText2);
|
||||||
bfmsg.WriteByte(client);
|
bfmsg.WriteByte(client);
|
||||||
bfmsg.WriteByte(true);
|
bfmsg.WriteByte(true);
|
||||||
bfmsg.WriteString(sText);
|
bfmsg.WriteString(sText);
|
||||||
delete bfmsg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EndMessage();
|
EndMessage();
|
||||||
@ -1041,7 +1039,10 @@ void PreviewChat(int client, int rank)
|
|||||||
{
|
{
|
||||||
if(gB_Protobuf)
|
if(gB_Protobuf)
|
||||||
{
|
{
|
||||||
Protobuf pbmsg = view_as<any>(hSayText2);
|
// show colors in cs:go
|
||||||
|
Format(sTextFormatting, MAXLENGTH_BUFFER, " %s", sTextFormatting);
|
||||||
|
|
||||||
|
Protobuf pbmsg = UserMessageToProtobuf(hSayText2);
|
||||||
pbmsg.SetInt("ent_idx", client);
|
pbmsg.SetInt("ent_idx", client);
|
||||||
pbmsg.SetBool("chat", true);
|
pbmsg.SetBool("chat", true);
|
||||||
pbmsg.SetString("msg_name", sTextFormatting);
|
pbmsg.SetString("msg_name", sTextFormatting);
|
||||||
@ -1050,17 +1051,14 @@ void PreviewChat(int client, int rank)
|
|||||||
{
|
{
|
||||||
pbmsg.AddString("params", "");
|
pbmsg.AddString("params", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
delete pbmsg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BfWrite bfmsg = view_as<any>(hSayText2);
|
BfWrite bfmsg = UserMessageToBfWrite(hSayText2);
|
||||||
bfmsg.WriteByte(client);
|
bfmsg.WriteByte(client);
|
||||||
bfmsg.WriteByte(true);
|
bfmsg.WriteByte(true);
|
||||||
bfmsg.WriteString(sTextFormatting);
|
bfmsg.WriteString(sTextFormatting);
|
||||||
delete bfmsg;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1138,7 +1138,10 @@ public int Native_PrintToChat(Handle handler, int numParams)
|
|||||||
|
|
||||||
if(gB_Protobuf)
|
if(gB_Protobuf)
|
||||||
{
|
{
|
||||||
Protobuf pbmsg = view_as<Protobuf>(CloneHandle(hSayText2));
|
// show colors in cs:go
|
||||||
|
Format(sBuffer, 300, " %s", sBuffer);
|
||||||
|
|
||||||
|
Protobuf pbmsg = UserMessageToProtobuf(hSayText2);
|
||||||
pbmsg.SetInt("ent_idx", client);
|
pbmsg.SetInt("ent_idx", client);
|
||||||
pbmsg.SetBool("chat", !gB_StopChatSound);
|
pbmsg.SetBool("chat", !gB_StopChatSound);
|
||||||
pbmsg.SetString("msg_name", sBuffer);
|
pbmsg.SetString("msg_name", sBuffer);
|
||||||
@ -1148,17 +1151,14 @@ public int Native_PrintToChat(Handle handler, int numParams)
|
|||||||
{
|
{
|
||||||
pbmsg.AddString("params", "");
|
pbmsg.AddString("params", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
delete pbmsg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BfWrite bfmsg = view_as<BfWrite>(CloneHandle(hSayText2));
|
BfWrite bfmsg = UserMessageToBfWrite(hSayText2);
|
||||||
bfmsg.WriteByte(client);
|
bfmsg.WriteByte(client);
|
||||||
bfmsg.WriteByte(!gB_StopChatSound);
|
bfmsg.WriteByte(!gB_StopChatSound);
|
||||||
bfmsg.WriteString(sBuffer);
|
bfmsg.WriteString(sBuffer);
|
||||||
delete bfmsg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EndMessage();
|
EndMessage();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user