Example #1
0
 public void Update()
 {		
     // If the touch event results from a button press it is ignored.
     if (!mButtonPressed)
     {
         // If finger is removed from screen.
         if (Input.GetMouseButtonUp(0))
         {
             // If menu is not rendered.
             if (mMenuToShow == MenuMode.MENU_OFF)
             {
                 // Show menu.
                 mMenuToShow = MenuMode.MENU_CAMERA_OPTIONS;
             }
             // If menu is already open.
             else
             {
                 // Close menu
                 mMenuToShow = MenuMode.MENU_OFF;
             }
         }
     }
     else
     {
         mButtonPressed = false;
     }
 }
Example #2
0
 public void Die()
 {
     MenuMode = MenuMode.Dead;
     Game1.GameMode = GameModes.Menu;
     TransFrame = 1f;
     Level = Level.Dead;
     TransType = Trans.All;
 }
Example #3
0
 public MenuViewModel(MenuMode mode)
 {
     if(mode != MenuMode.AtHome)
     {
         var messenger = Mvx.Resolve<IMvxMessenger>();
         _token = messenger.Subscribe<ContentReceivedMessage>(message =>
         {
             HasReceivedNotifications = true;
             RaisePropertyChanged(() => HasReceivedNotifications);
         });
     }
     HomeCommand = new MvxCommand(HomeCommandAction, () => mode != MenuMode.AtHome);
     SettingsCommand = new MvxCommand(SettingsCommandAction, () => mode != MenuMode.AtSettings);
     AddContactCommand = new MvxCommand(AddContactCommandAction, () => mode != MenuMode.AtAddContact);
 }
