- Added three new ACS functions:

* int GetUserCVar(int playernum, "cvarname")
  * bool SetCVar("cvarname", newvalue)
  * bool SetUserCVar(int playernum, "cvarname", newvalue)
  GetUserCVar is analogous to GetCVar, except it returns the value of a user cvar for a
  specific player. (All user cvars can be examined using the playerinfo console command.)
  SetCVar sets a cvar to a new value. If the cvar is floating point, then newvalue is treated
  as a fixed point number, otherwise it's treated as an integer. SetUserCVar is the same, but
  for a specific player's user cvar.

  SetCVar and SetUserCVar can only change cvars created via CVARINFO. They cannot alter built-in cvars.

  If you use GetCVar or SetCVar with a user cvar, they will act on the copy of the user cvar
  for the player who activated the script. e.g.
    GetCVar("gender")
  is the same as
    GetUserCVar(PlayerNumber(), "gender")

  If you get the value of a floating point cvar, it will be returned as a fixed point number.
  Otherwise, it will be returned as an integer.

SVN r4283 (trunk)
This commit is contained in:
Randy Heit 2013-05-25 19:08:05 +00:00
commit 167ee9e7fb
4 changed files with 168 additions and 17 deletions

View file

@ -132,10 +132,10 @@ FBaseCVar::~FBaseCVar ()
}
}
void FBaseCVar::ForceSet (UCVarValue value, ECVarType type)
void FBaseCVar::ForceSet (UCVarValue value, ECVarType type, bool nouserinfosend)
{
DoSet (value, type);
if ((Flags & CVAR_USERINFO) && !(Flags & CVAR_IGNORE))
if ((Flags & CVAR_USERINFO) && !nouserinfosend && !(Flags & CVAR_IGNORE))
D_UserInfoChanged (this);
if (m_UseCallback)
Callback ();