diff --git a/app/assets/css/styles.css b/app/assets/css/styles.css index 85ade54..997bcf2 100644 --- a/app/assets/css/styles.css +++ b/app/assets/css/styles.css @@ -1,9 +1,28 @@ +/******************************************************************************* + * * + * Fonts * + * * + ******************************************************************************/ + + /* Primary font for the application, found on http://www.dafont.com/ringbearer.font */ @font-face { font-family: ringbearer; src: url('../fonts/ringbearer.ttf'); } -body, html { +/* Logger font, found on https://fonts.google.com/specimen/Inconsolata?selection.family=Inconsolata */ +@font-face { + font-family: inconsolata; + src: url('../fonts/Inconsolata-Bold.ttf'); +} + +/******************************************************************************* + * * + * Body * + * * + ******************************************************************************/ + +body, html, div { margin: 0px; padding: 0px; } @@ -11,4 +30,57 @@ body, html { html { background: url('../images/BrownWithWignette.jpg') no-repeat center center fixed; background-size: cover; +} + +/******************************************************************************* + * * + * Header * + * * + ******************************************************************************/ + +/* Main div header container/ */ +#header_container { + background-color: black; + padding: 5px; + font-size: 0px; + text-align: center; + border-bottom: thick solid #a02d2a; + border-bottom-width: 5px; + position: relative; +} + +/* Div container for the seal image. */ +#header_seal_container { + position: absolute; +} + +/* Div container for the header image. */ +#header_img_container { + display: inline-block; + margin: 0 auto; +} + +/* Seal and header images. */ +#header_seal, +#header_img { + height: 75px; + width: auto; + display: block; +} + +/* Div container for the social buttons */ +#header_social_container { + font-size: 16px; + position: absolute; + bottom: 0px; + right: 0px; + margin-right: 5px; +} + +/* Social buttons */ +.header_social_img { + height: 25px; + width: auto; + display: inline-block; + cursor: pointer; } \ No newline at end of file diff --git a/app/assets/images/WCTextCrop.png b/app/assets/images/WCTextCrop.png new file mode 100644 index 0000000..26a452e Binary files /dev/null and b/app/assets/images/WCTextCrop.png differ diff --git a/app/assets/js/launchindex.json b/app/assets/js/launchindex.json new file mode 100644 index 0000000..b895ce7 --- /dev/null +++ b/app/assets/js/launchindex.json @@ -0,0 +1,75 @@ +{ + "version": "1.0", + "servers": [ + { + "id": "WesterosCraft-1.11.2", + "name": "WesterosCraft Production Client", + "news-feed": "http://www.westeroscraft.com/api/rss.php?preset_id=12700544", + "icon-url": "http://mc.westeroscraft.com/WesterosCraftLauncher/files/server-prod.png", + "revision": "0.0.1", + "server-ip": "mc.westeroscraft.com", + "mc-version": "1.11.2", + "main-class": "TBD", + "libraries": [ + { + "name": "net.minecraftforge.forge.forge-universal:1.11.2-13.20.0.2228", + "required": true, + "artifact": { + "size": 4123353, + "MD5": "5b9105f1a8552beac0c8228203d994ae", + "path": "net/minecraftforge/forge/1.11.2-13.20.0.2228/forge-1.11.2-13.20.0.2228-universal.jar", + "url": "http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.11.2-13.20.0.2228/forge-1.11.2-13.20.0.2228-universal.jar" + }, + "launch-args": ["--tweakClass cpw.mods.fml.common.launcher.FMLTweaker"] + }, + { + "name": "net.optifine.optifine:1.11.2_HD_U_B8", + "required": true, + "artifact": { + "size": 2050307, + "MD5": "c18c80f8bfa2a440cc5af4ab8816bc4b", + "path": "optifine/OptiFine/1.11.2_HD_U_B8/OptiFine-1.11.2_HD_U_B8.jar", + "url": "http://optifine.net/download.php?f=OptiFine_1.11.2_HD_U_B8.jar" + }, + "launch-args": [] + } + ], + "forgemods": [ + { + "name": "MODNAME", + "required": true, + "artifact": { + "size": 1234, + "MD5": "e71e88c744588fdad48d3b3beb4935fc", + "path": "/path/to/lib/modname.jar", + "url": "http://mc.westeroscraft.com/WesterosCraftLauncher/files/1.7.10/launchwrapper-1.11.jar" + } + } + ], + "litemods": [ + { + "name": "MODNAME", + "required": true, + "artifact": { + "size": 1234, + "MD5": "e71e88c744588fdad48d3b3beb4935fc", + "path": "/path/to/lib/modname.jar", + "url": "http://mc.westeroscraft.com/WesterosCraftLauncher/files/1.7.10/launchwrapper-1.11.jar" + } + } + ], + "files": [ + { + "name": "FILENAME", + "required": true, + "artifact": { + "size": 1234, + "MD5": "e71e88c744588fdad48d3b3beb4935fc", + "path": "/path/to/lib/filename.jar", + "url": "http://mc.westeroscraft.com/WesterosCraftLauncher/files/1.7.10/launchwrapper-1.11.jar" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/app/assets/js/launchprocess.js b/app/assets/js/launchprocess.js index 467e52d..4a36b38 100644 --- a/app/assets/js/launchprocess.js +++ b/app/assets/js/launchprocess.js @@ -8,15 +8,13 @@ const unzip = require('unzip') const mkpath = require('mkdirp'); exports.launchMinecraft = function(versionData, basePath){ - const authPromise = mojang.auth('nytrocraft@live.com', 'applesrgood123', uuidV4(), { + const authPromise = mojang.auth('EMAIL', 'PASS', uuidV4(), { name: 'Minecraft', version: 1 }) authPromise.then(function(data){ const hardcodedargs = '' const args = finalizeArguments(versionData, data, basePath) - //console.log(data) - //console.log(args) //TODO make this dynamic const child = child_process.spawn('C:\\Program Files\\Java\\jre1.8.0_131\\bin\\javaw.exe', args) }) diff --git a/app/assets/js/script.js b/app/assets/js/script.js index fb32b9f..085bfa8 100644 --- a/app/assets/js/script.js +++ b/app/assets/js/script.js @@ -1,8 +1,16 @@ +var $ = require('jQuery'); const remote = require('electron').remote +const shell = require('electron').shell -//Opens DevTools window if you type "wcdev" in sequence. -//This will crash the program if you are using multiple -//DevTools, for example the chrome debugger in VS Code. +/* Open web links in the user's default browser. */ +$(document).on('click', 'a[href^="http"]', function(event) { + event.preventDefault(); + shell.openExternal(this.href); +}); + +/*Opens DevTools window if you type "wcdev" in sequence. + This will crash the program if you are using multiple + DevTools, for example the chrome debugger in VS Code. */ const match = [87, 67, 68, 69, 86] let at = 0; @@ -30,6 +38,4 @@ document.addEventListener('keydown', function (e) { window.toggleDevTools() at = 0 } -}) - -console.log('Can you see me? ( ͡° ͜ʖ ͡°) Then it\'s working!') \ No newline at end of file +}) \ No newline at end of file diff --git a/app/index.html b/app/index.html index 372b60d..9c45a91 100644 --- a/app/index.html +++ b/app/index.html @@ -8,6 +8,24 @@ - +
+
+ +
+
+ +
+
+ + + + + + + + + +
+
diff --git a/index.js b/index.js index c545d32..ee2346a 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ function createWindow() { win.setMenu(null) - //Code for testing, marked for removal one it's properly implemented. + /*//Code for testing, marked for removal one it's properly implemented. const assetdl = require('./app/assets/js/assetdownload.js') const basePath = path.join(__dirname, 'mcfiles') const dataPromise = assetdl.parseVersionData('1.11.2', basePath) @@ -27,7 +27,7 @@ function createWindow() { //assetdl.downloadLogConfig(data, basePath) //assetdl.downloadLibraries(data, basePath) require('./app/assets/js/launchprocess.js').launchMinecraft(data, basePath) - }) + })*/ win.on('closed', () => { win = null diff --git a/package.json b/package.json index 52ce723..9d397f9 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,11 @@ "url": "https://gitlab.com/westeroscraft/electronlauncher/issues" }, "homepage": "http://www.westeroscraft.com/", - "devDependencies": { + "dependencies": { "async": "^2.3.0", "electron": "^1.6.5", "extract-zip": "=1.6.0", + "jQuery": "^1.7.4", "mojang": "^0.4.1", "promise": "^7.1.1", "unzip": "^0.1.11",