Example #4
0
    void CreditsGui()
    {
        GUILayout.BeginHorizontal();
        var spacerWidth = (Screen.width - 227.0f) / 2.0f;
        GUILayout.Space(spacerWidth);

        GUILayout.BeginVertical();

        GUILayout.Label(title);
        if (GUILayout.Button("Back", GUILayout.Width(title.width)))
        {
            mode = MenuMode.Title;
        }
        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
        GUILayout.BeginVertical();
        GUILayout.Label("Music:");
        GUILayout.Label("     Winter Reflections - Kevin Macleod (incompetech.com)", GUILayout.ExpandWidth(true));
        GUILayout.Label("     Plans in Motion - Kevin Macleod (incompetech.com)", GUILayout.ExpandWidth(true));
        GUILayout.Label("Artwork:");
        GUILayout.BeginHorizontal();
        GUILayout.Label("     Nova texture - ", GUILayout.ExpandWidth(false));
        if (GUILayout.Button("Poe Tatum", GUILayout.ExpandWidth(false))) {
            Application.OpenURL("http://www.flickr.com/photos/poetatum/3418291075/");
        }
        GUILayout.EndHorizontal();
        GUILayout.Label("     Ship - Logan Barnett");
        GUILayout.Label("     Navigation Ring - Logan Barnett");
        GUILayout.BeginHorizontal();
        GUILayout.Label("     Planetary textures - James Hastings-Trew ", GUILayout.ExpandWidth(false));
        if (GUILayout.Button("Planet Pixel Emporium", GUILayout.ExpandWidth(false))) {
            Application.OpenURL("http://planetpixelemporium.com/planets.html");
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Kevin Macloed's music is distributed under the ", GUILayout.ExpandWidth(false));
        if (GUILayout.Button("Creative Commons 3.0 license", GUILayout.ExpandWidth(false))) {
            Application.OpenURL(CreativeCommons30Url);
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.Label("Poe Tatum's artwork is distributed under the ");
        if (GUILayout.Button("Creative Commons 3.0 non-commercial license", GUILayout.ExpandWidth(false))) {
            Application.OpenURL(CreativeCommons30NonCommercialUrl);
        }
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();
    }
Example #5
0
        Base ConstructFindGame()
        {
            Base FindGame = new Base(MainCanvas.GetCanvas());
            FindGame.SetSize(300, 300);

            Label EnterIP = new Label(FindGame);
            EnterIP.AutoSizeToContents = true;
            EnterIP.SetText("Enter an IP:");
            EnterIP.SetPosition(10, 10);

            TextBox IPAddress = new TextBox(FindGame);
            IPAddress.SetText("127.0.0.1");
            IPAddress.SetPosition(10, 40);
            IPAddress.SetSize(260, 20);

            TextBox Port = new TextBox(FindGame);
            Port.SetText("54987");
            Port.SetPosition(10, 70);
            Port.SetSize(260, 20);

            Button Connect = new Button(FindGame);
            Connect.SetText("Connect");
            Connect.SetPosition(10, 200);
            Connect.SetSize(200, 20);
            Connect.Clicked += delegate(Base sender, ClickedEventArgs args) {
                Program.Connect(IPAddress.Text, Int32.Parse(Port.Text));
                MainMenu.Hide();
                FindGame.Hide();

                Connecting.Show();
            };

            Button Back = new Button(FindGame);
            Back.SetText("Back");
            Back.SetPosition(10, 225);
            Back.SetSize(200, 20);
            Back.Clicked += delegate(Base sender, ClickedEventArgs args) {
                Mode = MenuMode.MainMenu;
                MainMenu.Show();
                FindGame.Hide();
            };

            return FindGame;
        }
        public void Initialize(bool drawPushStart)
        {
            mode = MenuMode.Titlescreen;

            magicAlpha = 1f;
            magicAlphaDelta = 0f;

            deviceOkP1 = false;
            #if XBOX
            signInRequested = false;
            startPressed = drawPushStart ? false : true;
            startPressAlpha = 0.75f;
            startPressAlphaDelta = 0.01f;
            #else
            startPressed = true;
            startPressAlpha = 0f;
            startPressAlphaDelta = 0f;
            #endif
            this.fadeInOut = 1f;

            float ratio = TGPAContext.Instance.ScreenHeight / 768;
            src = new Rectangle(0, 0, 1024, 768);
            foreDst = new Rectangle(0, TGPAContext.Instance.ScreenHeight - (439 * (TGPAContext.Instance.ScreenHeight / 768)), 804 * (TGPAContext.Instance.ScreenWidth / 1024), 439 * (TGPAContext.Instance.ScreenHeight / 768));
            foreSrc = new Rectangle(0, 0, 804, 439);
            dst = new Rectangle(0, 0, TGPAContext.Instance.ScreenWidth, TGPAContext.Instance.ScreenHeight);

            focus = MenuButtons.Play;

            buttonGo = new Rectangle(0, 0, 286, 113);
            buttonGoDst = buttonGo;
            buttonGoDst.X = 670;
            buttonGoDst.Y = 380;

            buttonOptions = new Rectangle(0, 130, 166, 117);
            buttonOptionsDst = buttonOptions;
            buttonOptionsDst.X = 720;
            buttonOptionsDst.Y = 480;

            buttonExit = new Rectangle(0, 256, 219, 118);
            buttonExitDst = buttonExit;
            buttonExitDst.X = 730;
            buttonExitDst.Y = 580;

            confirm = false;

            flyingStuff = new List<FlyingStuff>();
            stuffCooldown = 1500f;
            stuffTimer = 0f;

            //Options
            //***********************************************************
            InitializeOptions();
        }
Example #7
0
        public void Update(GameTime gameTime)
        {
            prevKeyState = keyState;
            keyState = Keyboard.GetState();

            if (!songStart)
            {
                MediaPlayer.Play(titleTheme);
                songStart = true;
                MediaPlayer.IsRepeating = true;
            }

            #region If Enter is Pressed
            if (PressedOnlyOnce(Keys.Enter))
            {
                if (_menuMode == MenuMode.Default)
                {
                    //MakeErrorrySound
                }
                else if (_menuMode == MenuMode.Continue)
                {
                    //Not Yet Implemented
                }
                else if (_menuMode == MenuMode.NewGame)
                {
                    game._GameMode = Game1.GameMode.Playing;
                    this.SoundOff();
                }
                else if (_menuMode == MenuMode.LoadGame)
                {
                    //Not Yet Implemented
                }
                else if (_menuMode == MenuMode.Settings)
                {
                    //Not Yet Implemented
                }
                else if (_menuMode == MenuMode.Quit)
                {
                    game.Exit();
                }
            }
            #endregion

            #region Up Scrolling
            else if (PressedOnlyOnce(Keys.S) || PressedOnlyOnce(Keys.Down) || PressedOnlyOnce(Keys.D) || PressedOnlyOnce(Keys.Right))
            {
                if (_menuMode == MenuMode.Default)
                {
                    _menuMode = MenuMode.Continue;
                    _menuImage = menuImages[0];
                    gearTurn.Play();
                }
                else if (_menuMode == MenuMode.Continue)
                {
                    _menuMode = MenuMode.NewGame;
                    _menuImage = menuImages[1];
                    gearTurn.Play();

                }
                else if (_menuMode == MenuMode.NewGame)
                {
                    _menuMode = MenuMode.LoadGame;
                    _menuImage = menuImages[2];
                    gearTurn.Play();
                }
                else if (_menuMode == MenuMode.LoadGame)
                {
                    _menuMode = MenuMode.Settings;
                    _menuImage = menuImages[3];
                    gearTurn.Play();
                }
                else if (_menuMode == MenuMode.Settings)
                {
                    _menuMode = MenuMode.Quit;
                    _menuImage = menuImages[4];
                }
                else if (_menuMode == MenuMode.Quit)
                {
                    _menuMode = MenuMode.Continue;
                    _menuImage = menuImages[0];
                    gearTurn.Play();
                }
            }
            #endregion

            #region Down Scrolling
            else if (PressedOnlyOnce(Keys.W) || PressedOnlyOnce(Keys.Up) || PressedOnlyOnce(Keys.A) || PressedOnlyOnce(Keys.Left))
            {
                if (_menuMode == MenuMode.Default)
                {
                    _menuMode = MenuMode.Quit;
                    _menuImage = menuImages[4];
                    gearTurn.Play();
                }
                else if (_menuMode == MenuMode.Continue)
                {
                    _menuMode = MenuMode.Quit;
                    _menuImage = menuImages[4];
                    gearTurn.Play();
                }
                else if (_menuMode == MenuMode.NewGame)
                {
                    _menuMode = MenuMode.Continue;
                    _menuImage = menuImages[0];
                    gearTurn.Play();
                }
                else if (_menuMode == MenuMode.LoadGame)
                {
                    _menuMode = MenuMode.NewGame;
                    _menuImage = menuImages[1];
                    gearTurn.Play();
                }
                else if (_menuMode == MenuMode.Settings)
                {
                    _menuMode = MenuMode.LoadGame;
                    _menuImage = menuImages[2];
                    gearTurn.Play();
                }
                else if (_menuMode == MenuMode.Quit)
                {
                    _menuMode = MenuMode.Settings;
                    _menuImage = menuImages[3];
                }
            }
            #endregion
        }
Example #8
0
        protected override void HandleGraphEvent(EventCode code, int p1, int p2)
        {
            

            switch (code)
            {
                case EventCode.DvdCurrentHmsfTime:
                    byte[] ati = BitConverter.GetBytes(p1);
                    _currentPosition = new TimeSpan(ati[0], ati[1], ati[2]);
                    break;

                case EventCode.DvdDomChange:
                    DvdDomain dom = (DvdDomain)p1;
                    Logger.LogHeavyTrace("Currently in domain: {0}", dom);

                    if (dom == DvdDomain.Title)
                    {
                        object comobj = null;
                        dvdGraphBuilder.GetDvdInterface(typeof(IDvdInfo2).GUID, out comobj);

                        dvdInfo = comobj as IDvdInfo2;

                        DvdHMSFTimeCode timeCode;
                        DvdTimeCodeFlags flags;
                        dvdInfo.GetTotalTitleTime(out timeCode, out flags);
                        _totalTime = new TimeSpan(timeCode.bHours, timeCode.bMinutes, timeCode.bSeconds);
                    }
                    break;

                case EventCode.DvdChaptStart:
                case EventCode.DvdTitleChange:
                case EventCode.DvdCmdStart:
                case EventCode.DvdCmdEnd:
                    break;

                case EventCode.DvdStillOn:
                    if (p1 == 0)
                        menuMode = MenuMode.Buttons;
                    else
                        menuMode = MenuMode.Still;
                    break;

                case EventCode.DvdStillOff:
                    if (menuMode == MenuMode.Still)
                        menuMode = MenuMode.No;
                    break;

                case EventCode.DvdButtonChange:
                    if (p1 <= 0)
                        menuMode = MenuMode.No;
                    else
                        menuMode = MenuMode.Buttons;
                    break;

                case EventCode.DvdNoFpPgc:
                    if (dvdControl2 != null)
                    {
                        int hr = dvdControl2.PlayTitle(1, DvdCmdFlags.None, _lastCmd);
                        DsError.ThrowExceptionForHR(hr);
                    }
                    break;
                }
            }
Example #9
0
        protected override void Update(GameTime gameTime)
        {
            inputState.Update();
            gameTicksPerSecond = this.TargetElapsedTime.Milliseconds / 1000.0f;

            switch (currentState)
            {
            case GameState.SplashScreen:
                if (inputState.MenuCancel)
                {
                    currentState = GameState.ExitScreen;
                }
                else
                {
                    currentState = GameState.TitleScreen;
                }

                break;

            case GameState.TitleScreen:
                titleScreen.NextPosition(gameTicksPerSecond);

                if (inputState.MenuSelect || inputState.MenuCancel)
                {
                    currentState = GameState.MainMenu;
                }

                break;

            case GameState.MainMenu:
                ResetGame();

                if (inputState.MenuCancel)
                {
                    currentState = GameState.TitleScreen;
                }

                if (inputState.MenuUp)
                {
                    mainMenuMode--;
                    if (mainMenuMode < MenuMode.SinglePlayer)
                    {
                        mainMenuMode = MenuMode.SinglePlayer;
                    }
                }
                if (inputState.MenuDown)
                {
                    mainMenuMode++;
                    if (mainMenuMode > MenuMode.Exit)
                    {
                        mainMenuMode = MenuMode.Exit;
                    }
                }
                if (inputState.MenuSelect)
                {
                    switch (mainMenuMode)
                    {
                    case MenuMode.MultiPlayer:
                        gameScreen.GameMode = GameMode.MultiPlayer;
                        currentState        = GameState.Running;
                        break;

                    case MenuMode.SinglePlayer:
                        gameScreen.GameMode = GameMode.SinglePlayer;
                        currentState        = GameState.Running;
                        break;

                    case MenuMode.Option:
                        currentState = GameState.SettingsMenu;
                        break;

                    case MenuMode.Exit:
                        currentState = GameState.ExitScreen;
                        break;
                    }
                }
                break;

            case GameState.SettingsMenu:
                if (inputState.MenuCancel)
                {
                    currentState = GameState.MainMenu;
                }

                if (inputState.MenuUp)
                {
                    optionMenuMode--;
                    if (optionMenuMode < OptionMode.AdjustScreen)
                    {
                        optionMenuMode = OptionMode.AdjustScreen;
                    }
                }

                if (inputState.MenuDown)
                {
                    optionMenuMode++;
                    if (optionMenuMode > OptionMode.MainMenu)
                    {
                        optionMenuMode = OptionMode.MainMenu;
                    }
                }

                if (inputState.MenuSelect)
                {
                    switch (optionMenuMode)
                    {
                    case OptionMode.AdjustScreen:
                        currentState = GameState.ScalingScreen;
                        break;

                    case OptionMode.MainMenu:
                        currentState = GameState.MainMenu;
                        break;
                    }
                }
                break;

            case GameState.ScalingScreen:
                if (inputState.MenuCancel)
                {
                    currentState = GameState.MainMenu;
                }

                if (inputState.DirectionUp)
                {
                    screenOffset.Y--;
                }

                if (inputState.DirectionDown)
                {
                    screenOffset.Y++;
                }

                if (inputState.DirectionLeft)
                {
                    screenOffset.X--;
                }

                if (inputState.DirectionRight)
                {
                    screenOffset.X++;
                }

                if (inputState.DirectionClick)
                {
                    screenOffset = screenOffsetOrigin;
                }

                if (inputState.OtherDirectionUp)
                {
                    scalingFactor -= .001f;
                }

                if (inputState.OtherDirectionDown)
                {
                    scalingFactor += .001f;
                }

                if (inputState.OtherDirectionLeft)
                {
                    scalingFactor -= .01f;
                }

                if (inputState.OtherDirectionRight)
                {
                    scalingFactor += .01f;
                }

                if (inputState.OtherDirectionClick)
                {
                    scalingFactor = scalingFactorOrigin;
                }

                if (inputState.MenuSelect)
                {
                    pongConfig.ScalingFactor = scalingFactor;
                    pongConfig.ScreenOffset  = screenOffset;
                    pongConfig.Save(GetStorageDevice());
                    currentState = GameState.MainMenu;
                }

                break;

            case GameState.Running:
                startedGame = true;

                if (inputState.PauseGame)
                {
                    currentState = GameState.Paused;
                }

                if (GamePad.GetState(PlayerIndex.One).DPad.Up == ButtonState.Pressed
#if !ZUNE
                    || Keyboard.GetState().IsKeyDown(Keys.W)
#endif
                    )
                {
                    gameScreen.RedPaddleDirection = PaddleDirection.Up;
                }
                else if (GamePad.GetState(PlayerIndex.One).DPad.Down == ButtonState.Pressed
#if !ZUNE
                         || Keyboard.GetState().IsKeyDown(Keys.S)
#endif
                         )
                {
                    gameScreen.RedPaddleDirection = PaddleDirection.Down;
                }
                else
                {
                    gameScreen.RedPaddleDirection = PaddleDirection.Stop;
                }

                if (GamePad.GetState(PlayerIndex.Two).DPad.Up == ButtonState.Pressed
#if !ZUNE
                    || Keyboard.GetState().IsKeyDown(Keys.Up)
#endif
                    )
                {
                    gameScreen.BluePaddleDirection = PaddleDirection.Up;
                }
                else if (GamePad.GetState(PlayerIndex.Two).DPad.Down == ButtonState.Pressed
#if !ZUNE
                         || Keyboard.GetState().IsKeyDown(Keys.Down)
#endif
                         )
                {
                    gameScreen.BluePaddleDirection = PaddleDirection.Down;
                }
                else
                {
                    gameScreen.BluePaddleDirection = PaddleDirection.Stop;
                }

                gameScreen.NextPosition(gameTicksPerSecond);

                break;

            case GameState.GameOver:
                if (inputState.MenuCancel || inputState.MenuSelect)
                {
                    currentState = GameState.MainMenu;
                }
                break;

            case GameState.Paused:
                if (inputState.MenuSelect)
                {
                    currentState = GameState.Running;
                }

                if (inputState.MenuCancel)
                {
                    currentState = GameState.MainMenu;
                }

                break;

            case GameState.ExitScreen:
                if (inputState.MenuCancel)
                {
                    currentState = GameState.MainMenu;
                }

                if (
                    GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed
#if ZUNE
                    || inputState.MenuSelect
#endif
                    )
                {
                    this.Exit();
                }

                break;
            }

            base.Update(gameTime);
        }
Example #10
0
    private void OnGUI()
    {
        var serializedObject = new SerializedObject(this);

        EditorGUI.BeginChangeCheck();
        EditorGUILayout.BeginVertical();
        // Draw Top Help/Tutorial Boxes
        GUILayout.BeginHorizontal("box");


        if (GUILayout.Button("Check Updates"))
        {
            Application.OpenURL("https://github.com/hooh-hooah/ModdingTool/tree/release/");
        }
        if (GUILayout.Button("Tutorials"))
        {
            Application.OpenURL("https://hooh-hooah.github.io/");
        }
        GUILayout.EndHorizontal();

        TabSelector = (MenuMode)GUILayout.Toolbar((int)TabSelector, new[] { "Useful Macros", "Mod Setup", "Mod Integration" }, Style.ButtonTab);

        scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(0), GUILayout.Height(0));
        {
            switch (TabSelector)
            {
            case MenuMode.ModSetup:
                DrawModSetup(serializedObject);
                DrawXMLGenerator(serializedObject);
                break;

            case MenuMode.ModIntegration:
                DrawThumbnailUtility(serializedObject);
                DrawXMLHelper(serializedObject);
                DrawModBuilder(serializedObject);
                break;

            case MenuMode.UnityMacro:
                DrawLightProbeSetting(serializedObject);
                DrawUnityUtility(serializedObject);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
        EditorGUILayout.EndScrollView();
        // End Scroll Positions
        EditorGUILayout.EndVertical();
        var endChangeCheck = EditorGUI.EndChangeCheck();


        try
        {
            _guiEventAction?.Invoke();
        }
        catch (Exception e)
        {
            Debug.LogError(e);
            // ignored
        }
        finally
        {
            _guiEventAction = null;
            EditorUtility.ClearProgressBar();
        }

        if (!endChangeCheck)
        {
            return;
        }
        serializedObject.ApplyModifiedProperties();
        isDirty = true;
    }
 void cancelRoomWaitChoice(bool b)
 {
     AppWarp.deleteCurrentRoom();
     mode = MenuMode.MP_INIT;
 }
Example #12
0
        public void Update(Game1 game)
        {
            frame += Game1.FrameTime / 2f;
            if (frame > 6.28f) frame -= 6.28f;

            if (transFrame < 2f)
            {
                float pFrame = transFrame;
                transFrame += Game1.FrameTime;
                if (transType == Trans.Buttons)
                    transFrame += Game1.FrameTime;
                if (pFrame < 1f && transFrame >= 1f)
                {
                    levelSel[(int)level] = selItem;
                    level = transGoal;
                    selItem = levelSel[(int)level];
                    switch (level)
                    {
                        case Level.NewGame:
                            game.NewGame();
                            break;
                        case Level.ResumeGame:
                            Game1.GameMode = Game1.GameModes.Playing;
                            break;
                        case Level.EndGame:
                            menuMode = MenuMode.Main;
                            level = Level.Main;
                            break;
                        case Level.Quit:
                            game.Quit();
                            break;
                        case Level.HostGame:
                            Game1.NetPlay.NetConnect.Host();
                            break;
                        case Level.JoinGame:
                            Game1.NetPlay.NetConnect.Find();
                            break;
                        case Level.NewArena:
                            game.NewGame(true);
                            Game1.NetPlay.NetConnect.NewGame();
                            break;
                    }
                }
            }

            for (int i = 0; i < fog.Length; i++)
            {
                fog[i].X -= Game1.FrameTime * (50f + (float)(i % 20 + 2));
                fog[i].Y += Game1.FrameTime * (float)(i % 14 + 5);
                if (fog[i].X < -150f)
                {
                    fog[i].X = Game1.ScreenSize.X +
                        Rand.GetRandomFloat(150f, 200f);
                    fog[i].Y = Game1.ScreenSize.Y -
                        Rand.GetRandomFloat(0f, 300f);
                }
            }

            for (int i = 0; i < optionFrame.Length; i++)
            {
                if (selItem == i)
                {
                    if (optionFrame[i] < 1f)
                    {
                        optionFrame[i] += Game1.FrameTime * 7f;
                        if (optionFrame[i] > 1f) optionFrame[i] = 1f;
                    }
                }
                else
                {
                    if (optionFrame[i] > 0f)
                    {
                        optionFrame[i] -= Game1.FrameTime * 4f;
                        if (optionFrame[i] < 0f) optionFrame[i] = 0f;
                    }
                }
            }

            PopulateOptions();

            for (int i = 0; i < 4; i++)
            {
                GamePadState gs = GamePad.GetState((PlayerIndex)i);

                if (totalOptions > 0)
                {
                    if ((gs.ThumbSticks.Left.Y > 0.3f &&
                        oldState[i].ThumbSticks.Left.Y <= 0.3f) ||
                        (gs.DPad.Up == ButtonState.Pressed &&
                        oldState[i].DPad.Up == ButtonState.Released))
                    {
                        selItem = (selItem + (totalOptions - 1)) % totalOptions;
                    }

                    if ((gs.ThumbSticks.Left.Y < -0.3f &&
                        oldState[i].ThumbSticks.Left.Y >= -0.3f) ||
                        (gs.DPad.Down == ButtonState.Pressed &&
                        oldState[i].DPad.Down == ButtonState.Released))
                    {
                        selItem = (selItem + 1) % totalOptions;
                    }
                }

                if (option[0] == Option.AwaitingConnection)
                    selItem = 1;

                bool ok = false;
                if (transFrame > 1.9f)
                {
                    if (gs.Buttons.A == ButtonState.Pressed &&
                        oldState[i].Buttons.A == ButtonState.Released)
                        ok = true;
                    if (gs.Buttons.Start == ButtonState.Pressed &&
                        oldState[i].Buttons.Start == ButtonState.Released)
                    {
                        if (menuMode == MenuMode.Main ||
                            menuMode == MenuMode.Dead)
                            ok = true;
                        else
                        {
                            Transition(Level.ResumeGame, true);
                        }
                    }

                    if (ok)
                    {
                        switch (level)
                        {
                            case Level.Main:
                                switch (option[selItem])
                                {
                                    case Option.NewGame:
                                        Transition(Level.NewGame, true);
                                        break;
                                    case Option.ResumeGame:
                                        Transition(Level.ResumeGame, true);
                                        break;
                                    case Option.EndGame:
                                        Transition(Level.EndGame, true);
                                        break;
                                    case Option.Continue:

                                        break;
                                    case Option.Multiplayer:
                                        Transition(Level.Multiplayer);
                                        break;
                                    case Option.Options:
                                        Transition(Level.Options);
                                        break;
                                    case Option.Quit:
                                        Transition(Level.Quit, true);
                                        break;
                                }
                                break;
                            case Level.Dead:
                                switch (option[selItem])
                                {
                                    case Option.EndGame:
                                        Transition(Level.EndGame, true);
                                        break;
                                    case Option.Quit:
                                        Transition(Level.Quit, true);
                                        break;
                                }
                                break;
                            case Level.Options:
                                switch (option[selItem])
                                {
                                    case Option.Back:
                                        Transition(Level.Main);
                                        Game1.store.Write(Store.STORE_SETTINGS);
                                        break;
                                    case Option.RumbleOn:
                                        Game1.settings.Rumble = false;
                                        break;
                                    case Option.RumbleOff:
                                        Game1.settings.Rumble = true;
                                        break;
                                }
                                break;
                            case Level.Multiplayer:
                                switch (option[selItem])
                                {
                                    case Option.Back:
                                        Transition(Level.Main);
                                        break;
                                    case Option.HostGame:
                                        Transition(Level.HostGame);
                                        break;
                                    case Option.JoinGame:
                                        Transition(Level.JoinGame);
                                        break;
                                }
                                break;
                            case Level.HostGame:
                                switch (option[selItem])
                                {
                                    case Option.Cancel:
                                        Transition(Level.Main);
                                        Game1.NetPlay.NetConnect.Disconnect();
                                        break;
                                }
                                break;
                            case Level.JoinGame:
                                switch (option[selItem])
                                {
                                    case Option.Cancel:
                                        Transition(Level.Main);
                                        Game1.NetPlay.NetConnect.Disconnect();
                                        break;
                                }
                                break;
                        }
                    }
                    else
                    {
                        switch (level)
                        {
                            case Level.JoinGame:
                                if (Game1.NetPlay.Joined)
                                    Transition(Level.NewArena);
                                break;
                            case Level.HostGame:
                                if (Game1.NetPlay.NetSession != null)
                                {
                                    if (Game1.NetPlay.NetSession.AllGamers.Count == 2)
                                        Transition(Level.NewArena);
                                }
                                break;
                        }
                    }
                }
                oldState[i] = gs;
            }
        }
Example #13
0
        public void Update(Game1 game)
        {
            frame += Game1.FrameTime / 2f;
            if (frame > 6.28f)
            {
                frame -= 6.28f;
            }

            if (transFrame < 2f)
            {
                float pFrame = transFrame;
                transFrame += Game1.FrameTime;
                if (transType == Trans.Buttons)
                {
                    transFrame += Game1.FrameTime;
                }
                if (pFrame < 1f && transFrame >= 1f)
                {
                    levelSel[(int)level] = selItem;
                    level   = transGoal;
                    selItem = levelSel[(int)level];
                    switch (level)
                    {
                    case Level.NewGame:
                        game.NewGame();
                        break;

                    case Level.ResumeGame:
                        Game1.GameMode = Game1.GameModes.Playing;
                        break;

                    case Level.EndGame:
                        menuMode = MenuMode.Main;
                        level    = Level.Main;
                        break;

                    case Level.Quit:
                        game.Quit();
                        break;

                    case Level.HostGame:
                        Game1.NetPlay.NetConnect.Host();
                        break;

                    case Level.JoinGame:
                        Game1.NetPlay.NetConnect.Find();
                        break;

                    case Level.NewArena:
                        game.NewGame(true);
                        Game1.NetPlay.NetConnect.NewGame();
                        break;
                    }
                }
            }

            for (int i = 0; i < fog.Length; i++)
            {
                fog[i].X -= Game1.FrameTime * (50f + (float)(i % 20 + 2));
                fog[i].Y += Game1.FrameTime * (float)(i % 14 + 5);
                if (fog[i].X < -150f)
                {
                    fog[i].X = Game1.ScreenSize.X +
                               Rand.GetRandomFloat(150f, 200f);
                    fog[i].Y = Game1.ScreenSize.Y -
                               Rand.GetRandomFloat(0f, 300f);
                }
            }

            for (int i = 0; i < optionFrame.Length; i++)
            {
                if (selItem == i)
                {
                    if (optionFrame[i] < 1f)
                    {
                        optionFrame[i] += Game1.FrameTime * 7f;
                        if (optionFrame[i] > 1f)
                        {
                            optionFrame[i] = 1f;
                        }
                    }
                }
                else
                {
                    if (optionFrame[i] > 0f)
                    {
                        optionFrame[i] -= Game1.FrameTime * 4f;
                        if (optionFrame[i] < 0f)
                        {
                            optionFrame[i] = 0f;
                        }
                    }
                }
            }

            PopulateOptions();

            for (int i = 0; i < 4; i++)
            {
                GamePadState gs = GamePad.GetState((PlayerIndex)i);

                if (totalOptions > 0)
                {
                    if ((gs.ThumbSticks.Left.Y > 0.3f &&
                         oldState[i].ThumbSticks.Left.Y <= 0.3f) ||
                        (gs.DPad.Up == ButtonState.Pressed &&
                         oldState[i].DPad.Up == ButtonState.Released))
                    {
                        selItem = (selItem + (totalOptions - 1)) % totalOptions;
                    }

                    if ((gs.ThumbSticks.Left.Y < -0.3f &&
                         oldState[i].ThumbSticks.Left.Y >= -0.3f) ||
                        (gs.DPad.Down == ButtonState.Pressed &&
                         oldState[i].DPad.Down == ButtonState.Released))
                    {
                        selItem = (selItem + 1) % totalOptions;
                    }
                }

                if (option[0] == Option.AwaitingConnection)
                {
                    selItem = 1;
                }

                bool ok = false;
                if (transFrame > 1.9f)
                {
                    if (gs.Buttons.A == ButtonState.Pressed &&
                        oldState[i].Buttons.A == ButtonState.Released)
                    {
                        ok = true;
                    }
                    if (gs.Buttons.Start == ButtonState.Pressed &&
                        oldState[i].Buttons.Start == ButtonState.Released)
                    {
                        if (menuMode == MenuMode.Main ||
                            menuMode == MenuMode.Dead)
                        {
                            ok = true;
                        }
                        else
                        {
                            Transition(Level.ResumeGame, true);
                        }
                    }

                    if (ok)
                    {
                        switch (level)
                        {
                        case Level.Main:
                            switch (option[selItem])
                            {
                            case Option.NewGame:
                                Transition(Level.NewGame, true);
                                break;

                            case Option.ResumeGame:
                                Transition(Level.ResumeGame, true);
                                break;

                            case Option.EndGame:
                                Transition(Level.EndGame, true);
                                break;

                            case Option.Continue:

                                break;

                            case Option.Multiplayer:
                                Transition(Level.Multiplayer);
                                break;

                            case Option.Options:
                                Transition(Level.Options);
                                break;

                            case Option.Quit:
                                Transition(Level.Quit, true);
                                break;
                            }
                            break;

                        case Level.Dead:
                            switch (option[selItem])
                            {
                            case Option.EndGame:
                                Transition(Level.EndGame, true);
                                break;

                            case Option.Quit:
                                Transition(Level.Quit, true);
                                break;
                            }
                            break;

                        case Level.Options:
                            switch (option[selItem])
                            {
                            case Option.Back:
                                Transition(Level.Main);
                                Game1.store.Write(Store.STORE_SETTINGS);
                                break;

                            case Option.RumbleOn:
                                Game1.settings.Rumble = false;
                                break;

                            case Option.RumbleOff:
                                Game1.settings.Rumble = true;
                                break;
                            }
                            break;

                        case Level.Multiplayer:
                            switch (option[selItem])
                            {
                            case Option.Back:
                                Transition(Level.Main);
                                break;

                            case Option.HostGame:
                                Transition(Level.HostGame);
                                break;

                            case Option.JoinGame:
                                Transition(Level.JoinGame);
                                break;
                            }
                            break;

                        case Level.HostGame:
                            switch (option[selItem])
                            {
                            case Option.Cancel:
                                Transition(Level.Main);
                                Game1.NetPlay.NetConnect.Disconnect();
                                break;
                            }
                            break;

                        case Level.JoinGame:
                            switch (option[selItem])
                            {
                            case Option.Cancel:
                                Transition(Level.Main);
                                Game1.NetPlay.NetConnect.Disconnect();
                                break;
                            }
                            break;
                        }
                    }
                    else
                    {
                        switch (level)
                        {
                        case Level.JoinGame:
                            if (Game1.NetPlay.Joined)
                            {
                                Transition(Level.NewArena);
                            }
                            break;

                        case Level.HostGame:
                            if (Game1.NetPlay.NetSession != null)
                            {
                                if (Game1.NetPlay.NetSession.AllGamers.Count == 2)
                                {
                                    Transition(Level.NewArena);
                                }
                            }
                            break;
                        }
                    }
                }
                oldState[i] = gs;
            }
        }
Example #14
0
 protected void SceneChangeDelay(MenuMode newMode, string scene)
 {
     InputDelegateController.instance.TriggerSceneChange(newMode, scene);
 }
Example #15
0
    // Draw menu to control camera device.
    private void DrawMenu()
    {
        computePosition();

        // Setup style for buttons.
        GUIStyle buttonGroupStyle = new GUIStyle(GUI.skin.button);
        buttonGroupStyle.stretchWidth = true;
        buttonGroupStyle.stretchHeight = true;

        GUILayout.BeginArea(mAreaRect);

        GUILayout.BeginVertical(buttonGroupStyle);

        GUILayout.BeginHorizontal(buttonGroupStyle);

        // Turn flash on or off.
        if (GUILayout.Button("Toggle Flash", buttonGroupStyle))
        {
            if (!mFlashEnabled)
            {
                // Turn on flash if it is currently disabled.
                CameraDevice.Instance.SetFlashTorchMode(true);
                mFlashEnabled = true;
            }
            else
            {
                // Turn off flash if it is currently enabled.
                CameraDevice.Instance.SetFlashTorchMode(false);
                mFlashEnabled = false;
            }

            mMenuToShow = MenuMode.MENU_OFF;
            mButtonPressed = true;
        }

        // Swap data sets.
        if (GUILayout.Button("Toggle Data Set", buttonGroupStyle))
        {
            Debug.Log("Toggle data set");
            ImageTracker imageTracker = (ImageTracker)TrackerManager.Instance.GetTracker(Tracker.Type.IMAGE_TRACKER);

            // Toggle between first two available data sets.
            if (imageTracker.GetNumDataSets() >= 2)
            {
                DataSet activeDataSet = imageTracker.GetActiveDataSet();
                if (activeDataSet == imageTracker.GetDataSet(0))
                {
                    imageTracker.DeactivateDataSet(activeDataSet);
                    imageTracker.ActivateDataSet(imageTracker.GetDataSet(1));
                    Debug.Log("swapping to dataset " + imageTracker.GetDataSet(1).Path);
                }
                else
                {
                    imageTracker.DeactivateDataSet(activeDataSet);
                    imageTracker.ActivateDataSet(imageTracker.GetDataSet(0));
                    Debug.Log("swapping to dataset " + imageTracker.GetDataSet(0).Path);
                }
            }
            else
            {
                Debug.LogWarning("Not enough data sets to toggle");
            }
        }

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal(buttonGroupStyle);

        // Triggers auto focus:
        if (GUILayout.Button("Trigger Autofocus", buttonGroupStyle))
        {
            if (CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO))
                mFocusMode = CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO;

            mMenuToShow = MenuMode.MENU_OFF;
            mButtonPressed = true;
        }

        // Choose focus mode.
        if (GUILayout.Button("Focus Modes", buttonGroupStyle))
        {
            mMenuToShow = MenuMode.MENU_FOCUS_MODES;
            mButtonPressed = true;
        }

        GUILayout.EndHorizontal();

        GUILayout.EndVertical();

        GUILayout.EndArea();
    }
Example #16
0
    private void SelectInstructionMenu_ModeChanged(object sender, ModeChangedEventArgs e)
    {
        _mode = e.Mode;

        _footMenu.GetComponent <FootMenuController>().ChangeMode(_mode);
    }
 public ModeChangedEventArgs(MenuMode mode)
 {
     Mode = mode;
 }
Example #18
0
 //-----------------------------------------------------
 void Start()
 {
     m_curTool     = EditTool.None;
     m_curMenuMode = MenuMode.ImageMode;
     m_displayLightSliders = false;
 }
Example #19
0
 //-----------------------------------------------------
 public void SetMenuMode(bool light)
 {
     if(light)
         m_curMenuMode = MenuMode.LightMode;
     else
         m_curMenuMode = MenuMode.ImageMode;
 }
 private void changeModeAfterAlphaBlending(MenuMode newMode)
 {
     magicAlphaDelta = 0.1f;
     nextMode = newMode;
 }
Example #21
0
 public static UIWazaRenketsuMenu Create() => default;                         // 0x00D58A70-0x00D58C90
 public static UIWazaRenketsuMenu CreateForWazaMain(MenuMode mode) => default; // 0x00D4D4A0-0x00D4D6C0
    void Update()
    {
        int choice = 0;

        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            choice = 1;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            choice = 2;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            choice = 3;
        }

        switch (mode)
        {
        case MenuMode.SP_SETUP:
            switch (choice)
            {
            case 1:
                debugSettings1 = new Dictionary <string, object>()
                {
                    { "Lives", 5 },
                    { "First player first facility", (int)(WorldData.Facility.REDIRECTOR) },
                    { "Second player first facility", (int)(WorldData.Facility.SEISMOMETER) }
                };
                matchParameters = debugSettings1;
                oppUsername     = "******";
                matchParameters.Add("First player", "true");
                startGame();
                break;

            case 2:
                debugSettings2 = new Dictionary <string, object>()
                {
                    { "Lives", 10 },
                    { "First player first facility", (int)(WorldData.Facility.REDIRECTOR) },
                    { "Second player first facility", (int)(WorldData.Facility.SEISMOMETER) }
                };
                matchParameters = debugSettings2;
                oppUsername     = "******";
                matchParameters.Add("First player", "false");
                startGame();
                break;

            case 3:
                Application.LoadLevel("Menu");
                break;
            }
            break;

        case MenuMode.MP_INIT:
            switch (choice)
            {
            case 1:
                matchUp = false;
                mode    = MenuMode.MP_INPUTROOMNAME;
                break;

            case 2:
                matchUp = true;
                AppWarp.roomFoundEvent += roomFoundEventHandler;
                roomName = AppWarp.MATCHUP_ROOM_NAME;
                AppWarp.getRoom(roomName);
                mode = MenuMode.MP_WAITING;
                break;

            case 3:
                AppWarp.exit();
                Application.LoadLevel("Menu");
                break;
            }
            break;

        case MenuMode.MP_INPUTROOMNAME:
            switch (choice)
            {
            case 1:
                roomName = "debugRoom1";
                AppWarp.roomFoundEvent += roomFoundEventHandler;
                AppWarp.getRoom(roomName);
                mode = MenuMode.MP_WAITING;
                break;

            case 2:
                roomName = "debugRoom2";
                AppWarp.roomFoundEvent += roomFoundEventHandler;
                AppWarp.getRoom(roomName);
                mode = MenuMode.MP_WAITING;
                break;

            case 3:
                mode = MenuMode.MP_INIT;
                break;
            }
            break;

        case MenuMode.MP_CREATEROOM:
            switch (choice)
            {
            case 1:
                debugSettings1 = new Dictionary <string, object>()
                {
                    { "Lives", "5" }
                };
                matchParameters         = debugSettings1;
                AppWarp.oppJoinedEvent += oppJoinedEventHandler;
                AppWarp.createRoom(roomName, matchParameters);
                customChoice.message     = "Room created, waiting for opponent";
                customChoice.firstOption = "Cancel";
                customChoice.onChoice    = cancelRoomWaitChoice;
                mode = MenuMode.MP_MONO_CHOICE;
                break;

            case 2:
                debugSettings2 = new Dictionary <string, object>()
                {
                    { "Lives", "10" }
                };
                matchParameters         = debugSettings2;
                AppWarp.oppJoinedEvent += oppJoinedEventHandler;
                AppWarp.createRoom(roomName, matchParameters);
                customChoice.message     = "Room created, waiting for opponent";
                customChoice.firstOption = "Cancel";
                customChoice.onChoice    = cancelRoomWaitChoice;
                mode = MenuMode.MP_MONO_CHOICE;
                break;

            case 3:
                mode = MenuMode.MP_INIT;
                break;
            }
            break;

        case MenuMode.MP_BIN_CHOICE:
            if (customChoice.onChoice != null)
            {
                switch (choice)
                {
                case 1:
                    customChoice.onChoice(true);
                    break;

                case 2:
                    customChoice.onChoice(false);
                    break;
                }
            }
            break;

        case MenuMode.MP_MONO_CHOICE:
            if (customChoice.onChoice != null)
            {
                switch (choice)
                {
                case 1:
                    customChoice.onChoice(true);
                    break;
                }
            }
            break;
        }
    }
Example #23
0
        public void CancelSubPBtnHandler(object sender, MouseEventArgs e)
        {
            MapScene.EnterMoveMode();
            Mode = MenuMode.DEFAULT;

            CancelSubPBtn.Selected = false;
            PlayfieldPanel.Selected = true;
        }
 private void SetPlayMode()
 {
     Current_State = Types.Play;
     MenuMode.DisableMenu();
 }
Example #25
0
        public override void OnRender(Canvas canvas)
        {
            Rectangle PlayfieldRect = PlayfieldPanel.ClientArea;
            Rectangle SpriteRect = Rectangle.Empty;
            if (Map != null)
            {
                SpriteRect = Map.ToRectangle();
            }

            switch (SCROLL)
            {
                case ScrollState.LEFT:
                    SpriteRect.X = (int)(SpriteRect.X + 10);
                    if (SpriteRect.Contains(PlayfieldRect))
                    {
                        MapScene.Pan(10, 0);
                    }
                    break;
                case ScrollState.RIGHT:
                    SpriteRect.X = (int)(SpriteRect.X - 10);
                    if (SpriteRect.Contains(PlayfieldRect))
                    {
                        MapScene.Pan(-10, 0);
                    }
                    break;
                case ScrollState.UP:
                    SpriteRect.Y = (int)(SpriteRect.Y + 10);
                    if (SpriteRect.Contains(PlayfieldRect))
                    {
                        MapScene.Pan(0, 10);
                    }
                    break;
                case ScrollState.DOWN:
                    SpriteRect.Y = (int)(SpriteRect.Y - 10);
                    if (SpriteRect.Contains(PlayfieldRect))
                    {
                        MapScene.Pan(0, -10);
                    }
                    break;
            }


            canvas.DrawFillRect(background, background_material);
            canvas.DrawFillRect(frame, frame_color_material);
            canvas.DrawRect(frame, border_color);
            canvas.DrawRect(PlayfieldPanel.ClientArea, Color.Green);
            canvas.DrawFillRect(score, score_color_material);
            canvas.DrawFillRect(information_rect, score_color_material);
            
            canvas.DrawFillTri(left_arrow, background_material, DIRECTION.LEFT);
            canvas.DrawFillTri(right_arrow, background_material, DIRECTION.RIGHT);
            canvas.DrawFillTri(up_arrow, background_material, DIRECTION.UP);
            canvas.DrawFillTri(down_arrow, background_material, DIRECTION.DOWN);

            if (MapScene.SelectionCount() == 0)
            {
                Mode = MenuMode.DEFAULT;
            }
            switch (Mode)
            {
                case MenuMode.DEFAULT:
                    DrawMoveMode(canvas);
                    break;
                case MenuMode.ATTACK:
                    DrawAttackMode(canvas);
                    break;
                case MenuMode.SUBPLATFORM:
                    DrawSubPMode(canvas);
                    break;
            }

            Fonts["Large"].DrawText(null, ScoreHeader, score, DrawTextFormat.VerticalCenter, Color.Yellow);
            if (!IsPaused)
            {
                Fonts["Large"].DrawText(null, Time, time_rect, DrawTextFormat.VerticalCenter, Color.Yellow);
            }
            else
            {
                Fonts["Large"].DrawText(null, "Paused", time_rect, DrawTextFormat.VerticalCenter, Color.Yellow);
            }


            base.OnRender(canvas);

        }
        // When you click on secondary weapon in game
        // opens secondary weapon menu
        public void ClickSecondaryWeapon()
        {
            // Play menu sound
            SoundManager.instance.PlaySound(SoundEffect.menuSelect, GameData.menuSelectVolume);

            // set the text to say "Secondary Weapon"
            Text temp = GameObject.FindGameObjectWithTag("WeaponEditLabel").GetComponent<Text>();
            temp.text = "Secondary Weapon";

            // check the different menu modes
            switch (mode)
            {
                // if in the PrimaryWeapon menu
                case MenuMode.PrimaryWeapon:

                    // update primary wepaon
                    UpdateWeapon(PrimaryWeapon);

                    // get the WeaponEditPanel componenets
                    // set the primary weapon to false
                    // load the secondary weapon
                    transform.parent.transform.FindChild("WeaponEditPanel").GetComponent<WeaponDesignPanel>().isPrimary = false;
                    transform.parent.transform.FindChild("WeaponEditPanel").GetComponent<WeaponDesignPanel>().LoadWeapon(SecondaryWeapon);

                    // get the TestShip components
                    // set shouldFireSecondary to true
                    TestShip.GetComponent<TestShip>().shouldFireSecondary = true;

                    // set the mode to SecondaryWeapon
                    mode = MenuMode.SecondaryWeapon;
                    break;

                // if in the SecondaryWeapon menu
                case MenuMode.SecondaryWeapon:
                    break;

                // if in the Shield menu
                case MenuMode.Shield:
                    break;
            }
        }
Example #27
0
 public void ShowCharacterSelection()
 {
     currentMode = MenuMode.Select;
     SwitchMenu(ref characterSelection);
 }
Example #28
0
    // Draw menu to let user choose a focus mode.
    private void DrawFocusModes()
    {
        CameraDevice.FocusMode newMode;
        newMode = EnumOptionList(mFocusMode);

        // We set the new value only if the mode has changed.
        if (newMode != mFocusMode)
        {
            if (CameraDevice.Instance.SetFocusMode(newMode))
                mFocusMode = newMode;

            mMenuToShow = MenuMode.MENU_OFF;
            mButtonPressed = true;
        }
    }
Example #29
0
        protected override void HandleGraphEvent(EventCode code, int p1, int p2)
        {
            switch (code)
            {
            case EventCode.DvdCurrentHmsfTime:
                byte[] ati = BitConverter.GetBytes(p1);
                _currentPosition = new TimeSpan(ati[0], ati[1], ati[2]);
                break;

            case EventCode.DvdDomChange:
                DvdDomain dom = (DvdDomain)p1;
                Logger.LogTrace("Currently in domain: {0}", dom);

                if (dom == DvdDomain.Title)
                {
                    object comobj = null;
                    dvdGraphBuilder.GetDvdInterface(typeof(IDvdInfo2).GUID, out comobj);

                    dvdInfo = comobj as IDvdInfo2;

                    DvdHMSFTimeCode  timeCode;
                    DvdTimeCodeFlags flags;
                    dvdInfo.GetTotalTitleTime(out timeCode, out flags);
                    _totalTime = new TimeSpan(timeCode.bHours, timeCode.bMinutes, timeCode.bSeconds);
                }
                break;

            case EventCode.DvdChaptStart:
            case EventCode.DvdTitleChange:
            case EventCode.DvdCmdStart:
            case EventCode.DvdCmdEnd:
                break;

            case EventCode.DvdStillOn:
                if (p1 == 0)
                {
                    menuMode = MenuMode.Buttons;
                }
                else
                {
                    menuMode = MenuMode.Still;
                }
                break;

            case EventCode.DvdStillOff:
                if (menuMode == MenuMode.Still)
                {
                    menuMode = MenuMode.No;
                }
                break;

            case EventCode.DvdButtonChange:
                if (p1 <= 0)
                {
                    menuMode = MenuMode.No;
                }
                else
                {
                    menuMode = MenuMode.Buttons;
                }
                break;

            case EventCode.DvdNoFpPgc:
                if (dvdControl2 != null)
                {
                    int hr = dvdControl2.PlayTitle(1, DvdCmdFlags.None, _lastCmd);
                    DsError.ThrowExceptionForHR(hr);
                }
                break;
            }
        }
Example #30
0
 public void ShowCredits()
 {
     currentMode = MenuMode.Credits;
     SwitchMenu(ref credits);
 }
Example #31
0
        public void Update(Game1 game)
        {
            _frame += Game1.FrameTime / 2f;
            if (_frame > 6.28f)
            {
                _frame -= 6.28f;
            }

            if (TransFrame < 2f)
            {
                var pFrame = TransFrame;
                TransFrame += Game1.FrameTime;

                if (TransType == Trans.Buttons)
                {
                    TransFrame += Game1.FrameTime;
                }

                if (pFrame < 1f && TransFrame >= 1f)
                {
                    _levelSel[(int)Level] = SelItem;
                    Level   = TransGoal;
                    SelItem = _levelSel[(int)Level];

                    switch (Level)
                    {
                    case Level.NewGame:
                        game.NewGame();
                        break;

                    case Level.ResumeGame:
                        Game1.GameMode = GameModes.Playing;
                        break;

                    case Level.EndGame:
                        MenuMode = MenuMode.Main;
                        Level    = Level.Main;
                        break;

                    case Level.Quit:
                        game.Quit();
                        break;
                    }
                }
            }

            for (var i = 0; i < _fog.Length; i++)
            {
                _fog[i].X -= Game1.FrameTime * (50f + (i % 20 + 2));
                _fog[i].Y += Game1.FrameTime * (i % 14 + 5);

                if (_fog[i].X < -150f)
                {
                    _fog[i].X = Game1.ScreenSize.X + Rand.GetRandomFloat(150f, 200f);
                    _fog[i].Y = Game1.ScreenSize.Y - Rand.GetRandomFloat(0f, 300f);
                }
            }

            for (var i = 0; i < _optionFrame.Length; i++)
            {
                if (SelItem == i)
                {
                    if (_optionFrame[i] < 1f)
                    {
                        _optionFrame[i] += Game1.FrameTime * 7f;
                        if (_optionFrame[i] > 1f)
                        {
                            _optionFrame[i] = 1f;
                        }
                    }
                }
                else
                {
                    if (_optionFrame[i] > 0f)
                    {
                        _optionFrame[i] -= Game1.FrameTime * 4f;
                        if (_optionFrame[i] < 0f)
                        {
                            _optionFrame[i] = 0f;
                        }
                    }
                }
            }

            PopulateOptions();

            if (_totalOptions > 0)
            {
                if (ControlInput.KeyUpPressed)
                {
                    SelItem = (SelItem + (_totalOptions - 1)) % _totalOptions;
                }
                else if (ControlInput.KeyDownPressed)
                {
                    SelItem = (SelItem + 1) % _totalOptions;
                }
            }

            var ok = false;

            if (TransFrame > 1.9f)
            {
                if (ControlInput.KeyAttackPressed)
                {
                    ok = true;
                }

                if (ControlInput.KeyStartPressed)
                {
                    if (MenuMode == MenuMode.Main || MenuMode == MenuMode.Dead)
                    {
                        ok = true;
                    }
                    else
                    {
                        Transition(Level.ResumeGame, true);
                    }
                }

                if (ok)
                {
                    switch (Level)
                    {
                    case Level.Main:
                        switch (_option[SelItem])
                        {
                        case Option.NewGame:
                            Transition(Level.NewGame, true);
                            break;

                        case Option.ResumeGame:
                            Transition(Level.ResumeGame, true);
                            break;

                        case Option.EndGame:
                            Transition(Level.EndGame, true);
                            break;

                        case Option.Continue:
                            break;

                        case Option.Options:
                            Transition(Level.Options);
                            break;

                        case Option.Quit:
                            Transition(Level.Quit, true);
                            break;
                        }
                        break;

                    case Level.Dead:
                        switch (_option[SelItem])
                        {
                        case Option.EndGame:
                            Transition(Level.EndGame, true);
                            break;

                        case Option.Quit:
                            Transition(Level.Quit, true);
                            break;
                        }
                        break;

                    case Level.Options:
                        switch (_option[SelItem])
                        {
                        case Option.Back:
                            Transition(Level.Main);
                            break;
                        }
                        break;
                    }
                }
            }
        }
Example #32
0
 public void ShowMainMenu()
 {
     currentMode = MenuMode.Main;
     EventSystem.current.SetSelectedGameObject(mainMenu.GetComponentInChildren <UnityEngine.UI.Button>().gameObject);
     SwitchMenu(ref mainMenu);
 }
Example #33
0
        public void Die()
        {
            menuMode = MenuMode.Dead;
            RuinExplorersMain.GameMode = RuinExplorersMain.GameModes.Menu;

            transFrame = 1f;
            level = Level.Dead;
            transType = Trans.All;
        }
Example #34
0
    // Draw menu to control camera device.
    private void DrawMenu()
    {
        computePosition();

        // Setup style for buttons.
        GUIStyle buttonGroupStyle = new GUIStyle(GUI.skin.button);
        buttonGroupStyle.stretchWidth = true;
        buttonGroupStyle.stretchHeight = true;

        GUILayout.BeginArea(mAreaRect);

        GUILayout.BeginHorizontal(buttonGroupStyle);

        // Turn flash on or off.
        if (GUILayout.Button("Toggle Flash", buttonGroupStyle))
        {
            if (!mFlashEnabled)
            {
                // Turn on flash if it is currently disabled.
                CameraDevice.Instance.SetFlashTorchMode(true);
                mFlashEnabled = true;
            }
            else
            {
                // Turn off flash if it is currently enabled.
                CameraDevice.Instance.SetFlashTorchMode(false);
                mFlashEnabled = false;
            }

            mMenuToShow = MenuMode.MENU_OFF;
            mButtonPressed = true;
        }

        // Triggers auto focus:
        if (GUILayout.Button("Autofocus", buttonGroupStyle))
        {
            if (CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO))
                mFocusMode = CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO;

            mMenuToShow = MenuMode.MENU_OFF;
            mButtonPressed = true;
        }

        // Choose focus mode.
        if (GUILayout.Button("Focus Modes", buttonGroupStyle))
        {
            mMenuToShow = MenuMode.MENU_FOCUS_MODES;
            mButtonPressed = true;
        }
		
        if (GUILayout.Button("Target", buttonGroupStyle))
        {
			/*DataSetLoadBehaviour data = GetComponent<DataSetLoadBehaviour>();
			
			//print("NUM="+data.TrackerList["FlakesBox"].img.GetNumDataSets());
			
			if(data.DataSetToActivate == "Game")
			{	
				DataSetLoadBehaviour.ImageTrackedStruct imageTracked = data.TrackerList["FlakesBox"];
           		imageTracked.img.ActivateDataSet(imageTracked.data);
				data.DataSetToActivate = "FlakesBox";
			}
			else
			{	
				DataSetLoadBehaviour.ImageTrackedStruct imageTracked = data.TrackerList["Game"];
           		imageTracked.img.ActivateDataSet(imageTracked.data);
				data.DataSetToActivate = "Game";
			}*/
        }
		

        GUILayout.EndHorizontal();

        GUILayout.EndArea();
    }
