Пример #1
0
        public void InitPage()
        {
            NumberCounterDisplayStyle cstyle = new NumberCounterDisplayStyle(gameLink.Content.Load <Texture2D>(@"Counter/suuji_combo"), new Vector2(17, 30));

            menuBuilder = new MenuBuilder(gameLink);
            menuBuilder.AddItem(new VolumeScrollMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Null"),
                                    delegate(object sender, EventArgs e) { saveSetting(); }, new Vector2(0, 0), "BGM Setting", cstyle, THPages.GameConfig.Bgmvol));
            menuBuilder.AddItem(new VolumeScrollMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Null"),
                                    delegate(object sender, EventArgs e) { saveSetting(); }, new Vector2(0, 50), "SE Setting", cstyle, THPages.GameConfig.Sevol));

            /*menuBuilder.AddItem(new BasicMenuItem(
             *  gameLink.Content.Load<Texture2D>(@"Menu/Item/MainMenu_KeyConfig"),
             *  null, new Vector2(0, 100), "Key Config"));*/
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Back"),
                                    delegate(object sender, EventArgs e) { saveSetting(); ((Game1)gameLink).JumpToPage("MainMenu", 0, false); }
                                    , new Vector2(0, 350), "Back"));
            menuBuilder.DoubleLinkItem(0, 1, Arrow.Down);
            menuBuilder.DoubleLinkItem(1, 2, Arrow.Down);
            menuBuilder.DoubleLinkItem(2, 0, Arrow.Down);
            //menuBuilder.DoubleLinkItem(3, 0, Arrow.Down);
            menuBuilder.SetPosition(new Vector2(250, 140));
            testMenu = menuBuilder.getMenu();

            generatedComponents = new List <GameComponent>();
            generatedComponents.Add(this);
            generatedComponents.Add(testMenu);
        }
Пример #2
0
        public void InitPage()
        {
            menuBuilder = new MenuBuilder(gameLink);
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Start"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("MainGame", 0); },
                                    new Vector2(0, 0), "Game Start"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_HiScore"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("HiScore", 0); },
                                    new Vector2(0, 50), "Watch Hi-Score Table"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Setting"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("Setting", 0); },
                                    new Vector2(0, 100), "Game Configuration"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Staff"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("StaffPage", 0); },
                                    new Vector2(0, 150), "See Staffs"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Exit"),
                                    delegate(object sender, EventArgs e) { gameLink.Exit(); },
                                    new Vector2(0, 200), "Game Exit"));
            menuBuilder.DoubleLinkItem(0, 1, Arrow.Down);
            menuBuilder.DoubleLinkItem(1, 2, Arrow.Down);
            menuBuilder.DoubleLinkItem(2, 3, Arrow.Down);
            menuBuilder.DoubleLinkItem(3, 4, Arrow.Down);
            menuBuilder.DoubleLinkItem(4, 0, Arrow.Down);
            menuBuilder.SetPosition(new Vector2(250, 200));
            testMenu = menuBuilder.getMenu();

            generatedComponents = new List <GameComponent>();
            generatedComponents.Add(this);
            generatedComponents.Add(testMenu);
        }
