| | 1 | | using DCL; |
| | 2 | | using DCL.Helpers; |
| | 3 | | using DCL.SettingsCommon; |
| | 4 | |
|
| | 5 | | namespace MainScripts.DCL.Controllers.SettingsDesktop |
| | 6 | | { |
| | 7 | | public class SettingsDesktop : Singleton<SettingsDesktop> |
| | 8 | | { |
| | 9 | | const string DESKTOP_SETTINGS_KEY = "Settings.Quality.Desktop"; |
| | 10 | |
|
| | 11 | | public readonly ISettingsRepository<DisplaySettings> displaySettings; |
| | 12 | |
|
| 0 | 13 | | public SettingsDesktop() |
| | 14 | | { |
| 0 | 15 | | displaySettings = new ProxySettingsRepository<DisplaySettings>( |
| | 16 | | new PlayerPrefsDesktopDisplaySettingsRepository(new PlayerPrefsSettingsByKey(DESKTOP_SETTINGS_KEY), GetD |
| | 17 | | new SettingsModule<DisplaySettings>(DESKTOP_SETTINGS_KEY, GetDefaultDisplaySettings())); |
| 0 | 18 | | } |
| | 19 | |
|
| | 20 | | private DisplaySettings GetDefaultDisplaySettings() |
| | 21 | | { |
| 0 | 22 | | return new DisplaySettings |
| | 23 | | { |
| | 24 | | windowMode = WindowMode.Borderless, |
| | 25 | | resolutionSizeIndex = 0, |
| | 26 | | vSync = false, |
| | 27 | | fpsCapIndex = 0 |
| | 28 | | }; |
| | 29 | | } |
| | 30 | |
|
| | 31 | | public void Save() |
| | 32 | | { |
| 0 | 33 | | displaySettings.Save(); |
| 0 | 34 | | PlayerPrefsBridge.Save(); |
| 0 | 35 | | PlayerPrefsBridge.Save(); |
| 0 | 36 | | } |
| | 37 | | } |
| | 38 | | } |