Add CVar mp_show_scenarioicon (#416)

* Add CVar mp_show_scenarioicon (Condition-Zero style scenario icon near round timer)
This commit is contained in:
Vaqtincha 2019-09-18 13:04:32 +05:00 committed by Dmitry Novikov
parent 8c3cd4fc54
commit bed4180d03
6 changed files with 30 additions and 2 deletions

View File

@ -51,6 +51,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| mp_forcerespawn | 0 | 0 | - | Players will automatically respawn when killed.<br/>`0` disabled<br/>`>0.00001` time delay to respawn |
| mp_hostage_hurtable | 1 | 0 | 1 | The hostages can take damage.<br/>`0` disabled<br/>`1` from any team<br/>`2` only from `CT`<br/>`3` only from `T` |
| mp_show_radioicon | 1 | 0 | 1 | Show radio icon.<br/>`0` disabled<br/>`1` enabled |
| mp_show_scenarioicon | 0 | 0 | 1 | Show scenario icon in HUD such as count of alive hostages or ticking bomb.<br/>`0` disabled<br/>`1` enabled |
| mp_old_bomb_defused_sound | 1 | 0 | 1 | Play "Bomb has been defused" sound instead of "Counter-Terrorists win" when bomb was defused<br/>`0` disabled<br/>`1` enabled |
| showtriggers | 0 | 0 | 1 | Debug cvar shows triggers. |
| sv_alltalk | 0 | 0 | 4 | When players can hear each other ([further explanation](../../wiki/sv_alltalk)).<br/>`0` dead don't hear alive<br/>`1` no restrictions<br/>`2` teammates hear each other<br/>`3` Same as 2, but spectators hear everybody<br/>`4` alive hear alive, dead hear dead and alive.

7
dist/game.cfg vendored
View File

@ -158,6 +158,13 @@ mp_hostage_hurtable 1
// Default value: "1"
mp_show_radioicon 1
// Show scenario icon in HUD such as count of alive hostages or ticking bomb.
// 0 - disabled (default behavior)
// 1 - enabled
//
// Default value: "0"
mp_show_scenarioicon 0
// Play "Bomb has been defused" sound instead of "Counter-Terrorists win" when bomb was defused
// 0 - disabled (default behavior)
// 1 - enabled

View File

@ -115,6 +115,7 @@ cvar_t hostagehurtable = { "mp_hostage_hurtable", "1", FCVAR_SERVER, 1
cvar_t roundover = { "mp_roundover", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t forcerespawn = { "mp_forcerespawn", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t show_radioicon = { "mp_show_radioicon", "1", 0, 1.0f, nullptr };
cvar_t show_scenarioicon = { "mp_show_scenarioicon", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t old_bomb_defused_sound = { "mp_old_bomb_defused_sound", "1", 0, 1.0f, nullptr };
cvar_t item_staytime = { "mp_item_staytime", "300", FCVAR_SERVER, 300.0f, nullptr };
cvar_t legacy_bombtarget_touch = { "mp_legacy_bombtarget_touch", "1", 0, 1.0f, nullptr };
@ -317,6 +318,12 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&roundover);
CVAR_REGISTER(&forcerespawn);
CVAR_REGISTER(&show_radioicon);
if (!AreRunningCZero())
{
CVAR_REGISTER(&show_scenarioicon);
}
CVAR_REGISTER(&old_bomb_defused_sound);
CVAR_REGISTER(&item_staytime);
CVAR_REGISTER(&legacy_bombtarget_touch);

View File

@ -152,6 +152,7 @@ extern cvar_t hostagehurtable;
extern cvar_t roundover;
extern cvar_t forcerespawn;
extern cvar_t show_radioicon;
extern cvar_t show_scenarioicon;
extern cvar_t old_bomb_defused_sound;
extern cvar_t item_staytime;
extern cvar_t legacy_bombtarget_touch;

View File

@ -1270,8 +1270,14 @@ CGrenade *CGrenade::__API_HOOK(ShootSmokeGrenade)(entvars_t *pevOwner, VectorRef
void AnnounceFlashInterval(float interval, float offset)
{
if (!AreRunningCZero())
if (!AreRunningCZero()
#ifdef REGAMEDLL_ADD
&& !show_scenarioicon.value
#endif
)
{
return;
}
MESSAGE_BEGIN(MSG_ALL, gmsgScenarioIcon);
WRITE_BYTE(1);

View File

@ -6724,8 +6724,14 @@ void CBasePlayer::SendHostagePos()
void CBasePlayer::SendHostageIcons()
{
if (!AreRunningCZero())
if (!AreRunningCZero()
#ifdef REGAMEDLL_ADD
&& !show_scenarioicon.value
#endif
)
{
return;
}
int hostagesCount = 0;
CBaseEntity *pHostage = nullptr;