Пример #3
0
        public void InitPage()
        {
            menuBuilder = new MenuBuilder(gameLink);
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Continue"),
                                    delegate(object sender, EventArgs e) { inGameMenu.IsAvaliable = false; testGame.Continue(); },
                                    new Vector2(0, 0), "Game Start"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_BackToTitle"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("MainMenu", 0, true); },
                                    new Vector2(0, 60), "Back To Title"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Restart"),
                                    delegate(object sender, EventArgs e) { inGameMenu.IsAvaliable = false; testGame.Reset(5, GameConfig.FBgmvol, GameConfig.FSevol); },
                                    new Vector2(0, 120), "Restart"));
            menuBuilder.DoubleLinkItem(0, 1, Arrow.Down);
            menuBuilder.DoubleLinkItem(1, 2, Arrow.Down);
            menuBuilder.DoubleLinkItem(2, 0, Arrow.Down);
            menuBuilder.DoubleLinkItem(0, 1, Arrow.Right);
            menuBuilder.DoubleLinkItem(1, 2, Arrow.Right);
            menuBuilder.DoubleLinkItem(2, 0, Arrow.Right);
            menuBuilder.SetButtonSelectSE(gameLink.Content.Load <SoundEffect>(@"Sound/select"));
            menuBuilder.SetPosition(new Vector2(250, 300));
            inGameMenu = menuBuilder.getMenu();

            menuBuilder.NewMenu();
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_BackToTitle"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("MainMenu", 0, true); },
                                    new Vector2(0, 60), "Back To Title"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Restart"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("MainGame", 0, true); },
                                    new Vector2(0, 120), "Restart"));
            menuBuilder.DoubleLinkItem(0, 1, Arrow.Down);
            menuBuilder.DoubleLinkItem(1, 0, Arrow.Down);
            menuBuilder.DoubleLinkItem(0, 1, Arrow.Right);
            menuBuilder.DoubleLinkItem(1, 0, Arrow.Right);
            menuBuilder.SetButtonSelectSE(gameLink.Content.Load <SoundEffect>(@"Sound/select"));
            menuBuilder.SetPosition(new Vector2(250, 300));
            overMenu = menuBuilder.getMenu();

            //testGame = new TestGame.TestGame(new Rectangle(30, 50, 384, 512), gameLink);
            testGame = new TH_V0.SpriteManager(Game);

            generatedComponents = new List <GameComponent>();
            generatedComponents.Add(testGame);
            generatedComponents.Add(this);
            generatedComponents.Add(inGameMenu);
            generatedComponents.Add(overMenu);

            counterList = new List <LongCounterDisplay>();
            counterList.Add(new LongCounterDisplay(new Vector2(700, 80),
                                                   new StarLevelCounterDisplayStyle(Game.Content.Load <Texture2D>(@"Counter/Font_Star")), 1));
            counterList.Add(new LongCounterDisplay(new Vector2(700, 110),
                                                   new StarLevelCounterDisplayStyle(Game.Content.Load <Texture2D>(@"Counter/Font_Star")), 1));
            counterList.Add(new LongCounterDisplay(new Vector2(700, 140),
                                                   new NumberCounterDisplayStyle(Game.Content.Load <Texture2D>(@"Counter/suuji_combo"), new Vector2(17, 30)), 100));
        }
Пример #4
0
 public override void GetMainMenu(string menuName, MenuBuilder mb)
 {
     if (menuName == "tools" && LicenseTool.FeatureAllowed(DbStructSynchronizationFeature.Test))
     {
         mb.AddItem("s_synchronize_structure", SynchronizeStructureForm.RunNoParam);
     }
 }
Пример #5
0
 public override void GetMainMenu(string menuName, MenuBuilder mb)
 {
     if (menuName == "tools" && LicenseTool.FeatureAllowed(VersionedDbFeature.Test))
     {
         mb.AddItem("s_version_db", CreateVersionDbWindow);
     }
 }
Пример #6
0
 public override void GetMainMenu(string menuName, MenuBuilder mb)
 {
     if (menuName == "tools" && LicenseTool.FeatureAllowed(DataSynchronizationFeature.Test))
     {
         mb.AddItem("s_synchronize_data", ShowDataSynWindow);
     }
 }
Пример #7
0
        public void InitPage()
        {
            menuBuilder = new MenuBuilder(gameLink);
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Start"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("MainGame", 1, true); seok.Play(GameConfig.FSevol, 0f, 0f); },
                                    new Vector2(0, 0), "Game Start"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_HiScore"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("HiScorePage", 0, false); seok.Play(GameConfig.FSevol, 0f, 0f); },
                                    new Vector2(0, 50), "Watch Hi-Score Table"));

            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Setting"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("ConfigPage", 0, false); seok.Play(GameConfig.FSevol, 0f, 0f); },
                                    new Vector2(0, 100), "Game Configuration"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Staff"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("StaffPage", 0, false); seok.Play(GameConfig.FSevol, 0f, 0f); },
                                    new Vector2(0, 150), "See Staffs"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Exit"),
                                    delegate(object sender, EventArgs e) { seok.Play(GameConfig.FSevol, 0f, 0f); gameLink.Exit(); },
                                    new Vector2(0, 200), "Game Exit"));
            menuBuilder.DoubleLinkItem(0, 1, Arrow.Down);
            menuBuilder.DoubleLinkItem(1, 2, Arrow.Down);
            menuBuilder.DoubleLinkItem(2, 3, Arrow.Down);
            menuBuilder.DoubleLinkItem(3, 4, Arrow.Down);
            menuBuilder.DoubleLinkItem(4, 0, Arrow.Down);
            menuBuilder.SetButtonSelectSE(gameLink.Content.Load <SoundEffect>(@"Sound/select"));
            menuBuilder.SetPosition(new Vector2(250, 200));
            testMenu = menuBuilder.getMenu();

            generatedComponents = new List <GameComponent>();
            generatedComponents.Add(this);
            generatedComponents.Add(testMenu);
            bgm = gameLink.Content.Load <Song>(@"BGM/th128_01");
        }
