The easiest example is
Code: Select all
Engine.Weapon
Code: Select all
Mod -> Weapon Priority -> Advanced Priority....
Code: Select all
UMenu.UMenuWeaponPriorityListBox.uc
----------------------------------------------------
var string WeaponClassParent;
function Created() {
local name PriorityName;
local string WeaponClassName;
local class<Weapon> WeaponClass;
local int WeaponNum, i;
local UMenuWeaponPriorityList L;
local PlayerPawn P;
Super.Created();
SetHelpText(WeaponPriorityHelp);
P = GetPlayerOwner();
//!!!!!!!!!!!!!!!!!!!! CODE OF INTEREST !!!!!!!!!!!!!!!!!!!!!!!!!!!
// Load weapons into the list
for(i=0;i<ArrayCount(P.WeaponPriority);i++)
{
PriorityName = P.WeaponPriority[i];
if(PriorityName == 'None') break;
L = UMenuWeaponPriorityList(Items.Insert(ListClass));
L.PriorityName = PriorityName;
L.WeaponName = "(unk) "$PriorityName;
}
WeaponNum = 1;
//!!!!!!!!!!!!!!!!!!!! CODE OF INTEREST !!!!!!!!!!!!!!!!!!!!!!!!!!!
//My guess is this gets the first int file defined in this list? (index = 0?)
WeaponClassName = P.GetNextInt(WeaponClassParent, 0);
while( WeaponClassName != "" && WeaponNum < 50 )
{
for(L = UMenuWeaponPriorityList(Items.Next); L != None; L = UMenuWeaponPriorityList(L.Next))
{
if( string(L.PriorityName) ~= P.GetItemName(WeaponClassName) )
{
L.WeaponClassName = WeaponClassName;
L.bFound = True;
if( L.ShowThisItem() )
{
//!!!!!!!!!!!!!!!!!!!! CODE OF INTEREST !!!!!!!!!!!!!!!!!!!!!!!!!!!
// My guess is this loads the class at runtime based on the string
WeaponClass = class<Weapon>(DynamicLoadObject(WeaponClassName, class'Class'));
ReadWeapon(L, WeaponClass);
}
else
L.bFound = False;
break;
}
}
//!!!!!!!!!!!!!!!!!!!! CODE OF INTEREST !!!!!!!!!!!!!!!!!!!!!!!!!!!
//My guess is this iterates and finds the next INT file in the list loaded, of the class parent string, and given the index in WeaponNum
WeaponClassName = P.GetNextInt(WeaponClassParent, WeaponNum);
WeaponNum++;
}
}
defaultproperties {
//This seems to control which class to fetch using Actor.GetNextInt
WeaponClassParent="Engine.Weapon"
}
I see
Code: Select all
PlayerPawn.WeaponPriority
Code: Select all
WeaponClassName = P.GetNextInt(WeaponClassParent, WeaponNum)
I am unsure what
Code: Select all
Actor.GetNextInt
I originally considered:
Code: Select all
local string ClassListing;
ClassListing= (consoleCommand("obj classes"));
I added comments to denote code i believe are of interest and my thoughts. Can anybody give some insight and clarify some things?