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 |
//----------------------------------------------------------- // //----------------------------------------------------------- class ROUT2K4PlayerSetupPage extends ROUT2K4GUIPage; const NUM_ROLES = 10; var automated GUIImage BackgroundImage; var automated GUITitleBar TitleBar; var automated GUIHeader t_Header; var automated GUITabControl playerTabs; //var automated GUISectionBackground i_playerBG; var ROUT2K4TabPanel_UnitSelection unitTab; var ROUT2K4TabPanel_RoleSelection roleTab; //var ROUT2K4TabPanel_WeaponSelection weaponTab; //once the player selects their role this will be set // this is used to select the correct role to populate the weapons page. var int selectedRoleInfoIndex; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; local ROPlayer player; local ROPlayerReplicationInfo playerRep; Super.Initcomponent(MyController, MyOwner); class'ROInterfaceUtil'.static.SetROStyle(MyController, Controls); TitleBar.DockedTabs = playerTabs; // t_Header.DockedTabs = playerTabs; // t_Header.SetCaption("Player Setup"); selectedRoleInfoIndex = -1; //log("ROUT2K4PlayerSetupPage::InitComponent"); unitTab = ROUT2K4TabPanel_UnitSelection( playerTabs.addTab("Unit","ROInterface.ROUT2K4TabPanel_UnitSelection")); unitTab.OnSelect = onUnitSelected; roleTab=ROUT2K4TabPanel_RoleSelection( playerTabs.addTab("Role","ROInterface.ROUT2K4TabPanel_RoleSelection")); roleTab.OnSelect = onRoleSelected; // weaponTab=ROUT2K4TabPanel_WeaponSelection( // playerTabs.addTab("Weapon","ROInterface.ROUT2K4TabPanel_WeaponSelection")); // weaponTab.OnSelect = onWeaponSelected; // weaponTab.DisableMe(); // DisableComponent(weaponTab); player = ROPlayer(PlayerOwner()); playerRep = ROPlayerReplicationInfo(player.PlayerReplicationInfo); roleTab.DisableMe(); if(playerRep != none && playerRep.RoleInfo != none) { selectedRoleInfoIndex = findRoleIndexByAltName(playerRep.RoleInfo.AltName); if(selectedRoleInfoIndex != -1) { onRoleSelected(selectedRoleInfoIndex); roleTab.EnableMe(); playerTabs.ActivateTabByPanel(roleTab,true); } } else roleTab.DisableMe(); // Change the Style of the Tabs; DRR 05-11-2004 /*myStyleName = "ROTabButton"; // playerTabs.bFillSpace = True; */ playerTabs.bFillSpace = False; for ( i = 0; i < playerTabs.TabStack.Length; i++ ) { if ( playerTabs.TabStack[i] != None ) { playerTabs.TabStack[i].FontScale=FNS_Medium; playerTabs.TabStack[i].bAutoSize=True; playerTabs.TabStack[i].bAutoSize=False; playerTabs.TabStack[i].bAutoShrink=False; //playerTabs.TabStack[i].StyleName = myStyleName; //playerTabs.TabStack[i].Style = MyController.GetStyle(myStyleName,playerTabs.TabStack[i].FontScale); } } SetTimer(0.1, true); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function bool validTeam() { if(PlayerOwner().PlayerReplicationInfo == none || PlayerOwner().PlayerReplicationInfo.Team == none || PlayerOwner().PlayerReplicationInfo.Team.TeamIndex > 1) return false; return true; } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function InternalOnChange(GUIComponent Sender) { if (playerTabs.ActiveTab != None && playerTabs.ActiveTab.MyPanel != None) playerTabs.ActiveTab.MyPanel.Refresh(); //log("ROUT2K4PlayerSetupPage::InternalOnChange, sender="$Sender); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ /* function Timer() { if (ROPlayer(PlayerOwner()) != None && !ROPlayer(PlayerOwner()).HasSelectedTeam()) { roleTab.DisableMe(); // weaponTab.DisableMe(); } } */ //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function bool InternalOnCanClose(optional bool bCanceled) { return true; } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function onUnitSelected(int teamIndex) { roleTab.EnableMe(); roleTab.lastTeamIndex = teamIndex; playerTabs.ActivateTabByPanel(roleTab,true); // weaponTab.DisableMe(); } //------------------------------------------------------------------------------ function onRoleSelected(int roleIndex) { //enable weapon selection tab and focus weapon selection //log("OnRoleSelected("$roleIndex$")"); selectedRoleInfoIndex = roleIndex; if(selectedRoleInfoIndex == -1) return; // weaponTab.EnableMe(); // weaponTab.setRoleByIndex(roleIndex); // playerTabs.ActivateTabByPanel(weaponTab,true); // New players must be ready code //ROPlayer(PlayerOwner()).PlayerReplicationInfo.bReadyToPlay = true; //log("My player is ready = "$ROPlayer(PlayerOwner()).PlayerReplicationInfo.bReadyToPlay); controller.CloseMenu(); } //------------------------------------------------------------------------------ // weapon selection should complete the player setup //------------------------------------------------------------------------------ /* function onWeaponSelected() { controller.CloseMenu(); } */ //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function int findRoleIndexByAltName(string altName) { local int count, whichTeamIndex; local ROGameReplicationInfo GRI; GRI = ROGameReplicationInfo(PlayerOwner().GameReplicationInfo); if(GRI == none) return -1; if(!validTeam()) return -1; whichTeamIndex = PlayerOwner().PlayerReplicationInfo.Team.TeamIndex; for(count = 0 ; count < NUM_ROLES ; count++) { switch(whichTeamIndex) { case AXIS_TEAM_INDEX : if(GRI.AxisRoles[count] != none && GRI.AxisRoles[count].AltName == altName) { //log("findRoleIndexByAltName("$altName$") index = "$count); return count; } break; case ALLIES_TEAM_INDEX : if(GRI.AlliesRoles[count] != none && GRI.AlliesRoles[count].AltName == altName) { return count; } break; } } //not found return -1; } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ defaultproperties { Begin Object Class=GUIImage Name=MyBackground Image=Texture'InterfaceArt_tex.Menu.button_normal' ImageStyle=ISTY_Stretched WinHeight=1.000000 RenderWeight=0.000100 bBoundToParent=True bScaleToParent=True bNeverFocus=True End Object BackgroundImage=GUIImage'ROInterface.ROUT2K4PlayerSetupPage.MyBackground' Begin Object Class=GUITitleBar Name=psTitleBar bUseTextHeight=False Caption="Player Setup" StyleName="TitleBar" WinTop=0.050000 WinLeft=0.050000 WinWidth=0.800000 WinHeight=0.056055 RenderWeight=0.300000 End Object TitleBar=GUITitleBar'ROInterface.ROUT2K4PlayerSetupPage.psTitleBar' Begin Object Class=GUITabControl Name=PageTabs bDockPanels=True TabHeight=0.060000 WinTop=0.050000 WinLeft=0.050000 WinWidth=0.920000 WinHeight=0.100000 RenderWeight=0.490000 TabOrder=3 bAcceptsInput=True OnActivate=PageTabs.InternalOnActivate End Object playerTabs=GUITabControl'ROInterface.ROUT2K4PlayerSetupPage.PageTabs' bRenderWorld=True bAllowedAsLast=True OnCanClose=ROUT2K4PlayerSetupPage.InternalOnCanClose WinTop=0.025000 WinLeft=0.025000 WinWidth=0.950000 WinHeight=0.950000 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |