Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

GUI2K4.UT2K4CustomFilterPage


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
//==============================================================================
//	This page is the interface for custom filters
//
//	Created by Ron Prestenback
//	© 2003, Epic Games, Inc.  All Rights Reserved
//==============================================================================
class UT2K4CustomFilterPage extends FilterPageBase;


var				GUITitleBar				TabDock;
var				GUITabControl			c_Info;

var PlayInfo							FilterPI;

var array<string>						PanelClass;
var localized array<string>				PanelCaption;
var localized array<string>				PanelHint;

event Opened(GUIComponent Sender)
{
	local int i;

	if (c_Info.TabStack.Length > 0)
		return;

	CheckFM();
	Super.Opened(Sender);

	InitFilterList();
	c_Info.AddTab(PanelCaption[0], PanelClass[0],,PanelHint[0]);
	c_Info.AddTab(PanelCaption[1], PanelClass[1],,PanelHint[1]);
	for (i = 0; i < FilterPI.Groups.Length; i++)
		c_Info.AddTab(FilterPI.Groups[i], PanelClass[2],, FilterPI.Groups[i]@PanelHint[2]);
}

function CheckFM()
{
	Super.CheckFM();

	FilterPI = UT2K4ServerBrowser(ParentPage).FilterInfo;
}

function ApplyRules(int FilterIndex, optional bool bRefresh)
{
	local int i;

	if (FilterIndex >= 0)
	{
		EnableComponent(c_Info);

		UT2K4ServerBrowser(ParentPage).SetFilterInfo();
		FM.LoadSettings( FilterIndex );
		for (i = 0; i < c_Info.TabStack.Length; i++)
		{
			if (c_Info.TabStack[i] != None && GUIFilterPanel(c_Info.TabStack[i].MyPanel) != None)
			{
				// Only update the bRefresh flag if we want to make it 'true'
				GUIFilterPanel(c_Info.TabStack[i].MyPanel).bRefresh = (bRefresh || GUIFilterPanel(c_Info.TabStack[i].MyPanel).bRefresh);
				GUIFilterPanel(c_Info.TabStack[i].MyPanel).bUpdate = True;
			}
		}

		// Immediately update the active tabpanel
		if (c_Info.ActiveTab != None && c_Info.ActiveTab.MyPanel != None)
			c_Info.ActivateTab(c_Info.ActiveTab, True);
		else if (c_Info.TabStack.Length > 0)
			c_Info.ActivateTab(c_Info.TabStack[0], True);

		if ( !FM.IsActiveAt(FilterIndex) )
			DisableComponent(c_Info);
	}
}

function InternalOnChange(GUIComponent Sender)
{
	Super.InternalOnChange(Sender);

	if (Sender == li_Filter)
	{
		if ( li_Filter.ValidIndex(li_Filter.Index) && Controller.bCurMenuInitialized &&
			 FM != None && FM.IsActiveAt(li_Filter.Index) )
			ToggleTabControl(True);
		else
			ToggleTabControl(False);
	}
}

function InternalOnCreateComponent(GUIComponent NewComp, GUIComponent Sender)
{
	Super.InternalOnCreateComponent(NewComp, Sender);
	if (GUISplitter(Sender) != None)
	{
		if (GUITabControl(NewComp) != None)
		{
			c_Info = GUITabControl(NewComp);
			c_Info.WinHeight=0.9;
			c_Info.TabHeight=0.04;
			c_Info.bDrawTabAbove=False;
			c_Info.bFillSpace=True;
			c_Info.bAcceptsInput=True;
			c_Info.bDockPanels=True;
			c_Info.OnChange=InternalOnChange;
		    c_Info.BackgroundStyleName="TabBackground";
		}

	}
}

function ToggleTabControl(bool bEnable)
{
	if (c_Info != None)
	{
		if ( bEnable && c_Info.MenuState == MSAT_Disabled )
		{
			c_Info.EnableMe();
			c_Info.Show();
			c_Info.ActivateTab(c_Info.TabStack[0],True);
		}

		else if (!bEnable && c_Info.MenuState != MSAT_Disabled)
		{
			c_Info.DisableMe();
			c_Info.Hide();
		}
	}
}

function InternalReleaseSplitter(GUIComponent Splitter, float NewPos)
{
	if (Splitter == sp_Filter)
	{
		FilterSplitterPosition = NewPos;
		SaveConfig();
	}
}

DefaultProperties
{
	Begin Object Class=GUISplitter Name=FilterSplitter
		WinWidth=1.000000
		WinHeight=1.0
		WinLeft=0.000000
		WinTop=0.000000
		bNeverFocus=True
		bAcceptsInput=True
		DefaultPanels(0)="GUI2K4.UT2K4FilterControlPanel"
		DefaultPanels(1)="XInterface.GUITabControl"
		SplitOrientation=SPLIT_Horizontal
		SplitAreaSize=8
		RenderWeight=1
        MaxPercentage=0.9
        IniOption="@Internal"
 		OnCreateComponent=InternalOnCreateComponent
		OnLoadIni=InternalOnLoad
		OnReleaseSplitter=InternalReleaseSplitter
	End Object
	sp_Filter=FilterSplitter

	PanelCaption(0)="Filter Summary"
	PanelCaption(1)="Custom Rules"

	PanelHint(0)="View currently configured rules for this filter"
	PanelHint(1)="Additional custom filters"
	PanelHint(2)="Filters"

	PanelClass(0)="GUI2K4.UT2K4FilterSummaryPanel"
	PanelClass(1)="GUI2K4.UT2K4CustomRulesPanel"
	PanelClass(2)="GUI2K4.UT2K4FilterRulesPanel"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Di 5.9.2006 22:28:52.000 - Creation time: Do 14.8.2014 09:58:53.201 - Created with UnCodeX