/// <summary> /// Конструктор. /// </summary> public OptionsMenuScreen() : base("Options") { // Создаем пункты входа меню. 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"); // Подключаем меню обработчика событий. ungulateMenuEntry.Selected += UngulateMenuEntrySelected; languageMenuEntry.Selected += LanguageMenuEntrySelected; frobnicateMenuEntry.Selected += FrobnicateMenuEntrySelected; elfMenuEntry.Selected += ElfMenuEntrySelected; back.Selected += OnCancel; // Добавляем запись в меню. MenuEntries.Add(ungulateMenuEntry); MenuEntries.Add(languageMenuEntry); MenuEntries.Add(frobnicateMenuEntry); MenuEntries.Add(elfMenuEntry); MenuEntries.Add(back); }
/// <summary> /// Конструкторr. /// </summary> public PauseMenuScreen() : base("Paused") { // Создание входа в меню. MenuEntry resumeGameMenuEntry = new MenuEntry("Resume Game"); MenuEntry quitGameMenuEntry = new MenuEntry("Quit Game"); // Подключение обработчика событий меню. resumeGameMenuEntry.Selected += OnCancel; quitGameMenuEntry.Selected += QuitGameMenuEntrySelected; // Добавляем вход в меню. MenuEntries.Add(resumeGameMenuEntry); MenuEntries.Add(quitGameMenuEntry); }
/// <summary> /// Конструктор заполняет контент меню. /// </summary> public MainMenuScreen() : base("Main Menu") { // Создает компоненты нашего меню. MenuEntry playGameMenuEntry = new MenuEntry("Play Game"); MenuEntry testMenuEntry = new MenuEntry("3D Test"); MenuEntry optionsMenuEntry = new MenuEntry("Options"); MenuEntry exitMenuEntry = new MenuEntry("Exit"); // Подключаем обработчики событий меню. playGameMenuEntry.Selected += PlayGameMenuEntrySelected; testMenuEntry.Selected += testMenuEntrySelected; optionsMenuEntry.Selected += OptionsMenuEntrySelected; exitMenuEntry.Selected += OnCancel; // Добавляет компоненты в меню. MenuEntries.Add(playGameMenuEntry); MenuEntries.Add(testMenuEntry); MenuEntries.Add(optionsMenuEntry); MenuEntries.Add(exitMenuEntry); }