void gameRuleComponent_RuleChanged(object sender, EventArgs e) { if (RuleChanged != null) { RuleChanged.Invoke(gameRuleComponent.GameRule); } }
private void cbxRule_SelectedIndexChanged(object sender, EventArgs e) { if (cbxRule.SelectedIndex == -1) { return; } var val = cbxRule.Text; RuleChanged?.Invoke(sender, new RuleChangedEventArgs(val)); }
private void CmbPreset_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (SuspendChange != 0) { return; } PresetMode Value = (PresetMode)(cmbPreset.SelectedItem as ComboBoxItem).Tag; cmbPreset.Background = GetPresetColor(Value, this); SetPresetMode(Value, out rule.OnState, out rule.OffState); RuleChanged?.Invoke(this, new EventArgs()); }
void ItemSettingComponent_Inputed(IFocusable sender, InputEventArgs args) { if (args.InputInfo.IsPressed(ButtonType.Cross)) { sound.Play(PPDSetting.DefaultSounds[2], -1000); FocusManager.RemoveFocus(); } else if (args.InputInfo.IsPressed(ButtonType.Down)) { if (!CurrentSelectedComponent.Down()) { CurrentSelectedComponent.Selected = false; gridSelection.Down(); CurrentSelectedComponent.Selected = true; sound.Play(PPDSetting.DefaultSounds[0], -1000); } else { sound.Play(PPDSetting.DefaultSounds[3], -1000); } } else if (args.InputInfo.IsPressed(ButtonType.Up)) { if (!CurrentSelectedComponent.Up()) { CurrentSelectedComponent.Selected = false; gridSelection.Up(); CurrentSelectedComponent.Selected = true; sound.Play(PPDSetting.DefaultSounds[0], -1000); } else { sound.Play(PPDSetting.DefaultSounds[3], -1000); } } else if (args.InputInfo.IsPressed(ButtonType.Left)) { if (!CurrentSelectedComponent.Left()) { CurrentSelectedComponent.Selected = false; gridSelection.Left(); CurrentSelectedComponent.Selected = true; sound.Play(PPDSetting.DefaultSounds[0], -1000); } else { sound.Play(PPDSetting.DefaultSounds[3], -1000); } } else if (args.InputInfo.IsPressed(ButtonType.Right)) { if (!CurrentSelectedComponent.Right()) { CurrentSelectedComponent.Selected = false; gridSelection.Right(); CurrentSelectedComponent.Selected = true; sound.Play(PPDSetting.DefaultSounds[0], -1000); } else { sound.Play(PPDSetting.DefaultSounds[3], -1000); } } else if (args.InputInfo.IsPressed(ButtonType.Circle)) { if (CurrentSelectedComponent == okButton) { SetRule(); if (RuleChanged != null) { RuleChanged.Invoke(this, EventArgs.Empty); } sound.Play(PPDSetting.DefaultSounds[1], -1000); } else if (CurrentSelectedComponent == cancelButton) { FocusManager.RemoveFocus(); } else { CurrentSelectedComponent.Checked = !CurrentSelectedComponent.Checked; sound.Play(PPDSetting.DefaultSounds[3], -1000); } } }
protected virtual void OnRuleChanged(string obj) { RuleChanged?.Invoke(obj); }
protected virtual void OnRuleChanged(VersionUpdateRule rule) => RuleChanged?.Invoke(rule);