feat(genshin): removed use of Fps enum for unlocker options

This commit is contained in:
Observer KRypt0n_ 2023-04-15 12:47:25 +02:00
parent 7ed5457174
commit 4e835d8e33
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
3 changed files with 4 additions and 6 deletions

View file

@ -5,7 +5,7 @@ use crate::config::schema_blanks::prelude::*;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct Config { pub struct Config {
pub fps: Fps, pub fps: u64, // TODO: Fps enum
pub power_saving: bool, pub power_saving: bool,
pub monitor: u64, pub monitor: u64,
pub window_mode: WindowMode, pub window_mode: WindowMode,
@ -16,7 +16,7 @@ impl Default for Config {
#[inline] #[inline]
fn default() -> Self { fn default() -> Self {
Self { Self {
fps: Fps::HundredTwenty, fps: 120,
power_saving: false, power_saving: false,
monitor: 1, monitor: 1,
window_mode: WindowMode::default(), window_mode: WindowMode::default(),
@ -31,7 +31,7 @@ impl From<&JsonValue> for Config {
Self { Self {
fps: match value.get("fps") { fps: match value.get("fps") {
Some(value) => value.as_u64().map(Fps::from_num).unwrap_or(default.fps), Some(value) => value.as_u64().unwrap_or(default.fps),
None => default.fps None => default.fps
}, },

View file

@ -46,8 +46,6 @@ pub struct Game {
impl Default for Game { impl Default for Game {
#[inline] #[inline]
fn default() -> Self { fn default() -> Self {
let launcher_dir = launcher_dir().expect("Failed to get launcher dir");
Self { Self {
path: Paths::default(), path: Paths::default(),
voices: vec![ voices: vec![

View file

@ -52,7 +52,7 @@ impl Default for ConfigSchema {
impl ConfigSchema { impl ConfigSchema {
pub fn from_config(config: FpsUnlockerConfig) -> Self { pub fn from_config(config: FpsUnlockerConfig) -> Self {
Self { Self {
FPSTarget: config.fps.to_num(), FPSTarget: config.fps,
UsePowerSave: config.power_saving, UsePowerSave: config.power_saving,
PopupWindow: config.window_mode == WindowMode::Popup, PopupWindow: config.window_mode == WindowMode::Popup,
Fullscreen: config.window_mode == WindowMode::Fullscreen, Fullscreen: config.window_mode == WindowMode::Fullscreen,