protected override void Activate()
        {
            Quality.ValidateQualities();
            this.graphicsSettingsAnalyzer.Init();
            GraphicsSettings graphicsSettings = new GraphicsSettings();

            GraphicsSettings.INSTANCE = graphicsSettings;
            graphicsSettings.InitWindowModeSettings(this.isWindowedByDefault);
            graphicsSettings.InitQualitySettings(this.graphicsSettingsAnalyzer.GetDefaultQuality(), this.UltraEnabled());
            Quality defaultQuality = this.graphicsSettingsAnalyzer.GetDefaultQuality();

            if (defaultQuality.Level == 0)
            {
                this.defaultGrassLevel              = 0;
                this.defaultShadowQuality           = 0;
                this.defaultParticleQuality         = 0;
                this.defaultAnisotropicQuality      = 0;
                this.defaultTextureQuality          = 0;
                this.defaultVegetationLevel         = 0;
                this.defaultAntialiasingQuality     = 0;
                this.defaultRenderResolutionQuality = 1;
                this.defaultCartridgeCaseAmount     = 0;
                this.defaultVsyncQuality            = 1;
            }
            if (defaultQuality.Level == 1)
            {
                this.defaultGrassLevel              = 0;
                this.defaultShadowQuality           = 0;
                this.defaultParticleQuality         = 1;
                this.defaultAnisotropicQuality      = 0;
                this.defaultTextureQuality          = 0;
                this.defaultVegetationLevel         = 0;
                this.defaultAntialiasingQuality     = 0;
                this.defaultRenderResolutionQuality = 0;
                this.defaultCartridgeCaseAmount     = 0;
                this.defaultVsyncQuality            = 1;
            }
            if (defaultQuality.Level == 2)
            {
                this.defaultGrassLevel              = 1;
                this.defaultShadowQuality           = 1;
                this.defaultParticleQuality         = 2;
                this.defaultAnisotropicQuality      = 0;
                this.defaultTextureQuality          = 1;
                this.defaultVegetationLevel         = 1;
                this.defaultAntialiasingQuality     = 0;
                this.defaultRenderResolutionQuality = 0;
                this.defaultCartridgeCaseAmount     = 0;
                this.defaultVsyncQuality            = 1;
            }
            if (defaultQuality.Level == 3)
            {
                this.defaultGrassLevel              = 2;
                this.defaultShadowQuality           = 2;
                this.defaultParticleQuality         = 3;
                this.defaultAnisotropicQuality      = 1;
                this.defaultTextureQuality          = 1;
                this.defaultVegetationLevel         = 2;
                this.defaultAntialiasingQuality     = 0;
                this.defaultRenderResolutionQuality = 0;
                this.defaultCartridgeCaseAmount     = 1;
                this.defaultVsyncQuality            = 1;
            }
            if (defaultQuality.Level == 4)
            {
                this.defaultGrassLevel              = 3;
                this.defaultShadowQuality           = 3;
                this.defaultParticleQuality         = 4;
                this.defaultAnisotropicQuality      = 2;
                this.defaultTextureQuality          = 1;
                this.defaultVegetationLevel         = 3;
                this.defaultAntialiasingQuality     = 1;
                this.defaultRenderResolutionQuality = 0;
                this.defaultCartridgeCaseAmount     = 2;
                this.defaultVsyncQuality            = 1;
            }
            if (defaultQuality.Level == 5)
            {
                this.defaultGrassLevel              = 4;
                this.defaultShadowQuality           = 4;
                this.defaultParticleQuality         = 5;
                this.defaultAnisotropicQuality      = 2;
                this.defaultTextureQuality          = 1;
                this.defaultVegetationLevel         = 4;
                this.defaultAntialiasingQuality     = 1;
                this.defaultRenderResolutionQuality = 0;
                this.defaultCartridgeCaseAmount     = 3;
                this.defaultVsyncQuality            = 1;
            }
            this.DefineScreenResolutionData(graphicsSettings);
            graphicsSettings.InitSaturationLevelSettings(this.defaultSaturationLevel);
            graphicsSettings.InitAnisotropicQualitySettings(this.defaultAnisotropicQuality);
            graphicsSettings.InitRenderResolutionQualitySettings(this.defaultRenderResolutionQuality);
            graphicsSettings.InitAntialiasingQualitySettings(this.defaultAntialiasingQuality);
            graphicsSettings.InitShadowQualitySettings(this.defaultShadowQuality);
            graphicsSettings.InitParticleQualitySettings(this.defaultParticleQuality);
            graphicsSettings.InitTextureQualitySettings(this.defaultTextureQuality);
            graphicsSettings.InitVegetationLevelSettings(this.defaultVegetationLevel);
            graphicsSettings.InitGrassLevelSettings(this.defaultGrassLevel);
            graphicsSettings.InitCartridgeCaseAmount(this.defaultCartridgeCaseAmount);
            graphicsSettings.InitVSyncQualitySettings(this.defaultVsyncQuality);
            if (!graphicsSettings.NeedCompactWindow())
            {
                graphicsSettings.ApplyInitialScreenResolutionData();
            }
            else
            {
                graphicsSettings.EnableCompactScreen(base.gameObject.AddComponent <CompactScreenBehaviour>());
            }
        }