| | 1 | | using System; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | namespace MainScripts.DCL.Controllers.SettingsDesktop |
| | 5 | | { |
| | 6 | | [Serializable] |
| | 7 | | public enum WindowMode |
| | 8 | | { |
| | 9 | | Windowed, |
| | 10 | | Borderless, |
| | 11 | | FullScreen, |
| | 12 | | } |
| | 13 | |
|
| | 14 | | [Serializable] |
| | 15 | | public enum FpsCapMode |
| | 16 | | { |
| | 17 | | Max = 0, |
| | 18 | | FPS30 = 30, |
| | 19 | | FPS60 = 60, |
| | 20 | | FPS90 = 90, |
| | 21 | | FPS120 = 120, |
| | 22 | | FPS144 = 144, |
| | 23 | | } |
| | 24 | |
|
| | 25 | | [Serializable] |
| | 26 | | public struct DisplaySettings |
| | 27 | | { |
| | 28 | | public WindowMode windowMode; |
| | 29 | | public int resolutionSizeIndex; |
| | 30 | | public bool vSync; |
| | 31 | | public int fpsCapIndex; |
| | 32 | |
|
| | 33 | | public FullScreenMode GetFullScreenMode() |
| | 34 | | { |
| 0 | 35 | | return windowMode switch |
| | 36 | | { |
| 0 | 37 | | WindowMode.Windowed => FullScreenMode.Windowed, |
| 0 | 38 | | WindowMode.Borderless => FullScreenMode.FullScreenWindow, |
| 0 | 39 | | WindowMode.FullScreen => FullScreenMode.ExclusiveFullScreen, |
| 0 | 40 | | _ => throw new ArgumentOutOfRangeException() |
| | 41 | | }; |
| | 42 | | } |
| | 43 | | } |
| | 44 | | } |