Example #35
0
        public void Pause()
        {
            menuMode = MenuMode.Pause;
            RuinExplorersMain.GameMode = RuinExplorersMain.GameModes.Menu;

            transFrame = 1f;
            level = Level.Main;
            transType = Trans.All;
        }
Example #36
0
 public MainMenu(Game1 sentGame)
 {
     _menuMode = MenuMode.Default;
     menuImages = new List<Texture2D>();
     game = sentGame;
 }
Example #37
0
        public void Update(RuinExplorersMain game)
        {
            keyboardState = Keyboard.GetState();

            frame += RuinExplorersMain.FrameTime / 2f;
            if (frame > 6.28f) frame -= 6.28f;

            if (transFrame < 2f)
            {
                float pFrame = transFrame;
                transFrame += RuinExplorersMain.FrameTime;
                if (transType == Trans.Buttons)
                    transFrame += RuinExplorersMain.FrameTime;
                if (pFrame < 1f && transFrame >= 1f)
                {
                    levelSelect[(int)level] = selectedItem;
                    level = transGoal;
                    selectedItem = levelSelect[(int)level];
                    switch (level)
                    {
                        case Level.NewGame:
                            game.NewGame();
                            break;
                        case Level.ResumeGame:
                            RuinExplorersMain.GameMode = RuinExplorersMain.GameModes.Playing;
                            break;
                        case Level.EndGame:
                            menuMode = MenuMode.Main;
                            level = Level.Main;
                            break;
                        case Level.Quit:
                            game.Quit();
                            break;
                        case Level.HostGame:

                            break;
                        case Level.JoinGame:

                            break;
                        case Level.NewArena:

                            break;
                    }
                }
            }

            for (int i = 0; i < fog.Length; i++)
            {
                fog[i].X -= RuinExplorersMain.FrameTime * (50f + (float)(i % 20 + 2));
                fog[i].Y += RuinExplorersMain.FrameTime * (float)(i % 14 + 5);
                if (fog[i].X < -150f)
                {
                    fog[i].X = RuinExplorersMain.ScreenSize.X +
                        RandomGenerator.GetRandomFloat(150f, 200f);
                    fog[i].Y = RuinExplorersMain.ScreenSize.Y -
                        RandomGenerator.GetRandomFloat(0f, 300f);
                }
            }

            for (int i = 0; i < optionFrames.Length; i++)
            {
                if (selectedItem == i)
                {
                    if (optionFrames[i] < 1f)
                    {
                        optionFrames[i] += RuinExplorersMain.FrameTime * 7f;
                        if (optionFrames[i] > 1f) optionFrames[i] = 1f;
                    }
                }
                else
                {
                    if (optionFrames[i] > 0f)
                    {
                        optionFrames[i] -= RuinExplorersMain.FrameTime * 4f;
                        if (optionFrames[i] < 0f) optionFrames[i] = 0f;
                    }
                }
            }

            PopulateOptions();

            for (int i = 0; i < 4; i++)
            {
                GamePadState gs = GamePad.GetState((PlayerIndex)i);

                if (totalOptions > 0)
                {
                    if ((gs.ThumbSticks.Left.Y > 0.3f &&
                        oldState[i].ThumbSticks.Left.Y <= 0.3f) ||
                        (gs.DPad.Up == ButtonState.Pressed &&
                        oldState[i].DPad.Up == ButtonState.Released) ||
                        oldKeyboardState.IsKeyDown(Keys.Down) && keyboardState.IsKeyUp(Keys.Down))
                    {
                        selectedItem = (selectedItem + (totalOptions - 1)) % totalOptions;
                    }

                    if ((gs.ThumbSticks.Left.Y < -0.3f &&
                        oldState[i].ThumbSticks.Left.Y >= -0.3f) ||
                        (gs.DPad.Down == ButtonState.Pressed &&
                        oldState[i].DPad.Down == ButtonState.Released) ||
                        oldKeyboardState.IsKeyDown(Keys.Up) && keyboardState.IsKeyUp(Keys.Up))
                    {
                        selectedItem = (selectedItem + 1) % totalOptions;
                    }
                }

                if (options[0] == Option.AwaitingConnection)
                    selectedItem = 1;

                bool ok = false;
                if (transFrame > 1.9f)
                {
                    if ((gs.Buttons.A == ButtonState.Pressed &&
                        oldState[i].Buttons.A == ButtonState.Released) ||
                        keyboardState.IsKeyDown(Keys.Enter))
                        ok = true;
                    if ((gs.Buttons.Start == ButtonState.Pressed &&
                        oldState[i].Buttons.Start == ButtonState.Released) ||
                        keyboardState.IsKeyDown(Keys.Enter))
                    {
                        if (menuMode == MenuMode.Main ||
                            menuMode == MenuMode.Dead)
                            ok = true;
                        else
                        {
                            Transition(Level.ResumeGame, true);
                        }
                    }

                    if (ok)
                    {
                        switch (level)
                        {
                            case Level.Main:
                                switch (options[selectedItem])
                                {
                                    case Option.NewGame:
                                        Transition(Level.NewGame, true);
                                        break;
                                    case Option.ResumeGame:
                                        Transition(Level.ResumeGame, true);
                                        break;
                                    case Option.EndGame:
                                        Transition(Level.EndGame, true);
                                        break;
                                    case Option.Continue:

                                        break;
                                    case Option.Multiplayer:

                                        break;
                                    case Option.Options:
                                        Transition(Level.Options);
                                        break;
                                    case Option.Quit:
                                        Transition(Level.Quit, true);
                                        break;
                                }
                                break;
                            case Level.Dead:
                                switch (options[selectedItem])
                                {
                                    case Option.EndGame:
                                        Transition(Level.EndGame, true);
                                        break;
                                    case Option.Quit:
                                        Transition(Level.Quit, true);
                                        break;
                                }
                                break;
                            case Level.Options:
                                //switch (options[selectedItem])
                                //{
                                //    case Option.Back:
                                //        Transition(Level.Main);
                                //        RuinExplorersMain.store.Write(Store.STORE_SETTINGS);
                                //        break;
                                //    case Option.RumbleOn:
                                //        RuinExplorersMain.settings.Rumble = false;
                                //        break;
                                //    case Option.RumbleOff:
                                //        RuinExplorersMain.settings.Rumble = true;
                                //        break;
                                //}
                                break;
                            case Level.Multiplayer:
                                switch (options[selectedItem])
                                {
                                    case Option.Back:
                                        Transition(Level.Main);
                                        break;
                                    case Option.HostGame:
                                        Transition(Level.HostGame);
                                        break;
                                    case Option.JoinGame:
                                        Transition(Level.JoinGame);
                                        break;
                                }
                                break;
                            case Level.HostGame:

                                break;
                            case Level.JoinGame:

                                break;
                        }
                    }
                    else
                    {
                        switch (level)
                        {
                            case Level.JoinGame:

                                break;
                            case Level.HostGame:

                                break;
                        }
                    }
                }
                oldState[i] = gs;
            }
            oldKeyboardState = keyboardState;
        }
