feat: chuniio
This commit is contained in:
@ -95,7 +95,19 @@ impl Keyboard {
|
||||
.set("mouse", if kb.use_mouse { "1" } else { "0" });
|
||||
} else {
|
||||
ini.with_section(Some("io4"))
|
||||
.set("enable", "0");
|
||||
.set("test", "0")
|
||||
.set("service", "0")
|
||||
.set("coin", "0")
|
||||
.set("left1", "0")
|
||||
.set("left2", "0")
|
||||
.set("left3", "0")
|
||||
.set("right1", "0")
|
||||
.set("right2", "0")
|
||||
.set("right3", "0")
|
||||
.set("leftSide", "0")
|
||||
.set("rightSide", "0")
|
||||
.set("leftMenu", "0")
|
||||
.set("rightMenu", "0");
|
||||
}
|
||||
}
|
||||
Keyboard::Chunithm(kb) => {
|
||||
@ -109,14 +121,21 @@ impl Keyboard {
|
||||
ini.with_section(Some("io3"))
|
||||
.set("test", kb.test.to_string())
|
||||
.set("service", kb.svc.to_string())
|
||||
.set("coin", kb.coin.to_string())
|
||||
.set("ir", "0");
|
||||
.set("coin", kb.coin.to_string());
|
||||
} else {
|
||||
ini.with_section(Some("io4"))
|
||||
.set("enable", "0");
|
||||
ini.with_section(Some("slider"))
|
||||
.set("enable", "0");
|
||||
for (i, _) in kb.cell.iter().enumerate() {
|
||||
ini.with_section(Some("slider")).set(format!("cell{}", i + 1), "0");
|
||||
}
|
||||
for (i, _) in kb.ir.iter().enumerate() {
|
||||
ini.with_section(Some("ir")).set(format!("ir{}", i + 1), "0");
|
||||
}
|
||||
ini.with_section(Some("io3"))
|
||||
.set("test", "0")
|
||||
.set("service", "0")
|
||||
.set("coin", "0");
|
||||
}
|
||||
ini.with_section(Some("io3"))
|
||||
.set("ir", "0");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::path::{PathBuf, Path};
|
||||
use anyhow::{anyhow, Result};
|
||||
use ini::Ini;
|
||||
use crate::{model::{misc::{ConfigHook, ConfigHookAime, ConfigHookAimeUnit, ConfigHookAuth, Game}, profile::{Aime, Segatools}}, profiles::ProfilePaths, util::{self, PathStr}};
|
||||
use crate::{model::{misc::{ConfigHook, ConfigHookAime, ConfigHookAimeUnit, ConfigHookAuth, Game}, profile::{Aime, IOSelection, Segatools}}, profiles::ProfilePaths, util::{self, PathStr}};
|
||||
use crate::pkg_store::PackageStore;
|
||||
|
||||
impl Segatools {
|
||||
@ -21,8 +21,8 @@ impl Segatools {
|
||||
if let Some(key) = &self.hook {
|
||||
remove_if_nonpresent!(self.hook, key, None, store);
|
||||
}
|
||||
if let Some(key) = &self.io {
|
||||
remove_if_nonpresent!(self.io, key, None, store);
|
||||
if let IOSelection::Custom(key) = &self.io2 {
|
||||
remove_if_nonpresent!(self.io2, key, IOSelection::default(), store);
|
||||
}
|
||||
match &self.aime {
|
||||
Aime::AMNet(key) => remove_if_nonpresent!(self.aime, key, Aime::BuiltIn, store),
|
||||
@ -141,7 +141,7 @@ impl Segatools {
|
||||
}
|
||||
|
||||
if game == Game::Ongeki {
|
||||
if let Some(io) = &self.io {
|
||||
if let IOSelection::Custom(io) = &self.io2 {
|
||||
ini_out.with_section(Some("mu3io"))
|
||||
.set("path", util::pkg_dir().join(io.to_string()).join("segatools").join("mu3io.dll").stringify()?);
|
||||
} else {
|
||||
@ -149,6 +149,42 @@ impl Segatools {
|
||||
.set("path", "");
|
||||
}
|
||||
}
|
||||
match game {
|
||||
Game::Ongeki => {
|
||||
match &self.io2 {
|
||||
IOSelection::Custom(io) => {
|
||||
ini_out.with_section(Some("mu3io"))
|
||||
.set("path", util::pkg_dir().join(io.to_string()).join("segatools").join("mu3io.dll").stringify()?);
|
||||
}
|
||||
IOSelection::SegatoolsBuiltIn => {
|
||||
ini_out.with_section(Some("mu3io"))
|
||||
.set("path", "");
|
||||
}
|
||||
IOSelection::Hardware => {
|
||||
ini_out.with_section(Some("io4"))
|
||||
.set("enable", "0");
|
||||
}
|
||||
}
|
||||
},
|
||||
Game::Chunithm => {
|
||||
match &self.io2 {
|
||||
IOSelection::Custom(io) => {
|
||||
ini_out.with_section(Some("chuniio"))
|
||||
.set("path32", util::pkg_dir().join(io.to_string()).join("segatools").join("chuniio32.dll").stringify()?)
|
||||
.set("path64", util::pkg_dir().join(io.to_string()).join("segatools").join("chuniio64.dll").stringify()?);
|
||||
}
|
||||
IOSelection::SegatoolsBuiltIn => {
|
||||
ini_out.with_section(Some("chuniio"))
|
||||
.set("path32", "")
|
||||
.set("path64", "");
|
||||
}
|
||||
IOSelection::Hardware => {
|
||||
ini_out.with_section(Some("io4"))
|
||||
.set("enable", "0");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
log::debug!("option dir: {:?} -> {:?}", opt_dir_in, opt_dir_out);
|
||||
|
||||
|
Reference in New Issue
Block a user