Update filehandler.uc

Update filehandler.uc

Uses {@Evaluate} instead of {@Eval} for faster speed and to resolve quotes within arg

# filehandler.uc - uCalc Transformation file
# This file was saved with uCalc Transform 2.95 on 4/17/2014 11:20:35 AM
# Comment: File handler

ExternalKeywords: Exclude, Comment, Selected, ParentChild, FindMode, InputFile, OutputFile, BatchAction, SEND
ExternalKeywords: Highlight, ForeColor, BackColor, FontName, FontSize, FontStyle
ExternalKeywords: FilterEndText, FilterSeparator, FilterSort, FilterSortFunc, FilterStartText, FilterUnique, FilterTally

FindMode: Replace

# Definitions

# Search Criteria

Criteria: 0
Enabled: True
Exclude: False
Comment: File handler
Selected: False
Highlight: True
ForeColor: ControlText
BackColor: Aqua
FontName:
FontSize:
FontStyle:
CaseSensitive: False
QuoteSensitive: True
CodeBlockSensitive: True
FilterEndText:
FilterSeparator: {#10}
FilterSort: False
FilterSortFunc:
FilterStartText:
FilterUnique: False
FilterTally: False
Min: 0
Max: -1
MinSoft: 0
MaxSoft: -1
BatchAction: Transform
InputFile:
OutputFile:
SEND:
StartAfter: 0
StopAfter: -1
SkipOver: False
ParentChild: 0
Pass: 0
PassOnce: True
Precedence: 0
RightToLeft: False

Criteria: 1
Find:
Replace: {@Token:: : ~~ Properties: ucStatementSep }

Criteria: 2
Comment:
Pass: 1

Criteria: 3
BackColor: Yellow
SkipOver: True
Find: ' {Comment:".*"}
Replace: [Skip over]

Criteria: 4
BackColor: DeepSkyBlue
Find: {@Start}
Replace: #include <iostream>
         #include <fstream>
         {@Var: FreeFileNum}

Criteria: 5
BackColor: DeepSkyBlue
Find: Open {filespec}
      { For {{Input: Input}|{Output: Output}|{Append: Append}|{Binary: Binary}|{Random: Random}}|{Default: } }
      { Access Read | Access Write | Access Read Write | }
      { Lock {{LockRead: Read}|{LockWrite: Write}|{LockBoth: Read Write}|{LockShared: Shared}}|{LockDefault: } }
      As [#]{filenum} [Len = {size=128}]
Replace: fstream file_{filenum} (string({filespec}).c_str(),
            {Input:   ios::in}
            {Output:  ios::out | ios::trunc}
            {Append:  ios::out | ios::app}
            {Binary:  ios::binary | ios::in | ios::out}
            {Random:  ios::binary | ios::in | ios::out}
            {Default: ios::binary | ios::in | ios::out}
         );

Criteria: 6
BackColor: Lime
Find: Close [#]{filenum}
Replace: file_{filenum}.close() ' PB: Close #{filenum}

Criteria: 7
BackColor: RoyalBlue
PassOnce: False
Find: Close [#]{file1}, {more}
Replace: Close {file1}
         Close {more}

Criteria: 8
BackColor: Pink
Find: Seek [#] {filenum}, {position}
Replace: file_{filenum}.seekg({position}-1)
         file_{filenum}.seekp({position}-1)

Criteria: 9
Find: Seek([#] {filenum})
Replace: file_{filenum}.tellg()+1

Criteria: 10
BackColor: SlateBlue
Find: LOF({filenum})
Replace: PB_LOF({filenum})

Criteria: 11
Find: EOF({filenum})
Replace: file_{filenum}.eof()

Criteria: 12
Find: FreeFile
Replace: {@Eval: FreeFileNum += 1; FreeFileNum}

Criteria: 13
BackColor: Green
Find: Get$ [#] {filenum}, {count}, {StringVar}
Replace: {StringVar}.resize({count})
         file_{filenum}.read(&{StringVar}[0], {count})

Criteria: 14
BackColor: SandyBrown
Find: Put$ [#] {filenum}, {text}
Replace: file_{filenum}.write(&{text}[0], {text}.size())

Criteria: 15
Find: IsFile({file})
Replace: PB_ISFILE({file})

Criteria: 16
Find: Name {oldname} As {newname}
Replace: PB_NAME({oldname}, {newname})

Criteria: 17
BackColor: Gold
Find: EXE.Extn$
Replace: PB_EXE_EXTN

Criteria: 18
BackColor: Silver
Find: EXE.Full$
Replace: PB_EXE_FULL()

Criteria: 19
Find: EXE.Name$
Replace: PB_EXE_NAME

Criteria: 20
BackColor: CornflowerBlue
Find: EXE.Namex$
Replace: PB_EXE_NAMEX

Criteria: 21
Find: EXE.Path$
Replace: PB_EXE_PATH

Criteria: 22
Find: Dir$({mask})
Replace: PB_DIR({mask})

Criteria: 23
Find: Dir$([Next])
Replace: PB_DIR_NEXT()

Criteria: 24
Find: Print #{filenum}
Replace: file_{filenum} << endl

Criteria: 25
Find: Print #{filenum}, {text}
Replace: file_{filenum} << {text} << endl

Criteria: 26
Find: Print #{filenum}, {text};
Replace: file_{filenum} << {text}

Criteria: 27
PassOnce: False
Find: Print #{filenum}, {text}; {MoreText}
Replace: Print #{filenum}, {text} << {MoreText}

Criteria: 28
Comment:
Pass: 2

Criteria: 29
Selected: True
BackColor: Yellow
Find: fstream {file} ({args+})
Replace: {@Evaluate: Replace({@Self}, '{"[ \n]+"}', ' ')}

# End Search

# filehandler.uc - uCalc Transformation file
# This file was saved with uCalc Transform 2.95 on 3/28/2014 2:13:18 PM
# Comment: File handler

ExternalKeywords: Exclude, Comment, Selected, ParentChild, FindMode, InputFile, OutputFile, BatchAction, SEND
ExternalKeywords: Highlight, ForeColor, BackColor, FontName, FontSize, FontStyle
ExternalKeywords: FilterEndText, FilterSeparator, FilterSort, FilterSortFunc, FilterStartText, FilterUnique, FilterTally

FindMode: Replace

# Definitions

# Search Criteria

Criteria: 0
Enabled: True
Exclude: False
Comment: File handler
Selected: False
Highlight: True
ForeColor: ControlText
BackColor: Aqua
FontName:
FontSize:
FontStyle:
CaseSensitive: False
QuoteSensitive: True
CodeBlockSensitive: True
FilterEndText:
FilterSeparator: {#10}
FilterSort: False
FilterSortFunc:
FilterStartText:
FilterUnique: False
FilterTally: False
Min: 0
Max: -1
MinSoft: 0
MaxSoft: -1
BatchAction: Transform
InputFile:
OutputFile:
SEND:
StartAfter: 0
StopAfter: -1
SkipOver: False
ParentChild: 0
Pass: 0
PassOnce: True
Precedence: 0
RightToLeft: False

Criteria: 1
Selected: True
Find:
Replace: {@Token:: : ~~ Properties: ucStatementSep }

Criteria: 2
Comment:
Pass: 1

Criteria: 3
BackColor: Yellow
SkipOver: True
Find: ' {Comment:".*"}
Replace: [Skip over]

Criteria: 4
BackColor: DeepSkyBlue
Find: {@Start}
Replace: #include <iostream>
         #include <fstream>
         {@Var: FreeFileNum}

Criteria: 5
BackColor: DeepSkyBlue
Find: Open {filespec}
      { For {{Input: Input}|{Output: Output}|{Append: Append}|{Binary: Binary}|{Random: Random}}|{Default: } }
      { Access Read | Access Write | Access Read Write | }
      { Lock {{LockRead: Read}|{LockWrite: Write}|{LockBoth: Read Write}|{LockShared: Shared}}|{LockDefault: } }
      As [#]{filenum} [Len = {size=128}]
Replace: fstream file_{filenum} (string({filespec}).c_str(),
            {Input:   ios::in}
            {Output:  ios::out | ios::trunc}
            {Append:  ios::out | ios::app}
            {Binary:  ios::binary | ios::in | ios::out}
            {Random:  ios::binary | ios::in | ios::out}
            {Default: ios::binary | ios::in | ios::out}
         );

Criteria: 6
BackColor: Lime
Find: Close [#]{filenum}
Replace: file_{filenum}.close() ' PB: Close #{filenum}

Criteria: 7
BackColor: RoyalBlue
PassOnce: False
Find: Close [#]{file1}, {more}
Replace: Close {file1}
         Close {more}

Criteria: 8
BackColor: Pink
Find: Seek [#] {filenum}, {position}
Replace: file_{filenum}.seekg({position}-1)
         file_{filenum}.seekp({position}-1)

Criteria: 9
Find: Seek([#] {filenum})
Replace: file_{filenum}.tellg()+1

Criteria: 10
BackColor: SlateBlue
Find: LOF({filenum})
Replace: PB_LOF({filenum})

Criteria: 11
Find: EOF({filenum})
Replace: file_{filenum}.eof()

Criteria: 12
Find: FreeFile
Replace: {@Eval: FreeFileNum += 1; FreeFileNum}

Criteria: 13
BackColor: Green
Find: Get$ [#] {filenum}, {count}, {StringVar}
Replace: {StringVar}.resize({count})
         file_{filenum}.read(&{StringVar}[0], {count})

Criteria: 14
BackColor: SandyBrown
Find: Put$ [#] {filenum}, {text}
Replace: file_{filenum}.write(&{text}[0], {text}.size())

Criteria: 15
Find: IsFile({file})
Replace: PB_ISFILE({file})

Criteria: 16
Find: Name {oldname} As {newname}
Replace: PB_NAME({oldname}, {newname})

Criteria: 17
BackColor: Gold
Find: EXE.Extn$
Replace: PB_EXE_EXTN

Criteria: 18
BackColor: Silver
Find: EXE.Full$
Replace: PB_EXE_FULL()

Criteria: 19
Find: EXE.Name$
Replace: PB_EXE_NAME

Criteria: 20
BackColor: CornflowerBlue
Find: EXE.Namex$
Replace: PB_EXE_NAMEX

Criteria: 21
Find: EXE.Path$
Replace: PB_EXE_PATH

Criteria: 22
Find: Dir$({mask})
Replace: PB_DIR({mask})

Criteria: 23
Find: Dir$([Next])
Replace: PB_DIR_NEXT()

Criteria: 24
Find: Print #{filenum}
Replace: file_{filenum} << endl

Criteria: 25
Find: Print #{filenum}, {text}
Replace: file_{filenum} << {text} << endl

Criteria: 26
Find: Print #{filenum}, {text};
Replace: file_{filenum} << {text}

Criteria: 27
PassOnce: False
Find: Print #{filenum}, {text}; {MoreText}
Replace: Print #{filenum}, {text} << {MoreText}

Criteria: 28
Comment:
Pass: 2

Criteria: 29
BackColor: Yellow
Find: fstream {file} ({args+})
Replace: {@Eval: Replace('{Self}', '{"[ \n]+"}', ' ')}

# End Search


Added a validation func to X2SitRepEffect_ModifyTacticalStartState

//---------------------------------------------------------------------------------------
//  FILE:    XComGameState_ModifyTacticalStartState
//  AUTHOR:  statusNone
//
//  Class created to give SITREPs access to the Tactical XCGS StartState
//
//---------------------------------------------------------------------------------------
// File added to the CHL (this is a non-base game class)
//---------------------------------------------------------------------------------------

class X2SitRepEffect_ModifyTacticalStartState extends X2SitRepEffectTemplate;

var Delegate<ModifyTacticalStartStateDelegate> ModifyTacticalStartStateFn;

delegate ModifyTacticalStartStateDelegate(XComGameState StartState);

function bool ValidateTemplate(out string strError)
{
	if (ModifyTacticalStartStateFn == none)
	{
		strError = "ModifyTacticalStartStateFn not set";
		return false;
	}

	return true;
}

//---------------------------------------------------------------------------------------
//  FILE:    XComGameState_ModifyTacticalStartState
//  AUTHOR:  statusNone
//
//  Class created to give SITREPs access to the Tactical XCGS StartState
//
//---------------------------------------------------------------------------------------
// File added to the CHL this is a non-base game class
//---------------------------------------------------------------------------------------

class X2SitRepEffect_ModifyTacticalStartState extends X2SitRepEffectTemplate;

var Delegate<ModifyTacticalStartStateDelegate> ModifyTacticalStartStateFn;

delegate ModifyTacticalStartStateDelegate(XComGameState StartState);


Update print.uc

Update print.uc

Skip over comments

# print.uc - uCalc Transformation file
# This file was saved with uCalc Transform 2.95 on 4/9/2014 5:21:42 PM
# Comment:

ExternalKeywords: Exclude, Comment, Selected, ParentChild, FindMode, InputFile, OutputFile, BatchAction, SEND
ExternalKeywords: Highlight, ForeColor, BackColor, FontName, FontSize, FontStyle
ExternalKeywords: FilterEndText, FilterSeparator, FilterSort, FilterSortFunc, FilterStartText, FilterUnique, FilterTally

FindMode: Replace

# Definitions

# Search Criteria

Criteria: 0
Enabled: True
Exclude: False
Comment:
Selected: False
Highlight: False
ForeColor: ControlText
BackColor: Aqua
FontName:
FontSize:
FontStyle:
CaseSensitive: False
QuoteSensitive: True
CodeBlockSensitive: True
FilterEndText:
FilterSeparator: {#10}
FilterSort: False
FilterSortFunc:
FilterStartText:
FilterUnique: False
FilterTally: False
Min: 0
Max: -1
MinSoft: 0
MaxSoft: -1
BatchAction: Transform
InputFile:
OutputFile:
SEND:
StartAfter: 0
StopAfter: -1
SkipOver: False
ParentChild: 0
Pass: 0
PassOnce: True
Precedence: 0
RightToLeft: False

Criteria: 1
Selected: True
Highlight: True
BackColor: Yellow
Find:
Replace: {@Token:: : ~~ Properties: ucStatementSep }
         {@Token:: [\x27\_].* ~~ Properties: ucWhiteSpace}

Criteria: 2
Comment:
Pass: 1

Criteria: 3
BackColor: Purple
Find: Print
Replace: cout <<

Criteria: 4
Comment: Add ENDL to lines that need it
Pass: 2

Criteria: 5
Highlight: True
BackColor: DarkKhaki
Find: cout << [{data}]
Replace: cout << {data} << endl

Criteria: 6
Highlight: True
BackColor: DeepSkyBlue
Find: cout << [{data}] {punc: ; | , }{end: {nl} | : }
Replace: cout << {data} {punc}{end}

Criteria: 7
Comment:
Pass: 3

Criteria: 8
Highlight: True
BackColor: Lime
PassOnce: False
Find: cout << {data}, [{more}]
Replace: cout << PZONE << {data}{more: : cout << {more}}

Criteria: 9
BackColor: SlateBlue
PassOnce: False
Find: cout << {data}; [{more}]
Replace: cout << {data}{more: : cout << {more}}

Criteria: 10
Comment: Clean up
Pass: 4

Criteria: 11
Highlight: True
BackColor: RoyalBlue
PassOnce: False
Find: << <<
Replace: <<

Criteria: 12
BackColor: SlateBlue
PassOnce: False
Find: cout << {data} : cout <<
Replace: cout << {data} <<

# End Search

# print.uc - uCalc Transformation file
# This file was saved with uCalc Transform 2.95 on 4/8/2014 6:29:17 PM
# Comment:

ExternalKeywords: Exclude, Comment, Selected, ParentChild, FindMode, InputFile, OutputFile, BatchAction, SEND
ExternalKeywords: Highlight, ForeColor, BackColor, FontName, FontSize, FontStyle
ExternalKeywords: FilterEndText, FilterSeparator, FilterSort, FilterSortFunc, FilterStartText, FilterUnique, FilterTally

FindMode: Replace

# Definitions

# Search Criteria

Criteria: 0
Enabled: False
Exclude: False
Comment:
Selected: False
Highlight: False
ForeColor: ControlText
BackColor: Aqua
FontName:
FontSize:
FontStyle:
CaseSensitive: False
QuoteSensitive: True
CodeBlockSensitive: True
FilterEndText:
FilterSeparator: {#10}
FilterSort: False
FilterSortFunc:
FilterStartText:
FilterUnique: False
FilterTally: False
Min: 0
Max: -1
MinSoft: 0
MaxSoft: -1
BatchAction: Transform
InputFile:
OutputFile:
SEND:
StartAfter: 0
StopAfter: -1
SkipOver: False
ParentChild: 0
Pass: 0
PassOnce: True
Precedence: 0
RightToLeft: False

Criteria: 1
Enabled: True
Highlight: True
BackColor: Yellow
Find:
Replace: {@Token:: : ~~ Properties: ucStatementSep }

Criteria: 2
Comment:
Pass: 1

Criteria: 3
Enabled: True
BackColor: Purple
Find: Print
Replace: cout <<

Criteria: 4
Comment: Add ENDL to lines that need it
Pass: 2

Criteria: 5
Enabled: True
Highlight: True
BackColor: DarkKhaki
Find: cout << [{data}]
Replace: cout << {data} << endl

Criteria: 6
Enabled: True
Highlight: True
BackColor: DeepSkyBlue
Find: cout << [{data}] {punc: ; | , }{end: {nl} | : }
Replace: cout << {data} {punc}{end}

Criteria: 7
Comment:
Pass: 3

Criteria: 8
Enabled: True
Highlight: True
BackColor: Lime
PassOnce: False
Find: cout << {data}, [{more}]
Replace: cout << PZONE << {data}{more: : cout << {more}}

Criteria: 9
Enabled: True
Selected: True
BackColor: SlateBlue
PassOnce: False
Find: cout << {data}; [{more}]
Replace: cout << {data}{more: : cout << {more}}

Criteria: 10
Comment: Clean up
Pass: 4

Criteria: 11
Enabled: True
Highlight: True
BackColor: RoyalBlue
PassOnce: False
Find: << <<
Replace: <<

Criteria: 12
Enabled: True
BackColor: SlateBlue
PassOnce: False
Find: cout << {data} : cout <<
Replace: cout << {data} <<

# End Search


Fixed pre-loading wrong class

Fixed pre-loading wrong class

class TestCWR_ConfigDeployableUIConfig extends UTUIFrontEnd;

var transient localized string Title;

/** Replacement info. */
var transient name DeployableClassToReplace;

/** Reference to the pickup combo box. */
var transient UTUIComboBox PickupCombo;

/** Reference to the string list datastore. */
var transient UTUIDataStore_StringList StringListDataStore;

/** Reference to the menu item datastore. */
var transient UTUIDataStore_MenuItems MenuItemDataStore;

/** List of possible weapon classes. */
var transient array<name> PickupClassNames;
var transient array<string>	PickupFriendlyNames;

event PostInitialize()
{
	Super.PostInitialize();

	DeployableClassToReplace = class'TestCWR_ConfigDeployableMutatorCWR'.default.ReplaceDeployableClassName;

	// Get datastore references
	StringListDataStore = UTUIDataStore_StringList(FindDataStore('UTStringList'));
	MenuItemDataStore = UTUIDataStore_MenuItems(FindDataStore('UTMenuItems'));

	// setup combo selection
	PickupCombo = UTUIComboBox(FindChild('cboReplace', true));
	PickupCombo.ComboEditbox.StringRenderComponent.SetAlignment(UIORIENT_Horizontal, UIALIGN_Left);
	PickupCombo.ComboEditbox.StringRenderComponent.SetAlignment(UIORIENT_Vertical, UIALIGN_Center);

	BuildPickupOptions();
}

/** Sets the title for this scene. */
function SetTitle()
{
	local UILabel TitleLabel;

	TitleLabel = GetTitleLabel();
	if ( TitleLabel != None ) TitleLabel.SetDataStoreBinding("");
}

/** Sets up the scene's button bar. */
function SetupButtonBar()
{
	ButtonBar.Clear();
	ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.Back>", OnButtonBar_Back);
	ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.Accept>", OnButtonBar_Accept);
}

/** Provides a hook for unrealscript to respond to input using actual input key names (i.e. Left, Tab, etc.) */
function bool HandleInputKey( const out InputEventParameters EventParms )
{
	local bool bResult;

	bResult = false;

	if(EventParms.EventType==IE_Released)
	{
		if(EventParms.InputKeyName=='XboxTypeS_B' || EventParms.InputKeyName=='Escape')
		{
			OnBack();
			bResult = true;
		}
	}

	return bResult;
}

/** Buttonbar Callback for Back. */
function bool OnButtonBar_Back(UIScreenObject InButton, int InPlayerIndex)
{
	OnBack();
	return true;
}

/** Buttonbar Callback for Accept. */
function bool OnButtonBar_Accept(UIScreenObject InButton, int InPlayerIndex)
{
	OnAccept();
	return true;
}

/** Callback for when the user wants to back out of this screen. */
function OnBack()
{
	CloseScene(self);
}

/** Callback for when the user accepts the changes. */
function OnAccept()
{
	local int index;
	local ReplacementOptionsInfo defaultoptions;

	index = PickupCombo.ComboList.GetCurrentItem();
	if (PickupCombo.ComboList.Items.Length > 0 && index != INDEX_NONE)
	{
		class'TestCWR_ConfigDeployableMutatorCWR'.default.ReplaceDeployableClassName= PickupClassNames[index];
		class'TestCWR_ConfigDeployableMutatorCWR'.default.ReplaceDeployableOptions = defaultoptions;
		class'TestCWR_ConfigDeployableMutatorCWR'.static.StaticSaveConfig();
	}

	CloseScene(self);
}

/** Builds the pickup option lists. */
function BuildPickupOptions()
{
	local UIInteraction UIController;

	local string str;
	local string line, ClassStr;
	local array<string> lines;
	local name ClassName;
	local int i, index, PrefixCount, IndentCount;
	local int SelectedIndex;
	local string SelectedString;

	// Build a list of pickups
	PickupClassNames.length = 0;
	PickupFriendlyNames.length = 0;

	SelectedIndex = INDEX_NONE;
	index = StringListDataStore.Num('DeployableSelection');
	if (index <= 0)
	{
		UIController = GetCurrentUIController();
		if (UIController != none && UIController.Outer != None)
		{
			// fix to have the package UTGameContent loaded
			DynamicLoadObject("UTGameContent.UTDeployableEMPMine", class'class');
			DynamicLoadObject("UTGameContent.UTDeployableEnergyShield", class'class');
			DynamicLoadObject("UTGameContent.UTDeployableShapedCharge", class'class');
			DynamicLoadObject("UTGameContent.UTDeployableSlowVolume", class'class');
			DynamicLoadObject("UTGameContent.UTDeployableSpiderMineTrap", class'class');
			DynamicLoadObject("UT3Gold.UTDeployableLinkGenerator", class'class');
			DynamicLoadObject("UT3Gold.UTDeployableXRayVolume", class'class');

			str = UIController.Outer.ConsoleCommand("obj classes");
			ParseStringIntoArray(str, lines, Chr(10), true);

			index = lines.Find("            UTDeployable");
			if (index == INDEX_NONE)
			{
				for (i=0; i<lines.Length; i++)
				{
					ClassStr = TrimWhitespace(lines[i]);
					if (ClassStr ~= "UTDeployable")
					{
						PrefixCount = Len(lines[i])-Len(ClassStr);
						index = i;
						break;
					}
				}
			}

			line = TrimWhitespace(lines[index]);
			PrefixCount = Len(lines[index])-Len(line);
			for (i=index+1; i<lines.Length; i++)
			{
				ClassStr = TrimWhitespace(lines[i]);
				IndentCount = Len(lines[i])-Len(ClassStr);
				if (PrefixCount >= IndentCount)
				{
					break;
				}

				ClassName = name(ClassStr);
				PickupClassNames.AddItem(ClassName);
			}
		}

		StringListDataStore.Empty('DeployableSelection', true);
		StringListDataStore.Empty('DeployableSelectionClass', true);
		PickupFriendlyNames.Length = PickupClassNames.Length;
		for(i=0; i<PickupClassNames.length; i++)
		{
			PickupFriendlyNames[i] = ""$PickupClassNames[i];
			StringListDataStore.AddStr('DeployableSelection', PickupFriendlyNames[i], true);
			StringListDataStore.AddStr('DeployableSelectionClass', ""$PickupClassNames[i], true);

			if (SelectedIndex == INDEX_NONE && PickupClassNames[i] == DeployableClassToReplace)
			{
				SelectedIndex = i;
				SelectedString = PickupFriendlyNames[i];
			}
		}
	}
	else
	{
		PickupClassNames.Length = index;
		for (i=0; i<index; i++)
		{
			str = StringListDataStore.GetStr('DeployableSelectionClass', i);
			PickupClassNames[i] = name(str);

			if (SelectedIndex == INDEX_NONE && PickupClassNames[i] == DeployableClassToReplace)
			{
				SelectedIndex = i;
			}
		}

		PickupFriendlyNames.Length = index;
		for (i=0; i<index; i++)
		{
			str = StringListDataStore.GetStr('DeployableSelection', i);
			PickupFriendlyNames[i] = str;

			if (SelectedIndex != INDEX_NONE && i == SelectedIndex)
			{
				SelectedString = PickupFriendlyNames[i];
			}
		}
	}

	PickupCombo.ComboList.SetDataStoreBinding("<"$StringListDataStore.tag$":DeployableSelection>");
	StringListDataStore.RefreshSubscribers('DeployableSelection');

	if (SelectedIndex != INDEX_NONE)
	{
		PickupCombo.ComboList.SetIndex(SelectedIndex);
		PickupCombo.ComboEditbox.SetDataStoreBinding(SelectedString);
	}
}

DefaultProperties
{
	Title="[Config SlowVolume Mutator (CWR)]"
}

class TestCWR_ConfigDeployableUIConfig extends UTUIFrontEnd;

var transient localized string Title;

/** Replacement info. */
var transient name DeployableClassToReplace;

/** Reference to the pickup combo box. */
var transient UTUIComboBox PickupCombo;

/** Reference to the string list datastore. */
var transient UTUIDataStore_StringList StringListDataStore;

/** Reference to the menu item datastore. */
var transient UTUIDataStore_MenuItems MenuItemDataStore;

/** List of possible weapon classes. */
var transient array<name> PickupClassNames;
var transient array<string>	PickupFriendlyNames;

event PostInitialize()
{
	Super.PostInitialize();

	DeployableClassToReplace = class'TestCWR_ConfigDeployableMutatorCWR'.default.ReplaceDeployableClassName;

	// Get datastore references
	StringListDataStore = UTUIDataStore_StringList(FindDataStore('UTStringList'));
	MenuItemDataStore = UTUIDataStore_MenuItems(FindDataStore('UTMenuItems'));

	// setup combo selection
	PickupCombo = UTUIComboBox(FindChild('cboReplace', true));
	PickupCombo.ComboEditbox.StringRenderComponent.SetAlignment(UIORIENT_Horizontal, UIALIGN_Left);
	PickupCombo.ComboEditbox.StringRenderComponent.SetAlignment(UIORIENT_Vertical, UIALIGN_Center);

	BuildPickupOptions();
}

/** Sets the title for this scene. */
function SetTitle()
{
	local UILabel TitleLabel;

	TitleLabel = GetTitleLabel();
	if ( TitleLabel != None ) TitleLabel.SetDataStoreBinding("");
}

/** Sets up the scene's button bar. */
function SetupButtonBar()
{
	ButtonBar.Clear();
	ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.Back>", OnButtonBar_Back);
	ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.Accept>", OnButtonBar_Accept);
}

/** Provides a hook for unrealscript to respond to input using actual input key names (i.e. Left, Tab, etc.) */
function bool HandleInputKey( const out InputEventParameters EventParms )
{
	local bool bResult;

	bResult = false;

	if(EventParms.EventType==IE_Released)
	{
		if(EventParms.InputKeyName=='XboxTypeS_B' || EventParms.InputKeyName=='Escape')
		{
			OnBack();
			bResult = true;
		}
	}

	return bResult;
}

/** Buttonbar Callback for Back. */
function bool OnButtonBar_Back(UIScreenObject InButton, int InPlayerIndex)
{
	OnBack();
	return true;
}

/** Buttonbar Callback for Accept. */
function bool OnButtonBar_Accept(UIScreenObject InButton, int InPlayerIndex)
{
	OnAccept();
	return true;
}

/** Callback for when the user wants to back out of this screen. */
function OnBack()
{
	CloseScene(self);
}

/** Callback for when the user accepts the changes. */
function OnAccept()
{
	local int index;
	local ReplacementOptionsInfo defaultoptions;

	index = PickupCombo.ComboList.GetCurrentItem();
	if (PickupCombo.ComboList.Items.Length > 0 && index != INDEX_NONE)
	{
		class'TestCWR_ConfigDeployableMutatorCWR'.default.ReplaceDeployableClassName= PickupClassNames[index];
		class'TestCWR_ConfigDeployableMutatorCWR'.default.ReplaceDeployableOptions = defaultoptions;
		class'TestCWR_ConfigDeployableMutatorCWR'.static.StaticSaveConfig();
	}

	CloseScene(self);
}

/** Builds the pickup option lists. */
function BuildPickupOptions()
{
	local UIInteraction UIController;

	local string str;
	local string line, ClassStr;
	local array<string> lines;
	local name ClassName;
	local int i, index, PrefixCount, IndentCount;
	local int SelectedIndex;
	local string SelectedString;

	// Build a list of pickups
	PickupClassNames.length = 0;
	PickupFriendlyNames.length = 0;

	SelectedIndex = INDEX_NONE;
	index = StringListDataStore.Num('DeployableSelection');
	if (index <= 0)
	{
		UIController = GetCurrentUIController();
		if (UIController != none && UIController.Outer != None)
		{
			// fix to have the package UTGameContent loaded
			DynamicLoadObject("UTGameContent.UTDeployableEMPMine", class'class');
			DynamicLoadObject("UTGameContent.UTDeployableEnergyShield", class'class');
			DynamicLoadObject("UTGameContent.UTDeployableLinkGenerator", class'class');
			DynamicLoadObject("UTGameContent.UTDeployableShapedCharge", class'class');
			DynamicLoadObject("UTGameContent.UTDeployableSlowVolume", class'class');
			DynamicLoadObject("UTGameContent.UTDeployableSpiderMineTrap", class'class');
			DynamicLoadObject("UT3Gold.UTDeployableXRayVolume", class'class');

			str = UIController.Outer.ConsoleCommand("obj classes");
			ParseStringIntoArray(str, lines, Chr(10), true);

			index = lines.Find("            UTDeployable");
			if (index == INDEX_NONE)
			{
				for (i=0; i<lines.Length; i++)
				{
					ClassStr = TrimWhitespace(lines[i]);
					if (ClassStr ~= "UTDeployable")
					{
						PrefixCount = Len(lines[i])-Len(ClassStr);
						index = i;
						break;
					}
				}
			}

			line = TrimWhitespace(lines[index]);
			PrefixCount = Len(lines[index])-Len(line);
			for (i=index+1; i<lines.Length; i++)
			{
				ClassStr = TrimWhitespace(lines[i]);
				IndentCount = Len(lines[i])-Len(ClassStr);
				if (PrefixCount >= IndentCount)
				{
					break;
				}

				ClassName = name(ClassStr);
				PickupClassNames.AddItem(ClassName);
			}
		}

		StringListDataStore.Empty('DeployableSelection', true);
		StringListDataStore.Empty('DeployableSelectionClass', true);
		PickupFriendlyNames.Length = PickupClassNames.Length;
		for(i=0; i<PickupClassNames.length; i++)
		{
			PickupFriendlyNames[i] = ""$PickupClassNames[i];
			StringListDataStore.AddStr('DeployableSelection', PickupFriendlyNames[i], true);
			StringListDataStore.AddStr('DeployableSelectionClass', ""$PickupClassNames[i], true);

			if (SelectedIndex == INDEX_NONE && PickupClassNames[i] == DeployableClassToReplace)
			{
				SelectedIndex = i;
				SelectedString = PickupFriendlyNames[i];
			}
		}
	}
	else
	{
		PickupClassNames.Length = index;
		for (i=0; i<index; i++)
		{
			str = StringListDataStore.GetStr('DeployableSelectionClass', i);
			PickupClassNames[i] = name(str);

			if (SelectedIndex == INDEX_NONE && PickupClassNames[i] == DeployableClassToReplace)
			{
				SelectedIndex = i;
			}
		}

		PickupFriendlyNames.Length = index;
		for (i=0; i<index; i++)
		{
			str = StringListDataStore.GetStr('DeployableSelection', i);
			PickupFriendlyNames[i] = str;

			if (SelectedIndex != INDEX_NONE && i == SelectedIndex)
			{
				SelectedString = PickupFriendlyNames[i];
			}
		}
	}

	PickupCombo.ComboList.SetDataStoreBinding("<"$StringListDataStore.tag$":DeployableSelection>");
	StringListDataStore.RefreshSubscribers('DeployableSelection');

	if (SelectedIndex != INDEX_NONE)
	{
		PickupCombo.ComboList.SetIndex(SelectedIndex);
		PickupCombo.ComboEditbox.SetDataStoreBinding(SelectedString);
	}
}

DefaultProperties
{
	Title="[Config SlowVolume Mutator (CWR)]"
}


Update filehandler.uc

Update filehandler.uc

Added EOF

# filehandler.uc - uCalc Transformation file
# This file was saved with uCalc Transform 2.5 on 1/23/2014 5:55:48 PM
# Comment:

ExternalKeywords: Exclude, Comment, Selected, ParentChild, FindMode, OutputFile, BatchAction, SEND
ExternalKeywords: Highlight, ForeColor, BackColor, FontName, FontSize, FontStyle
ExternalKeywords: FilterEndText, FilterSeparator, FilterSort, FilterSortFunc, FilterStartText, FilterUnique

FindMode: Replace

# Definitions

# Search Criteria

Criteria: 0
Enabled: True
Exclude: False
Comment:
Selected: False
Highlight: True
ForeColor: ControlText
BackColor: Aqua
FontName:
FontSize:
FontStyle:
CaseSensitive: False
QuoteSensitive: True
CodeBlockSensitive: True
FilterEndText:
FilterSeparator: {#10}
FilterSort: False
FilterSortFunc:
FilterStartText:
FilterUnique: False
Min: 0
Max: -1
MinSoft: 0
MaxSoft: -1
BatchAction: Transform
OutputFile:
SEND:
StartAfter: 0
StopAfter: -1
SkipOver: False
ParentChild: 0
Pass: 0
PassOnce: True
Precedence: 0
RightToLeft: False

Criteria: 1
Comment:
Pass: 1

Criteria: 2
BackColor: Yellow
SkipOver: True
Find: ' {Comment:".*"}
Replace: [Skip over]

Criteria: 3
BackColor: DeepSkyBlue
Find: {@Start}
Replace: #include <Windows.h>

Criteria: 4
BackColor: DeepSkyBlue
Find: Open {filespec}
      { For {{Input: Input}|{Output: Output}|{Append: Append}|{Binary: Binary}|{Random: Random}}|{Default: } }
      { Access Read | Access Write | Access Read Write | }
      { Lock {{LockRead: Read}|{LockWrite: Write}|{LockBoth: Read Write}|{LockShared: Shared}}|{LockDefault: } }
      As [#]{filenum} [Len = {size=128}]
Replace: ' {Self}
         _FileHandle({filenum}) = CreateFile({filespec},
            {Input: GENERIC_READ}
            {Output: GENERIC_WRITE}
            {Append: GENERIC_WRITE}
            {Binary: GENERIC_READ Or GENERIC_WRITE}
            {Random: GENERIC_READ Or GENERIC_WRITE}
            {Default: GENERIC_READ Or GENERIC_WRITE}
         ,
            {LockRead: FILE_SHARE_WRITE}
            {LockWrite: FILE_SHARE_READ}
            {LockBoth: 0}
            {LockShared: FILE_SHARE_READ Or FILE_SHARE_WRITE}
            {LockDefault: 0}
         , 0,
            {Input: OPEN_EXISTING}
            {Output: CREATE_ALWAYS}
            {Append: OPEN_ALWAYS}
            {Binary: OPEN_ALWAYS}
            {Random: OPEN_ALWAYS}
            {Default: OPEN_ALWAYS}
         , FILE_ATTRIBUTE_NORMAL, 0)
         {Append:SetFilePointer(_FileHandle({filenum}), 0, 0, FILE_END){nl}}

Criteria: 5
BackColor: Lime
Find: Close [#]{filenum}
Replace: ' Close #{filenum}
         CloseHandle(_FileHandle({filenum}))
         _FileHandle({filenum}) = 0

Criteria: 6
BackColor: RoyalBlue
PassOnce: False
Find: Close [#]{file1}, {more}
Replace: Close {file1}
         Close {more}

Criteria: 7
BackColor: Pink
Find: Seek [#] {filenum}, {position}
Replace: SetFilePointer(_FileHandle({filenum}), {position}-1, 0, FILE_BEGIN)

Criteria: 8
Find: Seek([#] {filenum})
Replace: SetFilePointer(_FileHandle({filenum}), 0, 0, FILE_CURRENT)+1

Criteria: 9
BackColor: SlateBlue
Find: LOF({filenum})
Replace: GetFileSize(_FileHandle({filenum}), 0)

Criteria: 10
Selected: True
Find: EOF({filenum})
Replace: IIf(Seek({filenum}) = LOF({filenum})+1, -1, 0)

Criteria: 11
Comment:
Pass: 2

Criteria: 12
BackColor: Yellow
Find: CreateFile({arg1}{nl}{args+})
Replace: {@Eval: Replace('{Self}', '{"[ \n]+"}', ' ')}

# End Search

# filehandler.uc - uCalc Transformation file
# This file was saved with uCalc Transform 2.5 on 1/22/2014 11:01:56 PM
# Comment:

ExternalKeywords: Exclude, Comment, Selected, ParentChild, FindMode, OutputFile, BatchAction, SEND
ExternalKeywords: Highlight, ForeColor, BackColor, FontName, FontSize, FontStyle
ExternalKeywords: FilterEndText, FilterSeparator, FilterSort, FilterSortFunc, FilterStartText, FilterUnique

FindMode: Replace

# Definitions

# Search Criteria

Criteria: 0
Enabled: True
Exclude: False
Comment:
Selected: False
Highlight: True
ForeColor: ControlText
BackColor: Aqua
FontName:
FontSize:
FontStyle:
CaseSensitive: False
QuoteSensitive: True
CodeBlockSensitive: True
FilterEndText:
FilterSeparator: {#10}
FilterSort: False
FilterSortFunc:
FilterStartText:
FilterUnique: False
Min: 0
Max: -1
MinSoft: 0
MaxSoft: -1
BatchAction: Transform
OutputFile:
SEND:
StartAfter: 0
StopAfter: -1
SkipOver: False
ParentChild: 0
Pass: 0
PassOnce: True
Precedence: 0
RightToLeft: False

Criteria: 1
Comment:
Pass: 1

Criteria: 2
BackColor: Yellow
SkipOver: True
Find: ' {Comment:".*"}
Replace: [Skip over]

Criteria: 3
BackColor: DeepSkyBlue
Find: {@Start}
Replace: #include <Windows.h>

Criteria: 4
BackColor: DeepSkyBlue
Find: Open {filespec}
      { For {{Input: Input}|{Output: Output}|{Append: Append}|{Binary: Binary}|{Random: Random}}|{Default: } }
      { Access Read | Access Write | Access Read Write | }
      { Lock {{LockRead: Read}|{LockWrite: Write}|{LockBoth: Read Write}|{LockShared: Shared}}|{LockDefault: } }
      As [#]{filenum} [Len = {size=128}]
Replace: ' {Self}
         _FileHandle({filenum}) = CreateFile({filespec},
            {Input: GENERIC_READ}
            {Output: GENERIC_WRITE}
            {Append: GENERIC_WRITE}
            {Binary: GENERIC_READ Or GENERIC_WRITE}
            {Random: GENERIC_READ Or GENERIC_WRITE}
            {Default: GENERIC_READ Or GENERIC_WRITE}
         ,
            {LockRead: FILE_SHARE_WRITE}
            {LockWrite: FILE_SHARE_READ}
            {LockBoth: 0}
            {LockShared: FILE_SHARE_READ Or FILE_SHARE_WRITE}
            {LockDefault: 0}
         , 0,
            {Input: OPEN_EXISTING}
            {Output: CREATE_ALWAYS}
            {Append: OPEN_ALWAYS}
            {Binary: OPEN_ALWAYS}
            {Random: OPEN_ALWAYS}
            {Default: OPEN_ALWAYS}
         , FILE_ATTRIBUTE_NORMAL, 0)
         {Append:SetFilePointer(_FileHandle({filenum}), 0, 0, FILE_END){nl}}

Criteria: 5
BackColor: Lime
Find: Close [#]{filenum}
Replace: ' Close #{filenum}
         CloseHandle(_FileHandle({filenum}))
         _FileHandle({filenum}) = 0

Criteria: 6
BackColor: RoyalBlue
PassOnce: False
Find: Close [#]{file1}, {more}
Replace: Close {file1}
         Close {more}

Criteria: 7
BackColor: Pink
Find: Seek [#] {filenum}, {position}
Replace: SetFilePointer(_FileHandle({filenum}), {position}-1, 0, FILE_BEGIN)

Criteria: 8
Find: Seek([#] {filenum})
Replace: SetFilePointer(_FileHandle({filenum}), 0, 0, FILE_CURRENT)+1

Criteria: 9
Selected: True
BackColor: SlateBlue
Find: LOF({filenum})
Replace: GetFileSize(_FileHandle({filenum}), 0)

Criteria: 10
Comment:
Pass: 2

Criteria: 11
BackColor: Yellow
Find: CreateFile({arg1}{nl}{args+})
Replace: {@Eval: Replace('{Self}', '{"[ \n]+"}', ' ')}

# End Search