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; } }
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(); } }
private void OnResolutionChange() { if (!m_fresko.gameObject.activeSelf) { return; } Texture2D texture2D; switch (GraphicsConfigManager.GetAspectRatio()) { case EAspectRatio._16_9: texture2D = LocalResourcePathAttribute.LoadAsset <Texture2D>(m_freskoTexture_169); goto IL_6F; case EAspectRatio._16_10: texture2D = LocalResourcePathAttribute.LoadAsset <Texture2D>(m_freskoTexture_1610); goto IL_6F; } texture2D = LocalResourcePathAttribute.LoadAsset <Texture2D>(m_freskoTexture_43); IL_6F: if (m_fresko.mainTexture != texture2D) { Texture mainTexture = m_fresko.mainTexture; m_fresko.mainTexture = texture2D; if (mainTexture != null) { mainTexture.UnloadAsset(); } m_fresko.MakePixelPerfect(); } }
private void OnGammaSliderChange(Single p_value) { Single num = 0.5f + m_gammaSlider.sliderValue * 2.5f; GraphicsConfigManager.Settings.Gamma = (Single)Math.Round(num, 2); m_gammaLabel.text = GraphicsConfigManager.Settings.Gamma.ToString("0.0#"); GraphicsConfigManager.ApplyBrightnessOrGamma(); }
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")); }
private void OnResolutionChange() { EAspectRatio easpectRatio = GraphicsConfigManager.GetAspectRatio(); if (easpectRatio == EAspectRatio.None) { easpectRatio = EAspectRatio._4_3; } m_background.mainTexture = ((easpectRatio != EAspectRatio._4_3) ? m_backgroundTexture169 : m_backgroundTexture43); m_background.MakePixelPerfect(); }
private void Start() { SetupLogic(); SetupLanguage(); if (!LegacyLogic.Instance.ServiceWrapper.ForceAppExit()) { SoundConfigManager.Settings.Apply(); GraphicsConfigManager.Apply(); foreach (Hotkey hotkeyData in KeyConfigManager.KeyBindings) { InputManager.SetHotkeyData(hotkeyData); } } StartCoroutine(PreLoadAsset()); }
private Boolean HasUnsavedChanges() { switch (m_lastCategory) { case ECategory.GAME: return(ConfigManager.Instance.HasUnsavedChanges()); case ECategory.INPUT: return(KeyConfigManager.HasUnsavedChanges()); case ECategory.GRAPHICS: return(GraphicsConfigManager.HasUnsavedChanges()); case ECategory.SOUND: return(SoundConfigManager.HasUnsavedChanges()); default: return(false); } }
private void OnResolutionChange() { EAspectRatio easpectRatio = GraphicsConfigManager.GetAspectRatio(); if (easpectRatio == EAspectRatio.None) { easpectRatio = EAspectRatio._4_3; } Texture mainTexture = (easpectRatio != EAspectRatio._4_3) ? m_backgroundTexture169 : m_backgroundTexture43; if (LegacyLogic.Instance.ModController.InModMode) { ModController.ModInfo currentMod = LegacyLogic.Instance.ModController.CurrentMod; if (!String.IsNullOrEmpty(currentMod.TitleImage)) { String path = Path.Combine(currentMod.ImageFolder, currentMod.TitleImage); if (File.Exists(path)) { if (m_createdBackground == null) { m_createdBackground = new Texture2D(1, 1, TextureFormat.ARGB32, false); m_createdBackground.hideFlags = HideFlags.DontSave; } Byte[] data = File.ReadAllBytes(path); if (m_createdBackground.LoadImage(data)) { mainTexture = m_createdBackground; } } } } m_background.mainTexture = mainTexture; if (easpectRatio == EAspectRatio._4_3) { m_background.transform.localScale = new Vector3(2048f, 1536f, 1f); } else { m_background.transform.localScale = new Vector3(2732f, 1536f, 1f); } }
public void ReloadConfigs() { switch (m_lastCategory) { case ECategory.GAME: ConfigManager.Instance.ReloadGameOptions(); break; case ECategory.INPUT: KeyConfigManager.ReloadConfigurations(); break; case ECategory.GRAPHICS: GraphicsConfigManager.ReloadConfigurations(); GraphicsConfigManager.ApplyBrightnessOrGamma(); break; case ECategory.SOUND: SoundConfigManager.ReloadConfigurations(); break; } }