public ControlsOptionsMenuScreen() : base("Controls") { foreach (var controlSetting in SettingsManager.Instance.Controls) { var menuEntry = new KeySelectMenuEntry(controlSetting.Key, controlSetting.Value); menuEntry.KeySelectionFinished += OnKeySelectionFinished; menuEntry.Entered += OnKeySelectionStart; MenuEntries.Add(menuEntry); } var backMenuEntry = new MenuEntry("Back"); backMenuEntry.Entered += OnCancel; MenuEntries.Add(backMenuEntry); }
void OnKeySelectionStart(object sender, EventArgs e) { _activeMenuEntry = (KeySelectMenuEntry) sender; }
void OnKeySelectionFinished(object sender, EventArgs e) { _activeMenuEntry = null; }