private void HandleBackPressed() { tempState = SettingsState.Clone(savedState); fullscreenBox.Pressed = tempState.fullscreen; OnSettingsMenuBackPressed?.Invoke(); }
public static SettingsState Clone(SettingsState other) { SettingsState newState = new SettingsState(); newState.fullscreen = other.fullscreen; return(newState); }
public override void _Ready() { LoadSettings(); tempState = new SettingsState(); fullscreenBox = GetNode <CheckBox>(fullScreenBoxPath); applyButton = GetNode <Button>(applyButtonPath); backButton = GetNode <Button>(backButtonPath); fullscreenBox.Connect("toggled", this, nameof(HandleFullScreenToggled)); applyButton.Connect("pressed", this, nameof(HandleApplyPressed)); backButton.Connect("pressed", this, nameof(HandleBackPressed)); }
private void HandleApplyPressed() { savedState = SettingsState.Clone(tempState); OS.WindowFullscreen = savedState.fullscreen; }
private void LoadSettings() { savedState = new SettingsState(); }