Example #1
0
        internal override void LoadContent()
        {
            _batch = new SpriteBatch(Controller.GraphicsDevice);

            _optionsBox = new OptionsBox();
            _optionsBox.LoadContent();
            _optionsBox.BufferUp            = 1;
            _optionsBox.BufferRight         = 4;
            _optionsBox.CanCancel           = false;
            _optionsBox.CloseAfterSelection = false;

            var options = new List <string>()
            {
                "NEW GAME", "OPTION"
            };

            if (PlayerData.SaveFileExists())
            {
                // load player file if it exists
                Controller.ActivePlayer = new Player();
                Controller.ActivePlayer.Load();

                options.Insert(0, "CONTINUE");
            }
            _optionsBox.Show(options.ToArray());
            _optionsBox.OptionSelected += OptionSelected;

            var unit   = Border.UNIT * Border.SCALE;
            var offset = Controller.ClientRectangle.Height / 2 - Border.SCREEN_HEIGHT * unit / 2;

            _optionsBox.OffsetY = (int)(_optionsBox.Height * unit + offset);

            _fontRenderer = new PokemonFontRenderer();
            _fontRenderer.LoadContent();
        }
        internal override void LoadContent()
        {
            _batch = new SpriteBatch(Controller.GraphicsDevice);

            _itemIcon     = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokemon/item.png");
            _mailIcon     = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokemon/mail.png");
            _selector     = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Computer/selector.png");
            _moveSelector = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Computer/moveSelector.png");
            _arrow        = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Computer/arrow.png");

            _fontRenderer = new PokemonFontRenderer();
            _fontRenderer.LoadContent();

            _optionsBox = new OptionsBox();
            _optionsBox.LoadContent();
            _optionsBox.OffsetY            -= (int)(Border.SCALE * Border.UNIT * 3);
            _optionsBox.OffsetX            += (int)(Border.SCALE * Border.UNIT * 9);
            _optionsBox.OptionSelected     += OptionSelected;
            _optionsBox.CloseAfterSelection = false;

            _confirmationBox = new OptionsBox();
            _confirmationBox.LoadContent();
            _confirmationBox.OffsetY -= (int)(Border.SCALE * Border.UNIT);
            _confirmationBox.OffsetX += (int)(Border.SCALE * Border.UNIT * 14);

            _message = DEFAULT_MESSAGE;
        }
Example #3
0
    public override void SetPressed(bool value)
    {
        if (value)
        {
            if (!isPressed)
            {
                if (ParentMenu != null)
                {
                    ParentMenu.LastFocused = this;
                    ParentMenu.LastPressed = this;
                }
                SoundManager.instance.PlayUiEfx(pressSound);

                if (IsControlFocusedInGroup())
                {
                    currentFocused[controlGroup].SetFocused(false);
                }
                if (controlGroup != null)
                {
                    currentPressed.Add(controlGroup, this);
                }

                isPressed = true;
                front.gameObject.SetActive(true);
                front.SetColor(pressColor);
                mark.SetColor(lightColor);
                textName.SetColor(lightColor);
                pointer.SetPress();
                StartCoroutine(FadeSelection(1f, 0f, 0.1f));
                StartCoroutine(ChangeWidth(normalWidth, pressWidth));

                OptionsBox.Open(this);
            }
        }
        else
        {
            if (isPressed)
            {
                if (ParentMenu != null && ParentMenu.LastPressed == this)
                {
                    ParentMenu.LastPressed = null;
                }

                if (IsControlPressedInGroup())
                {
                    currentPressed.Remove(controlGroup);
                    SetFocused(true);
                }

                isPressed = false;
                StartCoroutine(FadeSelection(0f, 1f, 0.1f));
                StartCoroutine(ChangeWidth(pressWidth, normalWidth));
            }
        }
    }
        internal override void LoadContent()
        {
            _batch = new SpriteBatch(Controller.GraphicsDevice);

            _fontRenderer = new PokemonFontRenderer();
            _fontRenderer.LoadContent();

            _optionsBox = new OptionsBox();
            _optionsBox.LoadContent();
            _optionsBox.BufferUp            = 1;
            _optionsBox.OffsetX            += (int)(Border.SCALE * Border.UNIT * 11);
            _optionsBox.OffsetY            -= (int)(Border.SCALE * Border.UNIT * 3);
            _optionsBox.OptionSelected     += OptionSelected;
            _optionsBox.CloseAfterSelection = false;
        }
