Пример #1
0
        public void ApplyChanges()
        {
            switch (m_lastCategory)
            {
            case ECategory.GAME:
                if (ConfigManager.Instance.HasLanguageChanged())
                {
                    LegacyLogic.Instance.TrackingManager.TrackLanguangeChange();
                }
                ConfigManager.Instance.WriteConfigurations();
                ApplyGameOptions();
                break;

            case ECategory.INPUT:
                KeyConfigManager.WriteConfigurations();
                LegacyLogic.Instance.EventManager.InvokeEvent(null, EEventType.INPUT_CHANGED, EventArgs.Empty);
                break;

            case ECategory.GRAPHICS:
                GraphicsConfigManager.WriteConfigurations();
                GraphicsConfigManager.Apply();
                break;

            case ECategory.SOUND:
                SoundConfigManager.WriteConfigurations();
                break;
            }
        }
Пример #2
0
        private void ResetToDefaultRequestCallback(PopupRequest.EResultType p_result, String p_inputString)
        {
            if (p_result == PopupRequest.EResultType.CONFIRMED)
            {
                switch (m_lastCategory)
                {
                case ECategory.GAME:
                    ConfigManager.Instance.LoadDefaultOptions();
                    ApplyGameOptions();
                    m_optionsGame.UpdateGUI();
                    break;

                case ECategory.INPUT:
                    KeyConfigManager.LoadDefaultSettings();
                    m_optionsInput.UpdateGUI();
                    break;

                case ECategory.GRAPHICS:
                    GraphicsConfigManager.LoadDefaultSettings();
                    GraphicsConfigManager.InitDefaultResolution();
                    GraphicsConfigManager.WriteConfigurations();
                    GraphicsConfigManager.Apply();
                    GraphicsConfigManager.ApplyBrightnessOrGamma();
                    m_optionsGraphics.UpdateGUI();
                    break;

                case ECategory.SOUND:
                    SoundConfigManager.LoadDefaultSettings();
                    m_optionsSound.UpdateGUI();
                    break;
                }
                ApplyChanges();
            }
        }
Пример #3
0
        private void SetupLogic()
        {
            String streamingAssetsPath = Application.streamingAssetsPath;
            String text;
            String text2;

            if (Helper.Is64BitOperatingSystem())
            {
                text  = Path.Combine(streamingAssetsPath, "optionSettings.txt");
                text2 = Path.Combine(GamePaths.UserGamePath, "options64.txt");
            }
            else
            {
                text  = Path.Combine(streamingAssetsPath, "optionSettings32.txt");
                text2 = Path.Combine(GamePaths.UserGamePath, "options32.txt");
            }
            KeyConfigManager.SetDefaultsPath(text);
            SoundConfigManager.SetDefaultsPath(text);
            GraphicsConfigManager.SetDefaultsPath(text);
            ConfigManager.Instance.SetOptionDefaultsPath(text);
            Boolean flag = false;

            if (!File.Exists(text2))
            {
                File.Copy(text, text2);
                flag = true;
            }
            else
            {
                ConfigReader configReader = new ConfigReader();
                configReader.ReadData(text2);
                ConfigReader configReader2 = new ConfigReader();
                configReader2.ReadData(text);
                configReader.UnionWith(configReader2);
                configReader.WriteData(text2);
            }
            ConfigManager.Instance.LoadConfigurations(streamingAssetsPath);
            ConfigManager.Instance.LoadOptions(text2);
            KeyConfigManager.LoadConfigurations(text2);
            SoundConfigManager.LoadConfigurations(text2);
            GraphicsConfigManager.LoadConfigurations(text2);
            if (flag)
            {
                GraphicsConfigManager.InitDefaultResolution();
                GraphicsConfigManager.WriteConfigurations();
            }
            LegacyLogic.Instance.ServiceWrapper = new UplayServiceWrapperStrategy();
            if (LegacyLogic.Instance.ServiceWrapper.ForceAppExit() && !LegacyLogic.Instance.ServiceWrapper.UplayNotInstalled())
            {
                QuitGame();
            }
            LegacyLogic.Instance.MapLoader.MapFolder = Path.Combine(streamingAssetsPath, "Maps");
            LegacyLogic.Instance.SetConversationPath(Path.Combine(streamingAssetsPath, "Dialog"));
            LegacyLogic.Instance.LoadStaticData(Path.Combine(streamingAssetsPath, "StaticData"));
        }