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

@@ -7,7 +7,9 @@ use crate::event::LoadingBarType;
use crate::pack::install_from::{
EnvType, PackDependency, PackFile, PackFileHash, PackFormat,
};
use crate::prelude::{JavaVersion, ProfilePathId, ProjectPathId};
use crate::prelude::{
JavaVersion, ProfilePathId, ProjectPathId, SetFullscreen,
};
use crate::state::ProjectMetadata;
use crate::util::io::{self, IOError};
@@ -838,9 +840,23 @@ pub async fn run_credentials(
None
};
// Any options.txt settings that we want set, add here
let mut mc_set_options: Vec<(String, String)> = Vec::new();
match profile.force_fullscreen {
SetFullscreen::LeaveUnset => {}
SetFullscreen::SetWindowed => {
mc_set_options
.push(("fullscreen".to_string(), "false".to_string()));
}
SetFullscreen::SetFullscreen => {
mc_set_options.push(("fullscreen".to_string(), "true".to_string()));
}
}
let mc_process = crate::launcher::launch_minecraft(
java_args,
env_args,
&mc_set_options,
wrapper,
&memory,
&resolution,