Example #5
0
        internal override void LoadContent()
        {
            _batch = new SpriteBatch(Controller.GraphicsDevice);

            _arrow           = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokegear/arrow.png");
            _buttons         = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokegear/buttons.png");
            _switchButton    = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokegear/switchButton.png");
            _timeBox         = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokegear/time.png");
            _mapOverlay      = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokegear/mapOverlay.png");
            _phoneBackground = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokegear/phoneBackground.png");
            _reception       = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Pokegear/reception.png");

            _fontRenderer = new PokemonFontRenderer();
            _fontRenderer.LoadContent();

            _contactsFontRenderer = new PokemonFontRenderer();
            _contactsFontRenderer.LoadContent();
            _contactsFontRenderer.LineGap = 0;

            _exitTextbox = new Textbox();
            _exitTextbox.LoadContent();
            _exitTextbox.ShowAndSkip("Press any button\nto exit.");
            _exitTextbox.OffsetY = (int)(Border.SCREEN_HEIGHT * Border.SCALE * Border.UNIT - Textbox.HEIGHT * Border.UNIT * Border.SCALE);

            _phoneTextbox = new Textbox();
            _phoneTextbox.LoadContent();
            _phoneTextbox.ShowAndSkip("Whom do you want\nto call?");
            _phoneTextbox.OffsetY = (int)(Border.SCREEN_HEIGHT * Border.SCALE * Border.UNIT - Textbox.HEIGHT * Border.UNIT * Border.SCALE);

            _phoneOptionsBox = new OptionsBox();
            _phoneOptionsBox.LoadContent();
            _phoneOptionsBox.OffsetY     = _phoneTextbox.OffsetY;
            _phoneOptionsBox.OffsetX    += (int)(Border.SCALE * Border.UNIT * 9);
            _phoneOptionsBox.BufferUp    = 1;
            _phoneOptionsBox.BufferRight = 1;

            _deleteNumberOptionsBox = new OptionsBox();
            _deleteNumberOptionsBox.LoadContent();
            _deleteNumberOptionsBox.OffsetY  = _phoneTextbox.OffsetY;
            _deleteNumberOptionsBox.OffsetX += (int)(Border.SCALE * Border.UNIT * 14);

            // TODO: get correct location from world
            _mapScreen = new TownMapScreen(null, "kanto", "Pallet Town");
            _mapScreen.LoadContent();

            _phonebook = Phonebook.Load();
        }
        void DisplayModuleOptions()
        {
            OptionsBox.Clear();
            OptionsBox2.Items.Clear();
            int Count = Storage.Campaign.Modules[Storage.ModNum].Options.OptionsList.Count;

            if (Count > 0)
            {
                foreach (string Option in Storage.Campaign.Modules[Storage.ModNum].Options.OptionsList)
                {
                    OptionsBox.Text += Option + "//";
                }
                int Length = OptionsBox.Text.Length;
                OptionsBox.Text = OptionsBox.Text.Remove((Length - 2), 2);
                UpdateOptionBox2();
            }
        }
Example #7
0
        internal override void LoadContent()
        {
            _batch = new SpriteBatch(Controller.GraphicsDevice);

            _textbox = new Textbox();
            _textbox.LoadContent();
            _textbox.OffsetY = (int)(Border.SCREEN_HEIGHT * Border.SCALE * Border.UNIT - Textbox.HEIGHT * Border.UNIT * Border.SCALE);

            _optionsBox = new OptionsBox();
            _optionsBox.LoadContent();
            _optionsBox.OffsetY = 0;

            _confirmationBox = new OptionsBox();
            _confirmationBox.LoadContent();
            _confirmationBox.OffsetX += (int)(Border.SCALE * Border.UNIT * 14);

            ShowMain();
        }
Example #8
0
        internal override void LoadContent()
        {
            _batch = new SpriteBatch(Controller.GraphicsDevice);

            _fontRenderer = new PokemonFontRenderer();
            _fontRenderer.LoadContent();

            _textbox = new Textbox();
            _textbox.LoadContent();
            _textbox.Show("Would you like to\nsave the game?");
            _textbox.Finished += TextboxFinished;

            _optionsBox = new OptionsBox();
            _optionsBox.LoadContent();
            _optionsBox.OptionSelected += SelectedQuestion;

            var unit = (int)(Border.UNIT * Border.SCALE);

            _optionsBox.OffsetY = unit * 12;
            _textbox.OffsetY    = unit * 12;
        }
