![]() |
|
|
#1 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
Mutator Menu Code - Need Help
I am modifying the menu code for the mutator window for my own Unreal engine game mod. My menu structure is identical to UT, and after playing with the code, the following works perfectly with one exception. All the mutators with valid int files are found and names are read in, but the list items are never created.
Code:
function LoadMutators()
{
local int NumMutatorClasses;
local string NextMutator, NextDesc;
local UMenuMutatorList I;
local int j;
local int k;
GetPlayerOwner().GetNextIntDesc(MutatorBaseClass, 0, NextMutator, NextDesc);
while( (NextMutator != "") && (NumMutatorClasses < 200) )
{
I = UMenuMutatorList(Exclude.Items.Append(class'UMenuMutatorList'));
I.MutatorClass = NextMutator;
k = InStr(NextDesc, ",");
if(k == -1)
{
I.MutatorName = NextDesc;
I.HelpText = "";
}
else
{
I.MutatorName = Left(NextDesc, k);
I.HelpText = Mid(NextDesc, k+1);
}
GetPlayerOwner().GetNextIntDesc(MutatorBaseClass, NumMutatorClasses, NextMutator, NextDesc);
NumMutatorClasses++;
}
MutatorList = GetConfigString("NerfMenu.NerfPDAScreenSetupBotmatch", "SavedMutatorString", "Nerf.ini");
while(MutatorList != "")
{
j = InStr(MutatorList, ",");
if(j == -1)
{
NextMutator = MutatorList;
MutatorList = "";
}
else
{
NextMutator = Left(MutatorList, j);
MutatorList = Mid(MutatorList, j+1);
}
I = UMenuMutatorList(Exclude.Items).FindMutator(NextMutator);
if(I != None)
{
I.Remove();
Include.Items.AppendItem(I);
}
else
Log("Unknown mutator in mutator list: "$NextMutator);
}
Exclude.Sort();
}
Code:
UMenuMutatorList(Exclude.Items.Append(class'UMenuMutatorList')); Code:
var string MutatorName;
var string MutatorClass;
function int Compare(UWindowList T, UWindowList B)
{
if(Caps(UMenuMutatorList(T).MutatorName) < Caps(UMenuMutatorList(B).MutatorName))
return -1;
return 1;
}
// Call only on sentinel
function UMenuMutatorList FindMutator(string FindMutatorClass)
{
local UMenuMutatorList I;
for(I = UMenuMutatorList(Next); I != None; I = UMenuMutatorList(I.Next))
if(I.MutatorClass ~= FindMutatorClass)
return I;
return None;
}
__________________
How to play NAB Last edited by Rajada; 23rd May 2012 at 02:56 PM. |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
Ahhhhh I figured it out. I had to explicitly declare the ListClass in the Exclude and Include boxes for some reason.
__________________
How to play NAB |
|
|
|
![]() |
| Tags |
| code, menu, mutator |
| Thread Tools | |
| Display Modes | |
|
|