mirror of
https://github.com/ENSL/NS.git
synced 2024-11-10 07:11:38 +00:00
add cl_teamcfgs
- can change auto execution of team configs to be 0 =off, 1 = if playing only, 2 = also in spectate
This commit is contained in:
parent
710518f55a
commit
8835eb0a60
3 changed files with 19 additions and 7 deletions
|
@ -148,6 +148,7 @@ cvar_t *cl_mutemenu;
|
|||
cvar_t *cl_weaponcfgs;
|
||||
cvar_t *cl_pistoltrigger;
|
||||
cvar_t *cl_cmcancellast;
|
||||
cvar_t *cl_teamcfgs;
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
@ -1760,6 +1761,7 @@ void InitInput (void)
|
|||
cl_weaponcfgs = gEngfuncs.pfnRegisterVariable ("cl_weaponcfgs", "1", FCVAR_ARCHIVE);
|
||||
cl_pistoltrigger = gEngfuncs.pfnRegisterVariable ("cl_pistoltrigger", "1", FCVAR_ARCHIVE);
|
||||
cl_cmcancellast = gEngfuncs.pfnRegisterVariable("cl_cmcancellast", "0", FCVAR_ARCHIVE);
|
||||
cl_teamcfgs = gEngfuncs.pfnRegisterVariable("cl_teamcfgs", "1", FCVAR_ARCHIVE);
|
||||
|
||||
gEngfuncs.pfnRegisterVariable("cl_placebo", "0", 0); // Junk command for options menu dividers.
|
||||
|
||||
|
|
|
@ -91,6 +91,8 @@ extra_player_info_t g_PlayerExtraInfo[MAX_PLAYERS+1]; // additional player in
|
|||
team_info_t g_TeamInfo[MAX_TEAMS+1];
|
||||
int g_IsSpectator[MAX_PLAYERS+1];
|
||||
|
||||
extern cvar_t* cl_teamcfgs;
|
||||
|
||||
int HUD_IsGame( const char *game );
|
||||
int EV_TFC_IsAllyTeam( int iTeam1, int iTeam2 );
|
||||
|
||||
|
@ -599,10 +601,14 @@ void ScorePanel::SortTeams()
|
|||
SortActivePlayers(kAlien2Team);
|
||||
SortActivePlayers(kMarine2Team);
|
||||
|
||||
if (oldteam != gHUD.GetHUDTeam())
|
||||
if (m_iPlayerTeam != gHUD.GetHUDTeam())
|
||||
{
|
||||
m_iPlayerTeam = gHUD.GetHUDTeam();
|
||||
|
||||
if ((cl_teamcfgs->value == 1.0f && gHUD.GetPlayMode() == PLAYMODE_PLAYING) || cl_teamcfgs->value >= 2.0f)
|
||||
{
|
||||
ClientCmd("exec alienofficial.cfg\n");
|
||||
oldteam = gHUD.GetHUDTeam();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -611,10 +617,14 @@ void ScorePanel::SortTeams()
|
|||
SortActivePlayers(kMarine2Team);
|
||||
SortActivePlayers(kAlien2Team);
|
||||
|
||||
if (oldteam != gHUD.GetHUDTeam())
|
||||
if (m_iPlayerTeam != gHUD.GetHUDTeam())
|
||||
{
|
||||
m_iPlayerTeam = gHUD.GetHUDTeam();
|
||||
|
||||
if ((cl_teamcfgs->value == 1.0f && gHUD.GetPlayMode() == PLAYMODE_PLAYING) || cl_teamcfgs->value >= 2.0f)
|
||||
{
|
||||
ClientCmd("exec marineofficial.cfg\n");
|
||||
oldteam = gHUD.GetHUDTeam();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ private:
|
|||
|
||||
unsigned int m_iIconFrame;
|
||||
unsigned int m_iLastFrameIncrementTime;
|
||||
int oldteam;
|
||||
int m_iPlayerTeam;
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Reference in a new issue