Пример #8
0
        public void InitPage()
        {
            menuBuilder = new MenuBuilder(gameLink);
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Start"),
                                    null, new Vector2(0, 0), "Game Start"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Continue"),
                                    null, new Vector2(0, 60), "Game Continue"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_HiScore"),
                                    null, new Vector2(0, 120), "Watch Hi-Score Table"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Setting"),
                                    null, new Vector2(0, 180), "Game Configuration"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Exit"),
                                    delegate(object sender, EventArgs e) { ((Game1)gameLink).JumpToPage("TEST1", 0); },
                                    new Vector2(200, 150), "Game Exit"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_Staff"),
                                    null, new Vector2(200, 30), "See Staffs"));
            menuBuilder.AddItem(new BasicMenuItem(
                                    gameLink.Content.Load <Texture2D>(@"Menu/Item/MainMenu_BackToTitle"),
                                    null, new Vector2(200, 90), "Just For Test"));
            menuBuilder.DoubleLinkItem(0, 1, Arrow.Down);
            menuBuilder.DoubleLinkItem(1, 2, Arrow.Down);
            menuBuilder.DoubleLinkItem(2, 3, Arrow.Down);
            menuBuilder.DoubleLinkItem(3, 0, Arrow.Down);
            menuBuilder.DoubleLinkItem(5, 6, Arrow.Down);
            menuBuilder.DoubleLinkItem(6, 4, Arrow.Down);
            menuBuilder.DoubleLinkItem(4, 5, Arrow.Down);
            menuBuilder.SingleLinkItem(0, 5, Arrow.Right);
            menuBuilder.SingleLinkItem(5, 1, Arrow.Left);
            menuBuilder.SingleLinkItem(1, 6, Arrow.Right);
            menuBuilder.SingleLinkItem(6, 2, Arrow.Left);
            menuBuilder.SingleLinkItem(2, 4, Arrow.Right);
            menuBuilder.SingleLinkItem(4, 3, Arrow.Left);
            menuBuilder.SingleLinkItem(3, 4, Arrow.Right);
            testMenu = menuBuilder.getMenu();

            generatedComponents = new List <GameComponent>();
            generatedComponents.Add(this);
            generatedComponents.Add(testMenu);
        }
        public PackageTreeNodeViewModel(Object model, PackageDatabaseTreeViewModel parent, CompositionContainer container, String assetType)
        {
            this._parent = parent;
            this._contextMenuTopLevelItems = new ObservableCollection<MenuItemViewModel>();
            this._children = new ObservableCollection<PackageTreeNodeViewModel>();
            this.Model = model;

            var menuItemImports = container.GetExports<IMenuItem, IContextMenuItemMetaData>();
            var globalCommandImports = container.GetExports<IGlobalCommand>();

            var menuBuilder = new MenuBuilder(globalCommandImports);

            foreach (var import in menuItemImports.Where(x => x.Metadata.AssetType == assetType))
            {
                if (import.Metadata.IsPrimary)
                {
                    this.PrimaryCommand = import.Value.Command;
                }

                menuBuilder.AddItem(import.Value, import.Metadata);
            }

            foreach (var rootItem in menuBuilder.Build().Children)
            {
                MenuItemViewModel viewModel;

                if (rootItem is MenuSeparatorModel)
                {
                    viewModel = new MenuSeparatorViewModel();
                }
                else
                {
                    viewModel = new MenuItemViewModel(this.Model, rootItem.HeaderText, rootItem.Command, rootItem.GestureText, rootItem.Children);
                }

                _contextMenuTopLevelItems.Add(viewModel);
            }
        }