forked from akanyan/STARTLINER
feat: start checks
This commit is contained in:
102
rust/src/model/profile.rs
Normal file
102
rust/src/model/profile.rs
Normal file
@ -0,0 +1,102 @@
|
||||
use std::path::PathBuf;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use crate::pkg::PkgKey;
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone)]
|
||||
pub struct Segatools {
|
||||
pub target: PathBuf,
|
||||
pub hook: Option<PkgKey>,
|
||||
pub io: Option<PkgKey>,
|
||||
pub amfs: PathBuf,
|
||||
pub option: PathBuf,
|
||||
pub appdata: PathBuf,
|
||||
pub enable_aime: bool,
|
||||
pub intel: bool,
|
||||
}
|
||||
|
||||
impl Default for Segatools {
|
||||
fn default() -> Self {
|
||||
Segatools {
|
||||
target: PathBuf::default(),
|
||||
hook: Some(PkgKey("segatools-mu3hook".to_owned())),
|
||||
io: None,
|
||||
amfs: PathBuf::default(),
|
||||
option: PathBuf::default(),
|
||||
appdata: PathBuf::from("appdata"),
|
||||
enable_aime: false,
|
||||
intel: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone, Default, PartialEq)]
|
||||
pub enum DisplayMode {
|
||||
Window,
|
||||
#[default] Borderless,
|
||||
Fullscreen
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone)]
|
||||
pub struct Display {
|
||||
pub target: String,
|
||||
pub rez: (i32, i32),
|
||||
pub mode: DisplayMode,
|
||||
pub rotation: i32,
|
||||
pub frequency: i32,
|
||||
pub borderless_fullscreen: bool,
|
||||
}
|
||||
|
||||
impl Default for Display {
|
||||
fn default() -> Self {
|
||||
Display {
|
||||
target: "default".to_owned(),
|
||||
rez: (1080, 1920),
|
||||
mode: DisplayMode::Borderless,
|
||||
rotation: 0,
|
||||
frequency: 60,
|
||||
borderless_fullscreen: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone, Default, PartialEq)]
|
||||
pub enum NetworkType {
|
||||
#[default] Remote,
|
||||
Artemis,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone, Default)]
|
||||
pub struct Network {
|
||||
pub network_type: NetworkType,
|
||||
|
||||
pub local_path: PathBuf,
|
||||
pub local_console: bool,
|
||||
|
||||
pub remote_address: String,
|
||||
pub keychip: String,
|
||||
|
||||
pub subnet: String,
|
||||
pub suffix: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone, Default)]
|
||||
pub struct BepInEx {
|
||||
pub console: bool,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone)]
|
||||
pub struct Wine {
|
||||
pub runtime: PathBuf,
|
||||
pub prefix: PathBuf,
|
||||
}
|
||||
|
||||
impl Default for Wine {
|
||||
fn default() -> Self {
|
||||
Wine {
|
||||
runtime: PathBuf::from("/usr/bin/wine"),
|
||||
prefix: std::env::var("HOME")
|
||||
.and_then(|home| Ok(PathBuf::from(home).join(".wine")))
|
||||
.unwrap_or_default()
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user