News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 22nd May 2012, 11:53 PM   #1
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 204
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();
}
Once again, this is slightly modified for another version of the engine. Everything compiles, all the windows and fields show up, but the list items (IE the text reading "MUTATOR.MUTATORNAME") does not even get created. To me, that means there's something wrong with this line...

Code:
UMenuMutatorList(Exclude.Items.Append(class'UMenuMutatorList'));
or something wrong with the 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;
}
But these compile fine and are identical to the UT versions. So, does anyone have any insight into what could be causing the list items to not be made? When I log the contents of Exclude (Exclude.Items) it is returning None.
__________________
How to play NAB


Last edited by Rajada; 23rd May 2012 at 02:56 PM.
Rajada is offline   Reply With Quote
Old 24th May 2012, 01:45 AM   #2
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 204
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

Rajada is offline   Reply With Quote
Reply

Tags
code, menu, mutator

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:56 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer