OMG FINALLY FIXED OVERLAYZ. I almost killed myself over this one.

This commit is contained in:
Greyscale
2009-06-21 14:59:18 -07:00
parent 38b256419d
commit ff7528f09f
4 changed files with 28 additions and 71 deletions

View File

@ -133,9 +133,6 @@ ClassOnClientSpawn(client)
ClassReloadPlayerCache(client, ClassGetActiveIndex(client));
ClassApplyAttributes(client);
}
// Forward event to sub-modules.
ClassOverlayOnClientSpawn(client);
}
/**
@ -173,7 +170,4 @@ ClassOnClientInfected(client, bool:motherzombie = false)
// Apply the new attributes.
ClassApplyAttributes(client, motherzombie);
// Forward event to sub-modules.
ClassOverlayOnClientInfected(client);
}

View File

@ -105,31 +105,6 @@ ClassOverlayClientInit(client)
}
}
/**
* Client is spawning into the game.
*
* @param client The client index.
*/
ClassOverlayOnClientSpawn(client)
{
// If overlay toggle is enabled and class has an overlay, then send center text.
new bool:overlaytoggle = GetConVarBool(g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLE]);
decl String:overlaypath[PLATFORM_MAX_PATH];
ClassGetOverlayPath(client, overlaypath, sizeof(overlaypath));
if (overlaytoggle && overlaypath[0])
{
decl String:togglecmds[CLASSOVERLAY_TOGGLE_MAX_CMDS * CLASSOVERLAY_TOGGLE_MAX_LENGTH];
GetConVarString(g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLECMDS], togglecmds, sizeof(togglecmds));
TranslationPrintHUDText(client, "Classes overlay toggle", togglecmds);
}
// Update class overlay.
OverlaysClientUpdateOverlay(client, OVERLAYS_CHANNEL_CLASSES);
}
/**
* Client has been killed.
*
@ -141,28 +116,6 @@ ClassOverlayOnClientDeath(client)
OverlaysClientSetChannelState(client, OVERLAYS_CHANNEL_CLASSES, true, false, false, true);
}
/**
* Client has been infected.
*
* @param client The client index.
*/
ClassOverlayOnClientInfected(client)
{
// If overlay toggle is enabled and class has an overlay, then send center text.
new bool:overlaytoggle = GetConVarBool(g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLE]);
decl String:overlaypath[PLATFORM_MAX_PATH];
ClassGetOverlayPath(client, overlaypath, sizeof(overlaypath));
if (overlaytoggle && overlaypath[0])
{
decl String:togglecmds[CLASSOVERLAY_TOGGLE_MAX_CMDS * CLASSOVERLAY_TOGGLE_MAX_LENGTH];
GetConVarString(g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLECMDS], togglecmds, sizeof(togglecmds));
TranslationPrintCenterText(client, "Classes overlay toggle", togglecmds);
}
}
ClassOverlayInitialize(client, const String:overlay[])
{
if (IsFakeClient(client))
@ -177,6 +130,20 @@ ClassOverlayInitialize(client, const String:overlay[])
return;
}
// If overlay toggle is enabled and class has an overlay, then send center text.
new bool:overlaytoggle = GetConVarBool(g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLE]);
decl String:overlaypath[PLATFORM_MAX_PATH];
ClassGetOverlayPath(client, overlaypath, sizeof(overlaypath));
if (overlaytoggle && overlaypath[0])
{
decl String:togglecmds[CLASSOVERLAY_TOGGLE_MAX_CMDS * CLASSOVERLAY_TOGGLE_MAX_LENGTH];
GetConVarString(g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLECMDS], togglecmds, sizeof(togglecmds));
TranslationPrintHUDText(client, "Classes overlay toggle", togglecmds);
}
// Display class overlays.
OverlaysClientSetChannelPath(client, OVERLAYS_CHANNEL_CLASSES, overlay);
OverlaysClientSetChannelState(client, OVERLAYS_CHANNEL_CLASSES, true, false, CookiesGetClientCookieBool(client, g_hOverlayEnabledCookie));