Inheritance: MenuBase
Beispiel #1
0
        public UIHandler()
        {
            RPG.UIHandler = this;
            //Use some fancy transitions
            View.MenuTransitions = true;
            View.PopMenu();
            View.MenuOffset = new Point(-302, 0);
            View.MenuPosition = new Point(UI.WIDTH -300, 0);

            OptionsMenu = new RPGMenu("Options", new GTASprite("CommonMenu", "interaction_bgd", Color.ForestGreen), new IMenuItem[] {
                        new MenuButton("Save Game", "").WithActivate(() => { RPG.SaveAllData(); RPG.Subtitle("Saved");}),
                        new MenuButton("New Game", "").WithActivate(NewGame),
                        new MenuNumericScroller("SafeArea Setting","",0,10,1,RPG.PlayerData.Setup.SafeArea).WithNumericActions(ChangeSafeArea,d => { }),
                        new MenuToggle("Toggle Skill Bar", "",ShowSkillBar).WithToggles(() => ShowSkillBar = true, () => ShowSkillBar = false),
                        new MenuToggle("Toggle Quest Tracker", "").WithToggles(() => ShowQuestTracker = true, () => ShowQuestTracker = false),
                        new MenuButton("Version", RPG.Version),
                        new MenuButton("Back", "").WithActivate(() => View.PopMenu())
                    });
            CharacterMenu = new RPGMenu("Character Menu", new GTASprite("CommonMenu", "interaction_bgd", Color.ForestGreen), new IMenuItem[] {
                        new MenuButton("Quests", "").WithActivate(OpenQuestLog),
                        new MenuButton("Set Skillbar", "").WithActivate(OpenSkillBarMenu),
                        new MenuButton("Skills", "").WithActivate(OpenSkillsMenu),
                        //new MenuButton("Talents", "", () => { View.PopMenu(); }),
                        //new MenuButton("Mod Weapons", "", () => { View.PopMenu(); }),
                        //new MenuButton("Mod Cars", "", () => { View.PopMenu();}),
                        new MenuButton("Back", "").WithActivate(() => View.PopMenu())
                    });

            ActionsMenu = new RPGMenu("ACTIONS", new GTASprite("CommonMenu", "interaction_bgd", Color.Red), new IMenuItem[] {
                        new MenuButton("Spawn Personal Vehicle", "").WithActivate(() => RPGMethods.SpawnCar()),
                        new MenuButton("Get Random Contract", "").WithActivate(GetRandomContract),
                        new MenuButton("Purchase Goods", "").WithActivate(OpenShop),
                        new MenuButton("Craft Items", "").WithActivate(OpenCrafting),
                        new MenuButton("Back", "").WithActivate(View.PopMenu)
                    });

            SkillTreeMenu = RPG.SkillHandler.GetSkillMenu();

            //var o = new MenuNumericScroller("Number", "", d => { }, d => { }, 0, 100, 1);
            //var p = new MenuToggle("Toggle", "", ()=> { }, () => { });

            MainMenu = new RPGMenu("RPG Menu", new GTASprite("CommonMenu", "interaction_bgd", Color.DodgerBlue), new IMenuItem[] {
                new MenuButton("Inventory", "").WithActivate(OpenInventory),
                new MenuButton("Character Menu", "").WithActivate(OpenCharacterMenu),
                new MenuButton("Actions ", "").WithActivate(() => View.AddMenu(ActionsMenu)),
                new MenuButton("Options", "").WithActivate(() => OpenOptionsMenu()),
                new MenuButton("Return to Normal Mode ", "").WithActivate(ConfirmReturnToNormal),
                new MenuButton("Close", "").WithActivate(View.PopMenu)
            });

            RPGUI.FormatMenu(OptionsMenu);
            RPGUI.FormatMenu(ActionsMenu);
            RPGUI.FormatMenu(MainMenu);
            RPGUI.FormatMenu(CharacterMenu);
        }
Beispiel #2
0
        public UIHandler()
        {
            RPG.UIHandler = this;
            KeyDown += OnKeyDown;
            //Use some fancy transitions
            View.MenuTransitions = true;
            View.PopMenu();
            View.MenuOffset = new Point(-302, 0);
            View.MenuPosition = new Point(UI.WIDTH -300, 0);

            CharacterMenu = new RPGMenu("Character Menu", new GTASprite("CommonMenu", "interaction_bgd", Color.ForestGreen), new IMenuItem[] {
                        new MenuButton("Quests", "").WithActivate(OpenQuestLog),
                        new MenuButton("Set Skillbar", "").WithActivate(OpenSkillBarMenu),
                        new MenuButton("Skills", "").WithActivate(OpenSkillsMenu),
                        new MenuButton("Weapons", "").WithActivate(OpenWeaponsMenu),
                        //new MenuButton("Talents", "", () => { View.PopMenu(); }),
                        //new MenuButton("Mod Weapons", "", () => { View.PopMenu(); }),
                        //new MenuButton("Mod Cars", "", () => { View.PopMenu();}),
                        new MenuButton("Back", "").WithActivate(() => View.PopMenu())
                    });

            ActionsMenu = new RPGMenu("ACTIONS", new GTASprite("CommonMenu", "interaction_bgd", Color.Red), new IMenuItem[] {
                        new MenuButton("Spawn Personal Vehicle", "").WithActivate(() => RPGMethods.SpawnCar()),
                        new MenuButton("Get Random Contract", "").WithActivate(GetRandomContract),
                        new MenuButton("Purchase Goods", "").WithActivate(OpenShop),
                        new MenuButton("Craft Items", "").WithActivate(OpenCrafting),
                        new MenuButton("Back", "").WithActivate(View.PopMenu)
                    });

            SkillTreeMenu = RPG.SkillHandler.GetSkillMenu();
            WeaponTreeMenu = RPG.WeaponHandler.GetWeaponMenu();

            //var o = new MenuNumericScroller("Number", "", d => { }, d => { }, 0, 100, 1);
            //var p = new MenuToggle("Toggle", "", ()=> { }, () => { });

            MainMenu = new RPGMenu("RPG Menu", new GTASprite("CommonMenu", "interaction_bgd", Color.DodgerBlue), new IMenuItem[] {
                new MenuButton("Inventory", "").WithActivate(OpenInventory),
                new MenuButton("Character Menu", "").WithActivate(OpenCharacterMenu),
                new MenuButton("Actions ", "").WithActivate(() => View.AddMenu(ActionsMenu)),
                new MenuButton("Options", "").WithActivate(() => OpenOptionsMenu()),
                new MenuButton("Play as Michael, Franklin and Trevor ", "").WithActivate(ConfirmPlayAsTrio),
                new MenuButton("Play as Yourself", "").WithActivate(ConfirmPlayAsYourCharacter),
                new MenuButton("Return to Normal Mode ", "").WithActivate(ConfirmReturnToNormal),
                new MenuButton("Close", "").WithActivate(View.PopMenu)
            });

            RPGUI.FormatMenu(ActionsMenu);
            RPGUI.FormatMenu(MainMenu);
            RPGUI.FormatMenu(CharacterMenu);
        }