Example #38
0
    /// <summary>
    /// There is a lot of code in here, but it's really just controlling the visual effect in the menu, and a little bit of logic.  There are also responders for click events in if blocks.  Easy enough.
    /// </summary>
    public override void DoUpdate(SceneManager context)
    {
        if (mode == MenuMode.Main)
        {
            if (labs.IsClicked)
            {
                hike.Invisible = true;
                mode           = MenuMode.Labs;
                menu.gameObject.SetActive(true);
                hikeMenu.gameObject.SetActive(false);
                hikeTitleAlphaTarget = -1;
                labsTitleAlphaTarget = -1f;
                springMenu.minYaw    = springMenu.maxYaw = -7;
                //Debug.Log("labs");
            }

            if (hike.IsClicked)
            {
                labs.Invisible = true;
                mode           = MenuMode.Hike;
                hikeMenu.gameObject.SetActive(true);
                menu.gameObject.SetActive(false);
                labsTitleAlphaTarget = -1;
                hikeTitleAlphaTarget = -1f;
                springMenu.minYaw    = springMenu.maxYaw = 7;
                //Debug.Log("labs");
            }
        }

        if (mode == MenuMode.Labs || (mode == MenuMode.Main && labs.IsTarget))           //|| (mode == MenuMode.Main && (labs.IsTarget ||  (mode == MenuMode.Main && springMenu.Direction == -1 ) ) )

        //	realTarget = 1;
        {
            if (fadeValue < 0)
            {
                spring = 0.75f;
                //targetFade = 0;
            }
            else
            {
                spring = 0.25f;
                //targetFade = 1;
            }
            targetFade = 1;
        }
        else if (mode == MenuMode.Hike || (mode == MenuMode.Main && hike.IsTarget))           //|| (mode == MenuMode.Main && ( hike.IsTarget || (mode == MenuMode.Main && springMenu.Direction == 1) ) )
        //realTarget = -1;
        {
            if (fadeValue > 0)
            {
                spring = 0.75f;
                //targetFade = 0;
            }
            else
            {
                spring = 0.25f;
                //targetFade = -1;
            }
            targetFade = -1;
        }
        else
        {
            targetFade = 0;
            //realTarget = 0;
        }


        if (mode == MenuMode.Labs)
        {
            if (back.IsClicked)
            {
                hike.Invisible = false;
                mode           = MenuMode.Main;
                //menu.gameObject.SetActive(false);
                springMenu.minYaw    = -7;
                springMenu.maxYaw    = 7;
                labsTitleAlphaTarget = 1;
                hikeTitleAlphaTarget = 1;
                //Debug.Log("labs");
            }
            else if (targeting.IsClicked)
            {
                SceneManager.Instance.StateTransition(SceneManager.Instance.targetScene);
                //Debug.Log("labs");
            }
            else if (motion.IsClicked)
            {
                SceneManager.Instance.StateTransition(SceneManager.Instance.minecartScene);
                //Debug.Log("labs");
            }
            else if (text.IsClicked)
            {
                SceneManager.Instance.StateTransition(SceneManager.Instance.visionScene);
                //Debug.Log("labs");
            }
            else if (relativity.IsClicked)
            {
                SceneManager.Instance.StateTransition(SceneManager.Instance.relativityScene);
                //Debug.Log("labs");
            }
            else if (tracking.IsClicked)
            {
                SceneManager.Instance.StateTransition(SceneManager.Instance.trackingScene);
                //Debug.Log("labs");
            }
        }

        if (mode == MenuMode.Hike)
        {
            if (hikeBack.IsClicked)
            {
                labs.Invisible = false;
                mode           = MenuMode.Main;
                //hikeMenu.gameObject.SetActive(false);
                springMenu.minYaw    = -7;
                springMenu.maxYaw    = 7;
                labsTitleAlphaTarget = 1;
                hikeTitleAlphaTarget = 1;
                //Debug.Log("labs");
            }
            else if (hike1.IsClicked)
            {
                SceneManager.Instance.StateTransition(SceneManager.Instance.redwoodScene, Color.black, 0);
            }
            else if (hike2.IsClicked)
            {
                SceneManager.Instance.StateTransition(SceneManager.Instance.redwoodScene, Color.black, 1);
            }
            else if (hike3.IsClicked)
            {
                SceneManager.Instance.StateTransition(SceneManager.Instance.redwoodScene, Color.black, 2);
            }
            else if (hike4.IsClicked)
            {
                SceneManager.Instance.StateTransition(SceneManager.Instance.redwoodScene, Color.black, 3);
            }
            else if (hike5.IsClicked)
            {
                SceneManager.Instance.StateTransition(SceneManager.Instance.redwoodScene, Color.black, 4);
            }
        }

        //if( Mathf.Abs(fadeValue) < 0.05f ){
        //	targetFade = realTarget;
        //}

        hikeTitleAlpha = Smoothing.SpringSmooth(hikeTitleAlpha, hikeTitleAlphaTarget, ref hikeTitleAlphaSpeed, 0.4f, Time.deltaTime);
        labsTitleAlpha = Smoothing.SpringSmooth(labsTitleAlpha, labsTitleAlphaTarget, ref labsTitleAlphaSpeed, 0.4f, Time.deltaTime);

        Color col = labTitle.color;

        col.a          = labsTitleAlpha;
        labTitle.color = col;


        col             = hikeTitle.color;
        col.a           = hikeTitleAlpha;
        hikeTitle.color = col;


        col   = labIcon.material.color;
        col.a = labsTitleAlpha;
        labIcon.material.color = col;

        col   = hikeIcon.material.color;
        col.a = hikeTitleAlpha;
        hikeIcon.material.color = col;

        if (hikeMenu.gameObject.activeSelf)
        {
            if (mode != MenuMode.Hike && -hikeTitleAlpha < 0)
            {
                hikeMenu.gameObject.SetActive(false);
            }
            else
            {
                for (int i = 0; i < hikeListItems.Length; i++)
                {
                    col   = hikeListItems[i].material.color;
                    col.a = Mathf.Clamp01(-hikeTitleAlpha);
                    hikeListItems[i].material.color = col;
                }
            }
            hike1.PlateAlpha = Mathf.Clamp01(-hikeTitleAlpha);
            hike2.PlateAlpha = Mathf.Clamp01(-hikeTitleAlpha);
            hike3.PlateAlpha = Mathf.Clamp01(-hikeTitleAlpha);
            hike4.PlateAlpha = Mathf.Clamp01(-hikeTitleAlpha);
            hike5.PlateAlpha = Mathf.Clamp01(-hikeTitleAlpha);
        }
        if (menu.gameObject.activeSelf)
        {
            if (mode != MenuMode.Labs && -labsTitleAlpha < 0)
            {
                menu.gameObject.SetActive(false);
            }
            else
            {
                for (int i = 0; i < labsListItems.Length; i++)
                {
                    col   = labsListItems[i].material.color;
                    col.a = Mathf.Clamp01(-labsTitleAlpha);
                    labsListItems[i].material.color = col;
                }
            }

            motion.PlateAlpha     = Mathf.Clamp01(-labsTitleAlpha);
            targeting.PlateAlpha  = Mathf.Clamp01(-labsTitleAlpha);
            tracking.PlateAlpha   = Mathf.Clamp01(-labsTitleAlpha);
            text.PlateAlpha       = Mathf.Clamp01(-labsTitleAlpha);
            relativity.PlateAlpha = Mathf.Clamp01(-labsTitleAlpha);
        }



        if (fadeValue != targetFade)
        {
            fadeValue = Smoothing.SpringSmooth(fadeValue, targetFade, ref fadeSpeed, spring, Time.deltaTime);
            ResetUIColor();

            if (fadeValue > 0)
            {
                for (int i = 0; i < labsRenderers.Length; i++)
                {
                    labsRenderers[i].enabled = true;
                    Color c = labsRenderers[i].material.color;
                    c.a = fadeValue;
                    labsRenderers[i].material.color = c;
                }
                for (int i = 0; i < redwoodsRenderers.Length; i++)
                {
                    if (redwoodsRenderers[i] != null)
                    {
                        redwoodsRenderers[i].enabled = false;
                        //Color c = redwoodsRenderers[i].material.color;
                        //c.a = 0;
                        //redwoodsRenderers[i].material.color = c;
                    }
                }
            }
            else if (fadeValue < 0)
            {
                for (int i = 0; i < labsRenderers.Length; i++)
                {
                    labsRenderers[i].enabled = false;
                    //Color c = labsRenderers[i].material.color;
                    //c.a = 0;
                    //labsRenderers[i].material.color = c;
                }
                for (int i = 0; i < redwoodsRenderers.Length; i++)
                {
                    if (redwoodsRenderers[i] != null)
                    {
                        redwoodsRenderers[i].enabled = true;
                        Color c = redwoodsRenderers[i].material.color;
                        c.a = -fadeValue;
                        redwoodsRenderers[i].material.color = c;
                    }
                }
            }
            else
            {
                for (int i = 0; i < labsRenderers.Length; i++)
                {
                    labsRenderers[i].enabled = false;
                }
                for (int i = 0; i < redwoodsRenderers.Length; i++)
                {
                    if (redwoodsRenderers[i] != null)
                    {
                        redwoodsRenderers[i].enabled = false;
                    }
                }
            }
        }

        //// If the user rotates the screen too far away from the sub-menu, fade back to the splash screen
        if (Mathf.Abs(Mathf.DeltaAngle(OrientationYaw, VRInput.Instance.Yaw)) > 50)
        {
            MainMenu();
            SceneManager.Instance.StateTransition(SceneManager.Instance.splashScene);
        }
        if (Mathf.Abs(Mathf.DeltaAngle(0, VRInput.Instance.Pitch)) > 35)
        {
            MainMenu();
            SceneManager.Instance.StateTransition(SceneManager.Instance.splashScene);
        }
    }
    // Draw menu to let user choose a focus mode.
    private void DrawFocusModes()
    {
        CameraDeviceBehaviour.FocusMode newMode;
        newMode = EnumOptionList(mAutoFocusMode);

        // We set the new value only if the mode has changed.
        if (newMode != mAutoFocusMode)
        {
            this.GetComponent<CameraDeviceBehaviour>().SetAutoFocusMode(newMode);
            mAutoFocusMode = newMode;

            mMenuToShow = MenuMode.MENU_OFF;
            mButtonPressed = true;
        }
    }
