public PauseMenu(Texture2D[] panels, Texture2D[] backgroundAssets) : base(panels, backgroundAssets) { //This is the starting point of the menu. PauseMenu.Selected += (object sender, EventArgs args) => { this.CurrentState = State.Shown; this._delay = 0; }; MenuEntry resume = new MenuEntry("Resume"); MenuEntry exit = new MenuEntry("Exit"); resume.Enter += (object sender, EventArgs args) => { this.CurrentState = State.Hidden; ResumeEvent(); }; exit.Enter += (object sender, EventArgs args) => { this.CurrentState = State.Hidden; ExitEvent(); MainMenu.SelectedEvent(); }; this.MenuEntryList.Add(resume); this.MenuEntryList.Add(exit); }
public Blank2EntryScreen() { TransitionOffTime = TimeSpan.Zero; TransitionOnTime = TimeSpan.Zero; IsPopup = true; // Menu entry stuff. MenuEntry testEntry = new MenuEntry("test"); MenuEntry testEntry2 = new MenuEntry("test1"); MenuEntry testEntry3 = new MenuEntry("test2"); MenuEntry testEntry4 = new MenuEntry("test3"); MenuEntry testEntry5 = new MenuEntry("test4"); MenuEntry testEntry6 = new MenuEntry("test5"); MenuEntry testEntry7 = new MenuEntry("test6"); MenuEntry testEntry8 = new MenuEntry("test7"); MenuEntries.Add(testEntry); MenuEntries.Add(testEntry2); MenuEntries.Add(testEntry3); MenuEntries.Add(testEntry4); MenuEntries.Add(testEntry5); MenuEntries.Add(testEntry6); MenuEntries.Add(testEntry7); MenuEntries.Add(testEntry8); foreach (MenuEntry entry in MenuEntries) { entry.IsPulseMenuEntry = false; entry.ScaleFactor = 1.15f; } botDisplayedEntryIndex = 3; topDisplayedEntryIndex = 0; }
public AudioOptionsScreen() : base("Audio") { this._ambienceEntry = new MenuEntry("Sound Volume: "); this._musicEntry = new MenuEntry("Music Volume: "); this._voiceEntry = new MenuEntry("Voice Volume: "); this._effectsEntry = new MenuEntry("Effects Volume: "); MenuEntry sep = new MenuEntry("sep"); MenuEntry back = new MenuEntry("Back"); this._ambienceEntry.Origin = Graphics.UI.TextAlignment.Centre; this._musicEntry.Origin = Graphics.UI.TextAlignment.Centre; this._voiceEntry.Origin = Graphics.UI.TextAlignment.Centre; this._effectsEntry.Origin = Graphics.UI.TextAlignment.Centre; back.Origin = Graphics.UI.TextAlignment.Centre; sep.ItemType = MenuEntryType.Separator; back.Selected += OnCancel; menuEntries.Add(_ambienceEntry); menuEntries.Add(_effectsEntry); menuEntries.Add(_musicEntry); menuEntries.Add(_voiceEntry); menuEntries.Add(sep); menuEntries.Add(back); }
/// <summary> /// Constructor. /// </summary> public OptionsMenuScreen() : base("Options") { // Create our menu entries. _ungulateMenuEntry = new MenuEntry(string.Empty); _languageMenuEntry = new MenuEntry(string.Empty); _frobnicateMenuEntry = new MenuEntry(string.Empty); _elfMenuEntry = new MenuEntry(string.Empty); SetMenuEntryText(); MenuEntry back = new MenuEntry("Back"); // Hook up menu event handlers. _ungulateMenuEntry.Selected += UngulateMenuEntrySelected; _languageMenuEntry.Selected += LanguageMenuEntrySelected; _frobnicateMenuEntry.Selected += FrobnicateMenuEntrySelected; _elfMenuEntry.Selected += ElfMenuEntrySelected; back.Selected += OnCancel; // Add entries to the menu. MenuEntries.Add(_ungulateMenuEntry); MenuEntries.Add(_languageMenuEntry); MenuEntries.Add(_frobnicateMenuEntry); MenuEntries.Add(_elfMenuEntry); MenuEntries.Add(back); }
public SpaceMenu(Texture2D[] panels, Texture2D[] backgroundAssets, SpriteFont aboutFont) : base(panels, backgroundAssets) { _aboutFont = aboutFont; //This is the starting point of the menu. SpaceMenu.Selected += (object sender, EventArgs args) => { this.CurrentState = State.Shown; this._delay = 0; }; MenuEntry spacebattle = new MenuEntry("Let's do it!"); MenuEntry back = new MenuEntry("I am weak. [back]"); spacebattle.Enter += (object sender, EventArgs args) => { this.CurrentState = State.Hidden; SpaceBattleEvent(); }; back.Enter += (object sender, EventArgs args) => { this.CurrentState = State.Hidden; MainMenu.SelectedEvent(); }; this.MenuEntryList.Add(spacebattle); this.MenuEntryList.Add(back); }
/// <summary> /// Constructor. /// </summary> public OptionsMenuScreen() : base("Options") { // Create our menu entries. graphicsEntry = new MenuEntry("Display"); audioEntry = new MenuEntry("Audio"); MenuEntry sep = new MenuEntry("Sep"); MenuEntry back = new MenuEntry("Back"); graphicsEntry.Origin = Graphics.UI.TextAlignment.Centre; audioEntry.Origin = Graphics.UI.TextAlignment.Centre; sep.ItemType = MenuEntryType.Separator; back.Origin = Graphics.UI.TextAlignment.Centre; // Hook up menu event handlers. graphicsEntry.Selected += GraphicsEntrySelected; audioEntry.Selected += AudioEntrySelected; back.Selected += OnCancel; // Add entries to the menu. MenuEntries.Add(graphicsEntry); MenuEntries.Add(audioEntry); menuEntries.Add(sep); MenuEntries.Add(back); }
public EndGameMenu(Texture2D[] panels, Texture2D[] backgroundAssets, Save save, SpriteFont hudFont) : base(panels, backgroundAssets) { //This is the starting point of the menu. EndGameMenu.Selected += (object sender, EventArgs args) => { this.CurrentState = State.Shown; this._delay = 0; }; MenuEntry menu = new MenuEntry("Mission Select"); MenuEntry retry = new MenuEntry("Retry"); menu.Enter += (o, e) => { this.CurrentState = State.Hidden; MenuSelectedEvent(); PlayMenu.SelectedEvent(); }; retry.Enter += (o, e) => { this.CurrentState = State.Hidden; RestartEvent(); }; this.MenuEntryList.Add(menu); this.MenuEntryList.Add(retry); _save = save; _HUDFont = hudFont; }
public MainMenuScreen() : base("Main Menu") { // Create our menu entries. MenuEntry playGameMenuEntry = new MenuEntry("New Game"); MenuEntry optionsMenuEntry = new MenuEntry("Options"); MenuEntry testBattleScreenEntry = new MenuEntry("Battle Test"); MenuEntry exitMenuEntry = new MenuEntry("Exit"); // Hook up menu event handlers. playGameMenuEntry.Selected += NewGameMenuEntrySelected; optionsMenuEntry.Selected += OptionsMenuEntrySelected; testBattleScreenEntry.Selected += TestBattleScreenEntrySelected; exitMenuEntry.Selected += OnCancel; // Add entries to the menu. MenuEntries.Add(playGameMenuEntry); MenuEntries.Add(optionsMenuEntry); MenuEntries.Add(testBattleScreenEntry); MenuEntries.Add(exitMenuEntry); if (AudioManager.Instance.CurrentSong != "ct_testsong") { if (!AudioManager.IsSongLoaded("ct_testsong")) AudioManager.LoadSong("ct_testsong"); AudioManager.PlaySong("ct_testsong", true); } }
/// <summary> /// Constructor. /// </summary> public PauseMenuScreen() : base("Paused") { // Create our menu entries. var resumeGameMenuEntry = new MenuEntry("Resume Game"); var mainMenuEntry = new MenuEntry("Back to Main Menu"); var quitMenuEntry = new MenuEntry("Quit Game"); _gamepadMenuEntry = new MenuEntry(string.Empty); _fullScreenMenuEntry = new MenuEntry(string.Empty); SetMenuEntryText(); // Hook up menu event handlers. resumeGameMenuEntry.Selected += OnCancel; mainMenuEntry.Selected += QuitGameMenuEntrySelected; _gamepadMenuEntry.Selected += gamepadMenuEntry_Selected; _fullScreenMenuEntry.Selected += _fullScreenMenuEntry_Selected; quitMenuEntry.Selected += quitMenuEntry_Selected; // Add entries to the menu. MenuEntries.Add(resumeGameMenuEntry); MenuEntries.Add(_gamepadMenuEntry); MenuEntries.Add(_fullScreenMenuEntry); MenuEntries.Add(mainMenuEntry); MenuEntries.Add(quitMenuEntry); }
/// <summary> /// Constructor fills in the menu contents. /// </summary> public MainMenuScreen() : base("Main Menu") { // Create our menu entries. MenuEntry startMenuEntry = new MenuEntry("Start"); MenuEntry continueMenuEntry = new MenuEntry("Continue"); MenuEntry gameOverMenuEntry = new MenuEntry("Show Game Over"); MenuEntry testTitleMenuEntry = new MenuEntry("Test Title Transition"); MenuEntry exitMenuEntry = new MenuEntry("Quit"); // Hook up menu event handlers. startMenuEntry.Selected += StartMenuEntrySelected; continueMenuEntry.Selected += ContinueMenuEntrySelected; gameOverMenuEntry.Selected += GameOverMenuEntrySelected; testTitleMenuEntry.Selected += TestTitleMenuEntrySelected; exitMenuEntry.Selected += OnCancel; // Add entries to the menu. MenuEntries.Add(startMenuEntry); MenuEntries.Add(continueMenuEntry); MenuEntries.Add(gameOverMenuEntry); MenuEntries.Add(testTitleMenuEntry); MenuEntries.Add(exitMenuEntry); // Make the first menu visible SetMenuVisible(0, true); }
/// <summary> /// Constructor. /// </summary> public OptionsMenuScreen() : base("Options") { // Create our menu entries. difficultyMenuEntry = new MenuEntry(string.Empty); #if WINDOWS fullscreenMenuEntry = new MenuEntry(string.Empty); #endif SetMenuEntryText(); MenuEntry back = new MenuEntry("Back"); // Hook up menu event handlers. difficultyMenuEntry.Selected += DifficultyMenuEntrySelected; #if WINDOWS fullscreenMenuEntry.Selected += fullscreenMenuEntrySelected; #endif back.Selected += OnCancel; // Add entries to the menu. MenuEntries.Add(difficultyMenuEntry); #if WINDOWS MenuEntries.Add(fullscreenMenuEntry); #endif MenuEntries.Add(back); }
/// <summary> /// Constructor fills in the menu contents. /// </summary> /// <param name="host">Whether or not this player is the host.</param> /// <param name="multiplayer">Whether or not this game is multiplayer.</param> public HostSettingsMenuScreen() : base("Join Game") { hostAddressMenuEntry = new MenuEntry(string.Empty); hostAddressMenuEntry.Selected += HostAddressMenuEntrySelected; hostAddressMenuEntry.Typed += HostAddressMenuEntryTyped; MenuEntries.Add(hostAddressMenuEntry); // Both the host and the client should specify ports hostPortMenuEntry = new MenuEntry(string.Empty); hostPortMenuEntry.Selected += HostPortMenuEntrySelected; hostPortMenuEntry.Typed += HostPortMenuEntryTyped; MenuEntries.Add(hostPortMenuEntry); SetMenuEntryText(); // Set the initial menu text // Add the select and back options MenuEntry continueMenuEntry = new MenuEntry("Connect to Game"); continueMenuEntry.Selected += ContinueMenuEntrySelected; MenuEntries.Add(continueMenuEntry); MenuEntry backMenuEntry = new MenuEntry("Back"); backMenuEntry.Selected += OnCancel; MenuEntries.Add(backMenuEntry); return; }
/// <summary> /// Constructor. /// </summary> public OptionsMenuScreen() : base("Options") { // Create our menu entries. this.ungulateMenuEntry = new MenuEntry(string.Empty); this.languageMenuEntry = new MenuEntry(string.Empty); this.frobnicateMenuEntry = new MenuEntry(string.Empty); this.elfMenuEntry = new MenuEntry(string.Empty); this.SetMenuEntryText(); MenuEntry back = new MenuEntry("Back"); // Hook up menu event handlers. this.ungulateMenuEntry.Selected += this.UngulateMenuEntrySelected; this.languageMenuEntry.Selected += this.LanguageMenuEntrySelected; this.frobnicateMenuEntry.Selected += this.FrobnicateMenuEntrySelected; this.elfMenuEntry.Selected += this.ElfMenuEntrySelected; back.Selected += this.OnCancel; // Add entries to the menu. this.MenuEntries.Add(this.ungulateMenuEntry); this.MenuEntries.Add(this.languageMenuEntry); this.MenuEntries.Add(this.frobnicateMenuEntry); this.MenuEntries.Add(this.elfMenuEntry); this.MenuEntries.Add(back); }
public WeaponShopScreen(int playerIndex, Player player, World world) : base("Player " + (playerIndex + 1) + ": Weapon Shop") { this.player = player; this.world = world; guns = new BasicGun[5]; shopEntries = new MenuEntry[5]; // create menu entries for (int i = 0; i < shopEntries.Length; i++) shopEntries[i] = new MenuEntry(string.Empty); SetMenuEntryText(); MenuEntry back = new MenuEntry("Exit Shop"); // hook up event handlers back.Selected += OnCancel; for (int i = 0; i < shopEntries.Length; i++) { shopEntries[i].Selected += ShopMenuEntrySelected; } // add menu entries to screen for (int i = 0; i < shopEntries.Length; i++) MenuEntries.Add(shopEntries[i]); MenuEntries.Add(back); }
/// <summary> /// Initializes a new instance of the <see cref="SoundScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="screenManager">The screen manager.</param> public SoundScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager) : base(graphicsManager, screenManager, "Ballerburg3D") { // Zurück button zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 0) { Position = new Vector2(500, 450) }; zurueckMenuEntry.Selected += ZurueckMenuEntrySelected; musicVolumeSlider = new HSlider(this, new Rectangle(250, 100, 300, 20), screenManager.ApplicationSettings.MusicVolume); musicVolumeSlider.ValueChanged += OnMusicVolumeChanged; soundFxVolumeSlider = new HSlider(this, new Rectangle(250, 200, 300, 20), screenManager.ApplicationSettings.FxVolume); menuEffectsVolumeSlider = new HSlider(this, new Rectangle(250, 300, 300, 20), screenManager.ApplicationSettings.MenuEffectsVolume); var musicList = new List<string> { "DarkStar", "High Tension", "Tentacle", "Death Row", "Boomerang", "Aus" }; musicSelectButton = new ComboToggleButton(this, "Musik", new Collection<string>(musicList), 0, 0) { Position = new Vector2(20, 100) }; musicSelectButton.Selected += OnMusicButtonSelected; toggleMenuEffectsActionButton = new OnOffToggleButton(this, "Menueeffekte", true, 0) { Position = new Vector2(20, 200) }; toggleSoundEffectsActionButton = new OnOffToggleButton(this, "Soundeffekte", true, 0) { Position = new Vector2(20, 300) }; ControlsContainer.Add(zurueckMenuEntry); ControlsContainer.Add(musicVolumeSlider); ControlsContainer.Add(soundFxVolumeSlider); ControlsContainer.Add(menuEffectsVolumeSlider); ControlsContainer.Add(musicSelectButton); ControlsContainer.Add(toggleMenuEffectsActionButton); ControlsContainer.Add(toggleSoundEffectsActionButton); }
/// <summary> /// Constructor fills in the menu contents. /// </summary> public MainMenuScreen(string x) : base(x) { // Create our menu entries. if (BombermanAdventureGame.ActivePlayer.InGame) { var continueGameMenuEntry = new MenuEntry("continue game"); continueGameMenuEntry.Selected += ContinueGameMenuEntrySelected; MenuEntries.Add(continueGameMenuEntry); } var playGameMenuEntry = new MenuEntry("play new game"); var infoMenuEntry = new MenuEntry("player info"); var helpMenuEntry = new MenuEntry("command help"); var deleteProfileMenuEntry = new MenuEntry("delete profile"); var exitMenuEntry = new MenuEntry("exit"); // Hook up menu event handlers. playGameMenuEntry.Selected += PlayGameMenuEntrySelected; infoMenuEntry.Selected += InfoMenuEntrySelected; helpMenuEntry.Selected += HelpMenuEntrySelected; exitMenuEntry.Selected += OnExit; deleteProfileMenuEntry.Selected += OnDelete; // Add entries to the menu. MenuEntries.Add(playGameMenuEntry); MenuEntries.Add(infoMenuEntry); MenuEntries.Add(helpMenuEntry); MenuEntries.Add(deleteProfileMenuEntry); MenuEntries.Add(exitMenuEntry); }
public OptionsMenu(Texture2D[] panels, Texture2D[] backgroundAssets, Save save) : base(panels, backgroundAssets) { //This is the starting point of the menu. OptionsMenu.Selected += (object sender, EventArgs args) => { this.CurrentState = State.Shown; this._delay = 0; }; MenuEntry music = new MenuEntry("Music On"); if (!save.Config.MusicEnabled) music.Text = "Music Off"; MenuEntry voice = new MenuEntry("Voices On"); if (!save.Config.VoiceEnabled) voice.Text = "Voices Off"; MenuEntry soundeffects = new MenuEntry("Sound Effects On"); if (!save.Config.SoundEnabled) soundeffects.Text = "Sound Effects Off"; MenuEntry back = new MenuEntry("Back"); music.Enter += (object sender, EventArgs args) => { save.Config.MusicEnabled = !save.Config.MusicEnabled; if (save.Config.MusicEnabled) music.Text = "Music On"; else music.Text = "Music Off"; }; voice.Enter += (object sender, EventArgs args) => { save.Config.VoiceEnabled = !save.Config.VoiceEnabled; if (save.Config.VoiceEnabled) voice.Text = "Voices On"; else voice.Text = "Voices Off"; }; soundeffects.Enter += (object sender, EventArgs args) => { save.Config.SoundEnabled = !save.Config.SoundEnabled; if (save.Config.SoundEnabled) soundeffects.Text = "Sound Effects On"; else soundeffects.Text = "Sound Effects Off"; }; back.Enter += (object sender, EventArgs args) => { this.CurrentState = State.Hidden; MainMenu.SelectedEvent(); }; this.MenuEntryList.Add(music); this.MenuEntryList.Add(voice); this.MenuEntryList.Add(soundeffects); this.MenuEntryList.Add(back); }
/// <summary> /// Constructor fills in the menu contents. /// </summary> public HelpScreen() : base("command help") { var backEntry = new MenuEntry("back", new Vector2(LeftM + 20, BombermanAdventureGame.ScreenHeight - BottomM - 30)); backEntry.Selected += OnCancel; MenuEntries.Add(backEntry); }
/// <summary> /// Initializes a new instance of the <see cref="GraphikScreen"/> class. /// </summary> /// <param name="graphicsManager">The graphics manager.</param> /// <param name="screenManager">The screen manager.</param> public GraphikScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager) : base(graphicsManager, screenManager, "Ballerburg3D") { // Zurück button zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 0) { Position = new Vector2(500, 450) }; zurueckMenuEntry.Selected += ZurueckMenuEntrySelected; ControlsContainer.Add(zurueckMenuEntry); }
public OptionsMenu(SchmupGame game) : base(game) { MenuEntry menuEntry; menuEntry = new MenuEntry("Back to main menu"); AddEntry(menuEntry); this.Enabled = this.Visible = false; }
/// <summary> /// Initialize a new instance of MainMenu /// </summary> /// <param name="game">The game</param> public OptionsMenu(SchmupGame game) : base(game) { MenuEntry menuEntry; menuEntry = new MenuEntry("Back to main menu"); AddEntry(menuEntry); Stop(); }
/// <summary> /// Constructor fills in the menu contents. /// </summary> public ProfileDetailScreen() : base(BombermanAdventureGame.ActivePlayer.Name + " info") { var backEntry = new MenuEntry("back", new Vector2(LeftM + 20, BombermanAdventureGame.ScreenHeight - BottomM - 30)); backEntry.Selected += OnCancel; MenuEntries.Add(backEntry); }
/// <summary> /// Add entry to the menu /// </summary> /// <param name="MenuEntry">MenuEntry to add</param> public void addMenuEntry(MenuEntry menuEntry) { menuEntry.Initialize(_touchTarget); menuEntry.Dragable = false; menuEntry.Touchable = true; menuEntry.MenuCaller = this; _manager.Register(menuEntry); _menuEntries.Add(menuEntry); }
public ExitScreen() : base("Quit Game") { continueGame = new MenuEntry("Continue"); exitGame = new MenuEntry("Quit Game"); continueGame.entryClicked += OnContinueGame; exitGame.entryClicked += OnExitGame; menuEntries.Add(continueGame); menuEntries.Add(exitGame); }
public LobbyScreen() : base("Lobby") { MenuEntry joingame = new MenuEntry("Join a game"); MenuEntry back = new MenuEntry("Back"); joingame.Selected += JoinGameSelected; MenuEntries.Add(joingame); MenuEntries.Add(back); back.Selected += OnCancel; }
public StartScreen() : base("") { menuCancel = new InputAction(new Buttons[] { }, new Keys[] { }, true); MenuEntry enter = new MenuEntry("Press A"); enter.Selected += entry; MenuEntries.Add(enter); }
public CharacterSelect(Game game) { TransitionOnTime = TimeSpan.FromSeconds(1.5); TransitionOffTime = TimeSpan.FromSeconds(0.5); MenuEntry backMenuEntry = new MenuEntry("Back"); backMenuEntry.Selected += OnCancel; MenuScreen.MenuEntries.Add(backMenuEntry); this.game = game; }
public CreditsScreen() : base("Help") { MenuEntry back = new MenuEntry("Back"); // Hook up menu event handlers. back.Selected += OnCancel; // Add entries to the menu. MenuEntries.Add(back); }
public WinGameScreen() : base("YOU WIN!") { MenuEntry returnToMenuEntry = new MenuEntry("Return To Menu"); MenuEntry exitGameMenuEntry = new MenuEntry("Exit"); returnToMenuEntry.Selected += returnToMenuEntrySelected; exitGameMenuEntry.Selected += ExitGameMenuEntrySelected; MenuEntries.Add(returnToMenuEntry); MenuEntries.Add(exitGameMenuEntry); }
/// <summary> /// Constructor /// </summary> public MainMenu(Texture2D[] panels, Texture2D[] backgroundAssets) : base(panels, backgroundAssets) { //This is the starting point of the menu. MainMenu.Selected += (object sender, EventArgs args) => { this.CurrentState = State.Shown; this._delay = 0; }; MenuEntry play = new MenuEntry("Campaign"); MenuEntry spacebattle = new MenuEntry("Space Battle"); MenuEntry options = new MenuEntry("Options"); MenuEntry leaderboards = new MenuEntry("Leaderboards"); MenuEntry howtoplay = new MenuEntry("How To Play"); MenuEntry about = new MenuEntry("About"); play.Enter += (object sender, EventArgs args) => { this.CurrentState = State.Hidden; PlayMenu.SelectedEvent(); }; options.Enter += (object sender, EventArgs args) => { this.CurrentState = State.Hidden; OptionsMenu.SelectedEvent(); }; about.Enter += (object sender, EventArgs args) => { this.CurrentState = State.Hidden; AboutMenu.SelectedEvent(); }; spacebattle.Enter += (object sender, EventArgs args) => { this.CurrentState = State.Hidden; SpaceMenu.SelectedEvent(); }; leaderboards.Enter += (object sender, EventArgs args) => { this.CurrentState = State.Hidden; LeaderboardMenu.SelectedEvent(); }; this.MenuEntryList.Add(play); this.MenuEntryList.Add(spacebattle); this.MenuEntryList.Add(leaderboards); this.MenuEntryList.Add(options); this.MenuEntryList.Add(about); this.MenuEntryList.Add(howtoplay); }
public static void Create(MenuEntry menuEntry, FeedTarget target, bool machineWide, ITaskHandler handler) { throw new NotImplementedException(); }
//When you delete a category all the food items inside will be deleted as well public static void DeleteFoodItemsInsideCategory(FoodLists FoodLists, int deleteNum, MenuEntry item) { if (FoodLists.CategoryList[deleteNum] == item.Categories) { FoodLists.FoodItemList.Remove(item); } }
private void VisitItem(MenuEntry parent, object instance, MenuEntry rootMenu) { var type = instance.GetType(); var propertyInfos = type.GetProperties(BindingFlags.Instance | BindingFlags.Public); foreach (var propertyInfo in propertyInfos.OrderBy(x => this.Order(propertyInfos, x)).ToArray()) { var menuItemAttribute = propertyInfo.GetCustomAttribute <ItemAttribute>(); if (menuItemAttribute == null) { continue; } var propertyValue = propertyInfo.GetValue(instance); if (propertyValue == null) { throw new NullReferenceException($"{type.FullName} {propertyInfo.Name}"); } var menuItemName = menuItemAttribute.Name; if (string.IsNullOrEmpty(menuItemName)) { menuItemName = propertyInfo.Name; } this.context.Container.BuildUp(propertyValue); var textureAttribute = propertyInfo.GetCustomAttribute <TextureAttribute>(); textureAttribute?.Load(this.context.Renderer); var view = this.viewRepository.GetView(propertyInfo.PropertyType); MenuItemEntry menuItemEntry; if (propertyInfo.GetCustomAttribute <PermaShowAttribute>() != null) { var tmp = new PermaMenuItemEntry( menuItemName, textureAttribute?.TextureKey, view, this.context.Renderer, this.MenuConfig, new ValuePropertyBinding(instance, propertyInfo)); tmp.RootMenuName = rootMenu.Name; this.permaItemEntries.Add(tmp); menuItemEntry = tmp; } else { menuItemEntry = new MenuItemEntry( menuItemName, textureAttribute?.TextureKey, view, this.context.Renderer, this.MenuConfig, new ValuePropertyBinding(instance, propertyInfo)); } var tooltip = propertyInfo.GetCustomAttribute <TooltipAttribute>(); if (tooltip != null) { menuItemEntry.Tooltip = tooltip.Text; } parent.AddChild(menuItemEntry); } }
static public AufgaabeParamAndere KonstruktMenuEntry(MenuEntry MenuEntry) { return(new AufgaabeParamAndere(MenuEntry: MenuEntry)); }
public void UpdateMenuEntry_InvalidObjectId_Failure() { var res = MenuEntry.UpdateMenuEntry(_connectionServer, "aaa", "1", null); Assert.IsFalse(res.Success, "Invalid CallHandlerObjectId should fail"); }
public static void Remove(MenuEntry menuEntry, bool machineWide) { throw new NotImplementedException(); }
private void OnMouseClick(object sender, MouseEventArgs e) { if ((e.Buttons & MouseButtons.Left) == 0) { return; } if ((e.Buttons & MouseButtons.LeftUp) == MouseButtons.LeftUp) { if (this.titleBarDragged) { Log.Debug($"Stop title bar dragging"); this.titleBarDragged = false; return; } // handle drag and drop if (this.dragMenuEntry != null) { // TODO: this.dragMenuEntry = null; } if (this.blockedLeftClick) { e.Process = false; this.blockedLeftClick = false; } // return; } if (this.titleBarHovered && (e.Buttons & MouseButtons.LeftDown) == MouseButtons.LeftDown) { Log.Debug($"start title bar dragging"); if (this.IsVisible) { this.dragMouseDiff = e.Position - this.Position; this.titleBarDragged = true; } else if (this.MenuConfig.IsPermaShowActive) { this.dragMouseDiff = e.Position - this.PermaPosition; this.titleBarDragged = true; } return; } if (!this.IsVisible || !this.IsInsideMenu(e.Position)) { return; } // check for click if (this.LastHoverEntry != null) { if (this.context.Input.IsKeyDown(Key.Escape)) { this.LastHoverEntry.Reset(); } else { this.LastHoverEntry.OnClick(e.Buttons, e.Position); if (this.LastHoverEntry is MenuEntry menuEntry) { if (!menuEntry.IsCollapsed) { this.CollapseLayer(menuEntry, this.rootMenus); if (this.rootMenus.Contains(menuEntry)) { Messenger <RootMenuExpandMessage> .Publish(new RootMenuExpandMessage("SDK")); } } } } e.Process = false; this.blockedLeftClick = true; } }
public static string GetMenuEntryExplanation(MenuEntry entry) { string explanation; switch (entry) { case MenuEntry.MakeSystemAppsRemovable: return("This procedure will edit an internal database to allow the removal of system UWP apps " + "such as Edge, Security Center, Connect via normal PowerShell methods.\n" + "A backup of the database will be saved in the current directory. " + "It will become useless as soon as you install/remove an app, so make sure you don't have " + "any problems with Windows Update or the Store after the operation is completed.\n" + "Take note that you might not receive any more Windows feature updates after applying these modifications.\n" + @"If you get the error ""attempt to write a readonly database"", try again and make sure that " + "the Store is not installing/updating apps in the background."); case MenuEntry.RemoveUWPApps: explanation = "The following groups of UWP apps will be removed:\n"; foreach (UWPAppGroup app in Configuration.Instance.UWPAppsToRemove) { explanation += $" {app.ToString()}\n"; } explanation += "Some specific app-related services will also be removed " + "(but backed up in case you need to restore them).\n" + "In order to remove Edge, Connect and some components of Xbox, you need to make system apps removable first."; if (Configuration.Instance.UWPAppsRemovalMode == UWPAppRemovalMode.RemoveProvisionedPackages) { explanation += "\n\nAs specified in configuration file, provisioned packages of the " + "aforementioned apps will be removed too (if available).\n" + "This means that those apps won't be installed to new users when they log in for the first time.\n" + @"To prevent this behaviour, change UWPAppsRemovalMode option to ""KeepProvisionedPackages""."; } return(explanation); case MenuEntry.RemoveWinDefender: return("Important: Before starting, disable Tamper protection in Windows Security " + "under Virus & threat protection settings.\n" + "Defender will be removed using install-wim-tweak and disabled via Group Policies.\n" + "If you have already made system apps removable, Security Center app will be removed too; " + "otherwise, its menu icon will remain there, but the app won't start anymore."); case MenuEntry.RemoveMSEdge: return("Starting from Windows 10 version 1903, install-wim-tweak can no longer be used to remove " + "Edge since it breaks the installation of cumulative updates.\n" + @"To accomplish this task, add ""Edge"" to the list ""UWPAppsToRemove"" in configuration " + "file, make system apps removable and then use UWP apps removal."); case MenuEntry.RemoveOneDrive: return("If you allow the use of install-wim-tweak, this will prevent the app to be installed for " + "new users and to return after a reset or a major Windows update."); case MenuEntry.RemoveWindowsFeatures: explanation = "The following features will be removed:\n"; foreach (string feature in Configuration.Instance.WindowsFeaturesToRemove) { explanation += $" {feature}\n"; } return(explanation); case MenuEntry.DisableCortana: return("This won't remove Cortana (otherwise the system would break), it will only be disabled " + "using Group Policy and blocked by the firewall."); case MenuEntry.RemoveServices: explanation = "The services starting with the following names will be removed:\n"; foreach (string service in Configuration.Instance.ServicesToRemove) { explanation += $" {service}\n"; } return(explanation + "Services will be backed up in the same folder as this program executable."); case MenuEntry.DisableScheduledTasks: explanation = "The following scheduled tasks will be disabled:\n"; foreach (string task in Configuration.Instance.ScheduledTasksToDisable) { explanation += $" {task}\n"; } return(explanation); case MenuEntry.OpenGitHubIssue: return("Your browser will now open on a GitHub page where you will be able to " + "open an issue to report a bug or suggest a new feature."); case MenuEntry.DisableAutoUpdates: return("Windows and Store apps automatic updates will be disabled using Group Policies.\n" + "This method won't work on Windows 10 Home."); case MenuEntry.DisableTelemetry: return("This will backup and remove several telemetry-related services and disable features that " + "report data to Microsoft, including MS Compatibility Telemetry, Device Census, " + "SmartScreen, Steps Recorder and Compatibility Assistant."); case MenuEntry.DisableErrorReporting: return("Windows Error Reporting will disabled by editing Group Policies, as well as by removing " + "its services (after backing them up)."); case MenuEntry.Credits: return("Developed by Fs00\n" + "Official GitHub repository: github.com/Fs00/Win10BloatRemover\n" + "Based on Windows 10 de-botnet guide by Federico Dossena: fdossena.com\n\n" + "This software is released under BSD 3-Clause Clear license (continue to read full text)."); case MenuEntry.Quit: return("Are you sure?"); default: return(string.Empty); } }
private void InitilizeLanguages() { string[] k = temps_best.Split(new char[] { '-' }); scores = new float[k.Length]; for (int i = 0; i < k.Length; i++) { scores[i] = float.Parse(k[i]); } difficulte = lang.AffectationLANG("Difficulte", langue); locked = lang.AffectationLANG("Locked", langue); jouer = lang.AffectationLANG("Difficulte", langue); quitter = lang.AffectationLANG("Retour", langue); if (scores.Length > 5 && scores[5] >= 60000f) { MenuEntry JouerEntry2 = new MenuEntry(jouer + " 2"); MenuEntry JouerEntry3 = new MenuEntry(jouer + " 3"); MenuEntry JouerEntry4 = new MenuEntry(jouer + " 4"); MenuEntry JouerEntry5 = new MenuEntry(jouer + " 5"); MenuEntry JouerEntry6 = new MenuEntry(jouer + " 6"); MenuEntry JouerEntry7 = new MenuEntry(jouer + " 7"); MenuEntry JouerEntry8 = new MenuEntry(jouer + " 8"); JouerEntry2.Selected += Jouer2; JouerEntry3.Selected += Jouer3; JouerEntry4.Selected += Jouer4; JouerEntry5.Selected += Jouer5; JouerEntry6.Selected += Jouer6; JouerEntry7.Selected += Jouer7; JouerEntry8.Selected += Jouer8; MenuEntries.Add(JouerEntry2); MenuEntries.Add(JouerEntry3); MenuEntries.Add(JouerEntry4); MenuEntries.Add(JouerEntry5); MenuEntries.Add(JouerEntry6); MenuEntries.Add(JouerEntry7); MenuEntries.Add(JouerEntry8); } else if (scores.Length > 4 && scores[4] >= 60000f) { MenuEntry JouerEntry2 = new MenuEntry(jouer + " 2"); MenuEntry JouerEntry3 = new MenuEntry(jouer + " 3"); MenuEntry JouerEntry4 = new MenuEntry(jouer + " 4"); MenuEntry JouerEntry5 = new MenuEntry(jouer + " 5"); MenuEntry JouerEntry6 = new MenuEntry(jouer + " 6"); MenuEntry JouerEntry7 = new MenuEntry(jouer + " 7"); MenuEntry ADEBLOQUER = new MenuEntry(locked); JouerEntry2.Selected += Jouer2; JouerEntry3.Selected += Jouer3; JouerEntry4.Selected += Jouer4; JouerEntry5.Selected += Jouer5; JouerEntry6.Selected += Jouer6; JouerEntry7.Selected += Jouer7; ADEBLOQUER.Selected += Locked; MenuEntries.Add(JouerEntry2); MenuEntries.Add(JouerEntry3); MenuEntries.Add(JouerEntry4); MenuEntries.Add(JouerEntry5); MenuEntries.Add(JouerEntry6); MenuEntries.Add(JouerEntry7); MenuEntries.Add(ADEBLOQUER); } else if (scores.Length > 3 && scores[3] >= 60000f) { MenuEntry JouerEntry2 = new MenuEntry(jouer + " 2"); MenuEntry JouerEntry3 = new MenuEntry(jouer + " 3"); MenuEntry JouerEntry4 = new MenuEntry(jouer + " 4"); MenuEntry JouerEntry5 = new MenuEntry(jouer + " 5"); MenuEntry JouerEntry6 = new MenuEntry(jouer + " 6"); MenuEntry ADEBLOQUER = new MenuEntry(locked); MenuEntry ADEBLOQUER1 = new MenuEntry(locked); JouerEntry2.Selected += Jouer2; JouerEntry3.Selected += Jouer3; JouerEntry4.Selected += Jouer4; JouerEntry5.Selected += Jouer5; JouerEntry6.Selected += Jouer6; ADEBLOQUER.Selected += Locked; ADEBLOQUER1.Selected += Locked; MenuEntries.Add(JouerEntry2); MenuEntries.Add(JouerEntry3); MenuEntries.Add(JouerEntry4); MenuEntries.Add(JouerEntry5); MenuEntries.Add(JouerEntry6); MenuEntries.Add(ADEBLOQUER); MenuEntries.Add(ADEBLOQUER1); } else if (scores.Length > 2 && scores[2] >= 60000f) { MenuEntry JouerEntry2 = new MenuEntry(jouer + " 2"); MenuEntry JouerEntry3 = new MenuEntry(jouer + " 3"); MenuEntry JouerEntry4 = new MenuEntry(jouer + " 4"); MenuEntry JouerEntry5 = new MenuEntry(jouer + " 5"); MenuEntry ADEBLOQUER = new MenuEntry(locked); MenuEntry ADEBLOQUER1 = new MenuEntry(locked); MenuEntry ADEBLOQUER2 = new MenuEntry(locked); JouerEntry2.Selected += Jouer2; JouerEntry3.Selected += Jouer3; JouerEntry4.Selected += Jouer4; JouerEntry5.Selected += Jouer5; ADEBLOQUER.Selected += Locked; ADEBLOQUER1.Selected += Locked; ADEBLOQUER2.Selected += Locked; MenuEntries.Add(JouerEntry2); MenuEntries.Add(JouerEntry3); MenuEntries.Add(JouerEntry4); MenuEntries.Add(JouerEntry5); MenuEntries.Add(ADEBLOQUER); MenuEntries.Add(ADEBLOQUER1); MenuEntries.Add(ADEBLOQUER2); } else if (scores.Length > 1 && scores[1] >= 60000f) { MenuEntry JouerEntry2 = new MenuEntry(jouer + " 2"); MenuEntry JouerEntry3 = new MenuEntry(jouer + " 3"); MenuEntry JouerEntry4 = new MenuEntry(jouer + " 4"); MenuEntry ADEBLOQUER = new MenuEntry(locked); MenuEntry ADEBLOQUER1 = new MenuEntry(locked); MenuEntry ADEBLOQUER2 = new MenuEntry(locked); MenuEntry ADEBLOQUER3 = new MenuEntry(locked); JouerEntry2.Selected += Jouer2; JouerEntry3.Selected += Jouer3; JouerEntry4.Selected += Jouer4; ADEBLOQUER.Selected += Locked; ADEBLOQUER1.Selected += Locked; ADEBLOQUER2.Selected += Locked; ADEBLOQUER3.Selected += Locked; MenuEntries.Add(JouerEntry2); MenuEntries.Add(JouerEntry3); MenuEntries.Add(JouerEntry4); MenuEntries.Add(ADEBLOQUER); MenuEntries.Add(ADEBLOQUER1); MenuEntries.Add(ADEBLOQUER2); MenuEntries.Add(ADEBLOQUER3); } else if (scores[0] >= 60000f) { MenuEntry JouerEntry2 = new MenuEntry(jouer + " 2"); MenuEntry JouerEntry3 = new MenuEntry(jouer + " 3"); MenuEntry ADEBLOQUER = new MenuEntry(locked); MenuEntry ADEBLOQUER1 = new MenuEntry(locked); MenuEntry ADEBLOQUER2 = new MenuEntry(locked); MenuEntry ADEBLOQUER3 = new MenuEntry(locked); MenuEntry ADEBLOQUER4 = new MenuEntry(locked); JouerEntry2.Selected += Jouer2; JouerEntry3.Selected += Jouer3; ADEBLOQUER.Selected += Locked; ADEBLOQUER1.Selected += Locked; ADEBLOQUER2.Selected += Locked; ADEBLOQUER3.Selected += Locked; ADEBLOQUER4.Selected += Locked; MenuEntries.Add(JouerEntry2); MenuEntries.Add(JouerEntry3); MenuEntries.Add(ADEBLOQUER); MenuEntries.Add(ADEBLOQUER1); MenuEntries.Add(ADEBLOQUER2); MenuEntries.Add(ADEBLOQUER3); MenuEntries.Add(ADEBLOQUER4); } else { MenuEntry JouerEntry2 = new MenuEntry(jouer + " 2"); MenuEntry ADEBLOQUER = new MenuEntry(locked); MenuEntry ADEBLOQUER1 = new MenuEntry(locked); MenuEntry ADEBLOQUER2 = new MenuEntry(locked); MenuEntry ADEBLOQUER3 = new MenuEntry(locked); MenuEntry ADEBLOQUER4 = new MenuEntry(locked); MenuEntry ADEBLOQUER5 = new MenuEntry(locked); JouerEntry2.Selected += Jouer2; ADEBLOQUER.Selected += Locked; ADEBLOQUER1.Selected += Locked; ADEBLOQUER2.Selected += Locked; ADEBLOQUER3.Selected += Locked; ADEBLOQUER4.Selected += Locked; ADEBLOQUER5.Selected += Locked; MenuEntries.Add(JouerEntry2); MenuEntries.Add(ADEBLOQUER); MenuEntries.Add(ADEBLOQUER1); MenuEntries.Add(ADEBLOQUER2); MenuEntries.Add(ADEBLOQUER3); MenuEntries.Add(ADEBLOQUER4); MenuEntries.Add(ADEBLOQUER5); } MenuEntry exitMenuEntry = new MenuEntry(quitter); exitMenuEntry.Selected += Quitter; MenuEntries.Add(exitMenuEntry); }
private void OnMouseMove(object sender, MouseEventArgs e) { if (this.titleBarDragged) { if (this.IsVisible) { var pos = e.Position - this.dragMouseDiff; pos.X = Math.Max(this.MenuConfig.MenuPosition.MinValue.X, Math.Min(this.MenuConfig.MenuPosition.MaxValue.X, pos.X)); pos.Y = Math.Max(this.MenuConfig.MenuPosition.MinValue.Y, Math.Min(this.MenuConfig.MenuPosition.MaxValue.Y, pos.Y)); this.Position = pos; } else { var pos = e.Position - this.dragMouseDiff; pos.X = Math.Max(this.MenuConfig.PermaPosition.MinValue.X, Math.Min(this.MenuConfig.PermaPosition.MaxValue.X, pos.X)); pos.Y = Math.Max(this.MenuConfig.PermaPosition.MinValue.Y, Math.Min(this.MenuConfig.PermaPosition.MaxValue.Y, pos.Y)); this.PermaPosition = pos; } return; } // check for titlebar mouseover var titleBar = this.IsVisible ? new RectangleF(this.Position.X, this.Position.Y, this.TitleBarSize.X, this.TitleBarSize.Y) : new RectangleF(this.PermaPosition.X, this.PermaPosition.Y, this.TitleBarSize.X, this.TitleBarSize.Y); this.titleBarHovered = titleBar.Contains(e.Position); if (!this.IsVisible || !this.IsInsideMenu(e.Position)) { if (this.LastHoverEntry != null) { Log.Info($"MouseLeave {this.LastHoverEntry}"); this.LastHoverEntry = null; } return; } if (this.dragMenuEntry != null) { return; } if (!this.titleBarHovered) { // check for mouse hover foreach (var menuEntry in this.rootMenus) { var hoverItem = this.OnInsideCheck(menuEntry, e.Position); if (hoverItem != null) { if (this.LastHoverEntry != hoverItem) { if (this.LastHoverEntry != null) { Log.Info($"MouseLeave {this.LastHoverEntry}"); } Log.Info($"MouseHover {hoverItem}"); this.LastHoverEntry = hoverItem; // check for drag and drop of menu entries (possible to swap positions) if ((e.Buttons & MouseButtons.Left) != 0 && this.LastHoverEntry is MenuEntry hoverEntry && this.LastHoverEntry.DataContext != this.MenuConfig) { this.dragStartPosition = e.Position; this.dragMenuEntry = hoverEntry; } } return; } } } if (this.LastHoverEntry != null) { Log.Info($"MouseLeave {this.LastHoverEntry}"); this.LastHoverEntry = null; } }
public void Constructor_InvalidObjectIdAndKeyName_Failure() { MenuEntry oTest = new MenuEntry(_connectionServer, "bogus", "bogus"); Console.WriteLine(oTest); }
/// <summary> /// </summary> internal ToolbarInfo() { _count = 0; _menuEntrySeperator = null; }
public void UpdateMenuEntry_InvalidKeyName_Failure() { var res = MenuEntry.UpdateMenuEntry(_connectionServer, _callHandler.ObjectId, "a", null); Assert.IsFalse(res.Success, "Invalid menu entry key name should fail"); }
/// <summary> /// </summary> /// <param name = "menuEntrySeperator"></param> internal void setMenuEntrySeperator(MenuEntry menuEntrySeperator) { _menuEntrySeperator = menuEntrySeperator; }
private void VisitInstance(MenuEntry parent, object instance, MenuEntry rootMenu) { this.VisitMenu(parent, instance, rootMenu); this.VisitItem(parent, instance, rootMenu); }