Made cvar for minimum dx level.

This commit is contained in:
Richard Helgeby 2010-05-22 16:13:42 +02:00
parent d556da6a32
commit 64c49df505
3 changed files with 10 additions and 8 deletions

View File

@ -395,6 +395,10 @@ zr_damage_suicide_after_infect "1"
// Default: "1.0" // Default: "1.0"
zr_overlays_update_time "1.0" zr_overlays_update_time "1.0"
// Minimum DirectX level allowed for overlays (mat_dxlevel).
// Default: "80"
zr_overlays_min_dxlevel "80"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Round End (core) // Round End (core)

View File

@ -90,6 +90,7 @@ enum CvarsList
Handle:CVAR_SAYHOOKS_QUIET_FILTER, Handle:CVAR_SAYHOOKS_QUIET_FILTER,
Handle:CVAR_SAYHOOKS_QUIET_FLAGS, Handle:CVAR_SAYHOOKS_QUIET_FLAGS,
Handle:CVAR_OVERLAYS_UPDATE_TIME, Handle:CVAR_OVERLAYS_UPDATE_TIME,
Handle:CVAR_OVERLAYS_MIN_DXLEVEL,
Handle:CVAR_ROUNDEND_OVERLAY, Handle:CVAR_ROUNDEND_OVERLAY,
Handle:CVAR_ROUNDEND_OVERLAY_ZOMBIE, Handle:CVAR_ROUNDEND_OVERLAY_ZOMBIE,
Handle:CVAR_ROUNDEND_OVERLAY_HUMAN, Handle:CVAR_ROUNDEND_OVERLAY_HUMAN,
@ -355,6 +356,7 @@ CvarsCreate()
// Overlays (core) // Overlays (core)
// =========================== // ===========================
g_hCvarsList[CVAR_OVERLAYS_UPDATE_TIME] = CreateConVar("zr_overlays_update_time", "1.0", "How often to update overlays on players. [0.0 = Disabled]"); g_hCvarsList[CVAR_OVERLAYS_UPDATE_TIME] = CreateConVar("zr_overlays_update_time", "1.0", "How often to update overlays on players. [0.0 = Disabled]");
g_hCvarsList[CVAR_OVERLAYS_MIN_DXLEVEL] = CreateConVar("zr_overlays_min_dxlevel", "80", "Minimum DirectX level allowed for overlays (mat_dxlevel).");
// =========================== // ===========================

View File

@ -25,11 +25,6 @@
* ============================================================================ * ============================================================================
*/ */
/**
* Minimum dx level required to see overlays.
*/
#define OVERLAYS_DXL_MIN 90
/** /**
* Maximum amount of overlay channels. * Maximum amount of overlay channels.
*/ */
@ -202,10 +197,11 @@ OverlaysClientUpdateOverlay(client, OverlaysChannel:channel = OVERLAYS_CHANNEL_N
return; return;
} }
// If client doesn't meet DXLevel requirement, then tell client, then stop. // If client doesn't meet DXLevel requirement, then tell client and stop.
if (g_iOverlaysDXL[client] < OVERLAYS_DXL_MIN) new minDxLevel = GetConVarInt(g_hCvarsList[CVAR_OVERLAYS_MIN_DXLEVEL]);
if (g_iOverlaysDXL[client] < minDxLevel)
{ {
TranslationPrintCenterText(client, "Overlays not supported", g_iOverlaysDXL[client], OVERLAYS_DXL_MIN); TranslationPrintCenterText(client, "Overlays not supported", g_iOverlaysDXL[client], minDxLevel);
return; return;
} }