Example #40
0
 public void ShowMenu(MenuMode mode)
 {
     GameMenu = new Menu(this, mode);
 }
    // Draw menu to control camera device.
    private void DrawMenu()
    {
        // Setup style for buttons.
        GUIStyle buttonGroupStyle = new GUIStyle(GUI.skin.button);
        buttonGroupStyle.stretchWidth = true;
        buttonGroupStyle.stretchHeight = true;

        GUILayout.BeginArea(mAreaRect);

        GUILayout.BeginHorizontal(buttonGroupStyle);

        // Turn flash on or off.
        if (GUILayout.Button("Toggle Flash", buttonGroupStyle))
        {
            if (!mFlashEnabled)
            {
                // Turn on flash if it is currently disabled.
                this.GetComponent<CameraDeviceBehaviour>().SetFlashTorchMode(true);
                mFlashEnabled = true;
            }
            else
            {
                // Turn off flash if it is currently enabled.
                this.GetComponent<CameraDeviceBehaviour>().SetFlashTorchMode(false);
                mFlashEnabled = false;
            }

            mMenuToShow = MenuMode.MENU_OFF;
            mButtonPressed = true;
        }
        // Turn auto focus on or off.
        if (GUILayout.Button("Autofocus", buttonGroupStyle))
        {
            if (!mAutoFocusEnabled)
            {
                // Turn on flash if it is currently disabled.
                this.GetComponent<CameraDeviceBehaviour>().StartAutoFocus();
                mAutoFocusEnabled = true;
            }
            else
            {
                // Turn off flash if it is currently enabled.
                this.GetComponent<CameraDeviceBehaviour>().StopAutoFocus();
                mAutoFocusEnabled = false;
            }

            mMenuToShow = MenuMode.MENU_OFF;
            mButtonPressed = true;
        }
        // Choose focus mode.
        if (GUILayout.Button("Focus Modes", buttonGroupStyle))
        {
            mMenuToShow = MenuMode.MENU_FOCUS_MODES;
            mButtonPressed = true;
        }

        GUILayout.EndHorizontal();

        GUILayout.EndArea();
    }
        /// <summary>
        /// Update menu/title screen (buttons)
        /// </summary>
        /// <param name="gameTime"></param>
        public void Update(GameTime gameTime)
        {
            this.fadeInOut -= 0.05f;
            if (this.fadeInOut < 0) { this.fadeInOut = 0f; }

            #region Titlescreen
            if (mode == MenuMode.Titlescreen)
            {

                if (startPressed == false)
                {
                    startPressAlpha += startPressAlphaDelta;
                    if (startPressAlpha > 1f || startPressAlpha < 0f) startPressAlphaDelta = -startPressAlphaDelta;

                    //Wait for a player to press start
                    if (deviceOkP1 == false)
                    {
                        for (PlayerIndex index = PlayerIndex.One; index <= PlayerIndex.Four; index++)
                        {
                            if (GamePad.GetState(index).Buttons.Start == ButtonState.Pressed)
                            {
                                //It will become Player 1
                                player1device = new Device(DeviceType.Gamepad, (int)index);
                                deviceOkP1 = true;
                                break;
                            }
                        }
                    }
                    else
                    {
                        if (TGPAContext.Instance.Player1 == null)
                        {
                            if (deviceOkP1)
                            {
                                //Ask for sign in
                                if (Device.DeviceHasProfile(player1device) == false)
                                {
                                    if (Guide.IsVisible == false)
                                    {
                                        signInRequested = true;
                                        Guide.ShowSignIn(1, false);
                                    }
                                    else
                                    {
                                        if (signInRequested)
                                        {
                                            signInRequested = false;
                                            deviceOkP1 = false;
                                            player1device = null;
                                        }
                                    }
                                }

                                else
                                {
                                    TGPAContext.Instance.Player1 = new Player(PlayerIndex.One, player1device);
            #if XBOX
                                    TGPAContext.Instance.Player1.Name = TGPAContext.Instance.Player1.XboxProfile.Gamertag;
            #endif
                                }
                            }
                        }
                        else
                        {
                            //Assign eventually a new controller for P1
                            if (deviceOkP1)
                            {
                                TGPAContext.Instance.Player1.Device = player1device;
                            }

                            startPressed = true;
                        }
                    }
                }
                else
                {
                    if (TGPAContext.Instance.Player1 == null)
                        throw new Exception("No player WTF");

                    if (TGPAContext.Instance.InputManager.PlayerPressButtonBack(TGPAContext.Instance.Player1))
                    {
                        TGPAContext.Instance.CurrentGameState = GameState.Credits;
                    }
                    else
                    {
                        //Buy from title screen
                        if (TGPAContext.Instance.IsTrialMode)
                        {
                            if (TGPAContext.Instance.InputManager.PlayerPressYButton(TGPAContext.Instance.Player1))
                            {
                                if (Guide.IsVisible == false)
                                {
                                    //Player need rights
                                    SignedInGamer xboxProfile = Device.DeviceProfile(TGPAContext.Instance.Player1.Device);

                                    if (xboxProfile.Privileges.AllowPurchaseContent)
                                    {
                                        Guide.ShowMarketplace((PlayerIndex)TGPAContext.Instance.Player1.Device.Index);
                                    }
                                    else
                                    {
                                        Guide.BeginShowMessageBox(LocalizedStrings.GetString("BuyFailTitle"), LocalizedStrings.GetString("BuyFailContent"), new List<string> { "OK" }, 0, MessageBoxIcon.Warning, null, null);
                                    }
                                }
                            }
                        }

                    }

                    KeyboardState keyboard = Keyboard.GetState();

                    //Mouse and menus
                    Rectangle startRect = new Rectangle(
                        StartButton.X, StartButton.Y,
                        StartButton.X + StartButton.Width,
                        StartButton.Y + StartButton.Height);

                    Rectangle optionsRect = new Rectangle(
                         OptionsButton.X, OptionsButton.Y,
                         OptionsButton.X + OptionsButton.Width,
                         OptionsButton.Y + OptionsButton.Height);

                    Rectangle exitRect = new Rectangle(
                                         QuitButton.X, QuitButton.Y,
                         QuitButton.X + QuitButton.Width,
                         QuitButton.Y + QuitButton.Height);

                    //PC Management
                    #region Mouse input
                    if (TGPAContext.Instance.Player1.IsPlayingOnWindows() && TGPAContext.Instance.IsActive)
                    {
                        if (buttonGoDst.Contains(TGPAContext.Instance.MousePoint))
                        {
                            Focus = MenuButtons.Play;

                            if (TGPAContext.Instance.InputManager.PlayerPressButtonConfirm(TGPAContext.Instance.Player1))
                                TGPAContext.Instance.CurrentGameState = GameState.LevelSelectionScreen;

                        }
                        else if (buttonOptionsDst.Contains(TGPAContext.Instance.MousePoint))
                        {
                            Focus = MenuButtons.Options;

                            if (TGPAContext.Instance.InputManager.PlayerPressButtonConfirm(TGPAContext.Instance.Player1))
                            {
                                changeModeAfterAlphaBlending(MenuMode.Options);
                                InitializeOptionsValues(false);
                            }

                        }
                        else if (buttonExitDst.Contains(TGPAContext.Instance.MousePoint))
                        {
                            Focus = MenuButtons.Exit;

                            if ((InputManager.IsClic(previousMouseState, Mouse.GetState())) || (TGPAContext.Instance.InputManager.PlayerPressButtonConfirm(TGPAContext.Instance.Player1)))
                                TGPAContext.Instance.CurrentGameState = GameState.Exit;

                        }
                        else
                        {
                            Focus = MenuButtons.None;
                        }
                    }
                    #endregion

                    switch (focus)
                    {
                        case MenuButtons.Play:

                            if ((TGPAContext.Instance.InputManager.PlayerPressButtonConfirm(TGPAContext.Instance.Player1)))
                                TGPAContext.Instance.CurrentGameState = GameState.LevelSelectionScreen;

                            if (TGPAContext.Instance.InputManager.PlayerPressDown(TGPAContext.Instance.Player1))
                                focus = MenuButtons.Options;

                            if (TGPAContext.Instance.InputManager.PlayerPressUp(TGPAContext.Instance.Player1))
                                focus = MenuButtons.Exit;

                            break;

                        case MenuButtons.Options:

                            if ((TGPAContext.Instance.InputManager.PlayerPressButtonConfirm(TGPAContext.Instance.Player1)))
                            {
                                changeModeAfterAlphaBlending(MenuMode.Options);
                                InitializeOptionsValues(false);
                            }

                            if (TGPAContext.Instance.InputManager.PlayerPressDown(TGPAContext.Instance.Player1))
                                focus = MenuButtons.Exit;

                            if (TGPAContext.Instance.InputManager.PlayerPressUp(TGPAContext.Instance.Player1))
                                focus = MenuButtons.Play;

                            break;

                        case MenuButtons.Exit:

                            if ((TGPAContext.Instance.InputManager.PlayerPressButtonConfirm(TGPAContext.Instance.Player1)))
                                TGPAContext.Instance.CurrentGameState = GameState.Exit;

                            if (TGPAContext.Instance.InputManager.PlayerPressDown(TGPAContext.Instance.Player1))
                                focus = MenuButtons.Play;

                            if (TGPAContext.Instance.InputManager.PlayerPressUp(TGPAContext.Instance.Player1))
                                focus = MenuButtons.Options;

                            break;
            #if XBOX
                    case MenuButtons.None:
                        focus = MenuButtons.Play;
                        break;
            #endif
                    }
                    previousMouseState = Mouse.GetState();
                }

            }
            #endregion
            #region Option screen
            else if (mode == MenuMode.Options)
            {
                this.optionsSection.Update(gameTime);

                //Set focus
                if (TGPAContext.Instance.Player1.IsPlayingOnWindows() == false)
                {
                    #region Pad Management

                    TGPAControl control = null;

                    if (TGPAContext.Instance.InputManager.PlayerPressDown(TGPAContext.Instance.Player1))
                    {
                        if (optionsSection.CurrentLine + 1 < optionsSection.Lines)
                        {
                            control = optionsSection.GetControl(optionsSection.CurrentLine + 1, optionsSection.CurrentColumn);
                        }

                        if (control == null)
                        {
                            control = optionsSection.GetControl(0, optionsSection.CurrentColumn);
                        }

                        if (control != null)
                        {
                            optionsSection.UnsetFocus();
                            optionsSection.SetFocus(control);
                        }
                    }
                    else if (TGPAContext.Instance.InputManager.PlayerPressUp(TGPAContext.Instance.Player1))
                    {
                        if (optionsSection.CurrentLine - 1 < optionsSection.Lines)
                        {
                            control = optionsSection.GetControl(optionsSection.CurrentLine - 1, optionsSection.CurrentColumn);
                        }

                        if (control == null)
                        {
                            control = optionsSection.GetControl(optionsSection.Lines - 1, optionsSection.CurrentColumn);
                        }

                        if (control != null)
                        {
                            optionsSection.UnsetFocus();
                            optionsSection.SetFocus(control);
                        }
                    }
                    #endregion
                }
            #if WINDOWS
                else
                {
                    bool leave = false;

                    for (int i = 0; i < optionsSection.Lines; i++)
                    {
                        for (int j = 0; j < optionsSection.Columns; j++)
                        {
                            TGPAControl control = optionsSection.GetControl(i, j);

                            if (control != null)
                            {
                                if (control.DstRect.Intersects(TGPAContext.Instance.MouseDst))
                                {
                                    if (control != optionsSection.FocusedControl)
                                    {
                                        optionsSection.UnsetFocus();
                                        optionsSection.SetFocus(control);
                                    }
                                    leave = true;
                                    break;
                                }
                            }

                            if (leave) break; //As beautiful as a GOTO
                        }
                        if (leave) break;
                    }
                }
                if (TGPAContext.Instance.MouseDst.Intersects(buttonOptionsBackDst))
                {
                    buttonOptionsBackSrc.Y = 50;
                    bool exit = TGPAContext.Instance.InputManager.PlayerPressButtonConfirm(TGPAContext.Instance.Player1);

                    if (exit)
                    {
                        changeModeAfterAlphaBlending(MenuMode.Titlescreen);
                        TGPAContext.Instance.Saver.Save();
                    }
                }
                else
                {
                    buttonOptionsBackSrc.Y = 0;
                }
            #endif
                if (TGPAContext.Instance.InputManager.PlayerPressButtonBack(TGPAContext.Instance.Player1))
                {
                    changeModeAfterAlphaBlending(MenuMode.Titlescreen);
                    TGPAContext.Instance.Saver.Save();
                }

            }
            #endregion

            #region Animation

            stuffTimer += gameTime.ElapsedGameTime.Milliseconds;

            //Update stuff
            List<FlyingStuff> fsToDelete = new List<FlyingStuff>();
            foreach (FlyingStuff fs in flyingStuff)
            {
                fs.Update(gameTime);

                if (fs.KillMe)
                {
                    fsToDelete.Add(fs);
                }
            }

            foreach (FlyingStuff deadfs in fsToDelete)
            {
                flyingStuff.Remove(deadfs);
            }

            if (stuffTimer - stuffCooldown > 0f)
            {
                flyingStuff.Add(new FlyingStuff());
                stuffTimer = 0f;
                stuffCooldown = RandomMachine.GetRandomFloat(750, 6000);
            }

            for (int i = 0; i < 2; i++)
            {
                Vector2 loc = new Vector2(610, 625);
                loc.X += RandomMachine.GetRandomInt(-35, 35);
                loc.Y += RandomMachine.GetRandomInt(-35, 35);

                loc.Y = (loc.Y / 768) * TGPAContext.Instance.ScreenHeight;

                Smoke s = new Smoke(loc, RandomMachine.GetRandomVector2(30f, 150f, -40f, -120f), 0.03f, 0.04f, 0.14f, 1,
                                1f, RandomMachine.GetRandomInt(0, 4));

                pmanager.AddParticle(s, true);
            }

            //anim
            elapsed += gameTime.ElapsedGameTime.Milliseconds;

            if (elapsed > time)
            {
                anim = (anim == 0) ? 1 : 0;
                foreSrc.Y = anim * 440;
                elapsed = 0;
                time = 200 + (float)(RandomMachine.GetRandomFloat(-100, 300));
            }

            pmanager.UpdateParticles((float)gameTime.ElapsedGameTime.TotalSeconds);

            #endregion

            this.magicAlpha -= magicAlphaDelta;

            if (this.magicAlpha < 0) {
                this.magicAlpha = 0f;
                this.magicAlphaDelta = -magicAlphaDelta;

                //Change mode
                if (nextMode != mode)
                {
                    mode = nextMode;
                }
            }
            if (this.magicAlpha > 1) { this.magicAlpha = 1f; }
        }
