Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00301 00302 00303 00304 00305 00306 00307 00308 00309 00310 00311 00312 00313 00314 00315 00316 00317 00318 00319 00320 00321 00322 00323 00324 00325 00326 00327 00328 00329 00330 00331 00332 00333 00334 00335 00336 00337 00338 00339 00340 00341 00342 00343 00344 00345 00346 00347 00348 00349 00350 00351 00352 00353 00354 00355 00356 00357 00358 00359 00360 00361 00362 00363 00364 00365 00366 00367 00368 00369 00370 00371 00372 00373 00374 00375 00376 00377 00378 00379 00380 00381 00382 00383 00384 00385 00386 00387 00388 00389 00390 00391 00392 00393 00394 00395 00396 00397 00398 |
/** * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. */ class UTUIDataStore_StringList extends UIDataStore config(Game) native(UI) transient implements(UIListElementProvider) implements(UIListElementCellProvider); const INVALIDFIELD=-1; struct native EStringListData { /** the tag used for binding this data to a list cell */ var name Tag; /** the string to use as the column header for cells bound to this field */ var localized string ColumnHeaderText; /** the currently selected value from the Strings array */ var string CurrentValue; /** the index into the Strings array for the element that should be selected by default */ var int DefaultValueIndex; /** the available value choices */ var localized array<string> Strings; /** provider for the list of strings associated with this tag */ var transient UTUIDataProvider_StringArray DataProvider; }; var config array<EStringListData> StringData; // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) /** * Called when this data store is added to the data store manager's list of active data stores. * * @param PlayerOwner the player that will be associated with this DataStore. Only relevant if this data store is * associated with a particular player; NULL if this is a global data store. */ event Registered( LocalPlayer PlayerOwner ) { local int FieldIdx; Super.Registered(PlayerOwner); // Go through all of the config defined string items and set the default value string. for(FieldIdx=0; FieldIdx<StringData.length; FieldIdx++) { if(StringData[FieldIdx].Strings.length > StringData[FieldIdx].DefaultValueIndex && StringData[FieldIdx].DefaultValueIndex >= 0) { StringData[FieldIdx].CurrentValue = StringData[FieldIdx].Strings[StringData[FieldIdx].DefaultValueIndex]; } } } /** * @param FieldName Name of the String List to find * @return the index of a string list */ native function INT GetFieldIndex(Name FieldName); /** * Add a string to the list * * @Param FieldName The string list to work on * @Param NewString The new string to add * @param bBatchOp if TRUE, doesn't call RefreshSubscribers() */ native function AddStr(name FieldName, string NewString, optional bool bBatchOp); /** * Insert a string in to the list at a given index * * @Param FieldName The string list to work on * @Param NewString The new string to add * @Param InsertIndex The index where you wish to insert the string * @param bBatchOp if TRUE, doesn't call RefreshSubscribers() */ native function InsertStr(name FieldName, string NewString, int InsertIndex, optional bool bBatchOp); /** * Remove a string from the list * * @Param FieldName The string list to work on * @Param StringToRemove The string to remove * @param bBatchOp if TRUE, doesn't call RefreshSubscribers() */ native function RemoveStr(name FieldName, string StringToRemove, optional bool bBatchOp); /** * Remove a string (or multiple strings) by the index. * * @Param FieldName The string list to work on * @Param Index The index to remove * @Param Count <Optional> # of strings to remove * @param bBatchOp if TRUE, doesn't call RefreshSubscribers() */ native function RemoveStrByIndex(name FieldName, int Index, optional int Count=1, optional bool bBatchOp); /** * Empty a string List * * @Param FieldName The string list to work on * @param bBatchOp if TRUE, doesn't call RefreshSubscribers() */ native function Empty(name FieldName, optional bool bBatchOp); /** * Finds a string in the list * * @Param FieldName The string list to add the new string to * @Param SearchStr The string to find * * @returns the index in the list or INVALIDFIELD */ native function INT FindStr(name FieldName, string SearchString); /** * Returns the a string by the index * * @Param FieldName The string list to add the new string to * @Param StrIndex The index of the string to get * * @returns the string. */ native function string GetStr(name FieldName, int StrIndex); /** * Get a list * * @Param FieldName The string list to add the new string to * @returns a copy of the list */ native function array<string> GetList(name FieldName); /** * Returns the current value of a field. * * @param FieldName Field to search. * @param out_Value Variable to store the result string in. * * @return TRUE if the field was found, FLASE otherwise. */ event bool GetCurrentValue(name FieldName, out string out_Value) { local bool Result; local int FieldIndex; Result = FALSE; FieldIndex = GetFieldIndex(FieldName); if(FieldIndex!=INDEX_NONE) { Result = TRUE; out_Value = StringData[FieldIndex].CurrentValue; } return Result; } /** * Returns the current value index of a given field. * * @param FieldName Field to search. */ event int GetCurrentValueIndex(name FieldName) { local int Result; local int FieldIndex; Result = INDEX_NONE; FieldIndex = GetFieldIndex(FieldName); if(FieldIndex!=INDEX_NONE) { Result = FindStr(FieldName, StringData[FieldIndex].CurrentValue); } return Result; } /** * Sets the current value index of a given field. * * @param FieldName Field to change. * @param int NewValueIndex */ event int SetCurrentValueIndex(name FieldName, int NewValueIndex) { local int Result; local int FieldIndex; Result = INDEX_NONE; FieldIndex = GetFieldIndex(FieldName); if(FieldIndex!=INDEX_NONE && StringData[FieldIndex].Strings.length > NewValueIndex) { StringData[FieldIndex].CurrentValue = StringData[FieldIndex].Strings[NewValueIndex]; } //@fixme - should we call refresh subscribers here? return Result; } /** * Get the number of strings in a given list * * @Param FieldName The string list to work on * @returns the # of strings or -1 if the list does not exist */ event int Num(name FieldName) { local int FieldIndex; FieldIndex = GetFieldIndex(FieldName); if ( FieldIndex > INDEX_NONE ) // Found it, add the string { return StringData[FieldIndex].Strings.Length; } return -1; } defaultproperties { StringData(0)=(Tag="ServerType",ColumnHeaderText="Match Type",DefaultValueIndex=1,Strings=("LAN","Internet")) StringData(1)=(Tag="ServerType360",ColumnHeaderText="Match Type",DefaultValueIndex=1,Strings=("System Link","Player","Ranked")) StringData(2)=(Tag="MatchType",ColumnHeaderText="Match Type",DefaultValueIndex=1,Strings=("LAN","Internet")) StringData(3)=(Tag="MatchType360",ColumnHeaderText="Match Type",DefaultValueIndex=1,Strings=("System Link","Player","Ranked")) StringData(4)=(Tag="BotTeams",ColumnHeaderText="Bot Team",Strings=("Random","Iron Guard","Ronin","Krall","Liandri","Necris")) StringData(5)=(Tag="RecordDemo",ColumnHeaderText="Demo Recording",Strings=("No","Yes")) StringData(6)=(Tag="FullScreen",ColumnHeaderText="Fullscreen",DefaultValueIndex=1,Strings=("Fullscreen","Windowed")) StringData(7)=(Tag="ScreenResolution",ColumnHeaderText="Resolution",Strings=("800x600","960x720","1024x768","1280x720","1600x1200")) StringData(8)=(Tag="PS3ButtonPresets",ColumnHeaderText="Button Preset",Strings=("Preset 1","Preset 2","Preset 3")) StringData(9)=(Tag="Splitscreen",ColumnHeaderText="Splitscreen",Strings=("No","Yes")) StringData(10)=(Tag="CharacterParts",ColumnHeaderText="Uniform",Strings=("Facemask","Helmet","Goggles","Torso","Shoulder Pads","Arms","Thighs","Boots")) StringData(11)=(Tag="PlayerCardOptions",ColumnHeaderText="Server Mode",Strings=("Listen","Dedicated")) StringData(12)=(Tag="ComboTest",Strings=("Item1","Item2","Item3","Item4")) StringData(13)=(Tag="MissionList",Strings=()) StringData(14)=(Tag="PlayerName") StringData(15)=(Tag="MatchTypeCampaign",ColumnHeaderText="Match Type",Strings=("Single Player","Splitscreen","LAN","Internet Public","Internet Private")) StringData(16)=(Tag="Difficulty",ColumnHeaderText="Difficulty",DefaultValueIndex=1,Strings=("Casual","Normal","Hard","Insane")) StringData(17)=(Tag="BotCombatants",ColumnHeaderText="Bot Combatants",DefaultValueIndex=1,Strings=("Disabled","Enabled")) StringData(18)=(Tag="BotCombatantsRatio",ColumnHeaderText="Bot Combatants",DefaultValueIndex=1,Strings=("Disabled","Enabled","Players vs. Bots 1:1","Players vs. Bots 2:3","Players vs. Bots 1:2")) Tag="UTStringList" WriteAccessType=ACCESS_WriteAll Name="Default__UTUIDataStore_StringList" ObjectArchetype=UIDataStore'Engine.Default__UIDataStore' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |