public override void _Ready() { // Options control buttons resetButton = GetNode <Button>(ResetButtonPath); saveButton = GetNode <Button>(SaveButtonPath); // Tab selector buttons graphicsButton = GetNode <Button>(GraphicsButtonPath); soundButton = GetNode <Button>(SoundButtonPath); performanceButton = GetNode <Button>(PerformanceButtonPath); miscButton = GetNode <Button>(MiscButtonPath); // Graphics graphicsTab = GetNode <Control>(GraphicsTabPath); vsync = GetNode <CheckBox>(VSyncPath); fullScreen = GetNode <CheckBox>(FullScreenPath); msaaResolution = GetNode <OptionButton>(MSAAResolutionPath); colourblindSetting = GetNode <OptionButton>(ColourblindSettingPath); chromaticAberrationToggle = GetNode <CheckBox>(ChromaticAberrationTogglePath); chromaticAberrationSlider = GetNode <Slider>(ChromaticAberrationSliderPath); // Sound soundTab = GetNode <Control>(SoundTabPath); masterVolume = GetNode <Slider>(MasterVolumePath); masterMuted = GetNode <CheckBox>(MasterMutedPath); musicVolume = GetNode <Slider>(MusicVolumePath); musicMuted = GetNode <CheckBox>(MusicMutedPath); ambianceVolume = GetNode <Slider>(AmbianceVolumePath); ambianceMuted = GetNode <CheckBox>(AmbianceMutedPath); sfxVolume = GetNode <Slider>(SFXVolumePath); sfxMuted = GetNode <CheckBox>(SFXMutedPath); guiVolume = GetNode <Slider>(GUIVolumePath); guiMuted = GetNode <CheckBox>(GUIMutedPath); // Performance performanceTab = GetNode <Control>(PerformanceTabPath); cloudInterval = GetNode <OptionButton>(CloudIntervalPath); cloudResolution = GetNode <OptionButton>(CloudResolutionPath); runAutoEvoDuringGameplay = GetNode <CheckBox>(RunAutoEvoDuringGameplayPath); // Misc miscTab = GetNode <Control>(MiscTabPath); playIntro = GetNode <CheckBox>(PlayIntroPath); playMicrobeIntro = GetNode <CheckBox>(PlayMicrobeIntroPath); tutorialsEnabledOnNewGame = GetNode <CheckBox>(TutorialsEnabledOnNewGamePath); cheats = GetNode <CheckBox>(CheatsPath); autosave = GetNode <CheckBox>(AutoSavePath); maxAutosaves = GetNode <SpinBox>(MaxAutoSavesPath); maxQuicksaves = GetNode <SpinBox>(MaxQuickSavesPath); tutorialsEnabled = GetNode <CheckBox>(TutorialsEnabledPath); customUsernameEnabled = GetNode <CheckBox>(CustomUsernameEnabledPath); customUsername = GetNode <LineEdit>(CustomUsernamePath); backConfirmationBox = GetNode <WindowDialog>(BackConfirmationBoxPath); defaultsConfirmationBox = GetNode <ConfirmationDialog>(DefaultsConfirmationBoxPath); errorAcceptBox = GetNode <AcceptDialog>(ErrorAcceptBoxPath); selectedOptionsTab = SelectedOptionsTab.Graphics; }
/// <summary> /// Changes the active settings tab that is displayed, or returns if the tab is already active. /// </summary> private void ChangeSettingsTab(string newTabName) { // Convert from the string binding to an enum. SelectedOptionsTab selection = (SelectedOptionsTab)Enum.Parse(typeof(SelectedOptionsTab), newTabName); // Pressing the same button that's already active, so just return. if (selection == selectedOptionsTab) { return; } graphicsTab.Hide(); soundTab.Hide(); performanceTab.Hide(); inputsTab.Hide(); miscTab.Hide(); switch (selection) { case SelectedOptionsTab.Graphics: graphicsTab.Show(); graphicsButton.Pressed = true; break; case SelectedOptionsTab.Sound: soundTab.Show(); soundButton.Pressed = true; break; case SelectedOptionsTab.Performance: performanceTab.Show(); performanceButton.Pressed = true; break; case SelectedOptionsTab.Inputs: inputsTab.Show(); inputsButton.Pressed = true; break; case SelectedOptionsTab.Miscellaneous: miscTab.Show(); miscButton.Pressed = true; break; default: GD.PrintErr("Invalid tab"); break; } GUICommon.Instance.PlayButtonPressSound(); selectedOptionsTab = selection; }
public override void _Ready() { // Options control buttons resetButton = GetNode <Button>(ResetButtonPath); saveButton = GetNode <Button>(SaveButtonPath); // Tab selector buttons graphicsButton = GetNode <Button>(GraphicsButtonPath); soundButton = GetNode <Button>(SoundButtonPath); performanceButton = GetNode <Button>(PerformanceButtonPath); inputsButton = GetNode <Button>(InputsButtonPath); miscButton = GetNode <Button>(MiscButtonPath); // Graphics graphicsTab = GetNode <Control>(GraphicsTabPath); vsync = GetNode <CheckBox>(VSyncPath); fullScreen = GetNode <CheckBox>(FullScreenPath); msaaResolution = GetNode <OptionButton>(MSAAResolutionPath); colourblindSetting = GetNode <OptionButton>(ColourblindSettingPath); chromaticAberrationToggle = GetNode <CheckBox>(ChromaticAberrationTogglePath); chromaticAberrationSlider = GetNode <Slider>(ChromaticAberrationSliderPath); // Sound soundTab = GetNode <Control>(SoundTabPath); masterVolume = GetNode <Slider>(MasterVolumePath); masterMuted = GetNode <CheckBox>(MasterMutedPath); musicVolume = GetNode <Slider>(MusicVolumePath); musicMuted = GetNode <CheckBox>(MusicMutedPath); ambianceVolume = GetNode <Slider>(AmbianceVolumePath); ambianceMuted = GetNode <CheckBox>(AmbianceMutedPath); sfxVolume = GetNode <Slider>(SFXVolumePath); sfxMuted = GetNode <CheckBox>(SFXMutedPath); guiVolume = GetNode <Slider>(GUIVolumePath); guiMuted = GetNode <CheckBox>(GUIMutedPath); languageSelection = GetNode <OptionButton>(LanguageSelectionPath); resetLanguageButton = GetNode <Button>(ResetLanguageButtonPath); LoadLanguages(languageSelection); // Performance performanceTab = GetNode <Control>(PerformanceTabPath); cloudInterval = GetNode <OptionButton>(CloudIntervalPath); cloudResolution = GetNode <OptionButton>(CloudResolutionPath); runAutoEvoDuringGameplay = GetNode <CheckBox>(RunAutoEvoDuringGameplayPath); // Inputs inputsTab = GetNode <Control>(InputsTabPath); inputGroupList = GetNode <InputGroupList>(InputGroupListPath); inputGroupList.OnControlsChanged += OnControlsChanged; // Misc miscTab = GetNode <Control>(MiscTabPath); playIntro = GetNode <CheckBox>(PlayIntroPath); playMicrobeIntro = GetNode <CheckBox>(PlayMicrobeIntroPath); tutorialsEnabledOnNewGame = GetNode <CheckBox>(TutorialsEnabledOnNewGamePath); cheats = GetNode <CheckBox>(CheatsPath); autoSave = GetNode <CheckBox>(AutoSavePath); maxAutoSaves = GetNode <SpinBox>(MaxAutoSavesPath); maxQuickSaves = GetNode <SpinBox>(MaxQuickSavesPath); tutorialsEnabled = GetNode <CheckBox>(TutorialsEnabledPath); customUsernameEnabled = GetNode <CheckBox>(CustomUsernameEnabledPath); customUsername = GetNode <LineEdit>(CustomUsernamePath); backConfirmationBox = GetNode <AcceptDialog>(BackConfirmationBoxPath); defaultsConfirmationBox = GetNode <ConfirmationDialog>(DefaultsConfirmationBoxPath); errorAcceptBox = GetNode <AcceptDialog>(ErrorAcceptBoxPath); selectedOptionsTab = SelectedOptionsTab.Graphics; // We're only utilizing the AcceptDialog's auto resize functionality, // so hide the default Ok button since it's not needed backConfirmationBox.GetOk().Hide(); }
public override void _Ready() { // Options control buttons resetButton = GetNode <Button>(ResetButtonPath); saveButton = GetNode <Button>(SaveButtonPath); // Tab selector buttons graphicsButton = GetNode <Button>(GraphicsButtonPath); soundButton = GetNode <Button>(SoundButtonPath); performanceButton = GetNode <Button>(PerformanceButtonPath); miscButton = GetNode <Button>(MiscButtonPath); // Graphics graphicsTab = GetNode <Control>(GraphicsTabPath); vsync = GetNode <CheckBox>(VSyncPath); fullScreen = GetNode <CheckBox>(FullScreenPath); msaaResolution = GetNode <OptionButton>(MSAAResolutionPath); colourblindSetting = GetNode <OptionButton>(ColourblindSettingPath); chromaticAberrationToggle = GetNode <CheckBox>(ChromaticAberrationTogglePath); chromaticAberrationSlider = GetNode <Slider>(ChromaticAberrationSliderPath); // Sound soundTab = GetNode <Control>(SoundTabPath); masterVolume = GetNode <Slider>(MasterVolumePath); masterMuted = GetNode <CheckBox>(MasterMutedPath); musicVolume = GetNode <Slider>(MusicVolumePath); musicMuted = GetNode <CheckBox>(MusicMutedPath); ambianceVolume = GetNode <Slider>(AmbianceVolumePath); ambianceMuted = GetNode <CheckBox>(AmbianceMutedPath); sfxVolume = GetNode <Slider>(SFXVolumePath); sfxMuted = GetNode <CheckBox>(SFXMutedPath); guiVolume = GetNode <Slider>(GUIVolumePath); guiMuted = GetNode <CheckBox>(GUIMutedPath); // Performance performanceTab = GetNode <Control>(PerformanceTabPath); cloudInterval = GetNode <OptionButton>(CloudIntervalPath); cloudResolution = GetNode <OptionButton>(CloudResolutionPath); // Misc miscTab = GetNode <Control>(MiscTabPath); playIntro = GetNode <CheckBox>(PlayIntroPath); playMicrobeIntro = GetNode <CheckBox>(PlayMicrobeIntroPath); tutorialsEnabled = GetNode <CheckBox>(TutorialsEnabledPath); cheats = GetNode <CheckBox>(CheatsPath); autosave = GetNode <CheckBox>(AutoSavePath); maxAutosaves = GetNode <SpinBox>(MaxAutoSavesPath); maxQuicksaves = GetNode <SpinBox>(MaxQuickSavesPath); backConfirmationBox = GetNode <WindowDialog>(BackConfirmationBoxPath); defaultsConfirmationBox = GetNode <ConfirmationDialog>(DefaultsConfirmationBoxPath); errorAcceptBox = GetNode <AcceptDialog>(ErrorAcceptBoxPath); selectedOptionsTab = SelectedOptionsTab.Graphics; // Copy settings from the singleton to serve as a copy of the last saved settings. savedSettings = Settings.Instance.Clone(); // Set the initial state of the options controls to match the settings data. ApplySettingsToControls(savedSettings); CompareSettings(); }
public override void _Ready() { // Options control buttons resetButton = GetNode <Button>(ResetButtonPath); saveButton = GetNode <Button>(SaveButtonPath); // Tab selector buttons graphicsButton = GetNode <Button>(GraphicsButtonPath); soundButton = GetNode <Button>(SoundButtonPath); performanceButton = GetNode <Button>(PerformanceButtonPath); inputsButton = GetNode <Button>(InputsButtonPath); miscButton = GetNode <Button>(MiscButtonPath); // Graphics graphicsTab = GetNode <Control>(GraphicsTabPath); vsync = GetNode <CustomCheckBox>(VSyncPath); fullScreen = GetNode <CustomCheckBox>(FullScreenPath); msaaResolution = GetNode <OptionButton>(MSAAResolutionPath); maxFramesPerSecond = GetNode <OptionButton>(MaxFramesPerSecondPath); colourblindSetting = GetNode <OptionButton>(ColourblindSettingPath); chromaticAberrationToggle = GetNode <CustomCheckBox>(ChromaticAberrationTogglePath); chromaticAberrationSlider = GetNode <Slider>(ChromaticAberrationSliderPath); displayAbilitiesHotBarToggle = GetNode <CustomCheckBox>(DisplayAbilitiesBarTogglePath); guiLightEffectsToggle = GetNode <CustomCheckBox>(GUILightEffectsTogglePath); // Sound soundTab = GetNode <Control>(SoundTabPath); masterVolume = GetNode <Slider>(MasterVolumePath); masterMuted = GetNode <CustomCheckBox>(MasterMutedPath); musicVolume = GetNode <Slider>(MusicVolumePath); musicMuted = GetNode <CustomCheckBox>(MusicMutedPath); ambianceVolume = GetNode <Slider>(AmbianceVolumePath); ambianceMuted = GetNode <CustomCheckBox>(AmbianceMutedPath); sfxVolume = GetNode <Slider>(SFXVolumePath); sfxMuted = GetNode <CustomCheckBox>(SFXMutedPath); guiVolume = GetNode <Slider>(GUIVolumePath); guiMuted = GetNode <CustomCheckBox>(GUIMutedPath); audioOutputDeviceSelection = GetNode <OptionButton>(AudioOutputDeviceSelectionPath); languageSelection = GetNode <OptionButton>(LanguageSelectionPath); resetLanguageButton = GetNode <Button>(ResetLanguageButtonPath); languageProgressLabel = GetNode <Label>(LanguageProgressLabelPath); LoadLanguages(); LoadAudioOutputDevices(); // Performance performanceTab = GetNode <Control>(PerformanceTabPath); cloudInterval = GetNode <OptionButton>(CloudIntervalPath); cloudResolutionTitle = GetNode <VBoxContainer>(CloudResolutionTitlePath); cloudResolution = GetNode <OptionButton>(CloudResolutionPath); runAutoEvoDuringGameplay = GetNode <CustomCheckBox>(RunAutoEvoDuringGameplayPath); detectedCPUCount = GetNode <Label>(DetectedCPUCountPath); activeThreadCount = GetNode <Label>(ActiveThreadCountPath); assumeHyperthreading = GetNode <CustomCheckBox>(AssumeHyperthreadingPath); useManualThreadCount = GetNode <CustomCheckBox>(UseManualThreadCountPath); threadCountSlider = GetNode <Slider>(ThreadCountSliderPath); // Inputs inputsTab = GetNode <Control>(InputsTabPath); inputGroupList = GetNode <InputGroupList>(InputGroupListPath); inputGroupList.OnControlsChanged += OnControlsChanged; // Misc miscTab = GetNode <Control>(MiscTabPath); playIntro = GetNode <CustomCheckBox>(PlayIntroPath); playMicrobeIntro = GetNode <CustomCheckBox>(PlayMicrobeIntroPath); tutorialsEnabledOnNewGame = GetNode <CustomCheckBox>(TutorialsEnabledOnNewGamePath); cheats = GetNode <CustomCheckBox>(CheatsPath); autoSave = GetNode <CustomCheckBox>(AutoSavePath); maxAutoSaves = GetNode <SpinBox>(MaxAutoSavesPath); maxQuickSaves = GetNode <SpinBox>(MaxQuickSavesPath); tutorialsEnabled = GetNode <CustomCheckBox>(TutorialsEnabledPath); customUsernameEnabled = GetNode <CustomCheckBox>(CustomUsernameEnabledPath); customUsername = GetNode <LineEdit>(CustomUsernamePath); jsonDebugMode = GetNode <OptionButton>(JSONDebugModePath); unsavedProgressWarningEnabled = GetNode <CustomCheckBox>(UnsavedProgressWarningPath); screenshotDirectoryWarningBox = GetNode <CustomConfirmationDialog>(ScreenshotDirectoryWarningBoxPath); backConfirmationBox = GetNode <CustomDialog>(BackConfirmationBoxPath); defaultsConfirmationBox = GetNode <CustomConfirmationDialog>(DefaultsConfirmationBoxPath); errorAcceptBox = GetNode <ErrorDialog>(ErrorAcceptBoxPath); selectedOptionsTab = SelectedOptionsTab.Graphics; cloudResolutionTitle.RegisterToolTipForControl("cloudResolution", "options"); guiLightEffectsToggle.RegisterToolTipForControl("guiLightEffects", "options"); assumeHyperthreading.RegisterToolTipForControl("assumeHyperthreading", "options"); unsavedProgressWarningEnabled.RegisterToolTipForControl("unsavedProgressWarning", "options"); }