Example #43
0
    void Update()
    {
        int choice = 0;

        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            choice = 1;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            choice = 2;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            choice = 3;
        }

        switch (mode)
        {
        case MenuMode.INIT:
            switch (choice)
            {
            case 1:
                mode = MenuMode.PLAY;
                break;

            case 2:
                mode = MenuMode.STORY;
                break;

            case 3:
                mode = MenuMode.OPTIONS;
                break;
            }
            break;

        case MenuMode.PLAY:
            switch (choice)
            {
            case 1:
                enterGame(false);
                break;

            case 2:
                enterGame(true);
                break;

            case 3:
                mode = MenuMode.INIT;
                break;
            }
            break;

        case MenuMode.STORY:
            switch (choice)
            {
            case 1:
                mode = MenuMode.INIT;
                break;
            }
            break;

        case MenuMode.OPTIONS:
            switch (choice)
            {
            case 1:
                mode = MenuMode.INPUTNAME;
                break;

            case 2:
                mode = MenuMode.INIT;
                break;
            }
            break;

        case MenuMode.INPUTNAME:
            switch (choice)
            {
            case 1:
                Master.getInstance().username = "******";
                Master.getInstance().Log("Master object username set to debugUser1");
                mode = MenuMode.INIT;
                break;

            case 2:
                Master.getInstance().username = "******";
                Master.getInstance().Log("Master object username set to debugUser2");
                mode = MenuMode.INIT;
                break;
            }
            break;
        }
    }
Example #44
0
        /// <summary> DVD event message handler</summary>
        void OnDvdEvent()
        {
            IntPtr p1, p2;
            int hr = 0;
            EventCode code;
            do
            {
                hr = mediaEvt.GetEvent( out code, out p1, out p2, 0 );
                if( hr < 0 )
                {
                    break;
                }

                switch( code )
                {
                    case EventCode.DvdCurrentHmsfTime:
                    {
                        byte[] ati = BitConverter.GetBytes( p1.ToInt32() );
                        currnTime.bHours	= ati[0];
                        currnTime.bMinutes	= ati[1];
                        currnTime.bSeconds	= ati[2];
                        currnTime.bFrames	= ati[3];
                        UpdateFrameCaption();
                        break;
                    }
                    case EventCode.DvdChapterStart:
                    {
                        currnChapter = p1.ToInt32();
                        UpdateFrameCaption();
                        break;
                    }
                    case EventCode.DvdTitleChange:
                    {
                        currnTitle = p1.ToInt32();
                        UpdateFrameCaption();
                        break;
                    }
                    case EventCode.DvdDomainChange:
                    {
                        currnDomain = (DvdDomain) p1;
                        UpdateFrameCaption();
                        break;
                    }

                    case EventCode.DvdCmdStart:
                    {
                        break;
                    }
                    case EventCode.DvdCmdEnd:
                    {
                        OnCmdComplete( p1, p2 );
                        break;
                    }

                    case EventCode.DvdStillOn:
                    {
                        if( p1 == IntPtr.Zero )
                        {
                            menuMode = MenuMode.Buttons;
                        }
                        else
                        {
                            menuMode = MenuMode.Still;
                        }
                        break;
                    }
                    case EventCode.DvdStillOff:
                    {
                        if( menuMode == MenuMode.Still )
                        {
                            menuMode = MenuMode.No;
                        }
                        break;
                    }
                    case EventCode.DvdButtonChange:
                    {
                        if( p1.ToInt32() <= 0 )
                        {
                            menuMode = MenuMode.No;
                        }
                        else
                        {
                            menuMode = MenuMode.Buttons;
                        }
                        break;
                    }

                    case EventCode.DvdNoFpPgc:
                    {
                        IDvdCmd icmd;

                        if( dvdCtrl != null )
                        {
                            hr = dvdCtrl.PlayTitle( 1, DvdCmdFlags.None, out icmd );
                        }
                        break;
                    }
                }

                hr = mediaEvt.FreeEventParams( code, p1, p2 );
            }
            while( hr == 0 );
        }
Example #45
0
 public MenuBar()
 {
     InitializeComponent();
     TabStop = false;
     Modo    = MenuMode.Consulta;
 }
 void roomDeletedErrorChoice(bool b)
 {
     mode = MenuMode.MP_INIT;
 }
Example #47
0
        public void Update(double dt, bool clicked, int x, int y)
        {
            if (useTimer)
            {
                timer += dt;
            }

            if (clicked && !useTimer)
            {
                if (currentMode == MenuMode.CLOSED)
                {
                    //newMode = MenuMode.ACTION;
                    //useTimer = true;
                }
                else if (currentMode == MenuMode.MESSAGE)
                {
                }
                else if (currentMode == MenuMode.ACTION)
                {
                    for (int i = 3; i < 11; i++)
                    {
                        if (middle[i].x + middle[i].width - 15 >= x && middle[i].y + middle[i].height - 6 >= y && middle[i].x + 15 <= x && middle[i].y + 6 <= y)
                        {
                            if (g.getCanUse((byte)(i - 3)))
                            {
                                chosenAction = (byte)(i - 2);
                                if (g.getSwitch((byte)(chosenAction - 1)))
                                {
                                    newMode = MenuMode.ACTION_CHOICE;
                                }
                                else
                                {
                                    newMode = MenuMode.MOVEMENT;
                                }
                                useTimer = true;
                            }
                            else
                            {
                                chosenAction = 0;
                            }
                        }
                        else
                        {
                            if (i < 9)
                            {
                                middle[i].texture = normalactions;
                            }
                            else
                            {
                                middle[i].texture = smallactions;
                            }
                        }
                    }
                }
                else if (currentMode == MenuMode.CLOSED_CHOICE)
                {
                    if (y > 430)
                    {
                        byte choose = (byte)(Math.Floor((double)x * 6 / 720));
                        if (choose < 6 && g.getCanUseTeam(choose))
                        {
                            chosenCreature = (byte)(choose + 1);
                            newMode        = MenuMode.MESSAGE;
                            useTimer       = true;
                        }
                    }
                }
                else if (currentMode == MenuMode.ACTION_CHOICE)
                {
                    if (y > 430)
                    {
                        byte choose = (byte)(Math.Floor((double)x * 6 / 720));
                        if (choose < 6 && g.getCanUseTeam(choose))
                        {
                            chosenCreature = (byte)(choose + 1);
                            newMode        = MenuMode.MOVEMENT;
                            useTimer       = true;
                        }
                    }
                    else if (middle[12].x + middle[12].width - 15 >= x && middle[12].y + middle[12].height - 15 >= y && middle[12].x + 15 <= x && middle[12].y + 15 <= y)
                    {
                        newMode  = MenuMode.ACTION;
                        useTimer = true;
                    }
                }
                else if (currentMode == MenuMode.MOVEMENT)
                {
                    if (y > 435 && y < 490)
                    {
                        for (int i = 13; i < 17; i++)
                        {
                            if (middle[i].x + middle[i].width - 2 >= x && middle[i].x + 2 <= x)
                            {
                                middle[i].texture = outershellbuttons;
                                chosenMovement    = (byte)(i - 12);
                                newMode           = MenuMode.MESSAGE;
                                useTimer          = true;
                            }
                            else
                            {
                                middle[i].texture = outershell;
                            }
                        }
                    }
                    else if (middle[12].x + middle[12].width - 15 >= x && middle[12].y + middle[12].height - 15 >= y && middle[12].x + 15 <= x && middle[12].y + 15 <= y)
                    {
                        newMode  = MenuMode.ACTION;
                        useTimer = true;
                    }
                }
            }
            else if (!clicked && !useTimer)
            {
                if (currentMode == MenuMode.MOVEMENT)
                {
                    if (y > 435 && y < 490)
                    {
                        byte u = 0;
                        for (int i = 13; i < 17; i++)
                        {
                            if (middle[i].x + middle[i].width - 2 >= x && middle[i].x + 2 <= x)
                            {
                                middle[17].sourcey = 74 * (i - 12);
                                if (i == 13 && rot == 0)
                                {
                                    rot--;
                                }
                                if (i == 16 && rot == 0)
                                {
                                    rot++;
                                }
                            }
                            else
                            {
                                u++;
                            }
                        }
                        if (u >= 4)
                        {
                            middle[17].sourcey = 0;
                        }
                        u = 0;
                    }
                }
            }
        }
Example #48
0
 private static MenuMode validate(MenuMode mode)
 {
     return (mode < 0) ? 0 : (mode > MenuMode.Custom) ? MenuMode.Custom : mode;
 }
