Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 |
//==================================================================== // Written by Ron Prestenback // (c) 2003, Epic Games, Inc. All Rights Reserved // ==================================================================== class UT2K4Browser_ServerListPageBuddy extends UT2K4Browser_ServerListPageMS; // Actual list of buddies var() config float BuddySplitterPosition; var() config array<String> Buddies; var() config string BuddyListBoxClass; var GUISplitter sp_Buddy; var UT2K4Browser_BuddyListBox lb_Buddy; var UT2K4Browser_BuddyList li_Buddy; var localized string AddBuddyCaption, AddBuddyLabel; var localized string RemoveBuddyCaption; var localized string BuddyNameCaption; function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; Super.InitComponent(MyController, MyOwner); lb_Buddy.SetAnchor(Self); li_Buddy = UT2K4Browser_BuddyList(lb_Buddy.List); li_Buddy.OnChange = BuddyListChanged; li_Buddy.OnRightClick = InternalOnRightClick; lb_Buddy.TabOrder = 0; lb_Server.TabOrder = 1; lb_Rules.TabOrder = 2; lb_Players.TabOrder = 3; for ( i = 0; i < Buddies.Length; i++ ) li_Buddy.AddedItem(); } event Opened( GUIComponent Sender ) { Super.Opened(Sender); Controller.AddBuddy = AddBuddy; } function ShowPanel(bool bShow) { Super.ShowPanel(bShow); if (bShow && bInit) { sp_Buddy.SplitterUpdatePositions(); bInit = False; } } function Refresh() { local int i; Super.Refresh(); // Construct query containing all buddy names for(i=0; i<Buddies.Length; i++) AddQueryTerm("buddy", Buddies[i], QT_Equals); // Run query Browser.Uplink().StartQuery(CTM_Query); SetFooterCaption(StartQueryString); KillTimer(); // Stop it going back to ready from a previous timer! } function BuddyListChanged(GUIComponent Sender) { // Add code here to highlight server for this buddy } function AddBuddy(optional string NewBuddy) { if ( Controller.OpenMenu(Controller.RequestDataMenu, AddBuddyLabel, BuddyNameCaption) ) { Controller.ActivePage.SetDataString(NewBuddy); Controller.ActivePage.OnClose = BuddyPageClosed; } } function BuddyPageClosed( bool bCancelled ) { local string s; if ( bCancelled ) return; s = Controller.ActivePage.GetDataString(); if ( s != "" ) { if ( FindBuddyIndex(s) != -1 ) return; Buddies[Buddies.Length] = s; li_Buddy.AddedItem(); SaveConfig(); } } function InternalOnCreateComponent(GUIComponent NewComp, GUIComponent Sender) { if (GUISplitter(NewComp) != None) { // This splitter already has a panel if (GUISplitter(Sender).Panels[0] != None) { // This splitter is the main splitter if (UT2K4Browser_ServerListPageBuddy(Sender.MenuOwner) != None) { sp_Buddy = GUISplitter(NewComp); sp_Buddy.DefaultPanels[0] = "GUI2K4.UT2K4Browser_ServerListBox"; sp_Buddy.DefaultPanels[1] = "XInterface.GUISplitter"; sp_Buddy.WinTop=0; sp_Buddy.WinLeft=0; sp_Buddy.WinWidth=1.0; sp_Buddy.WinHeight=1.0; sp_Buddy.bNeverFocus=True; sp_Buddy.bAcceptsInput=True; sp_Buddy.RenderWeight=0; sp_Buddy.OnCreateComponent=InternalOnCreateComponent; sp_Buddy.OnLoadIni=InternalOnLoadIni; sp_Buddy.OnReleaseSplitter=InternalReleaseSplitter; sp_Buddy.SplitOrientation=SPLIT_Vertical; } // This is the second panel of sp_Buddy splitter else Super.InternalOnCreateComponent(NewComp, Sender); } else Super.InternalOnCreateComponent(NewComp, Sender); } else if (UT2K4Browser_BuddyListBox(NewComp) != None) { lb_Buddy = UT2K4Browser_BuddyListBox(NewComp); } else Super.InternalOnCreateComponent(NewComp, Sender); } function InternalOnLoadIni(GUIComponent Sender, string S) { if (Sender == sp_Buddy) sp_Buddy.SplitPosition = BuddySplitterPosition; else Super.InternalOnLoadIni(Sender, S); } function InternalReleaseSplitter(GUIComponent Sender, float NewPos) { if (Sender == sp_Buddy) { BuddySplitterPosition = NewPos; SaveConfig(); } else Super.InternalReleaseSplitter(Sender, NewPos); } function int FindBuddyIndex( string BuddyName ) { local int i; for ( i = 0; i < Buddies.Length; i++ ) if ( Buddies[i] ~= BuddyName ) return i; return -1; } function ContextSelect( GUIContextMenu Sender, int Index ) { if ( !NotifyContextSelect(Sender, Index) ) { switch ( Index ) { case 0: AddBuddy(); break; case 1: if ( li_Buddy.IsValid() ) { Buddies.Remove(li_Buddy.Index, 1); li_Buddy.RemovedCurrent(); SaveConfig(); } break; } } } defaultproperties { BuddySplitterPosition=0.597582 BuddyListBoxClass="GUI2K4.UT2K4Browser_BuddyListBox" AddBuddyCaption="ADD BUDDY" AddBuddyLabel="Add Buddy" RemoveBuddyCaption="REMOVE BUDDY" BuddyNameCaption="Buddy Name: " Begin Object Class=GUISplitter Name=HorzSplitter SplitOrientation=SPLIT_Horizontal DefaultPanels(0)="GUI2K4.UT2K4Browser_BuddyListBox" DefaultPanels(1)="XInterface.GUISplitter" OnReleaseSplitter=UT2k4Browser_ServerListPageBuddy.InternalReleaseSplitter OnCreateComponent=UT2k4Browser_ServerListPageBuddy.InternalOnCreateComponent IniOption="@Internal" WinHeight=1.000000 RenderWeight=1.000000 bBoundToParent=Wahr bScaleToParent=Wahr OnLoadINI=UT2k4Browser_ServerListPageBuddy.InternalOnLoadINI End Object sp_Main=GUISplitter'GUI2K4.UT2k4Browser_ServerListPageBuddy.HorzSplitter' MainSplitterPosition=0.184326 DetailSplitterPosition=0.319135 HeaderColumnSizes(0)=(ColumnSizes=(0.096562,0.493471,0.206944,0.102535,0.150000)) HeaderColumnSizes(1)=(ColumnSizes=(0.498144,0.500000)) HeaderColumnSizes(2)=(ColumnSizes=(0.473428,0.185665,0.226824,0.220000)) PanelCaption="Buddy Browser" Begin Object Class=GUIContextMenu Name=RCMenu ContextItems(0)="Add Buddy" ContextItems(1)="Remove Buddy" OnSelect=UT2k4Browser_ServerListPageBuddy.ContextSelect End Object ContextMenu=GUIContextMenu'GUI2K4.UT2k4Browser_ServerListPageBuddy.RCMenu' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |