diff --git a/app/assets/css/styles.css b/app/assets/css/styles.css index 8bf06065..9569f3c0 100644 --- a/app/assets/css/styles.css +++ b/app/assets/css/styles.css @@ -38,7 +38,6 @@ html { } #main_content { - height: auto; height: calc(100% - 90px); display: flex; } @@ -180,12 +179,38 @@ button:hover { width: 30%; } +#welcome_text_container { + display: table; + margin: 0 auto; +} + #welcome_text { font-family: 'ringbearer'; font-size: 16px; - display: block; + display: table-cell; text-align: center; - padding-top: 10px; + vertical-align: middle; + height: 35px; +} + +#login_pane { + background: linear-gradient(141deg, #000000 -5%, #a02d2a 120%, #000000 150%); + padding-top: 5px; + border-radius: 5px; + box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.28); + width: 97%; + margin: 0 auto; +} + +#login_pane_header_container { + margin-left: 10px; +} + +.login_pane_header { + font-size: 14px; + font-family: 'Segoe UI'; + font-weight: 500; + color: white; } #login_container { @@ -219,11 +244,14 @@ button:hover { font-size: 12px; font-family: 'Segoe UI'; font-weight: 500; + color: white; + /* new */ + display: table; } #button_login { float: right; - margin-right: 10px; + margin-top: 10px; } /******************************************************************************* @@ -273,4 +301,51 @@ button:hover { #launcher-log::-webkit-scrollbar-thumb:window-inactive, #launcher-log::-webkit-scrollbar-thumb { background: black -} \ No newline at end of file +} + +.log_debug { + color: blue; +} + +/******************************************************************************* + * * + * Login View * + * * + ******************************************************************************/ + +#login_view { + background: rgba(0, 0, 0, 0.76); + height: calc(100% - 90px); + display: flex; + justify-content: center; + align-items: center; +} + +#login_content { + width: 50%; + height: 75%; + display: flex; + justify-content: center; +} + +#login_view #content_main { + display: flex; +} + +#login_view #login_content_image { + height: 125px; + width: auto; +} + +#login_view #content_main #right { + margin-left: 10px; +} + +.login_input { + background-color: #a02d2a; +} + +.login_input::-webkit-input-placeholder { + color: white; +} + diff --git a/app/assets/js/assetguard.js b/app/assets/js/assetguard.js index 3919afc1..490aa524 100644 --- a/app/assets/js/assetguard.js +++ b/app/assets/js/assetguard.js @@ -186,7 +186,7 @@ const instance = new AssetGuard() * 'net.minecraftforge:forge:1.11.2-13.20.0.2282', '.jar' becomes * net\minecraftforge\forge\1.11.2-13.20.0.2282\forge-1.11.2-13.20.0.2282.jar * - * @param {String} artifact - the artifact id string. + * @param {String} artifactid - the artifact id string. * @param {String} extension - the extension of the file at the resolved path. * @returns {String} - the resolved relative path from the artifact id. */ @@ -201,6 +201,26 @@ function _resolvePath(artifactid, extension){ return path.join.apply(path, cs) } +/** + * Resolve an artifact id into a URL. For example, + * 'net.minecraftforge:forge:1.11.2-13.20.0.2282', '.jar' becomes + * net/minecraftforge/forge/1.11.2-13.20.0.2282/forge-1.11.2-13.20.0.2282.jar + * + * @param {String} artifactid - the artifact id string. + * @param {String} extension - the extension of the file at the resolved url. + * @returns {String} - the resolved relative URL from the artifact id. + */ +function _resolveURL(artifactid, extension){ + let ps = artifactid.split(':') + let cs = ps[0].split('.') + + cs.push(ps[1]) + cs.push(ps[2]) + cs.push(ps[1].concat('-').concat(ps[2]).concat(extension)) + + return cs.join('/') +} + /** * Calculates the hash for a file using the specified algorithm. * @@ -724,17 +744,19 @@ function _parseDistroModules(modules, basePath, version){ let obPath = obArtifact.path == null ? _resolvePath(ob.id, obArtifact.extension) : obArtifact.path switch(obType){ case 'forge-hosted': + case 'forge': obPath = path.join(basePath, 'libraries', obPath) - break; + break case 'library': obPath = path.join(basePath, 'libraries', obPath) - break; + break case 'forgemod': obPath = path.join(basePath, 'mods', obPath) - break; + break case 'litemod': obPath = path.join(basePath, 'mods', version, obPath) - break; + break + case 'file': default: obPath = path.join(basePath, obPath) } @@ -788,6 +810,10 @@ function loadForgeData(serverpack, basePath){ }) } +function _parseForgeLibraries(){ + +} + /** * This function will initiate the download processed for the specified identifiers. If no argument is * given, all identifiers will be initiated. Note that in order for files to be processed you need to run diff --git a/app/assets/js/modlist.js b/app/assets/js/modlist.js new file mode 100644 index 00000000..24b15767 --- /dev/null +++ b/app/assets/js/modlist.js @@ -0,0 +1,51 @@ +const fs = require('fs') + +/** + * Class used to configure mod launch args. + */ +export class ModList { + + /** + * Construct a ModList. + * + * @param {String} repositoryRoot - the base path of the mod locations. + * @param {Array.} modRef - array containing the mod artifact ids. + * @param {String} parentList - parent ModList file path, null if none. + */ + constructor(repositoryRoot, modRef, parentList){ + if(!arguments.length){ + this.repositoryRoot = '' + this.modRef = [] + } + this.repositoryRoot + this.modRef = modRef + if(parentList != null) this.parentList = parentList + } + + /** + * Exports a ModList object to the specified file path. + * + * @param {ModList} modList - the ModList object to export. + * @param {String} filePath - desired filepath. + * @returns {Promise.} - a promise which resolves FML modList argument. + */ + static exportModList(modList, filePath){ + return new Promise(function(resolve, reject){ + fs.writeFile(filePath, JSON.stringify(modList), (err) => { + if(err){ + reject(err.message) + } + resolve('--modListFile ' + filePath) + }) + }) + } + + /** + * + * @param {Object} distro - the distribution index. + */ + static generateModList(distro){ + + } + +} \ No newline at end of file diff --git a/app/assets/js/script.js b/app/assets/js/script.js index 3f8fe686..e5421890 100644 --- a/app/assets/js/script.js +++ b/app/assets/js/script.js @@ -14,7 +14,7 @@ function timestamp(){ const min = date.getMinutes() < 10 ? '0'.concat(date.getMinutes()) : date.getMinutes(); const sec = date.getSeconds() < 10 ? '0'.concat(date.getSeconds()) : date.getSeconds(); - return os.EOL + '[' + month + '/' + day + '/' + date.getFullYear() + ' ' + hour + ':' + min + ':' + sec + ']' + return '[' + month + '/' + day + '/' + date.getFullYear() + ' ' + hour + ':' + min + ':' + sec + ']' } $(document).on('ready', function(){ @@ -26,14 +26,17 @@ $(document).on('ready', function(){ $(this).parent().toggleClass("success") } }) - /*console.log = function(){ - $('#launcher-log').append(timestamp() + ' [Log] - ' + Array.prototype.slice.call(arguments).join(' ')) + console.log = function(){ + $('#launcher-log').append(timestamp() + ' [Log] - ' + Array.prototype.slice.call(arguments).join(' ') + os.EOL) } console.error = function(){ - $('#launcher-log').append(timestamp() + ' [Error] - ' + Array.prototype.slice.call(arguments).join(' ')) + $('#launcher-log').append('' + timestamp() + ' [Debug] - ' + Array.prototype.slice.call(arguments).join(' ') + "" + os.EOL) + } + console.debug = function(){ + $('#launcher-log').append('' + timestamp() + ' [Error] - ' + Array.prototype.slice.call(arguments).join(' ') + "" + os.EOL) } console.log('test') - //console.debug('test')*/ + console.debug('test') }) /* Open web links in the user's default browser. */ diff --git a/app/assets/westeroscraft.json b/app/assets/westeroscraft.json index 4f36c75f..ccd931d4 100644 --- a/app/assets/westeroscraft.json +++ b/app/assets/westeroscraft.json @@ -223,19 +223,30 @@ ] }, { - "id": "net.optifine:optifine:1.11.2_HD_U_B8", - "name": "Optifine (1.11.2_HD_U_B8)", + "id": "net.optifine:optifine:1.11.2_HD_U_B9", + "name": "Optifine (1.11.2_HD_U_B9)", "type": "forgemod", "artifact": { - "size": 2050500, - "MD5": "cf4da33e1014b1b77fea17d64668aff6", - "path": "OptiFine-1.11.2_HD_U_B8.jar", - "url": "http://optifine.net/download.php?f=OptiFine_1.11.2_HD_U_B8.jar" + "size": 2056699, + "MD5": "38b4c51b9c6ebc09e7a9784accea974e", + "path": "OptiFine-1.11.2_HD_U_B9.jar", + "url": "http://mc.westeroscraft.com/WesterosCraftLauncher/test-1.11.2/mods/OptiFine.jar" } }, { - "id": "com.westeroscraft:westerosblocks:3.0.0-beta-1", - "name": "WesterosBlocks (3.0.0-beta-1)", + "id": "jei", + "name": "JustEnoughItems (1.11.2-4.3.5.277)", + "type": "forgemod", + "artifact": { + "size": 509450, + "MD5": "ea56276646ce405bb4beeaf9064de611", + "path": "jei.jar", + "url": "http://mc.westeroscraft.com/WesterosCraftLauncher/test-1.11.2/mods/jei.jar" + } + }, + { + "id": "com.westeroscraft:westerosblocks:3.0.0-beta-71", + "name": "WesterosBlocks (3.0.0-beta-71)", "type": "forgemod", "artifact": { "size": 16230253, diff --git a/app/index.html b/app/index.html index 6de835a0..25ebcd65 100644 --- a/app/index.html +++ b/app/index.html @@ -6,14 +6,6 @@ Westeroscraft Launcher - - -
@@ -36,45 +28,75 @@
-
-
- Welcome to WesterosCraft! -
-
- +
+
+
+
+
-
+
-
- +
+
+ +