コード例 #1
0
        public override bool HandleInputs(InputState input)
        {
            if (input.IsMenuDown())
            {
                selected++;
                if (selected >= Entries.Count)
                    selected = 0;
            }
            if (input.IsMenuUp())
            {
                selected--;
                if (selected < 0)
                    selected = Entries.Count - 1;
            }

            if (input.IsMenuSelect())
            {
                if (Session.currentSession.Inventory.IsUseable(Consumable, Entries[selected]))
                {
                    ScriptEngine.ScriptEngine.Instance.SetVar("PartySelect", selected);
                    ScriptEngine.ScriptEngine.Instance.Execute(Consumable.Action);
                    Session.currentSession.Inventory.RemoveItem(Consumable, 1);
                    GameStateManager.Instance.RemoveScreen(this);
                }
            }
            if (input.IsBack())
            {
                GameStateManager.Instance.RemoveScreen(this);
            }
            return true;
        }
コード例 #2
0
ファイル: MenuScreen.cs プロジェクト: KDSBest/RPG-Game-XNA
        public override bool HandleInputs(InputState input)
        {
            if (input.IsMenuDown())
            {
                selected++;
                if (selected >= Entries.Count)
                    selected = 0;
            }
            if (input.IsMenuUp())
            {
                selected--;
                if (selected < 0)
                    selected = Entries.Count - 1;
            }

            if (input.IsMenuSelect())
                Entries[selected].Select();

            return true;
        }
コード例 #3
0
        public override bool HandleInputs(InputState input)
        {
            if (input.IsMenuDown())
            {
                selected++;
                if (selected >= Attacker.Skills.Count)
                    selected = 0;
            }
            if (input.IsMenuUp())
            {
                selected--;
                if (selected < 0)
                    selected = Attacker.Skills.Count - 1;
            }

            if (input.IsMenuSelect())
            {
                if(Attacker.MP >= Attacker.Skills[selected].ConsumeMP)
                    GameStateManager.Instance.AddScreen(new CombatVictimSelectScreen(Attacker, Enemies, Group, Attacker.Skills[selected].Name), true, false);
            }

            if (input.IsBack())
            {
                GameStateManager.Instance.RemoveScreen(this);
            }
            return true;
        }
コード例 #4
0
 public override bool HandleInputs(InputState input)
 {
     if (input.IsMenuSelect() || input.IsBack())
         GameStateManager.Instance.BackToTileScreen();
     return true;
 }
コード例 #5
0
        public override bool HandleInputs(InputState input)
        {
            userMovement = TileEngine.UpdateUserMovement(input.IsUp(), input.IsDown(), input.IsLeft(), input.IsRight());

            if (input.IsMenuSelect())
                TileEngine.TriggerEvent();
            if (input.IsMenu())
                GameStateManager.Instance.AddScreen(new WorldMenuScreen(), true, false);
            return true;
        }
コード例 #6
0
        public override bool HandleInputs(InputState input)
        {
            List<IMenuEntry> Entries = Menu[Keys[selectedCategory]];
            if (input.IsMenuDown())
            {
                selected++;
                if (selected >= Entries.Count)
                    selected = 0;
            }

            if (input.IsMenuUp())
            {
                selected--;
                if (selected < 0)
                    selected = Entries.Count - 1;
            }
            if (input.IsMenuSelect())
                Entries[selected].Select();
            if (input.IsNext())
            {
                selected = 0;
                selectedCategory++;
                if (selectedCategory >= Keys.Count)
                    selectedCategory = 0;
            }
            if (input.IsPrevious())
            {
                selected = 0;
                selectedCategory--;
                if (selectedCategory < 0)
                    selectedCategory = Keys.Count - 1;
            }
            return true;
        }
コード例 #7
0
        public override bool HandleInputs(InputState input)
        {
            if (input.IsMenuDown())
            {
                selected++;
                if (selected >= Texts.Length)
                    selected = 0;
            }
            if (input.IsMenuUp())
            {
                selected--;
                if (selected < 0)
                    selected = Texts.Length - 1;
            }

            if (input.IsMenuSelect())
            {
                switch (selected)
                {
                    case 0: // Attack
                        GameStateManager.Instance.AddScreen(new CombatVictimSelectScreen(Attacker, Enemies, Group, "Attack"), true, false);
                        break;
                    case 1: // Skill
                        if (Attacker.Skills.Count > 0)
                        {
                            GameStateManager.Instance.AddScreen(new CombatSkillSelectScreen(Attacker, Enemies, Group), true, false);
                        }
                        break;
                    case 2: // Item
                        GameStateManager.Instance.AddScreen(new CombatConsumableSelectScreen(Attacker, Group), true, false);
                        break;
                }
            }

            if (input.IsBack())
            {
                this.Attacker.ATB -= 50;
                GameStateManager.Instance.RemoveScreen(this);
            }
            return true;
        }
コード例 #8
0
ファイル: CombatScreen.cs プロジェクト: KDSBest/RPG-Game-XNA
        public override bool HandleInputs(InputState input)
        {
            if (input.IsMenuDown())
            {
                selected++;
                if (selected >= Entries.Count)
                    selected = 0;
            }
            if (input.IsMenuUp())
            {
                selected--;
                if (selected < 0)
                    selected = Entries.Count - 1;
            }

            if (input.IsMenuSelect())
            {

            }

            if (input.IsBack())
                GameStateManager.Instance.RemoveScreen(this);

            return true;
        }