feat: initial support for segatools pkgs

This commit is contained in:
2025-03-15 00:08:33 +01:00
parent b525e74467
commit caa20a3aa0
20 changed files with 246 additions and 112 deletions

View File

@ -3,7 +3,7 @@ use ongeki::OngekiProfile;
use serde::{Deserialize, Serialize};
use tauri::AppHandle;
use std::{collections::BTreeSet, path::{Path, PathBuf}};
use crate::{model::{config::Display, misc::Game}, modules::package::prepare_packages, pkg::PkgKey, util};
use crate::{model::misc::Game, modules::package::prepare_packages, pkg::PkgKey, util};
pub mod ongeki;
@ -72,14 +72,15 @@ impl AnyProfile {
}
pub async fn line_up(&self, pkg_hash: String, _app: AppHandle) -> Result<()> {
match self {
Self::OngekiProfile(p) => {
Self::OngekiProfile(_p) => {
#[cfg(target_os = "windows")]
let info = p.display.line_up()?;
let info = _p.display.line_up()?;
let res = self.line_up_the_rest(pkg_hash).await;
#[cfg(target_os = "windows")]
if let Some(info) = info {
use crate::model::config::Display;
if res.is_ok() {
Display::wait_for_exit(_app, info);
} else {

View File

@ -88,10 +88,13 @@ impl Profile for OngekiProfile {
let target_path = PathBuf::from(&self.sgt.target);
let exe_dir = target_path.parent().ok_or_else(|| anyhow!("Invalid target path"))?;
let sgt_dir = util::pkg_dir()
.join(self.sgt.hook.as_ref().ok_or_else(|| anyhow!("No hook"))?.to_string())
.join("segatools");
#[cfg(target_os = "windows")]
{
game_builder = Command::new(exe_dir.join("inject.exe"));
game_builder = Command::new(sgt_dir.join("inject.exe"));
amd_builder = Command::new("cmd.exe");
}
#[cfg(target_os = "linux")]
@ -99,7 +102,7 @@ impl Profile for OngekiProfile {
game_builder = Command::new(&self.wine.runtime);
amd_builder = Command::new(&self.wine.runtime);
game_builder.arg(exe_dir.join("inject.exe"));
game_builder.arg(sgt_dir.join("inject.exe"));
amd_builder.arg("cmd.exe");
}
@ -109,10 +112,10 @@ impl Profile for OngekiProfile {
)
.current_dir(&exe_dir)
.arg("/C")
.arg(&exe_dir.join("inject.exe"))
.args([
"-d", "-k", "mu3hook.dll",
"amdaemon.exe", "-f", "-c", "config_common.json", "config_server.json", "config_client.json"
.arg(&sgt_dir.join("inject.exe"))
.args(["-d", "-k"])
.arg(sgt_dir.join("mu3hook.dll"))
.args(["amdaemon.exe", "-f", "-c", "config_common.json", "config_server.json", "config_client.json"
]);
game_builder
.env(
@ -124,8 +127,9 @@ impl Profile for OngekiProfile {
self.config_dir().join("inohara.cfg"),
)
.current_dir(&exe_dir)
.args(["-d", "-k"])
.arg(sgt_dir.join("mu3hook.dll"))
.args([
"-d", "-k", "mu3hook.dll",
"mu3.exe", "-monitor 1",
"-screen-width", &self.display.rez.0.to_string(),
"-screen-height", &self.display.rez.1.to_string(),