feat: initial support for io pkgs

This commit is contained in:
2025-03-14 23:53:49 +00:00
parent caa20a3aa0
commit 156972607e
3 changed files with 31 additions and 16 deletions

View File

@ -1,3 +1,5 @@
use std::path::PathBuf;
use anyhow::{anyhow, Result};
use ini::Ini;
use crate::{model::{config::Segatools, segatools_base::segatools_base}, profiles::ProfilePaths, util::{self, PathStr}};
@ -59,7 +61,7 @@ impl Segatools {
if let Some(io) = &self.io {
ini_out.with_section(Some("mu3io"))
.set("path", util::pkg_dir().join(io.to_string()).join("mu3io.dll").stringify()?);
.set("path", util::pkg_dir().join(io.to_string()).join("segatools").join("mu3io.dll").stringify()?);
} else {
ini_out.with_section(Some("mu3io"))
.set("path", "");
@ -78,8 +80,22 @@ impl Segatools {
}
}
if !exe_dir.join("DEVICE").join("ca.crt").exists() {
util::copy_directory(
util::pkg_dir().join(self.hook_dir()?).join("DEVICE"),
exe_dir.join("DEVICE"),
false
)?;
}
log::debug!("end line-up: segatools");
Ok(ini_out)
}
pub fn hook_dir(&self) -> Result<PathBuf> {
Ok(util::pkg_dir()
.join(self.hook.as_ref().ok_or_else(|| anyhow!("No hook"))?.to_string())
.join("segatools"))
}
}

View File

@ -88,9 +88,7 @@ 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");
let sgt_dir = self.sgt.hook_dir()?;
#[cfg(target_os = "windows")]
{

View File

@ -81,18 +81,7 @@ const extraDisplayOptionsDisabled = computed(() => {
:callback="(value: string) => (prf.current!.sgt.target = value)"
></FilePicker>
</OptionRow>
<OptionRow title="mu3hook">
<Select
v-model="prf.current!.sgt.hook"
:options="
pkg.hooks.map((p) => {
return { title: pkgKey(p), value: pkgKey(p) };
})
"
option-label="title"
option-value="value"
></Select>
</OptionRow>
<OptionRow title="amfs">
<FilePicker
:directory="true"
@ -118,6 +107,18 @@ const extraDisplayOptionsDisabled = computed(() => {
"
></FilePicker>
</OptionRow>
<OptionRow title="mu3hook">
<Select
v-model="prf.current!.sgt.hook"
:options="
pkg.hooks.map((p) => {
return { title: pkgKey(p), value: pkgKey(p) };
})
"
option-label="title"
option-value="value"
></Select>
</OptionRow>
<OptionRow title="mu3io">
<Select
v-model="prf.current!.sgt.io"