feat(game): game uninstalling & partial compat

This commit is contained in:
DecDuck
2024-12-26 11:59:26 +11:00
parent 9ea2aa4997
commit dd7f5675d8
26 changed files with 469 additions and 96 deletions

View File

@ -46,6 +46,12 @@ impl ProcessManager<'_> {
(Platform::Linux, Platform::Linux),
&NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
),
/*
(
(Platform::Linux, Platform::Windows),
&UMULauncher {} as &(dyn ProcessHandler + Sync + Send + 'static)
)
*/
]),
}
}
@ -66,12 +72,6 @@ impl ProcessManager<'_> {
pub fn valid_platform(&self, platform: &Platform) -> Result<bool, String> {
let current = &self.current_platform;
info!("{:?}", self.game_launchers.keys());
info!(
"{:?} {}",
(current.clone(), platform.clone()),
(Platform::Linux, Platform::Linux) == (Platform::Linux, Platform::Linux)
);
Ok(self
.game_launchers
.contains_key(&(current.clone(), platform.clone())))
@ -201,3 +201,19 @@ impl ProcessHandler for NativeGameLauncher {
.map_err(|v| v.to_string())
}
}
struct UMULauncher;
impl ProcessHandler for UMULauncher {
fn launch_game(
&self,
game_id: &String,
version_name: &String,
command: String,
args: Vec<String>,
install_dir: &String,
log_file: File,
error_file: File,
) -> Result<Child, String> {
todo!()
}
}