Skip to content

Commit

Permalink
Another workaround for colored hint message
Browse files Browse the repository at this point in the history
  • Loading branch information
Bara committed Nov 19, 2019
1 parent caacde4 commit e713984
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
16 changes: 16 additions & 0 deletions addons/sourcemod/scripting/include/ttt.inc
Expand Up @@ -1170,3 +1170,19 @@ stock bool IsStringNumeric(const char[] str)

return true;
}

void PrintCenterText2(int client, const char[] title, const char[] message)
{
char sBuffer[2048];
Format(sBuffer, sizeof(sBuffer), "</font> %s\n%s\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", title, message);
Protobuf hMessage = view_as<Protobuf>(StartMessageOne("TextMsg", client));
hMessage.SetInt("msg_dst", 4);
hMessage.AddString("params", "#SFUI_ContractKillStart");
hMessage.AddString("params", sBuffer);
hMessage.AddString("params", NULL_STRING);
hMessage.AddString("params", NULL_STRING);
hMessage.AddString("params", NULL_STRING);
hMessage.AddString("params", NULL_STRING);

EndMessage();
}
16 changes: 8 additions & 8 deletions addons/sourcemod/scripting/ttt/ttt.sp
Expand Up @@ -827,8 +827,8 @@ public Action Timer_SelectionCountdown(Handle hTimer)
{
LoopValidClients(i)
{
Format(centerText, sizeof(centerText), "#SFUI_Notice_NewWaveBegun_\n<pre>%T</pre>", "RoundStartedCenter", i, g_cRoundStartedFontSize.IntValue, g_sRoundStartedFontColor);
PrintCenterText(i, centerText);
Format(centerText, sizeof(centerText), "<pre>%T</pre>", "RoundStartedCenter", i, g_cRoundStartedFontSize.IntValue, g_sRoundStartedFontColor);
PrintCenterText2(i, "Trouble in Terrorist Town", centerText);
}
}

Expand All @@ -843,8 +843,8 @@ public Action Timer_SelectionCountdown(Handle hTimer)

LoopValidClients(i)
{
Format(centerText, sizeof(centerText), "#SFUI_Notice_NewWaveBegun_\n<pre>%T</pre>", "RoundStartCenter", i, g_cRoundStartFontSize.IntValue, g_sRoundStartFontColor, timeLeft);
PrintCenterText(i, centerText);
Format(centerText, sizeof(centerText), "<pre>%T</pre>", "RoundStartCenter", i, g_cRoundStartFontSize.IntValue, g_sRoundStartFontColor, timeLeft);
PrintCenterText2(i, "Trouble in Terrorist Town", centerText);
}

return Plugin_Continue;
Expand Down Expand Up @@ -3705,8 +3705,8 @@ int addKarma(int client, int karma, bool message = false)
if (g_cmessageTypKarma.IntValue == 1)
{
char sBuffer[MAX_MESSAGE_LENGTH];
Format(sBuffer, sizeof(sBuffer), "#SFUI_Notice_NewWaveBegun_\n<pre>%T</pre>", "karma earned", client, karma, g_iKarma[client]);
PrintCenterText(client, sBuffer);
Format(sBuffer, sizeof(sBuffer), "<pre>%T</pre>", "karma earned", client, karma, g_iKarma[client]);
PrintCenterText2(client, "Trouble in Terrorist Town", sBuffer);
}
else
{
Expand Down Expand Up @@ -3764,8 +3764,8 @@ int subtractKarma(int client, int karma, bool message = false)
if (g_cmessageTypKarma.IntValue == 1)
{
char sBuffer[MAX_MESSAGE_LENGTH];
Format(sBuffer, sizeof(sBuffer), "#SFUI_Notice_NewWaveBegun_\n<pre>%T</pre>", "lost karma", client, karma, g_iKarma[client]);
PrintCenterText(client, sBuffer);
Format(sBuffer, sizeof(sBuffer), "<pre>%T</pre>", "lost karma", client, karma, g_iKarma[client]);
PrintCenterText2(client, "Trouble in Terrorist Town", sBuffer);
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions addons/sourcemod/scripting/ttt/ttt_shop.sp
Expand Up @@ -1191,8 +1191,8 @@ void addCredits(int client, int credits, bool message = false)
char sBuffer[MAX_MESSAGE_LENGTH];
Format(sBuffer, sizeof(sBuffer), "%T", "credits earned", client, credits, g_iCredits[client]);
CFormatColor(sBuffer, sizeof(sBuffer), client);
Format(sBuffer, sizeof(sBuffer), "#SFUI_Notice_NewWaveBegun_\n<pre>%s</pre>", sBuffer);
PrintCenterText(client, sBuffer);
Format(sBuffer, sizeof(sBuffer), "<pre>%s</pre>", sBuffer);
PrintCenterText2(client, "TTT - Shop", sBuffer);
}
else
{
Expand Down Expand Up @@ -1238,8 +1238,8 @@ void subtractCredits(int client, int credits, bool message = false)
char sBuffer[MAX_MESSAGE_LENGTH];
Format(sBuffer, sizeof(sBuffer), "%T", "lost credits", client, credits, g_iCredits[client]);
CFormatColor(sBuffer, sizeof(sBuffer), client);
Format(sBuffer, sizeof(sBuffer), "#SFUI_Notice_NewWaveBegun_\n<pre>%s</pre>", sBuffer);
PrintCenterText(client, sBuffer);
Format(sBuffer, sizeof(sBuffer), "<pre>%s</pre>", sBuffer);
PrintCenterText2(client, "TTT - Shop", sBuffer);
}
else
{
Expand Down

0 comments on commit e713984

Please sign in to comment.