add Loading to zone hud

This commit is contained in:
rtldg 2021-11-03 10:34:52 +00:00
parent 03d44c9d23
commit f344fddcdf
4 changed files with 28 additions and 0 deletions

View File

@ -1290,6 +1290,15 @@ native void Shavit_SetClientTimescale(int client, float scale);
*/
native float Shavit_GetClientTimescale(int client);
/**
* asdf
*
* @param client Client index
*
* @return asdf
*/
native bool Shavit_Core_CookiesRetrieved(int client);
public SharedPlugin __pl_shavit_core =
{
name = "shavit",
@ -1353,6 +1362,7 @@ public void __pl_shavit_core_SetNTVOptional()
MarkNativeAsOptional("Shavit_SetStyleSettingFloat");
MarkNativeAsOptional("Shavit_SetStyleSettingBool");
MarkNativeAsOptional("Shavit_SetStyleSettingInt");
MarkNativeAsOptional("Shavit_Core_CookiesRetrieved");
__pl_shavit_bhopstats_SetNTVOptional();
}

View File

@ -208,6 +208,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
CreateNative("Shavit_GetMaxVelocity", Native_GetMaxVelocity);
CreateNative("Shavit_SetAvgVelocity", Native_SetAvgVelocity);
CreateNative("Shavit_SetMaxVelocity", Native_SetMaxVelocity);
CreateNative("Shavit_Core_CookiesRetrieved", Native_Core_CookiesRetrieved);
// registers library, check "bool LibraryExists(const char[] name)" in order to use with other plugins
RegPluginLibrary("shavit");
@ -2028,6 +2029,11 @@ public any Native_SetMaxVelocity(Handle plugin, int numParams)
gA_Timers[GetNativeCell(1)].fMaxVelocity = GetNativeCell(2);
}
public any Native_Core_CookiesRetrieved(Handle plugin, int numParams)
{
return gB_CookiesRetrieved[GetNativeCell(1)];
}
public Action Shavit_OnStartPre(int client, int track)
{
if (GetTimerStatus(client) == Timer_Paused && gCV_PauseMovement.BoolValue)

View File

@ -1165,6 +1165,13 @@ int AddHUDToBuffer_Source2013(int client, huddata_t data, char[] buffer, int max
int iLines = 0;
char sLine[128];
if (client == data.iTarget && !Shavit_Core_CookiesRetrieved(client))
{
FormatEx(sLine, sizeof(sLine), "%T", "TimerLoading", client);
AddHUDLine(buffer, maxlen, sLine, iLines);
iLines++;
}
if (gCV_DebugTargetname.BoolValue && IsValidClient(data.iTarget))
{
char targetname[64], classname[64];

View File

@ -47,4 +47,9 @@
"#format" "{1:s}"
"en" "{1} seconds remaining."
}
// ----------- Random ----------- //
"TimerLoading"
{
"en" "Loading.."
}
}