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

@@ -29,6 +29,7 @@ pub async fn import_get_importable_instances(
}
/// Import an instance from a launcher type and base path
/// profile_path should be a blank profile for this purpose- if the function fails, it will be deleted
/// eg: import_instance(ImportLauncherType::MultiMC, PathBuf::from("C:/MultiMC"), "Instance 1")
#[tauri::command]
pub async fn import_import_instance(

View File

@@ -276,6 +276,7 @@ pub struct EditProfile {
pub memory: Option<MemorySettings>,
pub resolution: Option<WindowSize>,
pub hooks: Option<Hooks>,
pub force_fullscreen: Option<SetFullscreen>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
@@ -315,6 +316,9 @@ pub async fn profile_edit(
prof.java = edit_profile.java.clone();
prof.memory = edit_profile.memory;
prof.resolution = edit_profile.resolution;
if let Some(force_fullscreen) = edit_profile.force_fullscreen {
prof.force_fullscreen = force_fullscreen;
}
prof.hooks = edit_profile.hooks.clone();
prof.metadata.date_modified = chrono::Utc::now();

View File

@@ -182,6 +182,9 @@
<span class="label__title size-card-header">Window</span>
</h3>
</div>
<div class="adjacent-input">
<DropdownSelect v-model="forceFullscreen" :options="fullscreenOptions" />
</div>
<div class="adjacent-input">
<Checkbox v-model="overrideWindowSettings" label="Override global window settings" />
</div>
@@ -439,10 +442,12 @@ const maxMemory = Math.floor((await get_max_memory().catch(handleError)) / 1024)
const overrideWindowSettings = ref(!!props.instance.resolution)
const resolution = ref(props.instance.resolution ?? globalSettings.game_resolution)
const overrideHooks = ref(!!props.instance.hooks)
const hooks = ref(props.instance.hooks ?? globalSettings.hooks)
const fullscreenOptions = ref(['Leave unchanged', 'Set windowed', 'Set fullscreen'])
const forceFullscreen = ref(props.instance.force_fullscreen)
watch(
[
title,
@@ -458,6 +463,7 @@ watch(
memory,
overrideWindowSettings,
resolution,
forceFullscreen,
overrideHooks,
hooks,
],
@@ -505,6 +511,10 @@ watch(
editProfile.resolution = resolution.value
}
if (forceFullscreen.value) {
editProfile.force_fullscreen = forceFullscreen.value
}
if (overrideHooks.value) {
editProfile.hooks = hooks.value
}