v0.0.1-alpha.9 - Added option to enable/disable prereleases.
Added option to enable/disable prerelease updates. Implemented launcher tab on the settings UI, as this is the only current value. Added semver dependency.
This commit is contained in:
@@ -1017,6 +1017,7 @@ body, button {
|
||||
.settingsTabHeader {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.settingsTabHeaderText {
|
||||
font-size: 20px;
|
||||
@@ -1126,9 +1127,6 @@ input:checked + .toggleSwitchSlider:before {
|
||||
* * */
|
||||
|
||||
/* Add account button styles. */
|
||||
#settingsAddAccountContainer {
|
||||
margin-top: 20px;
|
||||
}
|
||||
#settingsAddAccount {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
border: 1px solid rgba(126, 126, 126, 0.57);
|
||||
@@ -1283,7 +1281,7 @@ input:checked + .toggleSwitchSlider:before {
|
||||
#settingsGameResolutionContainer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 20px 0px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
#settingsGameResolutionContent {
|
||||
display: flex;
|
||||
|
||||
@@ -40,7 +40,9 @@ const DEFAULT_CONFIG = {
|
||||
autoConnect: true,
|
||||
launchDetached: true
|
||||
},
|
||||
launcher: {}
|
||||
launcher: {
|
||||
allowPrerelease: false
|
||||
}
|
||||
},
|
||||
commonDirectory: path.join(dataPath, 'common'),
|
||||
instanceDirectory: path.join(dataPath, 'instances'),
|
||||
@@ -507,4 +509,25 @@ exports.getLaunchDetached = function(def = false){
|
||||
*/
|
||||
exports.setLaunchDetached = function(launchDetached){
|
||||
config.settings.game.launchDetached = launchDetached
|
||||
}
|
||||
|
||||
// Launcher Settings
|
||||
|
||||
/**
|
||||
* Check if the launcher should download prerelease versions.
|
||||
*
|
||||
* @param {boolean} def Optional. If true, the default value will be returned.
|
||||
* @returns {boolean} Whether or not the launcher should download prerelease versions.
|
||||
*/
|
||||
exports.getAllowPrerelease = function(def = false){
|
||||
return !def ? config.settings.launcher.allowPrerelease : DEFAULT_CONFIG.settings.launcher.allowPrerelease
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the status of Whether or not the launcher should download prerelease versions.
|
||||
*
|
||||
* @param {boolean} launchDetached Whether or not the launcher should download prerelease versions.
|
||||
*/
|
||||
exports.setAllowPrerelease = function(allowPrerelease){
|
||||
config.settings.launcher.allowPrerelease = allowPrerelease
|
||||
}
|
||||
@@ -86,6 +86,11 @@ function saveSettingsValues(){
|
||||
sFn(v.value)
|
||||
} else if(v.type === 'checkbox'){
|
||||
sFn(v.checked)
|
||||
// Special Conditions
|
||||
const cVal = v.getAttribute('cValue')
|
||||
if(cVal === 'AllowPrerelease'){
|
||||
changeAllowPrerelease(v.checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ webFrame.setVisualZoomLevelLimits(1, 1)
|
||||
webFrame.setLayoutZoomLevelLimits(0, 0)
|
||||
|
||||
// Initialize auto updates in production environments.
|
||||
// TODO Make this the case after implementation is done.
|
||||
let updateCheckListener
|
||||
if(!isDev){
|
||||
ipcRenderer.on('autoUpdateNotification', (event, arg, info) => {
|
||||
@@ -71,6 +70,18 @@ if(!isDev){
|
||||
ipcRenderer.send('autoUpdateAction', 'initAutoUpdater')
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a notification to the main process changing the value of
|
||||
* allowPrerelease. If we are running a prerelease version, then
|
||||
* this will always be set to true, regardless of the current value
|
||||
* of val.
|
||||
*
|
||||
* @param {boolean} val The new allow prerelease value.
|
||||
*/
|
||||
function changeAllowPrerelease(val){
|
||||
ipcRenderer.send('autoUpdateAction', 'allowPrereleaseChange', val)
|
||||
}
|
||||
|
||||
function showUpdateUI(info){
|
||||
//TODO Make this message a bit more informative `${info.version}`
|
||||
document.getElementById('image_seal_container').setAttribute('update', true)
|
||||
|
||||
@@ -98,6 +98,18 @@
|
||||
<span class="settingsTabHeaderText">Launcher Settings</span>
|
||||
<span class="settingsTabHeaderDesc">Options related to the launcher itself.</span>
|
||||
</div>
|
||||
<div class="settingsFieldContainer">
|
||||
<div class="settingsFieldLeft">
|
||||
<span class="settingsFieldTitle">Allow prerelease updates.</span>
|
||||
<span class="settingsFieldDesc">Prereleases contain the latest features and updates, however they may be buggy.<br>This will always be true if you are using a prerelease version.</span>
|
||||
</div>
|
||||
<div class="settingsFieldRight">
|
||||
<label class="toggleSwitch">
|
||||
<input type="checkbox" cValue="AllowPrerelease">
|
||||
<span class="toggleSwitchSlider"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="./assets/js/scripts/settings.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user