Exemple #1
0
        public static SObject show(ScriptProcessor processor, SObject[] parameters)
        {
            // TODO: get correct location from world screen
            var screenManager = GetComponent <ScreenManager>();
            var townMapScreen = new TownMapScreen(screenManager.ActiveScreen, "johto", "New Bark Town");

            townMapScreen.LoadContent();
            screenManager.SetScreen(townMapScreen);

            ScriptManager.WaitUntil(() => !(screenManager.ActiveScreen is TownMapScreen));

            return(ScriptInAdapter.GetUndefined(processor));
        }
        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();
        }