feat: audio mode
This commit is contained in:
@ -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 {
|
||||
|
@ -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
|
||||
}
|
Reference in New Issue
Block a user