mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-22 11:42:14 -08:00
Close the launcher on game launch.
Added a requested feature in: #246 Default: false
This commit is contained in:
parent
eb683f89ec
commit
22102da217
@ -81,6 +81,7 @@ const DEFAULT_CONFIG = {
|
|||||||
resWidth: 1280,
|
resWidth: 1280,
|
||||||
resHeight: 720,
|
resHeight: 720,
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
|
CloseOnLaunch: false,
|
||||||
autoConnect: true,
|
autoConnect: true,
|
||||||
launchDetached: true
|
launchDetached: true
|
||||||
},
|
},
|
||||||
@ -733,6 +734,25 @@ exports.setFullscreen = function(fullscreen){
|
|||||||
config.settings.game.fullscreen = fullscreen
|
config.settings.game.fullscreen = fullscreen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the launcher should be closed when the game launch.
|
||||||
|
*
|
||||||
|
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||||
|
* @returns {boolean} Whether or not the launcher should be closed when the game launched.
|
||||||
|
*/
|
||||||
|
exports.getCloseOnLaunch = function(def = false){
|
||||||
|
return !def ? config.settings.game.CloseOnLaunch : DEFAULT_CONFIG.settings.game.CloseOnLaunch
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the status if the launcher should be closed when the game launch.
|
||||||
|
*
|
||||||
|
* @param {boolean} CloseOnLaunch Whether or not the launcher should be closed when the game launched.
|
||||||
|
*/
|
||||||
|
exports.setCloseOnLaunch = function(CloseOnLaunch){
|
||||||
|
config.settings.game.CloseOnLaunch = CloseOnLaunch
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the game should auto connect to servers.
|
* Check if the game should auto connect to servers.
|
||||||
*
|
*
|
||||||
|
@ -7,6 +7,8 @@ const { getMojangOS, isLibraryCompatible, mcVersionAtLeast } = require('helios-
|
|||||||
const { Type } = require('helios-distribution-types')
|
const { Type } = require('helios-distribution-types')
|
||||||
const os = require('os')
|
const os = require('os')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const remote = require('@electron/remote');
|
||||||
|
const win = remote.getCurrentWindow();
|
||||||
|
|
||||||
const ConfigManager = require('./configmanager')
|
const ConfigManager = require('./configmanager')
|
||||||
|
|
||||||
@ -82,6 +84,10 @@ class ProcessBuilder {
|
|||||||
child.unref()
|
child.unref()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ConfigManager.getCloseOnLaunch()){
|
||||||
|
win.close();
|
||||||
|
}
|
||||||
|
|
||||||
child.stdout.setEncoding('utf8')
|
child.stdout.setEncoding('utf8')
|
||||||
child.stderr.setEncoding('utf8')
|
child.stderr.setEncoding('utf8')
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ accountSelectConfirm = "Select"
|
|||||||
accountSelectCancel = "Cancel"
|
accountSelectCancel = "Cancel"
|
||||||
|
|
||||||
[ejs.settings]
|
[ejs.settings]
|
||||||
|
closeLauncherOnLaunch = "Close the launcher when the game is launched."
|
||||||
navHeaderText = "Settings"
|
navHeaderText = "Settings"
|
||||||
navAccount = "Account"
|
navAccount = "Account"
|
||||||
navMinecraft = "Minecraft"
|
navMinecraft = "Minecraft"
|
||||||
|
@ -93,6 +93,17 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="settingsFieldContainer">
|
||||||
|
<div class="settingsFieldLeft">
|
||||||
|
<span class="settingsFieldTitle"><%- lang('settings.closeLauncherOnLaunch') %></span>
|
||||||
|
</div>
|
||||||
|
<div class="settingsFieldRight">
|
||||||
|
<label class="toggleSwitch">
|
||||||
|
<input type="checkbox" cValue="CloseOnLaunch">
|
||||||
|
<span class="toggleSwitchSlider"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="settingsFieldContainer">
|
<div class="settingsFieldContainer">
|
||||||
<div class="settingsFieldLeft">
|
<div class="settingsFieldLeft">
|
||||||
<span class="settingsFieldTitle"><%- lang('settings.autoConnectTitle') %></span>
|
<span class="settingsFieldTitle"><%- lang('settings.autoConnectTitle') %></span>
|
||||||
|
9466
package-lock.json
generated
9466
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user