コード例 #1
0
        public void OnButtonAHit( PlayerIndex playerIndex, ref SignInSlot slot )
        {
            if ( slot.Slot.Player < PlayerIndex.One )
              {
            if ( Guide.IsTrialMode && slots.Count( s => s.Slot.Player.IsHuman() ) > 0 )
            {
              nagText.DeathBegin = (float)lastGameTime.TotalGameTime.TotalSeconds;

              MessageBoxScreen messageBox = new MessageBoxScreen( "Full version required for Multiplayer. " +
                                                              "Buy Avatar Hamster Panic now?" );
              messageBox.Accepted += GameCore.Instance.ShowBuy;
              ScreenManager.AddScreen( messageBox, null );
            }
            else
            {
              bool found = false;
              foreach ( SignedInGamer gamer in Gamer.SignedInGamers )
              {
            if ( gamer.PlayerIndex == playerIndex )
            {
              found = true;
              break;
            }
              }

              if ( !found )
              {
            Guide.ShowSignIn( 4, false );
            autoSignIn = true;
              }
              else
              {
            AddPlayer( ref slot, playerIndex );
              }
            }
              }
              else if ( slot.Ready == false )
              {
            GameCore.Instance.AudioManager.Play2DCue( "readyUp", 1f );
            slot.Ready = true;
              }

              if ( slots.Count( s => s.Slot.Player.IsHuman() ) != 0 )
              {
            if ( slots.Count( s => s.Slot.Player.IsHuman() && !s.Ready ) == 0 )
            {
              Slot[] initSlots = new Slot[4];
              for ( int i = 0; i < 4; ++i )
            initSlots[i] = slots[i].Slot;
              GameCore.Instance.AudioManager.Play2DCue( "startGame", 1f );
              //ScreenManager.MenuTrack.Pause();
              LoadingScreen.Load( ScreenManager, true, playerIndex, new GameplayScreen( initSlots ) );
            }
              }
        }
コード例 #2
0
        protected override void OnCancel( PlayerIndex playerIndex )
        {
            const string message = "Egads! Do you really want to exit Avatar Hamster Panic?";

              MessageBoxScreen confirmExitMessageBox = new MessageBoxScreen( message );

              confirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;

              ScreenManager.AddScreen( confirmExitMessageBox, playerIndex );
        }
コード例 #3
0
        void RestartMenuEntrySelected( object sender, PlayerIndexEventArgs e )
        {
            const string message = "Ack! Do you really want to quit this game?";

              MessageBoxScreen confirmRestartMessageBox = new MessageBoxScreen( message );

              confirmRestartMessageBox.Accepted += ConfirmRestartMessageBoxAccepted;

              ScreenManager.AddScreen( confirmRestartMessageBox, ControllingPlayer );
        }