Various changes and improvements.

Added warning message when console is opened, this is in preparation for alpha.
Added a new background image. Restored random backgrounds on launch (for now).
Changed the overlay dismiss/cancel buttons from anchors to buttons.
This commit is contained in:
Daniel Scalzi
2018-04-26 02:01:46 -04:00
parent 2f66d44824
commit 4b8133474d
7 changed files with 33 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ const os = require('os')
const path = require('path')
const rimraf = require('rimraf')
console.log('Preloading')
console.log('%c[Preloader]', 'color: #a02d2a; font-weight: bold', 'Loading..')
// Load ConfigManager
ConfigManager.load()
@@ -22,8 +22,8 @@ if(ConfigManager.getSelectedServer() == null){
// Clean up temp dir incase previous launches ended unexpectedly.
rimraf(path.join(os.tmpdir(), ConfigManager.getTempNativeFolder()), (err) => {
if(err){
console.warn('Error while cleaning temp dir', err)
console.warn('%c[Preloader]', 'color: #a02d2a; font-weight: bold', 'Error while cleaning natives directory', err)
} else {
console.log('Cleaned temp dir.')
console.log('%c[Preloader]', 'color: #a02d2a; font-weight: bold', 'Cleaned natives directory.')
}
})

View File

@@ -2,6 +2,8 @@
* Script for overlay.ejs
*/
//document.getElementById('overlayDismiss').href = 'javascript:void(0);'
/* Overlay Wrapper Functions */
/**

View File

@@ -14,6 +14,13 @@ window.eval = global.eval = function () {
throw new Error('Sorry, this app does not support window.eval().')
}
// Display warning when devtools window is opened.
remote.getCurrentWebContents().on('devtools-opened', () => {
console.log('%cThe console is dark and full of terrors.', 'color: white; -webkit-text-stroke: 4px #a02d2a; font-size: 60px; font-weight: bold')
console.log('%cIf you\'ve been told to paste something here, you\'re being scammed.', 'font-size: 16px')
console.log('%cUnless you know exactly what you\'re doing, close this window.', 'font-size: 16px')
})
// Disable zoom, needed for darwin.
webFrame.setZoomLevel(0)
webFrame.setVisualZoomLevelLimits(1, 1)