Added window_mode property to fps unlocker config

This commit is contained in:
Observer KRypt0n_ 2022-12-30 11:23:18 +02:00
parent 3a9e8c2d14
commit e0ca079052
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
2 changed files with 13 additions and 6 deletions

View file

@ -14,7 +14,7 @@ dirs = "4.0.0"
serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true }
wincompatlib = { version = "0.1.2", features = ["dxvk"], optional = true }
wincompatlib = { version = "0.1.3", features = ["dxvk"], optional = true }
lazy_static = { version = "1.4.0", optional = true }
md5 = { version = "0.7.0", optional = true }

View file

@ -11,7 +11,8 @@ pub mod prelude {
pub struct Config {
pub fps: u64,
pub power_saving: bool,
pub fullscreen: bool,
pub monitor: u64,
pub window_mode: u64,
pub priority: u64
}
@ -20,7 +21,8 @@ impl Default for Config {
Self {
fps: 120,
power_saving: false,
fullscreen: false,
monitor: 1,
window_mode: 0,
priority: 3
}
}
@ -41,9 +43,14 @@ impl From<&JsonValue> for Config {
None => default.power_saving
},
fullscreen: match value.get("fullscreen") {
Some(value) => value.as_bool().unwrap_or(default.fullscreen),
None => default.fullscreen
monitor: match value.get("monitor") {
Some(value) => value.as_u64().unwrap_or(default.monitor),
None => default.monitor
},
window_mode: match value.get("window_mode") {
Some(value) => value.as_u64().unwrap_or(default.window_mode),
None => default.window_mode
},
priority: match value.get("priority") {