Legacy:PlayInfo

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to navigation Jump to search
UT2003 :: Object >> PlayInfo (Package: Engine)

Collects information about Info classes for the web admin interface.

GameInfo, GameReplicationInfo, AccessControl and all loaded Mutator classes get the opportunity to add their user-editable properties to the PlayInfo object. The web admin interface displays all those properties and allows users to modify them interactively.

Class Function
GameInfo FillPlayInfo (static)
GameReplicationInfo FillPlayInfo (static)
AccessControl FillPlayInfo (static)
Mutator MutatorFillPlayInfo

The implementation of MutatorFillPlayInfo in Mutator was a little buggy in earlier versions of UT2003, so the mutator configuration options aren't registered reliably for the web admin interface. In version 2186 and later this has been fixed and you can implement it like in one of the following examples

Either directly overwrite MutatorFillPlayInfo...

<uscript> function MutatorFillPlayInfo(PlayInfo PlayInfo) {

   // add current class to stack
   PlayInfo.AddClass(Class);
   // now register any mutator settings
   PlayInfo.AddSetting("Mutators", "bMyFirstSetting",  "First mutator setting",  0, 0, "Check");
   PlayInfo.AddSetting("Mutators", "bMySecondSetting", "Second mutator setting", 0, 0, "Check");
   // remove mutator class from class stack
   PlayInfo.PopClass();
   // call default implementation
   if (NextMutator != None)
       NextMutator.MutatorFillPlayInfo(PlayInfo);

} </uscript>

...or FillPlayInfo.

<uscript> static function FillPlayInfo(PlayInfo PlayInfo) {

   // call superclass implementation, which adds the mutator class to the stack
   Super.FillPlayInfo(PlayInfo);
   // now register any mutator settings
   PlayInfo.AddSetting("Mutators", "bMyFirstSetting",  "First mutator setting",  0, 0, "Check");
   PlayInfo.AddSetting("Mutators", "bMySecondSetting", "Second mutator setting", 0, 0, "Check");
   // remove mutator class from class stack
   PlayInfo.PopClass();

} </uscript>

Properties

array<PlayInfoData> Settings (const) 
array<class<Info> > InfoClasses (const) 
array<int> ClassStack (const) 
array<string> Groups (const) 
string LastError (const) 

Structs

PlayInfoData

<uscript> struct PlayInfoData { var const Property ThisProp; // Pointer to property var const class<Info> ClassFrom; // Which class was this Property from var const string SettingName; // Name of the class member var const string DisplayName; // Display Name of the control (from .INT/.INI File ?) var const string RenderType; // Type of rendered control var const string Grouping; // Grouping for this parameter var const string Data; // Extra Data (like Gore Level Texts) var const string ExtraPriv; // Extra Privileges Required to set this parameter var const byte SecLevel; // Sec Level Required to set this param. (Read from Ini file afterwards) var const byte Weight; // Importance of the setting compared to others in its group var const bool bGlobal; // GlobalConfig Property ? (Set by native function) var const string Value; // Value of the setting }; </uscript>

Methods

All PlayInfo methods are native and final with the exception of Init() which is only final.

Clear() 
Clears the Settings array.
AddClass(class<Info> Class) 
Prepares the PlayInfo object for subsequent AddSetting calls relating to the given class.
PopClass() 
Removes the last class added to the class stack with the AddClass method, thus returning to the previously added class.
AddSetting(string Group, string PropertyName, string Description, byte SecLevel, byte Weight, string RenderType, optional string Extras, optional string ExtraPrivs) 
Validates the given data and adds an entry to the Settings array. The given PropertyName must correspond to an existing config variable in the current class. (Existing entries can be changed with the StoreSetting function.)
bool SaveSettings() 
Saves stored settings to an .ini file.
bool StoreSetting(int index, coerce string NewVal, optional string RangeData) 
Validates the given data and sets an element of the Settings array.
int FindIndex(string SettingName) 
Returns an index into the Settings array corresponding to the given property name.
SplitStringToArray(out array<string> AStr, string Str, string Divider) 
Splits the given string into an array of elements that were separated by the given divider substring (for instance, a comma).
Init() 
Prints a list of all currently stored settings to the log.

RenderType

This is an explaination of the render types. Render types tell WebAdmin which HTML widget to display for the variable.

Check 
Checkbox. This is associated with variable with a boolean type. Whether it's checked, or not, is based on the value of the variable.
Text 

Input field used for strings and numeric data. This render type can use the optional Extras parameter in AddSetting to determine the length of the field, and for the valid value range.

<uscript> "Length;Min Value:Max Value" // for numerics "Length" // for alphanumerics </uscript>

For example, "3;0:200" would create an input field of length 3 and only accept values between 0 and 200. Values outside the range will default to closest minimum or maximum value.

For alphanumeric fields you can specify a maximum length or leave this out completely, which will most likely make the imput field too small.


Select 

Drop down select box: This render type requires the optional Extras parameter in AddSetting for the selection list. The parameter is structured as follows:

<uscript> "Value1;Text1;Value2;Text2; ... ValueN;TextN" </uscript>

For example, if I had three items with unique ids the parameter might look like this.

<uscript> "0;Unreal Rifle Sound;1;UT Rifle Sound;2;Lightning Gun Sound" </uscript>

The value of the variable will determine which item is selected as the default.