Esempio n. 1
0
 /// <summary>
 /// A function to get the singleton instance of the class, or create it if id doesnt
 /// exist.
 /// </summary>
 /// <returns>SelectionScreen</returns>
 public static SelectionScreen SelectionScreenInstance()
 {
     if (selectionScreen == null)
     {
         selectionScreen = new SelectionScreen();
     }
     return(selectionScreen);
 }
Esempio n. 2
0
 // Use this for initialization
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     y = 0;
     x = 0;
 }
Esempio n. 3
0
        private static void SelectionScreen()
        {
            // clear current childrens
            Global.CurrentScreen.Children.Clear();

            _logoConsole          = new LogoConsole(110, 6);
            _logoConsole.Position = new Point(2, 1);

            _selectionScreen          = new SelectionScreen(_controller, 110, 25);
            _selectionScreen.Position = new Point(2, 9);

            // Set our new console as the thing to render and process
            Global.CurrentScreen.Children.Add(_logoConsole);
            Global.CurrentScreen.Children.Add(_selectionScreen);
        }
Esempio n. 4
0
        private static void Update(GameTime time)
        {
            // As an example, we'll use the F5 key to make the game full screen
            if (Global.KeyboardState.IsKeyReleased(Keys.F5))
            {
                Settings.ToggleFullScreen();
            }
            else if (Global.KeyboardState.IsKeyReleased(Keys.Escape))
            {
                Game.Instance.Exit();
            }

            //return;

            // Called each logic update.
            switch (_state)
            {
            case SadGuiState.Start:
                _state = LoadBlocksAsync();
                return;

            case SadGuiState.Action:
                return;

            case SadGuiState.Login:
                _state = !_controller.IsWalletCreated ? CreateWallet() : Unlock();
                return;

            case SadGuiState.Mnemoic:
                _state = ShowMnemonic();
                break;

            case SadGuiState.Selection:
                if (_selectionScreen == null)
                {
                    if (_playScreen != null)
                    {
                        _playScreen.IsVisible = false;
                    }
                    _playScreen = null;
                    SelectionScreen();
                    break;
                }
                _selectionScreen.ProcessKeyboard(Global.KeyboardState);
                _state = _selectionScreen.GetState();
                break;

            case SadGuiState.Play:
                if (_playScreen == null)
                {
                    if (_selectionScreen != null)
                    {
                        _selectionScreen.IsVisible = false;
                    }
                    _selectionScreen = null;
                    PlayScreen();
                    break;
                }
                _playScreen.ProcessKeyboard(Global.KeyboardState);
                _state = _playScreen.GetState();
                break;

            case SadGuiState.Fatalerror:
                _state = Warning("A fatal error happend!", true);
                break;

            case SadGuiState.Quit:
                Game.Instance.Exit();
                break;
            }
        }
Esempio n. 5
0
        private static void Update(GameTime time)
        {
            // As an example, we'll use the F5 key to make the game full screen
            if (Global.KeyboardState.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.F5))
            {
                Settings.ToggleFullScreen();
            }
            else if (Global.KeyboardState.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Escape))
            {
                SadConsole.Game.Instance.Exit();
            }

            //return;

            // Called each logic update.
            switch (_state)
            {
            case SadGuiState.START:
                _state = LoadBlocksAsync();
                return;

            case SadGuiState.ACTION:
                return;

            case SadGuiState.LOGIN:
                if (!_controller.IsWalletCreated)
                {
                    _state = CreateWallet();
                }
                else
                {
                    _state = Unlock();
                }
                return;

            case SadGuiState.MNEMOIC:
                _state = ShowMnemoic();
                break;

            case SadGuiState.SELECTION:
                if (_selectionScreen == null)
                {
                    _playScreen = null;
                    SelectionScreen();
                    _selectionScreen.Init();
                    break;
                }
                _selectionScreen.ProcessKeyboard(Global.KeyboardState);
                _state = _selectionScreen.GetState();
                break;

            case SadGuiState.PLAY:
                if (_playScreen == null)
                {
                    _selectionScreen = null;
                    PlayScreen();
                    break;
                }
                _playScreen.ProcessKeyboard(Global.KeyboardState);
                _state = _playScreen.GetState();
                break;

            case SadGuiState.FATALERROR:
                _state = Warning("A fatal error happend!", true);
                break;

            case SadGuiState.QUIT:
                SadConsole.Game.Instance.Exit();
                break;
            }
        }
Esempio n. 6
0
 private void Start()
 {
     selectionScreen = transform.root.GetComponent <SelectionScreen>();
 }