Example #49
0
        public void Draw(SpriteBatch spriteBatch)
        {
            if (useTimer)
            {
                if (newMode == MenuMode.ACTION)
                {
                    if (currentMode == MenuMode.CLOSED)
                    {
                        for (int i = 0; i < 8; i++)
                        {
                            actions[i].element = g.getActionElement((byte)i) - 1;
                            actions[i].type    = g.getActionType((byte)i);
                        }


                        middle[0].Draw(248, 505 - (int)((505 - 368) * Bezier(timer / 0.35)), spriteBatch);
                        middle[1].Draw(248, 475 - (int)((475 - 475) * Bezier(timer / 0.35)), spriteBatch);
                        middle[2].Draw(249, 464 - (int)((464 - 328) * Bezier(timer / 0.35)), spriteBatch);

                        foreach (DiscThing d in discParts)
                        {
                            d.Draw(249, 464 - (int)((464 - 328) * Bezier(timer / 0.35)), spriteBatch);
                        }

                        blend(middle[3], Bezier((timer - 0.2) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[4], Bezier((timer - 0.15) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[5], Bezier((timer - 0.1) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        blend(middle[6], Bezier((timer - 0.2) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[7], Bezier((timer - 0.15) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[8], Bezier((timer - 0.1) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        blend(middle[9], Bezier((timer - 0.05) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[10], Bezier((timer - 0.05) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        middle[3].Draw(80 + 50 - (int)(50 * Bezier((timer - 0.2) / 0.2)), 357, spriteBatch);
                        middle[4].Draw(100 + 50 - (int)(50 * Bezier((timer - 0.15) / 0.2)), 416, spriteBatch);
                        middle[5].Draw(120 + 50 - (int)(50 * Bezier((timer - 0.1) / 0.2)), 475, spriteBatch);

                        middle[6].Draw(464 - 50 + (int)(50 * Bezier((timer - 0.2) / 0.2)), 357, spriteBatch);
                        middle[7].Draw(444 - 50 + (int)(50 * Bezier((timer - 0.15) / 0.2)), 416, spriteBatch);
                        middle[8].Draw(424 - 50 + (int)(50 * Bezier((timer - 0.1) / 0.2)), 475, spriteBatch);

                        middle[9].Draw(50 - (int)(50 * Bezier((timer - 0.05) / 0.2)), 475, spriteBatch);
                        middle[10].Draw(590 - 50 + (int)(50 * Bezier((timer - 0.05) / 0.2)), 475, spriteBatch);
                        if (timer > 1 * 0.2 + 0.2)
                        {
                            timer       = 0;
                            currentMode = MenuMode.ACTION;
                            useTimer    = false;
                        }
                    }
                    else if (currentMode == MenuMode.ACTION_CHOICE)
                    {
                        middle[0].Draw(248, 368, spriteBatch);
                        middle[1].Draw(248, 475, spriteBatch);
                        middle[2].Draw(249, 328, spriteBatch);

                        foreach (DiscThing d in discParts)
                        {
                            d.Draw(249, 328, spriteBatch);
                        }

                        middle[3].Draw(80, 357, spriteBatch);
                        middle[4].Draw(100, 416, spriteBatch);
                        middle[5].Draw(120, 475, spriteBatch);

                        middle[6].Draw(464, 357, spriteBatch);
                        middle[7].Draw(444, 416, spriteBatch);
                        middle[8].Draw(424, 475, spriteBatch);

                        middle[9].Draw(0, 475, spriteBatch);
                        middle[10].Draw(590, 475, spriteBatch);


                        middle[11].Draw(0, 540 - (int)(122 * Bezier(1 - (timer / 0.2))), spriteBatch);
                        blend(middle[12], Bezier(1 - (timer / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        middle[12].Draw(317, 510 - (int)(122 * Bezier(1 - (timer / 0.2))), spriteBatch);
                        if (timer > 1 * 0.2)
                        {
                            timer       = 0;
                            currentMode = MenuMode.ACTION;
                            useTimer    = false;
                        }
                    }
                    else if (currentMode == MenuMode.MOVEMENT)
                    {
                        middle[0].Draw(248, 368, spriteBatch);
                        middle[1].Draw(248, (int)(475 - 80 + 80 * Bezier(timer / 0.2)), spriteBatch);
                        middle[2].Draw(249, 328, spriteBatch);

                        middle[2].sourcey = 0;

                        foreach (DiscThing d in discParts)
                        {
                            d.sourcey = 0;
                            d.Draw(249, 328, spriteBatch);
                        }

                        blend(middle[3], Bezier((timer - 0.2) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[4], Bezier((timer - 0.15) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[5], Bezier((timer - 0.1) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        blend(middle[6], Bezier((timer - 0.2) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[7], Bezier((timer - 0.15) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[8], Bezier((timer - 0.1) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        blend(middle[9], Bezier((timer - 0.05) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[10], Bezier((timer - 0.05) / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        middle[3].Draw(80 + 50 - (int)(50 * Bezier((timer - 0.2) / 0.2)), 357, spriteBatch);
                        middle[4].Draw(100 + 50 - (int)(50 * Bezier((timer - 0.15) / 0.2)), 416, spriteBatch);
                        middle[5].Draw(120 + 50 - (int)(50 * Bezier((timer - 0.1) / 0.2)), 475, spriteBatch);

                        middle[6].Draw(464 - 50 + (int)(50 * Bezier((timer - 0.2) / 0.2)), 357, spriteBatch);
                        middle[7].Draw(444 - 50 + (int)(50 * Bezier((timer - 0.15) / 0.2)), 416, spriteBatch);
                        middle[8].Draw(424 - 50 + (int)(50 * Bezier((timer - 0.1) / 0.2)), 475, spriteBatch);

                        middle[9].Draw(50 - (int)(50 * Bezier((timer - 0.05) / 0.2)), 475, spriteBatch);
                        middle[10].Draw(590 - 50 + (int)(50 * Bezier((timer - 0.05) / 0.2)), 475, spriteBatch);

                        blend(middle[12], Bezier(timer / 0.3), new Color(255, 255, 255, 255), new Color(0, 0, 0, 0));
                        middle[12].Draw(317, 510 - 18 + (int)(18 * Bezier(timer / 0.3)), spriteBatch);

                        if (timer > 1 * 0.2 + 0.2)
                        {
                            timer       = 0;
                            currentMode = MenuMode.ACTION;
                            useTimer    = false;
                        }
                    }
                }
                else if (newMode == MenuMode.ACTION_CHOICE)
                {
                    middle[0].Draw(248, 368, spriteBatch);
                    middle[1].Draw(248, 475, spriteBatch);
                    middle[2].Draw(249, 328, spriteBatch);

                    foreach (DiscThing d in discParts)
                    {
                        d.Draw(249, 328, spriteBatch);
                    }

                    middle[3].Draw(80, 357, spriteBatch);
                    middle[4].Draw(100, 416, spriteBatch);
                    middle[5].Draw(120, 475, spriteBatch);

                    middle[6].Draw(464, 357, spriteBatch);
                    middle[7].Draw(444, 416, spriteBatch);
                    middle[8].Draw(424, 475, spriteBatch);

                    middle[9].Draw(0, 475, spriteBatch);
                    middle[10].Draw(590, 475, spriteBatch);


                    middle[11].Draw(0, 540 - (int)(122 * Bezier(timer / 0.2)), spriteBatch);
                    blend(middle[12], Bezier(timer / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                    middle[12].Draw(317, 510 - (int)(122 * Bezier(timer / 0.2)), spriteBatch);
                    if (timer > 1 * 0.2)
                    {
                        timer       = 0;
                        currentMode = MenuMode.ACTION_CHOICE;
                        useTimer    = false;
                    }
                }
                else if (newMode == MenuMode.CLOSED_CHOICE)
                {
                    middle[0].Draw(248, 505, spriteBatch);
                    middle[1].Draw(248, 475, spriteBatch);
                    middle[2].Draw(249, 464, spriteBatch);

                    foreach (DiscThing d in discParts)
                    {
                        d.Draw(249, 464, spriteBatch);
                    }

                    middle[11].Draw(0, 540 - (int)(122 * Bezier(timer / 0.2)), spriteBatch);
                    blend(middle[12], Bezier(timer / 0.2), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                    middle[12].Draw(317, 510 - (int)(122 * Bezier(timer / 0.2)), spriteBatch);
                    if (timer > 1 * 0.2)
                    {
                        timer       = 0;
                        currentMode = MenuMode.CLOSED_CHOICE;
                        useTimer    = false;
                    }
                }
                else if (newMode == MenuMode.MOVEMENT)
                {
                    if (currentMode == MenuMode.ACTION)
                    {
                        middle[0].Draw(248, 368, spriteBatch);
                        middle[1].Draw(248, (int)(475 - 80 * Bezier(timer / 0.2)), spriteBatch);
                        middle[2].Draw(249, 328, spriteBatch);

                        foreach (DiscThing d in discParts)
                        {
                            d.Draw(249, 328, spriteBatch);
                        }

                        blend(middle[3], Bezier(1 - ((timer - 0.2) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[4], Bezier(1 - ((timer - 0.15) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[5], Bezier(1 - ((timer - 0.1) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        blend(middle[6], Bezier(1 - ((timer - 0.2) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[7], Bezier(1 - ((timer - 0.15) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[8], Bezier(1 - ((timer - 0.1) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        blend(middle[9], Bezier(1 - ((timer - 0.05) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[10], Bezier(1 - ((timer - 0.05) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        middle[3].Draw(80 + 50 - (int)(50 * Bezier(1 - ((timer - 0.2) / 0.2))), 357, spriteBatch);
                        middle[4].Draw(100 + 50 - (int)(50 * Bezier(1 - ((timer - 0.15) / 0.2))), 416, spriteBatch);
                        middle[5].Draw(120 + 50 - (int)(50 * Bezier(1 - ((timer - 0.1) / 0.2))), 475, spriteBatch);

                        middle[6].Draw(464 - 50 + (int)(50 * Bezier(1 - ((timer - 0.2) / 0.2))), 357, spriteBatch);
                        middle[7].Draw(444 - 50 + (int)(50 * Bezier(1 - ((timer - 0.15) / 0.2))), 416, spriteBatch);
                        middle[8].Draw(424 - 50 + (int)(50 * Bezier(1 - ((timer - 0.1) / 0.2))), 475, spriteBatch);

                        middle[9].Draw(50 - (int)(50 * Bezier(1 - ((timer - 0.05) / 0.2))), 475, spriteBatch);
                        middle[10].Draw(590 - 50 + (int)(50 * Bezier(1 - ((timer - 0.05) / 0.2))), 475, spriteBatch);

                        blend(middle[12], Bezier(timer / 0.3), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        middle[12].Draw(317, 510 - (int)(18 * Bezier(timer / 0.3)), spriteBatch);

                        if (timer > 1 * 0.2 + 0.2)
                        {
                            timer       = 0;
                            currentMode = MenuMode.MOVEMENT;
                            useTimer    = false;
                        }
                    }
                    else if (currentMode == MenuMode.ACTION_CHOICE)
                    {
                        middle[0].Draw(248, 368, spriteBatch);
                        middle[1].Draw(248, (int)(475 - 80 * Bezier(timer / 0.2)), spriteBatch);
                        middle[2].Draw(249, 328, spriteBatch);

                        foreach (DiscThing d in discParts)
                        {
                            d.Draw(249, 328, spriteBatch);
                        }

                        blend(middle[3], Bezier(1 - ((timer - 0.2) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[4], Bezier(1 - ((timer - 0.15) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[5], Bezier(1 - ((timer - 0.1) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        blend(middle[6], Bezier(1 - ((timer - 0.2) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[7], Bezier(1 - ((timer - 0.15) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[8], Bezier(1 - ((timer - 0.1) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        blend(middle[9], Bezier(1 - ((timer - 0.05) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        blend(middle[10], Bezier(1 - ((timer - 0.05) / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));

                        middle[3].Draw(80 + 50 - (int)(50 * Bezier(1 - ((timer - 0.2) / 0.2))), 357, spriteBatch);
                        middle[4].Draw(100 + 50 - (int)(50 * Bezier(1 - ((timer - 0.15) / 0.2))), 416, spriteBatch);
                        middle[5].Draw(120 + 50 - (int)(50 * Bezier(1 - ((timer - 0.1) / 0.2))), 475, spriteBatch);

                        middle[6].Draw(464 - 50 + (int)(50 * Bezier(1 - ((timer - 0.2) / 0.2))), 357, spriteBatch);
                        middle[7].Draw(444 - 50 + (int)(50 * Bezier(1 - ((timer - 0.15) / 0.2))), 416, spriteBatch);
                        middle[8].Draw(424 - 50 + (int)(50 * Bezier(1 - ((timer - 0.1) / 0.2))), 475, spriteBatch);

                        middle[9].Draw(50 - (int)(50 * Bezier(1 - ((timer - 0.05) / 0.2))), 475, spriteBatch);
                        middle[10].Draw(590 - 50 + (int)(50 * Bezier(1 - ((timer - 0.05) / 0.2))), 475, spriteBatch);


                        middle[11].Draw(0, 540 - (int)(122 * Bezier(1 - (timer / 0.2))), spriteBatch);
                        middle[12].Draw(317, 492 - (int)(122 * Bezier(1 - (timer / 0.2))), spriteBatch);
                        if (timer > 1 * 0.2 + 0.2)
                        {
                            timer       = 0;
                            currentMode = MenuMode.MOVEMENT;
                            useTimer    = false;
                        }
                    }
                }
                else if (newMode == MenuMode.MESSAGE)
                {
                    if (currentMode == MenuMode.MOVEMENT)
                    {
                        middle[0].Draw(248, 368 + (int)(137 * Bezier(timer / 0.2)), spriteBatch);
                        middle[1].Draw(248, 475 - 80 + (int)(80 * Bezier(timer / 0.2)), spriteBatch);
                        middle[2].Draw(249, 328 + (int)(136 * Bezier(timer / 0.2)), spriteBatch);

                        middle[2].sourcey = 0;

                        foreach (DiscThing d in discParts)
                        {
                            d.sourcey = 0;
                            d.Draw(249, 328 + (int)(136 * Bezier(timer / 0.2)), spriteBatch);
                        }

                        if (timer > 1 * 0.2)
                        {
                            timer       = 0;
                            currentMode = MenuMode.MESSAGE;
                            useTimer    = false;
                        }
                    }
                    else if (currentMode == MenuMode.CLOSED_CHOICE)
                    {
                        middle[0].Draw(248, 505, spriteBatch);
                        middle[1].Draw(248, 475, spriteBatch);
                        middle[2].Draw(249, 464, spriteBatch);

                        foreach (DiscThing d in discParts)
                        {
                            d.Draw(249, 464, spriteBatch);
                        }

                        middle[11].Draw(0, 540 - (int)(122 * Bezier(1 - (timer / 0.2))), spriteBatch);
                        blend(middle[12], Bezier(1 - (timer / 0.2)), new Color(0, 0, 0, 0), new Color(255, 255, 255, 255));
                        middle[12].Draw(317, 510 - (int)(122 * Bezier(1 - (timer / 0.2))), spriteBatch);
                        if (timer > 1 * 0.2)
                        {
                            timer       = 0;
                            currentMode = MenuMode.MESSAGE;
                            useTimer    = false;
                        }
                    }
                }
            }
            else
            {
                if (currentMode == MenuMode.CLOSED)
                {
                    middle[0].Draw(248, 505, spriteBatch);
                    middle[1].Draw(248, 475, spriteBatch);
                    middle[2].sourcey = 74 * spriteRot;
                    middle[2].Draw(249, 464, spriteBatch);

                    foreach (DiscThing d in discParts)
                    {
                        d.sourcey = 74 * spriteRot;
                        d.Draw(249, 464, spriteBatch);
                    }
                }
                else if (currentMode == MenuMode.MESSAGE)
                {
                    middle[0].Draw(248, 505, spriteBatch);
                    middle[1].Draw(248, 475, spriteBatch);
                    middle[2].Draw(249, 464, spriteBatch);

                    foreach (DiscThing d in discParts)
                    {
                        d.Draw(249, 464, spriteBatch);
                    }

                    g.chosen    = true;
                    currentMode = MenuMode.CLOSED;
                }
                else if (currentMode == MenuMode.ACTION)
                {
                    for (int i = 3; i < 11; i++)
                    {
                        middle[i].color = new Color(255, 255, 255, 255);
                    }

                    for (int i = 3; i < 9; i++)
                    {
                        if (!g.getCanUse((byte)(i - 3)))
                        {
                            middle[i].texture = unusableactions;
                        }
                        else
                        {
                            middle[i].texture = normalactions;
                        }
                    }
                    for (int i = 0; i < 11; i++)
                    {
                        middle[i].Draw(spriteBatch);
                    }

                    foreach (DiscThing d in discParts)
                    {
                        d.Draw(spriteBatch);
                    }

                    spriteBatch.DrawString(g.font, g.getAction(0), new Vector2(100, 367), Color.Fuchsia);
                    spriteBatch.DrawString(g.font, g.getAction(1), new Vector2(120, 426), Color.Fuchsia);
                    spriteBatch.DrawString(g.font, g.getAction(2), new Vector2(140, 485), Color.Fuchsia);
                    spriteBatch.DrawString(g.font, g.getAction(3), new Vector2(504, 367), Color.Fuchsia);
                    spriteBatch.DrawString(g.font, g.getAction(4), new Vector2(484, 426), Color.Fuchsia);
                    spriteBatch.DrawString(g.font, g.getAction(5), new Vector2(464, 485), Color.Fuchsia);

                    spriteBatch.DrawString(g.font, "Attack", new Vector2(30, 485), Color.Fuchsia);
                    spriteBatch.DrawString(g.font, "Switch", new Vector2(624, 485), Color.Fuchsia);

                    spriteBatch.DrawString(g.font, g.getCanUseAction(0), new Vector2(203, 381), Color.Blue);
                    spriteBatch.DrawString(g.font, g.getCanUseAction(1), new Vector2(223, 440), Color.Blue);
                    spriteBatch.DrawString(g.font, g.getCanUseAction(2), new Vector2(243, 499), Color.Blue);
                    spriteBatch.DrawString(g.font, g.getCanUseAction(3), new Vector2(502, 381), Color.Blue);
                    spriteBatch.DrawString(g.font, g.getCanUseAction(4), new Vector2(482, 440), Color.Blue);
                    spriteBatch.DrawString(g.font, g.getCanUseAction(5), new Vector2(462, 499), Color.Blue);
                }
                else if (currentMode == MenuMode.ACTION_CHOICE)
                {
                    for (int i = 0; i < 13; i++)
                    {
                        middle[i].Draw(spriteBatch);
                    }

                    foreach (DiscThing d in discParts)
                    {
                        d.Draw(spriteBatch);
                    }

                    for (int i = 18; i < 24; i++)
                    {
                        if (!g.getCanUseTeam((byte)(i - 18)))
                        {
                            middle[i].Draw(120 * (i - 18), 418, spriteBatch);
                        }
                    }

                    spriteBatch.DrawString(g.font, g.getTeam(0), new Vector2(10, 500), Color.Black);
                    spriteBatch.DrawString(g.font, g.getTeam(1), new Vector2(130, 500), Color.Black);
                    spriteBatch.DrawString(g.font, g.getTeam(2), new Vector2(250, 500), Color.Black);
                    spriteBatch.DrawString(g.font, g.getTeam(3), new Vector2(370, 500), Color.Black);
                    spriteBatch.DrawString(g.font, g.getTeam(4), new Vector2(490, 500), Color.Black);
                    spriteBatch.DrawString(g.font, g.getTeam(5), new Vector2(610, 500), Color.Black);
                }
                else if (currentMode == MenuMode.CLOSED_CHOICE)
                {
                    middle[0].Draw(248, 505, spriteBatch);
                    middle[1].Draw(248, 475, spriteBatch);
                    middle[2].Draw(249, 464, spriteBatch);

                    foreach (DiscThing d in discParts)
                    {
                        d.Draw(249, 464, spriteBatch);
                    }

                    middle[11].Draw(spriteBatch);
                    middle[12].Draw(spriteBatch);

                    for (int i = 18; i < 24; i++)
                    {
                        if (!g.getCanUseTeam((byte)(i - 18)))
                        {
                            middle[i].Draw(120 * (i - 18), 418, spriteBatch);
                        }
                    }

                    spriteBatch.DrawString(g.font, g.getTeam(0), new Vector2(10, 500), Color.Black);
                    spriteBatch.DrawString(g.font, g.getTeam(1), new Vector2(130, 500), Color.Black);
                    spriteBatch.DrawString(g.font, g.getTeam(2), new Vector2(250, 500), Color.Black);
                    spriteBatch.DrawString(g.font, g.getTeam(3), new Vector2(370, 500), Color.Black);
                    spriteBatch.DrawString(g.font, g.getTeam(4), new Vector2(490, 500), Color.Black);
                    spriteBatch.DrawString(g.font, g.getTeam(5), new Vector2(610, 500), Color.Black);
                }
                else if (currentMode == MenuMode.MOVEMENT)
                {
                    for (int i = 0; i < 2; i++)
                    {
                        middle[i].Draw(spriteBatch);
                    }
                    middle[2].sourcey = 74 * spriteRot;
                    middle[2].Draw(spriteBatch);

                    foreach (DiscThing d in discParts)
                    {
                        d.sourcey = 74 * spriteRot;
                        d.Draw(spriteBatch);
                    }

                    middle[13].Draw(248, 475 - 80, spriteBatch);
                    middle[14].Draw(248 + 47, 475 - 80, spriteBatch);
                    middle[15].Draw(248 + 111, 475 - 80, spriteBatch);
                    middle[16].Draw(248 + 174, 475 - 80, spriteBatch);

                    middle[17].Draw(249, 328, spriteBatch);

                    middle[12].Draw(spriteBatch);
                }
            }
        }
 private void SetBuildMode()
 {
     MenuMode.SetMode(4);
 }
Example #51
0
        public Menu(ContentManager Content)
        {
            currentMode = MenuMode.CLOSED;

            timer             = 0;
            rotateTimer       = 0;
            outershell        = Content.Load <Texture2D>("outershell");
            outershellbuttons = Content.Load <Texture2D>("outershellbuttons");
            shell             = Content.Load <Texture2D>("shell");
            normalactions     = Content.Load <Texture2D>("actions");
            smallactions      = Content.Load <Texture2D>("smallactions");
            unusableactions   = Content.Load <Texture2D>("noactions");
            disc = Content.Load <Texture2D>("disc");

            arrows = Content.Load <Texture2D>("arrows");
            cross  = Content.Load <Texture2D>("cross");

            Texture2D chooser  = Content.Load <Texture2D>("chooser");
            Texture2D pointers = Content.Load <Texture2D>("pointers");

            discTextures = new Texture2D[] {
                Content.Load <Texture2D>("discparts/disc0"),
                Content.Load <Texture2D>("discparts/disc1"),
                Content.Load <Texture2D>("discparts/disc2"),
                Content.Load <Texture2D>("discparts/disc3"),
                Content.Load <Texture2D>("discparts/disc4"),
                Content.Load <Texture2D>("discparts/disc5"),
                Content.Load <Texture2D>("discparts/disc6"),
                Content.Load <Texture2D>("discparts/disc7"),
            };

            discParts = new DiscThing[] {
                new DiscThing(discTextures[0], 0, 0, 222, 74),
                new DiscThing(discTextures[1], 0, 0, 222, 74),
                new DiscThing(discTextures[2], 0, 0, 222, 74),
                new DiscThing(discTextures[3], 0, 0, 222, 74),
                new DiscThing(discTextures[4], 0, 0, 222, 74),
                new DiscThing(discTextures[5], 0, 0, 222, 74),
                new DiscThing(discTextures[6], 0, 0, 222, 74),
                new DiscThing(discTextures[7], 0, 0, 222, 74),
            };

            middle = new Thing[] {
                new Thing(shell, 0, 0, 224, 192),
                new Thing(outershell, 0, 0, 224, 224),
                new Thing(disc, 0, 0, 222, 74),

                ////
                new ActionThing(normalactions, 0, 192, 180, 64, true),
                new ActionThing(normalactions, 0, 192, 180, 64, true),
                new ActionThing(normalactions, 0, 192, 180, 64, true),

                new ActionThing(normalactions, 0, 128, 180, 64, false),
                new ActionThing(normalactions, 0, 128, 180, 64, false),
                new ActionThing(normalactions, 0, 128, 180, 64, false),

                new ActionThing(smallactions, 0, 64, 140, 64, true),
                new ActionThing(smallactions, 0, 0, 140, 64, false),
                ////

                new Thing(chooser, 0, 0, 720, 122),
                new Thing(pointers, 64, 0, 86, 50),

                new Thing(outershell, 0, 0, 49, 224),
                new Thing(outershell, 47, 0, 66, 224),
                new Thing(outershell, 111, 0, 66, 224),
                new Thing(outershell, 174, 0, 49, 224),

                new Thing(arrows, 0, 0, 222, 74),
                new Thing(cross, 0, 0, 122, 122),
                new Thing(cross, 0, 0, 122, 122),
                new Thing(cross, 0, 0, 122, 122),
                new Thing(cross, 0, 0, 122, 122),
                new Thing(cross, 0, 0, 122, 122),
                new Thing(cross, 0, 0, 122, 122),
            };

            actions = new ActionThing[] {
                new ActionThing(normalactions, 0, 192, 180, 64, true),
                new ActionThing(normalactions, 0, 192, 180, 64, true),
                new ActionThing(normalactions, 0, 192, 180, 64, true),

                new ActionThing(normalactions, 0, 128, 180, 64, false),
                new ActionThing(normalactions, 0, 128, 180, 64, false),
                new ActionThing(normalactions, 0, 128, 180, 64, false),

                new ActionThing(smallactions, 0, 64, 130, 64, true),
                new ActionThing(smallactions, 0, 0, 130, 64, false),
            };

            for (int i = 3; i < 11; i++)
            {
                middle[i]       = actions[i - 3];
                middle[i].color = new Color(0, 0, 0, 0);
            }
        }
Example #52
0
    }                             // 0x00D59C90-0x00D59D60

    public void Init(IPokemonStatus pokemonStatus, MenuMode mode)
    {
    }                                                                    // 0x00D58ED0-0x00D59BA0
Example #53
0
 public void Pause()
 {
     MenuMode = MenuMode.Pause;
     Game1.GameMode = GameModes.Menu;
     TransFrame = 1f;
     Level = Level.Main;
     TransType = Trans.All;
 }
Example #54
0
 protected void MenuChangeDelay(MenuMode newMode)
 {
     InputDelegateController.instance.TriggerMenuChange(newMode);
 }
Example #55
0
        public void Update(Game1 game)
        {
            _frame += Game1.FrameTime / 2f;
            if (_frame > 6.28f)
                _frame -= 6.28f;

            if (TransFrame < 2f)
            {
                var pFrame = TransFrame;
                TransFrame += Game1.FrameTime;

                if (TransType == Trans.Buttons)
                    TransFrame += Game1.FrameTime;

                if (pFrame < 1f && TransFrame >= 1f)
                {
                    _levelSel[(int)Level] = SelItem;
                    Level = TransGoal;
                    SelItem = _levelSel[(int)Level];

                    switch (Level)
                    {
                        case Level.NewGame:
                            game.NewGame();
                            break;
                        case Level.ResumeGame:
                            Game1.GameMode = GameModes.Playing;
                            break;
                        case Level.EndGame:
                            MenuMode = MenuMode.Main;
                            Level = Level.Main;
                            break;
                        case Level.Quit:
                            game.Quit();
                            break;
                    }
                }
            }

            for (var i = 0; i < _fog.Length; i++)
            {
                _fog[i].X -= Game1.FrameTime * (50f + (i % 20 + 2));
                _fog[i].Y += Game1.FrameTime * (i % 14 + 5);

                if (_fog[i].X < -150f)
                {
                    _fog[i].X = Game1.ScreenSize.X + Rand.GetRandomFloat(150f, 200f);
                    _fog[i].Y = Game1.ScreenSize.Y - Rand.GetRandomFloat(0f, 300f);
                }
            }

            for (var i = 0; i < _optionFrame.Length; i++)
            {
                if (SelItem == i)
                {
                    if (_optionFrame[i] < 1f)
                    {
                        _optionFrame[i] += Game1.FrameTime * 7f;
                        if (_optionFrame[i] > 1f)
                            _optionFrame[i] = 1f;
                    }
                }
                else
                {
                    if (_optionFrame[i] > 0f)
                    {
                        _optionFrame[i] -= Game1.FrameTime * 4f;
                        if (_optionFrame[i] < 0f)
                            _optionFrame[i] = 0f;
                    }
                }
            }

            PopulateOptions();

            if (_totalOptions > 0)
            {
                if (ControlInput.KeyUpPressed)
                {
                    SelItem = (SelItem + (_totalOptions - 1)) % _totalOptions;
                }
                else if (ControlInput.KeyDownPressed)
                {
                    SelItem = (SelItem + 1) % _totalOptions;
                }
            }

            var ok = false;
            if (TransFrame > 1.9f)
            {
                if (ControlInput.KeyAttackPressed)
                    ok = true;

                if (ControlInput.KeyStartPressed)
                {
                    if (MenuMode == MenuMode.Main || MenuMode == MenuMode.Dead)
                        ok = true;
                    else
                        Transition(Level.ResumeGame, true);
                }

                if (ok)
                {
                    switch (Level)
                    {
                        case Level.Main:
                            switch (_option[SelItem])
                            {
                                case Option.NewGame:
                                    Transition(Level.NewGame, true);
                                    break;
                                case Option.ResumeGame:
                                    Transition(Level.ResumeGame, true);
                                    break;
                                case Option.EndGame:
                                    Transition(Level.EndGame, true);
                                    break;
                                case Option.Continue:
                                    break;
                                case Option.Options:
                                    Transition(Level.Options);
                                    break;
                                case Option.Quit:
                                    Transition(Level.Quit, true);
                                    break;
                            }
                            break;

                        case Level.Dead:
                            switch (_option[SelItem])
                            {
                                case Option.EndGame:
                                    Transition(Level.EndGame, true);
                                    break;
                                case Option.Quit:
                                    Transition(Level.Quit, true);
                                    break;
                            }
                            break;

                        case Level.Options:
                            switch (_option[SelItem])
                            {
                                case Option.Back:
                                    Transition(Level.Main);
                                    break;
                            }
                            break;
                    }
                }
            }
        }
Example #56
0
 public void DeactivateSpecificMenu(MenuMode mode)
 {
     UIElementManager.Instance.ActivateOrDeactivateMenu(mode);
 }
Example #57
0
 public void ShowOptions()
 {
     currentMode = MenuMode.Options;
     SwitchMenu(ref options);
 }
Example #58
0
    // Draw menu to control camera device.
    private void DrawMenu()
    {
        computePosition();

        // Setup style for buttons.
        GUIStyle buttonGroupStyle = new GUIStyle(GUI.skin.button);
        buttonGroupStyle.stretchWidth = true;
        buttonGroupStyle.stretchHeight = true;

        GUILayout.BeginArea(mAreaRect);

        GUILayout.BeginHorizontal(buttonGroupStyle);

        // Turn flash on or off.
        if (GUILayout.Button("Toggle Flash", buttonGroupStyle))
        {
            if (!mFlashEnabled)
            {
                // Turn on flash if it is currently disabled.
                CameraDevice.Instance.SetFlashTorchMode(true);
                mFlashEnabled = true;
            }
            else
            {
                // Turn off flash if it is currently enabled.
                CameraDevice.Instance.SetFlashTorchMode(false);
                mFlashEnabled = false;
            }

            mMenuToShow = MenuMode.MENU_OFF;
            mButtonPressed = true;
        }

        // Triggers auto focus:
        if (GUILayout.Button("Autofocus", buttonGroupStyle))
        {
            if (CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO))
                mFocusMode = CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO;

            mMenuToShow = MenuMode.MENU_OFF;
            mButtonPressed = true;
        }

        // Choose focus mode.
        if (GUILayout.Button("Focus Modes", buttonGroupStyle))
        {
            mMenuToShow = MenuMode.MENU_FOCUS_MODES;
            mButtonPressed = true;
        }

        GUILayout.EndHorizontal();

        GUILayout.EndArea();
    }
Example #59
0
    public void ActivateOrDeactivateMenu(MenuMode mode)
    {
        bool isactive = false;

        switch (mode)
        {
        case MenuMode.BuildMode:
            isactive = BuildCanvas.activeSelf;
            BuildCanvas.SetActive(!isactive);

            if (!BuildCanvas.activeSelf)
            {
                EditMenuCanvas.SetActive(false);
            }

            if (ActionsCanvas != null)
            {
                ActionsCanvas.SetActive(false);
            }
            if (ActionsOptionsMenuCanvas != null)
            {
                ActionsOptionsMenuCanvas.SetActive(false);
            }
            if (StorageCanvas != null)
            {
                StorageCanvas.SetActive(false);
            }

            break;

        case MenuMode.ActionsMode:
            isactive = ActionsCanvas.activeSelf;
            ActionsCanvas.SetActive(!isactive);

            if (!ActionsCanvas.activeSelf)
            {
                ActionsOptionsMenuCanvas.SetActive(false);
            }

            if (BuildCanvas != null)
            {
                BuildCanvas.SetActive(false);
            }
            if (EditMenuCanvas != null)
            {
                EditMenuCanvas.SetActive(false);
            }
            if (StorageCanvas != null)
            {
                StorageCanvas.SetActive(false);
            }
            break;

        case MenuMode.StorageMode:
            isactive = StorageCanvas.activeSelf;
            if (StorageCanvas != null)
            {
                StorageCanvas.SetActive(!isactive);
            }
            if (BuildCanvas != null)
            {
                BuildCanvas.SetActive(false);
            }
            if (EditMenuCanvas != null)
            {
                EditMenuCanvas.SetActive(false);
            }
            if (ActionsCanvas != null)
            {
                ActionsCanvas.SetActive(false);
            }
            if (ActionsOptionsMenuCanvas != null)
            {
                ActionsOptionsMenuCanvas.SetActive(false);
            }
            break;

        default:
            break;
        }

        if (!isactive)
        {
            currentMode = mode;
        }
        else
        {
            currentMode = MenuMode.None;
        }
    }