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

GUI2K4.UT2K4Tab_MainBase


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
//==============================================================================
//  Created on: 12/11/2003
//  Base class for main maplist tab in Host Multiplayer / Instant Action areas
//
//  Written by Ron Prestenback
//  © 2003, Epic Games, Inc. All Rights Reserved
//==============================================================================

class UT2K4Tab_MainBase extends UT2K4GameTabBase;

var() globalconfig bool bOnlyShowOfficial, bOnlyShowCustom;

var MaplistManager MapHandler;
var array<CacheManager.MapRecord> CacheMaps;
var() array<MaplistRecord.MapItem> Maps;
var array<string> TutorialMaps;
var CacheManager.GameRecord CurrentGameType;

// Common
var automated moCheckBox		ch_OfficialMapsOnly;
var           GUIButton         b_Primary, b_Secondary;

var() localized string MessageNoInfo, AuthorText, PlayerText;
var() localized string FilterText, ClearText;
var() localized string LinkText, DefaultText, AutoSelectText;

var globalconfig string MaplistEditorMenu;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
   Super.InitComponent(MyController, MyOwner);

    ch_OfficialMapsOnly.Checked(bOnlyShowOfficial);
}

// Called when a new gametype is selected
function InitGameType();

// Query the CacheManager for the maps that correspond to this gametype, then fill the main list
function InitMaps( optional string MapPrefix );

function HandleContextOpen(GUIComponent Sender, GUIContextMenu Menu, GUIComponent ContextMenuOwner)
{
	if ( !bOnlyShowOfficial )
		Menu.ContextItems[3] = FilterText;
	else Menu.ContextItems[3] = ClearText;
}

function InitMapHandler()
{
	local PlayerController PC;

	PC = PlayerOwner();

	if ( PC.Level.Game != None && MaplistManager(PC.Level.Game.MaplistHandler) != None )
		MapHandler = MaplistManager(PC.Level.Game.MaplistHandler);

	if ( MapHandler == None )
		foreach PC.DynamicActors(class'MaplistManager', MapHandler)
			break;

	if ( MapHandler == None )
		MapHandler = PC.Spawn(class'MaplistManager');
}

// =====================================================================================================================
// =====================================================================================================================
//  Utility functions - handles all special stuff that should happen whenever events are received on the page
// =====================================================================================================================
// =====================================================================================================================

function string GetMapPrefix()
{
    return CurrentGameType.MapPrefix;
}

function string GetRulesClass()
{
    return "";
}

function string GetMapListClass()
{
    return CurrentGameType.MapListClassName;
}

function bool GetIsTeamGame()
{
    return CurrentGameType.bTeamGame && !(GetGameClass() ~= "SkaarjPack.Invasion");
}

function string GetGameClass()
{
    return CurrentGameType.ClassName;
}

function string GetMapName( GUITreeList List, int Index )
{
	local MaplistRecord.MapItem Item;

	if ( List == None )
		return "";

	if ( !List.IsValidIndex(Index) )
		Index = List.Index;

	class'MaplistRecord'.static.CreateMapItem(List.GetValueAtIndex(Index), Item);
	return Item.MapName;
}

// Remove the additional text, and append the extra string data from the list
// Used when passing in a URL for the selected map
function string GetMapURL( GUITreeList List, int Index )
{
	local MaplistRecord.MapItem Item;

	if ( List == None )
		return "";

	if ( !List.IsValidIndex(Index) )
		Index = List.Index;

	class'MaplistRecord'.static.CreateMapItem(List.GetValueAtIndex(Index),Item);
	return Item.FullURL;
}

// Called when the "Only official maps" checkbox is clicked on
function ChangeMapFilter(GUIComponent Sender)
{
	if ( Sender != ch_OfficialMapsOnly )
		return;

	bOnlyShowOfficial = ch_OfficialMapsOnly.IsChecked();
	InitMaps();
}

defaultproperties
{
     Begin Object Class=moCheckBox Name=FilterCheck
         CaptionWidth=0.100000
         ComponentWidth=0.900000
         Caption="Only Official Maps"
         OnCreateComponent=FilterCheck.InternalOnCreateComponent
         Hint="Hides all maps not created by Epic or Digital Extremes."
         WinTop=0.949531
         WinLeft=0.039258
         WinWidth=0.341797
         WinHeight=0.030035
         TabOrder=1
         OnChange=UT2K4Tab_MainBase.ChangeMapFilter
     End Object
     ch_OfficialMapsOnly=moCheckBox'GUI2K4.UT2K4Tab_MainBase.FilterCheck'

     MessageNoInfo="No information available!"
     AuthorText="Author"
     PlayerText="players"
     FilterText="Only Official Maps"
     ClearText="Show All Maps"
     LinkText="Link Setup"
     DefaultText="Default"
     AutoSelectText="Random"
     MaplistEditorMenu="GUI2K4.MaplistEditor"
     WinTop=0.150000
     WinHeight=0.770000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: pr 5-2-2018 12:35:54.000 - Creation time: sk 18-3-2018 09:50:24.512 - Created with UnCodeX