Example #9
0
        internal override void LoadContent()
        {
            _batch = new SpriteBatch(Controller.GraphicsDevice);

            _textbox = new Textbox();
            _textbox.LoadContent();
            _textbox.OffsetY = _offsetY + (int)(12 * Border.UNIT * Border.SCALE);

            _optionsBox = new OptionsBox();
            _optionsBox.LoadContent();
            _optionsBox.OffsetY  = _textbox.OffsetY;
            _optionsBox.OffsetX += (int)(Border.SCALE * Border.UNIT * 14);

            _moveSelectBox = new OptionsBox();
            _moveSelectBox.LoadContent();
            _moveSelectBox.OffsetY  = _textbox.OffsetY;
            _moveSelectBox.OffsetX += (int)(Border.SCALE * Border.UNIT * 5);
            _moveSelectBox.BufferUp = 1;

            ShowInitialQuestion();
        }
Example #10
0
        internal override void LoadContent()
        {
            _batch = new SpriteBatch(Controller.GraphicsDevice);

            _fontRenderer = new PokemonFontRenderer();
            _fontRenderer.LoadContent();

            _oak        = Controller.Content.LoadDirect <Texture2D>("Textures/UI/NewGame/oak.png");
            _player     = Controller.Content.LoadDirect <Texture2D>("Textures/UI/NewGame/player.png");
            _namingIcon = Controller.Content.LoadDirect <Texture2D>("Textures/UI/NewGame/namingIcon.png");

            _random         = new Random();
            _previewPokemon = Pokemon.Get(POKEMON_PREVIEW_IDS[_random.Next(0, POKEMON_PREVIEW_IDS.Length)], 1);

            _textbox = new Textbox();
            _textbox.LoadContent();
            _textbox.OffsetY = GameController.RENDER_HEIGHT / 2 - (int)(Border.SCALE * Border.UNIT * Border.SCREEN_HEIGHT) / 2 + (int)(12 * Border.UNIT * Border.SCALE);

            _nameSelection = new OptionsBox();
            _nameSelection.LoadContent();
            _nameSelection.BufferUp  = 1;
            _nameSelection.CanCancel = false;
        }
Example #11
0
        internal override void LoadContent()
        {
            _batch = new SpriteBatch(Controller.GraphicsDevice);

            _arrow = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Computer/arrow2.png");

            _fontRenderer = new PokemonFontRenderer();
            _fontRenderer.LoadContent();

            _textbox = new Textbox();
            _textbox.LoadContent();
            _textbox.OffsetY = (int)(Border.SCREEN_HEIGHT * Border.SCALE * Border.UNIT - Textbox.HEIGHT * Border.UNIT * Border.SCALE);

            _optionsBox = new OptionsBox();
            _optionsBox.LoadContent();
            _optionsBox.OffsetY  = _textbox.OffsetY;
            _optionsBox.OffsetX += (int)(Border.SCALE * Border.UNIT * 14);

            _amountSelector = new AmountSelector();
            _amountSelector.LoadContent();
            _amountSelector.OffsetY = _textbox.OffsetY - (int)(Border.SCALE * Border.UNIT * AmountSelector.HEIGHT);

            SetItems();
        }
Example #12
0
        internal override void LoadContent()
        {
            _batch = new SpriteBatch(Controller.GraphicsDevice);

            _arrow = Controller.Content.LoadDirect <Texture2D>("Textures/UI/Computer/arrow2.png");

            _fontRenderer = new PokemonFontRenderer();
            _fontRenderer.LoadContent();

            _textbox = new Textbox();
            _textbox.LoadContent();
            _textbox.OffsetY = (int)(Border.SCREEN_HEIGHT * Border.SCALE * Border.UNIT - Textbox.HEIGHT * Border.UNIT * Border.SCALE);

            _optionsBox = new OptionsBox();
            _optionsBox.LoadContent();
            _optionsBox.BufferUp = 1;

            _confirmationBox = new OptionsBox();
            _confirmationBox.LoadContent();
            _confirmationBox.OffsetX += (int)(Border.SCALE * Border.UNIT * 14);
            _confirmationBox.OffsetY  = _textbox.OffsetY;

            SetMails();
        }