forked from akanyan/STARTLINER
feat: initial support for io pkgs
This commit is contained in:
@ -1,3 +1,5 @@
|
|||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use ini::Ini;
|
use ini::Ini;
|
||||||
use crate::{model::{config::Segatools, segatools_base::segatools_base}, profiles::ProfilePaths, util::{self, PathStr}};
|
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 {
|
if let Some(io) = &self.io {
|
||||||
ini_out.with_section(Some("mu3io"))
|
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 {
|
} else {
|
||||||
ini_out.with_section(Some("mu3io"))
|
ini_out.with_section(Some("mu3io"))
|
||||||
.set("path", "");
|
.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");
|
log::debug!("end line-up: segatools");
|
||||||
|
|
||||||
Ok(ini_out)
|
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"))
|
||||||
|
}
|
||||||
}
|
}
|
@ -88,9 +88,7 @@ impl Profile for OngekiProfile {
|
|||||||
|
|
||||||
let target_path = PathBuf::from(&self.sgt.target);
|
let target_path = PathBuf::from(&self.sgt.target);
|
||||||
let exe_dir = target_path.parent().ok_or_else(|| anyhow!("Invalid target path"))?;
|
let exe_dir = target_path.parent().ok_or_else(|| anyhow!("Invalid target path"))?;
|
||||||
let sgt_dir = util::pkg_dir()
|
let sgt_dir = self.sgt.hook_dir()?;
|
||||||
.join(self.sgt.hook.as_ref().ok_or_else(|| anyhow!("No hook"))?.to_string())
|
|
||||||
.join("segatools");
|
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
{
|
{
|
||||||
|
@ -81,18 +81,7 @@ const extraDisplayOptionsDisabled = computed(() => {
|
|||||||
:callback="(value: string) => (prf.current!.sgt.target = value)"
|
:callback="(value: string) => (prf.current!.sgt.target = value)"
|
||||||
></FilePicker>
|
></FilePicker>
|
||||||
</OptionRow>
|
</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">
|
<OptionRow title="amfs">
|
||||||
<FilePicker
|
<FilePicker
|
||||||
:directory="true"
|
:directory="true"
|
||||||
@ -118,6 +107,18 @@ const extraDisplayOptionsDisabled = computed(() => {
|
|||||||
"
|
"
|
||||||
></FilePicker>
|
></FilePicker>
|
||||||
</OptionRow>
|
</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">
|
<OptionRow title="mu3io">
|
||||||
<Select
|
<Select
|
||||||
v-model="prf.current!.sgt.io"
|
v-model="prf.current!.sgt.io"
|
||||||
|
Reference in New Issue
Block a user