feat: audio mode

This commit is contained in:
2025-03-29 00:55:31 +00:00
parent ad5a800d1b
commit 17411e8f0d
9 changed files with 203 additions and 8 deletions

View File

@ -1,6 +1,9 @@
use enumflags2::make_bitflags;
use serde::{Deserialize, Serialize};
use crate::pkg::PkgKey;
use super::profile::ProfileModule;
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Copy)]
pub enum Game {
#[serde(rename = "ongeki")]
@ -59,6 +62,13 @@ impl Game {
Game::Chunithm => vec!["-c", "config_common.json", "config_server.json", "config_client.json", "config_cvt.json", "config_sp.json", "config_hook.json"]
}
}
pub fn has_module(&self, module: ProfileModule) -> bool {
match self {
Game::Ongeki => make_bitflags!(ProfileModule::{Segatools | Display | Network | BepInEx | Mu3Ini}),
Game::Chunithm => make_bitflags!(ProfileModule::{Segatools | Network}),
}.contains(module)
}
}
impl std::fmt::Display for Game {

View File

@ -1,6 +1,7 @@
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
use crate::pkg::PkgKey;
use enumflags2::bitflags;
use super::misc::Game;
@ -135,4 +136,31 @@ impl Default for Wine {
.unwrap_or_default()
}
}
}
#[derive(Deserialize, Serialize, Clone, PartialEq, Debug, Copy)]
pub enum Mu3Audio {
Shared,
Excl6Ch,
Excl2Ch,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct Mu3Ini {
#[serde(skip_serializing_if = "Option::is_none")]
pub audio: Option<Mu3Audio>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blacklist: Option<(i32, i32)>,
}
#[bitflags]
#[repr(u8)]
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum ProfileModule {
Segatools,
Network,
Display,
BepInEx,
Mu3Ini
}