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 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00301 00302 00303 00304 00305 00306 00307 00308 00309 00310 00311 00312 00313 00314 00315 00316 |
class TribesGUIController extends Gameplay.TribesGUIControllerBase native; import enum eTribesGameState from Gameplay.TribesGuiConfig; var(TribesGUIController) Editinline EditConst Array<GUIPage> StorageStack "Holds an out-of-game set of page names for recreating the stack"; // profile manager for tribes var TribesGUI.ProfileManager profileManager; var Color neutralColor, neutralHighlightColor; #if IG_TRIBES3 // Alex: used by localisation tool to load GUI pages for dumping event AutoLoadMenuClass(class<Object> menuClass) { local GUIComponent NewMenu; // ignore if not a class we are interested in if (!ClassIsChildOf(menuClass, class'TribesGuiPage')) return; NewMenu = CreateComponent(menuClass.outer.name $ "." $ String(menuClass.name), String(menuClass.name)); if (NewMenu==None) log("Could not Autoload" @ menuClass.name); else { if (!NewMenu.bInited) NewMenu.InitComponent(None); log("AutoLoaded Menu " $ menuClass.name); } } #endif event bool ShouldSuppressLevelRender() { if(TribesGUIPage(ActivePage) != None) return TribesGUIPage(ActivePage).bSuppressLevelRender; return false; } ///////////////////////////////////////////////////////////////////////////// // Initialization ///////////////////////////////////////////////////////////////////////////// function InitializeController() { log("[dkaplan] >>> InitializeController of (TribesGUIController) "$self); Super.InitializeController(); // if the current level is not the entry level, we've specified a map on the command // line and shouldn't show the main menu if( GuiConfig.TribesGameState==GAMESTATE_None && ViewportOwner.Actor.Level.IsEntry() ) { OpenMenu( class'GameEngine'.default.MainMenuClass ); } // create the ProfileManager profileManager = new class'TribesGUI.ProfileManager'; profileManager.LoadProfiles(self); } event PreLevelChange(string DestURL, LevelSummary NewSummary) { local int iMenu; for(iMenu = 0; iMenu < MenuStack.Length; ++iMenu) { if(TribesGUIPage(MenuStack[iMenu]) != None) TribesGUIPage(MenuStack[iMenu]).OnPreLevelChange(DestURL, NewSummary); } for(iMenu = 0; iMenu < PersistentStack.Length; ++iMenu) { if(TribesGUIPage(PersistentStack[iMenu]) != None) TribesGUIPage(PersistentStack[iMenu]).OnPreLevelChange(DestURL, NewSummary); } super.PreLevelChange(DestURL, NewSummary); } ///////////////////////////////////////////////////////////////////////////// // Entry stack loading/saving utilities ///////////////////////////////////////////////////////////////////////////// function SaveEntryStack() { local int i; StorageStack.Remove(0,StorageStack.Length); for (i=0;i<MenuStack.Length;i++) { StorageStack[i]=MenuStack[i]; } } function OpenEntryStack() { local int i; CloseAll(); for (i=0;i<StorageStack.Length-1;i++) { MenuStack[i]=StorageStack[i]; } InternalOpenMenu(StorageStack[StorageStack.Length-1]); } native function FindQuickChatNames(out Array<string> Names); function int GetGameSpyProfileId() { return profileManager.GetActiveProfile().statTrackingID; } function int GetGameSpyTeamId() { return profileManager.GetActiveProfile().affiliatedTeamId; } function bool UseGameSpyTeamAffiliation() { return profileManager.GetActiveProfile().bUseTeamAffiliation; } function String GetGameSpyPassword() { return profileManager.GetActiveProfile().statTrackingPassword; } event bool OnNetworkBrowse(string URL, string ProfileOption, bool bSelectProfile) { // TEAMTAG: Removed //local TribesGameSpyManager tgm; local TribesMultiplayerMenu mpMenu; local PlayerProfile p; // unreal always seems to prepend '=' ProfileOption = Mid(ProfileOption, 1); // bring up modified profile screen if profile select was desired if (bSelectProfile) { if (TribesMultiplayerMenu(ActivePage) == None) OpenMenu("TribesGui.TribesMultiplayerMenu"); mpMenu = TribesMultiplayerMenu(ActivePage); if (mpMenu != None) { mpMenu.SetGamespyMode(true, URL); return false; } } else { // see if a specific player profile was requested log("Trying to find profile "$DecodeFromURL(ProfileOption)$"..."); if (ProfileOption != "") { profileManager.SetActiveProfile(profileManager.GetProfileByName(DecodeFromURL(ProfileOption))); } p = profileManager.GetActiveProfile(); if (p == None) { log("No active player profile -- can't log into gamespy"); return true; } log("Active profile is "$p$", "$p.playerName); if (TribesMultiplayerMenu(ActivePage) == None) { // TEAMTAG: Removed if ((p.bUseStatTracking && ViewportOwner.Actor.GetUrlOption("HasStats") == "1")/* || p.bUseTeamAffiliation*/) { // TEAMTAG: Removed if (p.needStatTrackingUserInput()/* || p.needTeamAffiliationUserInput()*/) { log("Connecting to "$URL$" via join screen..."); OpenMenu("TribesGui.TribesMultiplayerMenu"); mpMenu = TribesMultiplayerMenu(ActivePage); if (mpMenu != None) { mpMenu.MyTabControl.OpenTab(mpMenu.MPGameGuidePanel); mpMenu.MPGameGuidePanel.AttemptURL(URL); return false; } } // TEAMTAG: Removed //else //{ // tgm = TribesGameSpyManager(ViewportOwner.Actor.Level.GetGameSpyManager()); // if (tgm != None) // { // tgm.OnLoginTeamResult = OnGamespyTeamLoginResult; // tgm.LoginTeam(p.statTrackingID, p.affiliatedTeamId, p.affiliatedTeamPassword, true); // } // else // { // Log("Couldn't log into team because there was no GameSpy manager"); // } //} } } } return true; } private function OnGamespyTeamLoginResult(bool succeeded, String ResponseData) { local string teamTag; local string teamName; local PlayerProfile p; if (succeeded) { if (ResponseData != "INVALID PASSWORD" && ResponseData != "INVALID PARAMETER") { Div(ResponseData, "|", teamTag, teamName); p = profileManager.GetActiveProfile(); p.affiliatedTeamTag = teamTag; p.affiliatedTeamName = teamName; } } } function String EncodePlayerName(GUIComponent Sender, TribesReplicationInfo TRI) { local int Index; local String NameReplacementTag; local String ReturnString; local Color NameColor, TagColor; local TeamInfo ownTeam, otherTeam; local PlayerCharacterController PlayerOwner; PlayerOwner = PlayerCharacterController(ViewportOwner.Actor); if (PlayerOwner == None) return ""; ownTeam = PlayerOwner.getOwnTeam(); otherTeam = TRI.team; // Only use the absolute coloring scheme. Relative coloring looks strange in the GUI //if(PlayerOwner.bTeamMarkerColors) //{ if (otherTeam == None) { NameColor = neutralColor; TagColor = neutralHighlightColor; } else if(ownTeam == otherTeam) { NameColor = ownTeam.TeamColor; TagColor = ownTeam.TeamHighlightColor; } else { NameColor = otherTeam.TeamColor; TagColor = otherTeam.TeamHighlightColor; } //} //else //{ // if (ownTeam == None) // { // NameColor = neutralColor; // TagColor = neutralHighlightColor; // } // else if(ownTeam == otherTeam) // { // NameColor = ownTeam.relativeFriendlyTeamColor; // TagColor = ownTeam.relativeFriendlyHighlightColor; // } // else // { // NameColor = ownTeam.relativeEnemyTeamColor; // TagColor = ownTeam.relativeEnemyHighlightColor; // } //} NameReplacementTag = "<NAME>"; Index = InStr(TRI.TeamTag, NameReplacementTag); if(Index == -1) { Index = 0; NameReplacementTag = ""; } if(TRI.TeamTag != "") ReturnString = Sender.MakeColorCode(TagColor) $ Left(TRI.TeamTag, Index) $ Sender.MakeColorCode(NameColor) $ TRI.PlayerName $ "[\\C]" $ Mid(TRI.TeamTag, Index + Len(NameReplacementTag)) $ "[\\C]"; else ReturnString = Sender.MakeColorCode(NameColor) $ TRI.PlayerName $ "[\\C]"; return ReturnString; } defaultproperties { bDontDisplayHelpText=false neutralColor = (R=210,G=210,B=210,A=255) neutralHighlightColor = (R=255,G=255,B=255,A=255) } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |