-
Notifications
You must be signed in to change notification settings - Fork 0
Simplify game resolver code and add support for platform specifiers #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fn construct(self: Box<Self>, base: ImportBase) -> Result<GameData, Error> { | ||
let subkey = format!("Software\\{}\\", self.ident.replace('.', "\\")); | ||
let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?; | ||
pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> { |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?; | ||
pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> { | ||
let subkey = format!("Software\\{}\\", ident.replace('.', "\\")); | ||
let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?; |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?; | ||
pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> { | ||
let subkey = format!("Software\\{}\\", ident.replace('.', "\\")); | ||
let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?; |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
} | ||
} | ||
} | ||
pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> { |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
// I'm going to go for the second option. | ||
// Attempt to get the path of the EGS /Data directory from the registry. | ||
let subkey = r#"Software\WOW64Node\Epic Games\EpicGamesLauncher"#; | ||
let value = reg::get_value_at(HKey::LocalMachine, subkey, "AppDataPath")?; |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
.ok_or_else(|| { | ||
GameError::NotFound(ident.into(), "Gamepass".to_string()) | ||
})?; | ||
let game_dir = PathBuf::from(reg::get_value_at(HKey::LocalMachine, &game_root, "Root")?); |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
use once_cell::sync::Lazy; | ||
use project::error::ProjectError; | ||
use project::ProjectKind; | ||
use ts::error::ApiError; | ||
use ts::v1::models::ecosystem::GamePlatform; |
Check warning
Code scanning / clippy
unused import: ts::v1::models::ecosystem::GamePlatform Warning
@@ -2,7 +2,11 @@ | |||
|
|||
use serde::{Deserialize, Serialize}; | |||
|
|||
use crate::error::Error; |
Check warning
Code scanning / clippy
unused import: crate::error::Error Warning
use crate::ts::version::Version; | ||
use crate::game::ecosystem; |
Check warning
Code scanning / clippy
unused import: crate::game::ecosystem Warning
use crate::ts::version::Version; | ||
use crate::game::ecosystem; | ||
use crate::game::error::GameError; |
Check warning
Code scanning / clippy
unused import: crate::game::error::GameError Warning
No description provided.