Beispiel #1
0
    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");
    }