mirror of
https://github.com/gradenGnostic/LegacyLauncher.git
synced 2026-07-23 13:27:05 +00:00
Merge pull request #209 from nothingman4ik/feat-fullscreen-new
feat: add fullscreen launch option to new version
This commit is contained in:
commit
aa7c257553
|
|
@ -258,6 +258,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="mc-input-group">
|
||||||
|
<label class="mc-label" style="display: flex; align-items: center; cursor: pointer;">
|
||||||
|
<input type="checkbox" id="fullscreen-checkbox" class="nav-item" style="width: 24px; height: 24px; margin-right: 12px; cursor: pointer;" tabindex="0">
|
||||||
|
Launch in Fullscreen (-fullscreen)
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="mc-input-group">
|
<div class="mc-input-group">
|
||||||
<label class="mc-label" style="display: flex; align-items: center; cursor: pointer;">
|
<label class="mc-label" style="display: flex; align-items: center; cursor: pointer;">
|
||||||
<input type="checkbox" id="server-checkbox" class="nav-item" style="width: 24px; height: 24px; margin-right: 12px; cursor: pointer;" tabindex="0">
|
<input type="checkbox" id="server-checkbox" class="nav-item" style="width: 24px; height: 24px; margin-right: 12px; cursor: pointer;" tabindex="0">
|
||||||
|
|
|
||||||
13
renderer.js
13
renderer.js
|
|
@ -566,6 +566,7 @@ async function migrateLegacyConfig() {
|
||||||
ip: ip,
|
ip: ip,
|
||||||
port: port,
|
port: port,
|
||||||
isServer: isServer,
|
isServer: isServer,
|
||||||
|
fullscreen: false,
|
||||||
compatLayer: compat,
|
compatLayer: compat,
|
||||||
installPath: installDir,
|
installPath: installDir,
|
||||||
installedTag: installedTag
|
installedTag: installedTag
|
||||||
|
|
@ -694,6 +695,8 @@ window.onload = async () => {
|
||||||
if (ipInput) ipInput.value = currentInstance.ip;
|
if (ipInput) ipInput.value = currentInstance.ip;
|
||||||
if (portInput) portInput.value = currentInstance.port;
|
if (portInput) portInput.value = currentInstance.port;
|
||||||
if (serverCheck) serverCheck.checked = currentInstance.isServer;
|
if (serverCheck) serverCheck.checked = currentInstance.isServer;
|
||||||
|
const fullscreenCheck = document.getElementById('fullscreen-checkbox');
|
||||||
|
if (fullscreenCheck) fullscreenCheck.checked = currentInstance.fullscreen || false;
|
||||||
if (installInput) installInput.value = currentInstance.installPath;
|
if (installInput) installInput.value = currentInstance.installPath;
|
||||||
if (controllerLayoutSelect) controllerLayoutSelect.value = await Store.get('legacy_controller_layout_mode', 'auto');
|
if (controllerLayoutSelect) controllerLayoutSelect.value = await Store.get('legacy_controller_layout_mode', 'auto');
|
||||||
initControllerLayoutPresets();
|
initControllerLayoutPresets();
|
||||||
|
|
@ -882,6 +885,7 @@ async function saveNewInstance() {
|
||||||
ip: "",
|
ip: "",
|
||||||
port: "",
|
port: "",
|
||||||
isServer: false,
|
isServer: false,
|
||||||
|
fullscreen: false,
|
||||||
compatLayer: 'direct',
|
compatLayer: 'direct',
|
||||||
installPath: installPath,
|
installPath: installPath,
|
||||||
installedTag: null
|
installedTag: null
|
||||||
|
|
@ -907,6 +911,8 @@ async function switchInstance(id) {
|
||||||
document.getElementById('ip-input').value = currentInstance.ip;
|
document.getElementById('ip-input').value = currentInstance.ip;
|
||||||
document.getElementById('port-input').value = currentInstance.port;
|
document.getElementById('port-input').value = currentInstance.port;
|
||||||
document.getElementById('server-checkbox').checked = currentInstance.isServer;
|
document.getElementById('server-checkbox').checked = currentInstance.isServer;
|
||||||
|
const fullscreenCheck = document.getElementById('fullscreen-checkbox');
|
||||||
|
if (fullscreenCheck) fullscreenCheck.checked = currentInstance.fullscreen || false;
|
||||||
document.getElementById('install-path-input').value = currentInstance.installPath;
|
document.getElementById('install-path-input').value = currentInstance.installPath;
|
||||||
|
|
||||||
if (process.platform === 'linux' || process.platform === 'darwin') {
|
if (process.platform === 'linux' || process.platform === 'darwin') {
|
||||||
|
|
@ -1367,9 +1373,11 @@ async function launchLocalClient() {
|
||||||
const ip = currentInstance.ip;
|
const ip = currentInstance.ip;
|
||||||
const port = currentInstance.port;
|
const port = currentInstance.port;
|
||||||
const isServer = currentInstance.isServer;
|
const isServer = currentInstance.isServer;
|
||||||
|
const fullscreen = currentInstance.fullscreen;
|
||||||
let args = [];
|
let args = [];
|
||||||
if (username) args.push("-name", username);
|
if (username) args.push("-name", username);
|
||||||
if (isServer) args.push("-server");
|
if (isServer) args.push("-server");
|
||||||
|
if (fullscreen) args.push("-fullscreen");
|
||||||
if (ip) args.push("-ip", ip);
|
if (ip) args.push("-ip", ip);
|
||||||
if (port) args.push("-port", port);
|
if (port) args.push("-port", port);
|
||||||
const argString = args.map(a => `"${a}"`).join(" ");
|
const argString = args.map(a => `"${a}"`).join(" ");
|
||||||
|
|
@ -1629,6 +1637,7 @@ async function saveOptions() {
|
||||||
const ip = document.getElementById('ip-input').value.trim();
|
const ip = document.getElementById('ip-input').value.trim();
|
||||||
const port = document.getElementById('port-input').value.trim();
|
const port = document.getElementById('port-input').value.trim();
|
||||||
const isServer = document.getElementById('server-checkbox').checked;
|
const isServer = document.getElementById('server-checkbox').checked;
|
||||||
|
const fullscreen = document.getElementById('fullscreen-checkbox')?.checked || false;
|
||||||
const customProtonPath = document.getElementById('custom-proton-path').value.trim();
|
const customProtonPath = document.getElementById('custom-proton-path').value.trim();
|
||||||
const newInstallPath = document.getElementById('install-path-input').value.trim();
|
const newInstallPath = document.getElementById('install-path-input').value.trim();
|
||||||
const oldInstallPath = currentInstance.installPath;
|
const oldInstallPath = currentInstance.installPath;
|
||||||
|
|
@ -1645,7 +1654,9 @@ async function saveOptions() {
|
||||||
}
|
}
|
||||||
if (newRepo) currentInstance.repo = newRepo;
|
if (newRepo) currentInstance.repo = newRepo;
|
||||||
if (newExec) currentInstance.execPath = newExec;
|
if (newExec) currentInstance.execPath = newExec;
|
||||||
currentInstance.ip = ip; currentInstance.port = port; currentInstance.isServer = isServer;
|
currentInstance.ip = ip; currentInstance.port = port;
|
||||||
|
currentInstance.isServer = isServer;
|
||||||
|
currentInstance.fullscreen = fullscreen;
|
||||||
if (compatSelect) {
|
if (compatSelect) {
|
||||||
currentInstance.compatLayer = compatSelect.value;
|
currentInstance.compatLayer = compatSelect.value;
|
||||||
currentInstance.customCompatPath = customProtonPath;
|
currentInstance.customCompatPath = customProtonPath;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue