fullscreen (#360)

* fullscreen

* improvements, and error catching

* yarn prettier

* discord rpc

* fixed uninitialized options.txt

* working discord version

* incorrect boolean

* change

* merge issue; regex solution

* fixed error

* multi line mode

* moved \n to start
This commit is contained in:
Wyatt Verchere
2023-07-27 00:10:07 -07:00
committed by GitHub
parent ce01ee6a2d
commit c364468ed5
20 changed files with 367 additions and 56 deletions

View File

@@ -149,6 +149,8 @@ pub struct Profile {
pub memory: Option<MemorySettings>,
#[serde(skip_serializing_if = "Option::is_none")]
pub resolution: Option<WindowSize>,
#[serde(default)]
pub force_fullscreen: SetFullscreen,
#[serde(skip_serializing_if = "Option::is_none")]
pub hooks: Option<Hooks>,
pub projects: HashMap<ProjectPathId, Project>,
@@ -223,6 +225,21 @@ impl ModLoader {
}
}
#[derive(Serialize, Deserialize, Clone, Debug, Copy)]
pub enum SetFullscreen {
#[serde(rename = "Leave unset")]
LeaveUnset,
#[serde(rename = "Set windowed")]
SetWindowed,
#[serde(rename = "Set fullscreen")]
SetFullscreen,
}
impl Default for SetFullscreen {
fn default() -> Self {
Self::LeaveUnset
}
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct JavaSettings {
#[serde(skip_serializing_if = "Option::is_none")]
@@ -268,6 +285,7 @@ impl Profile {
java: None,
memory: None,
resolution: None,
force_fullscreen: SetFullscreen::LeaveUnset,
hooks: None,
modrinth_update_version: None,
})