public void OnApply()
    {
        LocalizationTable.SetLocalization(languageDropdown.value);

        if (WorldController.Instance != null)
        {
            WorldController.Instance.spawnInventoryController.SetUIVisibility(developerModeToggle.isOn);
        }

        // MasterTextureLimit should get 0 for High quality and higher values for lower qualities.
        // For example count is 3 (0:Low, 1:Med, 2:High).
        // For High: count - 1 - value  =  3 - 1 - 2  =  0  (therefore no limit = high quality).
        // For Med:  count - 1 - value  =  3 - 1 - 1  =  1  (therefore a slight limit = medium quality).
        // For Low:  count - 1 - value  =  3 - 1 - 0  =  1  (therefore more limit = low quality).
        QualitySettings.masterTextureLimit = qualityDropdown.options.Count - 1 - qualityDropdown.value;

        Screen.fullScreen = fullScreenToggle.isOn;

        ResolutionOption selectedOption = (ResolutionOption)resolutionDropdown.options[resolutionDropdown.value];
        Resolution       resolution     = selectedOption.Resolution;

        Screen.SetResolution(resolution.width, resolution.height, fullScreenToggle.isOn, resolution.refreshRate);

        if (WorldController.Instance != null)
        {
            WorldController.Instance.autosaveManager.SetAutosaveInterval(int.Parse(autosaveInterval.text));
        }

        // One to many but we want an applying feature;
        PerformanceHUDManager.DirtyUI();
    }
 public override void CancelSetting()
 {
     if (LocalizationTable.currentLanguage != LocalizationTable.GetLanguages()[getValue()])
     {
         LocalizationTable.SetLocalization(getValue());
     }
 }
 public override void CancelSetting()
 {
     base.CancelSetting();
     if (LocalizationTable.currentLanguage != LocalizationTable.GetLanguages()[selectedValue])
     {
         LocalizationTable.SetLocalization(getValue());
     }
 }
 public override void ApplySetting()
 {
     if (LocalizationTable.currentLanguage != LocalizationTable.GetLanguages()[selectedValue])
     {
         Settings.SetSetting(option.key, LocalizationTable.GetLanguages()[selectedValue]);
         LocalizationTable.SetLocalization(selectedValue);
     }
 }
Example #5
0
    public void OnApply()
    {
        LocalizationTable.SetLocalization(languageDropdown.value);

        fpsObject.SetActive(fpsToggle.isOn);
        WorldController.Instance.spawnInventoryController.SetUIVisibility(developerModeToggle.isOn);

        // MasterTextureLimit should get 0 for High quality and higher values for lower qualities.
        // For example count is 3 (0:Low, 1:Med, 2:High).
        // For High: count - 1 - value  =  3 - 1 - 2  =  0  (therefore no limit = high quality).
        // For Med:  count - 1 - value  =  3 - 1 - 1  =  1  (therefore a slight limit = medium quality).
        // For Low:  count - 1 - value  =  3 - 1 - 0  =  1  (therefore more limit = low quality).
        QualitySettings.masterTextureLimit = qualityDropdown.options.Count - 1 - qualityDropdown.value;

        Screen.fullScreen = fullScreenToggle.isOn;

        ResolutionOption selectedOption = (ResolutionOption)resolutionDropdown.options[resolutionDropdown.value];
        Resolution       resolution     = selectedOption.Resolution;

        Screen.SetResolution(resolution.width, resolution.height, fullScreenToggle.isOn, resolution.refreshRate);
    }
 public override void CancelSetting()
 {
     LocalizationTable.SetLocalization(getValue());
 }