Skip to content

Commit

Permalink
Enfin la version stable!
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekCornerGH committed Oct 27, 2020
1 parent 181e496 commit 7b68abf
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
22 changes: 21 additions & 1 deletion app/assets/js/configmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ const DEFAULT_CONFIG = {
resHeight: 720,
fullscreen: false,
autoConnect: true,
launchDetached: true
launchDetached: true,
consoleOnLaunch: false
},
launcher: {
allowPrerelease: false,
Expand Down Expand Up @@ -688,6 +689,25 @@ exports.setLaunchDetached = function(launchDetached){
config.settings.game.launchDetached = launchDetached
}

/**
* Check if the game should open the devtools console on launch
*
* @param {boolean} def Optional. If true, the default value will be returned.
* @returns {boolean} Whether or not to open the devtools console on launch
*/
exports.getConsoleOnLaunch = function(def = false){
return !def ? config.settings.game.consoleOnLaunch : DEFAULT_CONFIG.settings.game.consoleOnLaunch
}

/**
* Change the status of whether or not the devtools console should open on launch
*
* @param {boolean} consoleOnLaunch whether or not to open the devtools console on launch
*/
exports.setConsoleOnLaunch = function(consoleOnLaunch){
config.settings.game.consoleOnLaunch = consoleOnLaunch
}

// Launcher Settings

/**
Expand Down
6 changes: 5 additions & 1 deletion app/assets/js/scripts/landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ function setLaunchEnabled(val) {
// Bind launch button
document.getElementById('launch_button').addEventListener('click', function (e) {
if (checkCurrentServer(true)) {
if(ConfigManager.getConsoleOnLaunch()){
let window = remote.getCurrentWindow()
window.toggleDevTools()
}
loggerLanding.log('Launching game..')
const mcVersion = DistroManager.getDistribution().getServer(ConfigManager.getSelectedServer()).getMinecraftVersion()
const jExe = ConfigManager.getJavaExecutable()
Expand Down Expand Up @@ -755,7 +759,7 @@ function dlAsync(login = true) {
proc.stdout.on('data', tempListener)
proc.stderr.on('data', gameErrorListener)

setLaunchDetails('C\'est bon! Profitez de votre expérience de jeu sur le serveur!')
setLaunchDetails('C\'est bon!<br>Bon jeu!')

proc.on('close', (code, signal) => {
if(hasRPC){
Expand Down
11 changes: 11 additions & 0 deletions app/settings.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@
</label>
</div>
</div>
<div class="settingsFieldContainer">
<div class="settingsFieldLeft">
<span class="settingsFieldTitle">Ouvrir la console au démarrage du jeu</span>
<span class="settingsFieldDesc">Ceci ouvre la console dès que Minecraft démarre.</span>
</div>
<label class="toggleSwitch">
<input type="checkbox" cValue="ConsoleOnLaunch">
<span class="toggleSwitchSlider"></span>
</label>
</div>
</div>
</div>
<div id="settingsTabMods" class="settingsTab" style="display: none;">
<div class="settingsTabHeader">
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rtmclauncher",
"version": "1.8.3-beta.1",
"version": "1.8.3-release",
"productName": "Launcher RTMC",
"description": "Launcher pour RTMC",
"author": "Daniel Scalzi (https://github.com/dscalzi/) et GeekCorner (https://geekcorner.page.link/yt)",
Expand Down

0 comments on commit 7b68abf

Please sign in to comment.