Make it optional

This commit is contained in:
Q 2020-08-20 09:57:59 +08:00
parent d4d51c752d
commit 733b9a61e3
2 changed files with 28 additions and 4 deletions

View File

@ -44,6 +44,7 @@
#define HUD2_MAPTIER (1 << 9)
#define HUD2_TIMEDIFFERENCE (1 << 10)
#define HUD2_PERFS (1 << 11)
#define HUD2_TOPLEFT_RANK (1 << 12)
#define HUD_DEFAULT (HUD_MASTER|HUD_CENTER|HUD_ZONEHUD|HUD_OBSERVE|HUD_TOPLEFT|HUD_SYNC|HUD_TIMELEFT|HUD_2DVEL|HUD_SPECTATORS)
#define HUD_DEFAULT2 (HUD2_PERFS)
@ -234,7 +235,8 @@ public void OnPluginStart()
..."HUD2_SPLITPB 256\n"
..."HUD2_MAPTIER 512\n"
..."HUD2_TIMEDIFFERENCE 1024\n"
..."HUD2_PERFS 2048");
..."HUD2_PERFS 2048\n"
..."HUD2_TOPLEFT_RANK 4096");
Convar.AutoExecConfig();
@ -724,6 +726,10 @@ Action ShowHUDMenu(int client, int item)
FormatEx(sHudItem, 64, "%T", "HudSplitPbText", client);
menu.AddItem(sInfo, sHudItem);
FormatEx(sInfo, 16, "@%d", HUD2_TOPLEFT_RANK);
FormatEx(sHudItem, 64, "%T", "HudTopLeftRankText", client);
menu.AddItem(sInfo, sHudItem);
if(gB_Rankings)
{
FormatEx(sInfo, 16, "@%d", HUD2_MAPTIER);
@ -1704,12 +1710,26 @@ void UpdateTopLeftHUD(int client, bool wait)
{
if(fTargetPB != 0.0)
{
Format(sTopLeft, 128, "%s\n (#%d) %s (%N)", sTopLeft, Shavit_GetRankForTime(style, fTargetPB, track), sTargetPB, target);
if((gI_HUD2Settings[client]& HUD2_TOPLEFT_RANK) == 0)
{
Format(sTopLeft, 128, "%s\n%s (#%d) (%N)", sTopLeft, Shavit_GetRankForTime(style, fTargetPB, track), sTargetPB, target);
}
else
{
Format(sTopLeft, 128, "%s\n%s (%N)", sTopLeft, sTargetPB, target);
}
}
if(fSelfPB != 0.0)
{
Format(sTopLeft, 128, "%s\n%s (#%d) (%N)", sTopLeft, Shavit_GetRankForTime(style, fSelfPB, track), sSelfPB, client);
if((gI_HUD2Settings[client]& HUD2_TOPLEFT_RANK) == 0)
{
Format(sTopLeft, 128, "%s\n%s (#%d) (%N)", sTopLeft, Shavit_GetRankForTime(style, fSelfPB, track), sSelfPB, client);
}
else
{
Format(sTopLeft, 128, "%s\n%s (%N)", sTopLeft, Shavit_GetRankForTime(style, fSelfPB, track), sSelfPB, client);
}
}
}
@ -1759,7 +1779,7 @@ void UpdateKeyHint(int client)
{
Format(sMessage, 256, "%s%s%T: %.01f", sMessage, (strlen(sMessage) > 0)? "\n\n":"", "HudSync", client, Shavit_GetSync(target));
if(!gA_StyleSettings[style].bAutobhop && (gI_HUDSettings[client] & HUD2_PERFS) > 0)
if(!gA_StyleSettings[style].bAutobhop && (gI_HUD2Settings[client] & HUD2_PERFS) == 0)
{
Format(sMessage, 256, "%s\n%T: %.1f", sMessage, "HudPerfs", client, Shavit_GetPerfectJumps(target));
}

View File

@ -157,6 +157,10 @@
{
"en" "Time Difference"
}
"HudTopLeftRankText"
{
"en" "Top left Rank"
}
// ---------- Record Bots ---------- //
"ReplayText"
{