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

UTDom.DomGameReplicationInfo


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
/**
 * Needed to correctly setup the midgamemenu for the corresponding # of teams 
 * (allways use the 2 team midgamemenu if this is the PS3 build)
 * 
 * Writen by Brian 'Snake' Alexander. Copyright(c) 2009-2010 All Rights Reserved.
 */
class DomGameReplicationInfo extends UTMT_GameReplicationInfo;

/** Replicated value of UTDomGame.bShowPickTeamAtLogin */
var bool bPickTeamAtLogin;
var UIScene TeamPickerTemplate;
var name MidGameMenuTag[4];

replication
{
   if (bNetInitial || bNetDirty)
      bPickTeamAtLogin;
}

/**
 * Use the 'DomMidGameMenu' instead
 */
simulated function PostBeginPlay()
{
   local UTPowerupPickupFactory Powerup;
   local Sequence GameSequence;
   local array<SequenceObject> AllFactoryActions;
   local SeqAct_ActorFactory FactoryAction;
   local UTActorFactoryPickup Factory;
   local int i, T;
   local UTGameUISceneClient SC;

   if ( WorldInfo.IsConsoleBuild() )
      Super.PostBeginPlay();
   else
   {
      Super(GameReplicationInfo).PostBeginPlay();
      if (WorldInfo.NetMode != NM_DedicatedServer)
      {
         SetTimer(1.0, false, 'StartProcessingCharacterData');
      }

      // using DynamicActors here so the overlays don't break if the LD didn't build paths
      foreach DynamicActors(class'UTPowerupPickupFactory', Powerup)
      {
         Powerup.AddWeaponOverlay(self);
      }

      // also check if any Kismet actor factories spawn powerups
      GameSequence = WorldInfo.GetGameSequence();
      if (GameSequence != None)
      {
         GameSequence.FindSeqObjectsByClass(class'SeqAct_ActorFactory', true, AllFactoryActions);
         for (i = 0; i < AllFactoryActions.length; i++)
         {
            FactoryAction = SeqAct_ActorFactory(AllFactoryActions[i]);
            Factory = UTActorFactoryPickup(FactoryAction.Factory);
            if (Factory != None && ClassIsChildOf(Factory.InventoryClass, class'UTInventory'))
            {
               class<UTInventory>(Factory.InventoryClass).static.AddWeaponOverlay(self);
            }
         }
      }

      // Look for a mid game menu and if it's there fix it up
      SC = UTGameUISceneClient(class'UIRoot'.static.GetSceneClient());
      if (SC != none )
      {
         T = Teams.Length;

         if ( MidGameMenuTag[T] != '' )
            CurrentMidGameMenu = UTUIScene_MidGameMenu(SC.FindSceneByTag(MidGameMenuTag[T]));
         else
            CurrentMidGameMenu = UTUIScene_MidGameMenu(SC.FindSceneByTag(MidGameMenuTag[1]));

         if ( CurrentMidGameMenu != none )
            CurrentMidGameMenu.Reset();
      }
   }
}

/**
 * Open the mid-game menu unless if the TabTag='LoginPickTeam', then open the UIDomPlayerConfigScene instead.
 * 
 * @note using the TabTag='LoginPickTeam' should only be done once at the players login
 */
simulated function UTUIScene_MidGameMenu ShowMidGameMenu(UTPlayerController InstigatorPC, optional name TabTag,optional bool bEnableInput)
{
   local UIScene Scene;
   local UTUIScene Template;
   local class<UTDomGame> UTDomGameClass;

   if ( WorldInfo.IsConsoleBuild() )
   {
      return super.ShowMidGameMenu(InstigatorPC,TabTag,bEnableInput);
   }
   else
   {
      if (TabTag == '')
      {
         if (LastUsedMidgameTab != '')
         {
            TabTag = LastUsedMidGameTab;
         }
      }

      if ( CurrentMidGameMenu != none )
      {
         if ( TabTag != '' && TabTag != 'ChatTab' )
         {
   //       CurrentMidGameMenu.ActivateTab(TabTag);
         }
         return CurrentMidGameMenu;
      }

      if ( ScoreboardScene != none )   // Force the scoreboards to close
      {
         ShowScores(false, none, none );
      }

      UTDomGameClass = class<UTDomGame>(GameClass);
      if (UTDomGameClass == none)
      {
         LogInternal("UTDomGameClass is none!!",'DomGameReplicationInfo');
         return None;
      }

      if ( UTDomGameClass.Default.MidGameMenuTemplates[Teams.Length-2] != none )
         Template = UTDomGameClass.Default.MidGameMenuTemplates[Teams.Length-2];
      else
         Template = UTDomGameClass.Default.MidGameMenuTemplate;

      if ( Template != none )
      {
         Scene = OpenUIScene(InstigatorPC,Template);
         if ( Scene != none )
         {
            CurrentMidGameMenu = UTUIScene_MidGameMenu(Scene);
            ToggleViewingMap(true);

            if (bMatchIsOver)
            {
               CurrentMidGameMenu.TabControl.RemoveTabByTag('SettingsTab');
            }

            if ( TabTag != '' )
            {
               CurrentMidGameMenu.ActivateTab(TabTag);
            }
         }
         else
         {
            `log("ERROR - Could not open the mid-game menu:"@Template);
         }
      }

      if ( CurrentMidGameMenu != none && bEnableInput)
      {
         CurrentMidGameMenu.SetSceneInputMode(INPUTMODE_Free);
      }

      if (TabTag == 'LoginPickTeam')
      {
         ClientOpenUIScene(InstigatorPC, TeamPickerTemplate);
         if ( DomPRI(InstigatorPC.PlayerReplicationInfo) != none)
            DomPRI(InstigatorPC.PlayerReplicationInfo).bTeamPickerMenuDone = true;
      }

      return CurrentMidGameMenu;
   }
}

/** 
 * wrapper for opening UI scenes on the clienbt
 * 
 * @param InstigatorPC - player to open it for
 * @param Template - the scene to open
 */
reliable client function UIScene ClientOpenUIScene(UTPlayerController InstigatorPC, UIScene Template)
{
   local UIInteraction UIController;
   local LocalPlayer LP;
   local UIScene s;

   LP = LocalPlayer(InstigatorPC.Player);
   UIController = LP.ViewportClient.UIController;
   if ( UIController != none )
   {
      UIController.OpenScene(Template,LP,s);
   }

   return S;
}

defaultproperties
{
   TeamPickerTemplate=UTUIScene'UI_UT3Dom.DomTeamConfig'
   MidGameMenuTag(0)=DomMidGameMenu2
   MidGameMenuTag(1)=DomMidGameMenu2
   MidGameMenuTag(2)=DomMidGameMenu3
   MidGameMenuTag(3)=DomMidGameMenu
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Wed 8/12/2010 21:18:38.000 - Creation time: Fri 23/12/2011 20:31:26.283 - Created with UnCodeX