void SaveSettings() { var settings = AppSettings.Load(); settings.Difficulty = cmbDifficulty.SelectedItem.ToEnumOrDefault(GameDifficultyTypes.NORMAL); settings.PlayerName = txtPlayerName.Text; settings.BGMVolume = tbBGMVolume.Value; settings.SFXVolume = tbSFXVolume.Value; settings.Save(); OnSettingsSaved?.Invoke(settings); }
public void INTERNAL_OnSettingsSaved() { foreach (var setting in Settings) { setting.UpdateValue(false); } if (OnSettingsSaved != null) { //Debug.Log("OnSettingsSaved Callback for " + this.ModName); OnSettingsSaved.Invoke(); } }
protected virtual void NotifyOnSettingsSaved() { //send a notification to everyone subscribed to recieve an event when the settings are applied OnSettingsSaved?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Saves settings and invokes <see cref="OnSettingsSaved"/> /// </summary> /// <param name="sender">Author of the save</param> public static void Save(object sender) { Settings.Default.Save(); OnSettingsSaved?.Invoke(sender, new EventArgs()); }