diff --git a/.gitignore b/.gitignore index 0fa0219..08377b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /node_modules/ /.vs/ /.vscode/ -/mcfiles/ -/logs/ \ No newline at end of file +/target/ \ No newline at end of file diff --git a/app/assets/css/launcher.css b/app/assets/css/launcher.css new file mode 100644 index 0000000..32cf016 --- /dev/null +++ b/app/assets/css/launcher.css @@ -0,0 +1,42 @@ +/* Reset body, html, and div presets. */ +body, html, div { + margin: 0px; + padding: 0px; +} + +body { + background: url('./../images/backgrounds/0.jpg') no-repeat center center fixed; + background-size: cover; +} + +#frame_bar { + -webkit-app-region: drag; + background: rgba(1, 2, 1, 0.5); + min-height: 22px; + display: flex; + align-items: center; +} + +#button_dock { + margin-left: 2px; +} + +.frame_button { + height: 12px; + width: 12px; + border-radius: 50%; + border: 0px; + margin-left: 5px; +} + +#frame_button_close { + background-color: #e74c32; +} + +#frame_button_restoredown { + background-color: #fed045; +} + +#frame_button_minimize { + background-color: #96e734; +} \ No newline at end of file diff --git a/app/assets/images/backgrounds/0.jpg b/app/assets/images/backgrounds/0.jpg new file mode 100644 index 0000000..66a2c12 Binary files /dev/null and b/app/assets/images/backgrounds/0.jpg differ diff --git a/app/assets/images/backgrounds/1.jpg b/app/assets/images/backgrounds/1.jpg new file mode 100644 index 0000000..e343cbe Binary files /dev/null and b/app/assets/images/backgrounds/1.jpg differ diff --git a/app/assets/images/backgrounds/2.jpg b/app/assets/images/backgrounds/2.jpg new file mode 100644 index 0000000..c75ca9c Binary files /dev/null and b/app/assets/images/backgrounds/2.jpg differ diff --git a/app/assets/images/backgrounds/3.jpg b/app/assets/images/backgrounds/3.jpg new file mode 100644 index 0000000..5c7be56 Binary files /dev/null and b/app/assets/images/backgrounds/3.jpg differ diff --git a/app/assets/images/backgrounds/4.jpg b/app/assets/images/backgrounds/4.jpg new file mode 100644 index 0000000..1db7800 Binary files /dev/null and b/app/assets/images/backgrounds/4.jpg differ diff --git a/app/assets/images/loginBackground.jpg b/app/assets/images/loginBackground.jpg deleted file mode 100644 index fdb3deb..0000000 Binary files a/app/assets/images/loginBackground.jpg and /dev/null differ diff --git a/app/assets/js/launchprocess.js b/app/assets/js/launchprocess.js index 6b60f1a..579313a 100644 --- a/app/assets/js/launchprocess.js +++ b/app/assets/js/launchprocess.js @@ -8,7 +8,7 @@ const fs = require('fs') const mkpath = require('mkdirp'); function launchMinecraft(versionData, forgeData, basePath){ - const authPromise = mojang.auth('nytrocraft@live.com', 'applesrsogood123', uuidV4(), { + const authPromise = mojang.auth('email', 'pass', uuidV4(), { name: 'Minecraft', version: 1 }) diff --git a/app/assets/js/script.js b/app/assets/js/script.js index db405db..49d71bd 100644 --- a/app/assets/js/script.js +++ b/app/assets/js/script.js @@ -51,7 +51,7 @@ $(document).on('click', 'a[href^="http"]', function(event) { testdownloads = async function(){ const lp = require(path.join(__dirname, 'assets', 'js', 'launchprocess.js')) - const basePath = path.join(__dirname, '..', 'mcfiles') + const basePath = path.join(__dirname, '..', 'target', 'test', 'mcfiles') let versionData = await ag.loadVersionData('1.11.2', basePath) await ag.validateAssets(versionData, basePath) console.log('assets done') diff --git a/app/frame.ejs b/app/frame.ejs new file mode 100644 index 0000000..ff41724 --- /dev/null +++ b/app/frame.ejs @@ -0,0 +1,8 @@ + +
+
+ + + +
+
\ No newline at end of file diff --git a/app/index.ejs b/app/index.ejs new file mode 100644 index 0000000..cb39118 --- /dev/null +++ b/app/index.ejs @@ -0,0 +1,13 @@ + + + + Westeroscraft Launcher + + + + + <% include frame.ejs %> +
+
+ + \ No newline at end of file diff --git a/index.js b/index.js index eca68cc..8fb20cb 100644 --- a/index.js +++ b/index.js @@ -1,22 +1,25 @@ const {app, BrowserWindow} = require('electron') const path = require('path') const url = require('url') +const ejse = require('ejs-electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. let win function createWindow() { - win = new BrowserWindow({ width: 925, height: 500, icon: getPlatformIcon('WesterosSealSquare')}) + win = new BrowserWindow({ width: 980, height: 552, icon: getPlatformIcon('WesterosSealSquare'), frame: false}) win.loadURL(url.format({ - pathname: path.join(__dirname, 'app', 'index.html'), + pathname: path.join(__dirname, 'app', 'index.ejs'), protocol: 'file:', slashes: true })) win.setMenu(null) + win.setResizable(true) + win.on('closed', () => { win = null }) diff --git a/package.bat b/package.bat new file mode 100644 index 0000000..065324d --- /dev/null +++ b/package.bat @@ -0,0 +1,4 @@ +@echo off +cmd /k electron-packager . WesterosCraftLauncher --overwrite --asar --platform=win32 --arch=x64 --ignore="\.git(ignore|modules)|package\.bat|node_modules|target" --out="./target" --icon="app/assets/images/WesterosSealSquare.ico" +echo Startup canceled. +pause \ No newline at end of file diff --git a/package.json b/package.json index 36c30f9..23e093c 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "westeroscraftlauncher", "version": "0.0.1", "description": "Custom modded launcher for Westeroscraft", + "productName": "WesterosCraft Launcher", "main": "index.js", "scripts": { "start": "electron index.js" @@ -18,13 +19,16 @@ "homepage": "http://www.westeroscraft.com/", "dependencies": { "adm-zip": "^0.4.7", - "async": "^2.3.0", - "electron": "^1.6.5", - "extract-zip": "=1.6.0", - "find-java-home": "^0.1.4", - "jQuery": "^1.7.4", + "async": "^2.5.0", + "ejs": "^2.5.7", + "ejs-electron": "^2.0.1", + "find-java-home": "^0.2.0", + "jquery": "^3.2.1", "mojang": "^0.4.1", - "promise": "^7.1.1", - "uuid": "^3.0.1" + "uuid": "^3.1.0" + }, + "devDependencies": { + "electron": "^1.7.5", + "electron-packager": "^9.0.0" } }