Skip to content

Commit

Permalink
hotfix remove logic bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alphastrata committed Nov 10, 2023
1 parent 047c5cf commit 5018048
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
7 changes: 2 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ use shadplay::{plugin::ShadPlayPlugin, system::config::UserConfig, utils::AppSta
fn main() {
// Get UserConfig for the Shadplay window dimensions, decorations toggle etc.
let path = UserConfig::get_config_path();
let user_config = match UserConfig::load_from_toml(&path) {
let user_config = match UserConfig::load_from_toml(path) {
Ok(config) => config,
Err(_) => {
let default_config = UserConfig::default();
default_config
}
Err(_) => UserConfig::default(),
};
let user_cfg_window = user_config.create_window_settings();

Expand Down
20 changes: 0 additions & 20 deletions src/system/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,6 @@ impl UserConfig {
Ok(config)
}

pub fn config_is_valid(&self) -> bool {
// Check that the window dimensions are positive numbers
if self.window_dims.0 <= 0.0 || self.window_dims.1 <= 0.0 {
return false;
}

if self.last_updated >= 1 << 63 {
return false;
}

if self.decorations == true || self.decorations == false {
return false;
}

if self.always_on_top == true || self.always_on_top == false {
return false;
}

true
}
pub fn create_window_settings(&self) -> Window {
Window {
title: "shadplay".into(),
Expand Down

0 comments on commit 5018048

Please sign in to comment.