diff --git a/Cargo.lock b/Cargo.lock index 931c91f..52a4c29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -826,6 +826,29 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "env_filter" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", +] + [[package]] name = "epaint" version = "0.19.0" @@ -1234,6 +1257,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "iana-time-zone" version = "0.1.60" @@ -1524,9 +1553,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "malloc_buf" @@ -2890,11 +2919,13 @@ dependencies = [ "clap", "eframe", "egui_extras", + "env_logger", "global-hotkey", "image", "indexmap 1.9.3", "lazy_static", "levenshtein", + "log", "notify", "ordered-float", "palette", diff --git a/README.md b/README.md index 2256901..b6abbf1 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,9 @@ When the highest value is determined by the ducat value and there is more than o - Due to buffering when the game writes the `EE.log` file, it is possible that WFInfo doesn't pick up the reward screen event until the screen has disappeared. I haven't found a way of getting around the buffered writer. If this happens, you can manually trigger the detection by pressing the F12 key. + +- If you are using gamescope add the flag `--window-name=gamescope` + # Logging Using the Environment Variables WFINFO_LOG you can control the output. diff --git a/src/bin/main.rs b/src/bin/main.rs index 757314f..1b02a37 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -151,17 +151,24 @@ fn benchmark() -> Result<(), Box> { } #[derive(Parser)] +#[command(version, about, long_about = None)] struct Arguments { /// Path to the `EE.log` file located in the game installation directory /// /// Most likely located at `~/.local/share/Steam/steamapps/compatdata/230410/pfx/drive_c/users/steamuser/AppData/Local/Warframe/EE.log` game_log_file_path: Option, + /// Warframe Window Name + /// + /// some systems may require the window name to be specified (e.g. when using gamescope) + #[arg(short, long, default_value = "Warframe")] + window_name: String, } fn main() -> Result<(), Box> { let arguments = Arguments::parse(); let default_log_path = PathBuf::from_str(&std::env::var("HOME").unwrap()).unwrap().join(PathBuf::from_str(".local/share/Steam/steamapps/compatdata/230410/pfx/drive_c/users/steamuser/AppData/Local/Warframe/EE.log")?); let log_path = arguments.game_log_file_path.unwrap_or(default_log_path); + let window_name = arguments.window_name; let env = Env::default() .filter_or("WFINFO_LOG", "info") .write_style_or("WFINFO_STYLE", "always"); @@ -174,7 +181,7 @@ fn main() -> Result<(), Box> { let windows = Window::all()?; let db = Database::load_from_file(None, None); - let Some(warframe_window) = windows.iter().find(|x| x.title() == "Warframe") else { + let Some(warframe_window) = windows.iter().find(|x| x.title() == window_name) else { return Err("Warframe window not found".into()); };