diff --git a/app/assets/js/discordwrapper.js b/app/assets/js/discordwrapper.js index 11ed053b..1e44e867 100644 --- a/app/assets/js/discordwrapper.js +++ b/app/assets/js/discordwrapper.js @@ -5,17 +5,15 @@ const logger = LoggerUtil.getLogger('DiscordWrapper') const { Client } = require('discord-rpc-patch') -const Lang = require('./langloader') - let client let activity -exports.initRPC = function(genSettings, servSettings, initialDetails = Lang.queryJS('discord.waiting')){ +exports.initRPC = function(genSettings, servSettings, initialDetails = 'Waiting for Client..'){ client = new Client({ transport: 'ipc' }) activity = { details: initialDetails, - state: Lang.queryJS('discord.state', {shortId: servSettings.shortId}), + state: 'Server: ' + servSettings.shortId, largeImageKey: servSettings.largeImageKey, largeImageText: servSettings.largeImageText, smallImageKey: genSettings.smallImageKey, diff --git a/app/assets/js/langloader.js b/app/assets/js/langloader.js index 4bd0e15d..605bab81 100644 --- a/app/assets/js/langloader.js +++ b/app/assets/js/langloader.js @@ -1,27 +1,19 @@ const fs = require('fs-extra') const path = require('path') -const toml = require('toml') -const merge = require('lodash.merge') let lang exports.loadLanguage = function(id){ - lang = merge(lang || {}, toml.parse(fs.readFileSync(path.join(__dirname, '..', 'lang', `${id}.toml`))) || {}) + lang = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'lang', `${id}.json`))) || {} } -exports.query = function(id, placeHolders){ +exports.query = function(id){ let query = id.split('.') let res = lang for(let q of query){ res = res[q] } - let text = res === lang ? '' : res - if (placeHolders) { - Object.entries(placeHolders).forEach(([key, value]) => { - text = text.replace(`{${key}}`, value) - }) - } - return text + return res === lang ? {} : res } exports.queryJS = function(id, placeHolders){ diff --git a/app/assets/js/processbuilder.js b/app/assets/js/processbuilder.js index 7bbd6824..6bf2b2bb 100644 --- a/app/assets/js/processbuilder.js +++ b/app/assets/js/processbuilder.js @@ -12,23 +12,14 @@ const ConfigManager = require('./configmanager') const logger = LoggerUtil.getLogger('ProcessBuilder') - -/** - * Only forge and fabric are top level mod loaders. - * - * Forge 1.13+ launch logic is similar to fabrics, for now using usingFabricLoader flag to - * change minor details when needed. - * - * Rewrite of this module may be needed in the future. - */ class ProcessBuilder { - constructor(distroServer, vanillaManifest, modManifest, authUser, launcherVersion){ + constructor(distroServer, versionData, forgeData, authUser, launcherVersion){ this.gameDir = path.join(ConfigManager.getInstanceDirectory(), distroServer.rawServer.id) this.commonDir = ConfigManager.getCommonDirectory() this.server = distroServer - this.vanillaManifest = vanillaManifest - this.modManifest = modManifest + this.versionData = versionData + this.forgeData = forgeData this.authUser = authUser this.launcherVersion = launcherVersion this.forgeModListFile = path.join(this.gameDir, 'forgeMods.list') // 1.13+ @@ -37,7 +28,6 @@ class ProcessBuilder { this.libPath = path.join(this.commonDir, 'libraries') this.usingLiteLoader = false - this.usingFabricLoader = false this.llPath = null } @@ -50,12 +40,9 @@ class ProcessBuilder { process.throwDeprecation = true this.setupLiteLoader() logger.info('Using liteloader:', this.usingLiteLoader) - this.usingFabricLoader = this.server.modules.some(mdl => mdl.rawModule.type === Type.Fabric) - logger.info('Using fabric loader:', this.usingFabricLoader) const modObj = this.resolveModConfiguration(ConfigManager.getModConfiguration(this.server.rawServer.id).mods, this.server.modules) // Mod list below 1.13 - // Fabric only supports 1.14+ if(!mcVersionAtLeast('1.13', this.server.rawServer.minecraftVersion)){ this.constructJSONModList('forge', modObj.fMods, true) if(this.usingLiteLoader){ @@ -179,7 +166,7 @@ class ProcessBuilder { for(let mdl of mdls){ const type = mdl.rawModule.type - if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader || type === Type.FabricMod){ + if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader){ const o = !mdl.getRequired().value const e = ProcessBuilder.isModEnabled(modCfg[mdl.getVersionlessMavenIdentifier()], mdl.getRequired()) if(!o || (o && e)){ @@ -191,7 +178,7 @@ class ProcessBuilder { continue } } - if(type === Type.ForgeMod || type === Type.FabricMod){ + if(type === Type.ForgeMod){ fMods.push(mdl) } else { lMods.push(mdl) @@ -207,7 +194,7 @@ class ProcessBuilder { } _lteMinorVersion(version) { - return Number(this.modManifest.id.split('-')[0].split('.')[1]) <= Number(version) + return Number(this.forgeData.id.split('-')[0].split('.')[1]) <= Number(version) } /** @@ -219,7 +206,7 @@ class ProcessBuilder { if(this._lteMinorVersion(9)) { return false } - const ver = this.modManifest.id.split('-')[2] + const ver = this.forgeData.id.split('-')[2] const pts = ver.split('.') const min = [14, 23, 3, 2655] for(let i=0; i} mods An array of mods to add to the mod list. */ constructModList(mods) { const writeBuffer = mods.map(mod => { - return this.usingFabricLoader ? mod.getPath() : mod.getExtensionlessMavenIdentifier() + return mod.getExtensionlessMavenIdentifier() }).join('\n') if(writeBuffer) { fs.writeFileSync(this.forgeModListFile, writeBuffer, 'UTF-8') - return this.usingFabricLoader ? [ - '--fabric.addMods', - `@${this.forgeModListFile}` - ] : [ + return [ '--fml.mavenRoots', path.join('..', '..', 'common', 'modstore'), '--fml.modLists', @@ -323,15 +307,10 @@ class ProcessBuilder { _processAutoConnectArg(args){ if(ConfigManager.getAutoConnect() && this.server.rawServer.autoconnect){ - if(mcVersionAtLeast('1.20', this.server.rawServer.minecraftVersion)){ - args.push('--quickPlayMultiplayer') - args.push(`${this.server.hostname}:${this.server.port}`) - } else { - args.push('--server') - args.push(this.server.hostname) - args.push('--port') - args.push(this.server.port) - } + args.push('--server') + args.push(this.server.hostname) + args.push('--port') + args.push(this.server.port) } } @@ -377,7 +356,7 @@ class ProcessBuilder { args.push('-Djava.library.path=' + tempNativePath) // Main Java Class - args.push(this.modManifest.mainClass) + args.push(this.forgeData.mainClass) // Forge Arguments args = args.concat(this._resolveForgeArgs()) @@ -400,17 +379,17 @@ class ProcessBuilder { const argDiscovery = /\${*(.*)}/ // JVM Arguments First - let args = this.vanillaManifest.arguments.jvm + let args = this.versionData.arguments.jvm // Debug securejarhandler // args.push('-Dbsl.debug=true') - if(this.modManifest.arguments.jvm != null) { - for(const argStr of this.modManifest.arguments.jvm) { + if(this.forgeData.arguments.jvm != null) { + for(const argStr of this.forgeData.arguments.jvm) { args.push(argStr .replaceAll('${library_directory}', this.libPath) .replaceAll('${classpath_separator}', ProcessBuilder.getClasspathSeparator()) - .replaceAll('${version_name}', this.modManifest.id) + .replaceAll('${version_name}', this.forgeData.id) ) } } @@ -427,10 +406,10 @@ class ProcessBuilder { args = args.concat(ConfigManager.getJVMOptions(this.server.rawServer.id)) // Main Java Class - args.push(this.modManifest.mainClass) + args.push(this.forgeData.mainClass) // Vanilla Arguments - args = args.concat(this.vanillaManifest.arguments.game) + args = args.concat(this.versionData.arguments.game) for(let i=0; i { @@ -558,7 +551,7 @@ class ProcessBuilder { * @returns {Array.} An array containing the arguments required by forge. */ _resolveForgeArgs(){ - const mcArgs = this.modManifest.minecraftArguments.split(' ') + const mcArgs = this.forgeData.minecraftArguments.split(' ') const argDiscovery = /\${*(.*)}/ // Replace the declared variables with their proper values. @@ -571,7 +564,7 @@ class ProcessBuilder { val = this.authUser.displayName.trim() break case 'version_name': - //val = vanillaManifest.id + //val = versionData.id val = this.server.rawServer.id break case 'game_directory': @@ -581,7 +574,7 @@ class ProcessBuilder { val = path.join(this.commonDir, 'assets') break case 'assets_index_name': - val = this.vanillaManifest.assets + val = this.versionData.assets break case 'auth_uuid': val = this.authUser.uuid.trim() @@ -596,7 +589,7 @@ class ProcessBuilder { val = '{}' break case 'version_type': - val = this.vanillaManifest.type + val = this.versionData.type break } if(val != null){ @@ -671,10 +664,10 @@ class ProcessBuilder { classpathArg(mods, tempNativePath){ let cpArgs = [] - if(!mcVersionAtLeast('1.17', this.server.rawServer.minecraftVersion) || this.usingFabricLoader) { + if(!mcVersionAtLeast('1.17', this.server.rawServer.minecraftVersion)) { // Add the version.jar to the classpath. // Must not be added to the classpath for Forge 1.17+. - const version = this.vanillaManifest.id + const version = this.versionData.id cpArgs.push(path.join(this.commonDir, 'versions', version, version + '.jar')) } @@ -713,7 +706,7 @@ class ProcessBuilder { const nativesRegex = /.+:natives-([^-]+)(?:-(.+))?/ const libs = {} - const libArr = this.vanillaManifest.libraries + const libArr = this.versionData.libraries fs.ensureDirSync(tempNativePath) for(let i=0; i 0){ const res = this._resolveModuleLibraries(mdl) @@ -889,6 +882,24 @@ class ProcessBuilder { return libs } + static isAutoconnectBroken(forgeVersion) { + + const minWorking = [31, 2, 15] + const verSplit = forgeVersion.split('.').map(v => Number(v)) + + if(verSplit[0] === 31) { + for(let i=0; i minWorking[i]) { + return false + } else if(verSplit[i] < minWorking[i]) { + return true + } + } + } + + return false + } + } module.exports = ProcessBuilder \ No newline at end of file diff --git a/app/assets/js/scripts/login.js b/app/assets/js/scripts/login.js index 30ff8937..96ec9234 100644 --- a/app/assets/js/scripts/login.js +++ b/app/assets/js/scripts/login.js @@ -220,7 +220,10 @@ loginButton.addEventListener('click', () => { } else { // Uh oh. msftLoginLogger.error('Unhandled error during login.', displayableError) - actualDisplayableError = Lang.queryJS('login.error.unknown') + actualDisplayableError = { + title: 'Unknown Error During Login', + desc: 'An unknown error has occurred. Please see the console for details.' + } } setOverlayContent(actualDisplayableError.title, actualDisplayableError.desc, Lang.queryJS('login.tryAgain')) diff --git a/app/assets/js/scripts/overlay.js b/app/assets/js/scripts/overlay.js index 0d6ab2ae..f85a28b0 100644 --- a/app/assets/js/scripts/overlay.js +++ b/app/assets/js/scripts/overlay.js @@ -130,7 +130,7 @@ async function toggleServerSelection(toggleState){ * @param {string} acknowledge Acknowledge button text. * @param {string} dismiss Dismiss button text. */ -function setOverlayContent(title, description, acknowledge, dismiss = Lang.queryJS('overlay.dismiss')){ +function setOverlayContent(title, description, acknowledge, dismiss = 'Dismiss'){ document.getElementById('overlayTitle').innerHTML = title document.getElementById('overlayDesc').innerHTML = description document.getElementById('overlayAcknowledge').innerHTML = acknowledge @@ -289,7 +289,7 @@ async function populateServerListings(){ - ${Lang.queryJS('settings.serverListing.mainServer')} + Main Server ` : ''} diff --git a/app/assets/js/scripts/settings.js b/app/assets/js/scripts/settings.js index 0ea4a305..d71ed34d 100644 --- a/app/assets/js/scripts/settings.js +++ b/app/assets/js/scripts/settings.js @@ -59,8 +59,8 @@ function bindFileSelectors(){ if(isJavaExecSel && process.platform === 'win32') { options.filters = [ - { name: Lang.queryJS('settings.fileSelectors.executables'), extensions: ['exe'] }, - { name: Lang.queryJS('settings.fileSelectors.allFiles'), extensions: ['*'] } + { name: 'Executables', extensions: ['exe'] }, + { name: 'All Files', extensions: ['*'] } ] } @@ -374,9 +374,9 @@ ipcRenderer.on(MSFT_OPCODE.REPLY_LOGIN, (_, ...arguments_) => { // Unexpected error. setOverlayContent( - Lang.queryJS('settings.msftLogin.errorTitle'), - Lang.queryJS('settings.msftLogin.errorMessage'), - Lang.queryJS('settings.msftLogin.okButton') + 'Something Went Wrong', + 'Microsoft authentication failed. Please try again.', + 'OK' ) setOverlayHandler(() => { toggleOverlay(false) @@ -401,7 +401,7 @@ ipcRenderer.on(MSFT_OPCODE.REPLY_LOGIN, (_, ...arguments_) => { setOverlayContent( error, errorDesc, - Lang.queryJS('settings.msftLogin.okButton') + 'OK' ) setOverlayHandler(() => { toggleOverlay(false) @@ -429,7 +429,10 @@ ipcRenderer.on(MSFT_OPCODE.REPLY_LOGIN, (_, ...arguments_) => { } else { // Uh oh. msftLoginLogger.error('Unhandled error during login.', displayableError) - actualDisplayableError = Lang.queryJS('login.error.unknown') + actualDisplayableError = { + title: 'Unknown Error During Login', + desc: 'An unknown error has occurred. Please see the console for details.' + } } switchView(getCurrentView(), viewOnClose, 500, 500, () => { @@ -458,11 +461,11 @@ function bindAuthAccountSelect(){ for(let i=0; iThis is Your Last Account', + 'In order to use the launcher you must be logged into at least one account. You will need to login again after.

Are you sure you want to log out?', + 'I\'m Sure', + 'Cancel' ) setOverlayHandler(() => { processLogOut(val, isLastAccount) @@ -552,9 +555,9 @@ ipcRenderer.on(MSFT_OPCODE.REPLY_LOGOUT, (_, ...arguments_) => { // Unexpected error. setOverlayContent( - Lang.queryJS('settings.msftLogout.errorTitle'), - Lang.queryJS('settings.msftLogout.errorMessage'), - Lang.queryJS('settings.msftLogout.okButton') + 'Something Went Wrong', + 'Microsoft logout failed. Please try again.', + 'OK' ) setOverlayHandler(() => { toggleOverlay(false) @@ -608,12 +611,12 @@ function refreshAuthAccountSelected(uuid){ const selBtn = val.getElementsByClassName('settingsAuthAccountSelect')[0] if(uuid === val.getAttribute('uuid')){ selBtn.setAttribute('selected', '') - selBtn.innerHTML = Lang.queryJS('settings.authAccountSelect.selectedButton') + selBtn.innerHTML = 'Selected Account ✔' } else { if(selBtn.hasAttribute('selected')){ selBtn.removeAttribute('selected') } - selBtn.innerHTML = Lang.queryJS('settings.authAccountSelect.selectButton') + selBtn.innerHTML = 'Select Account' } }) } @@ -645,18 +648,18 @@ function populateAuthAccounts(){
-
${Lang.queryJS('settings.authAccountPopulate.username')}
+
Username
${acc.displayName}
-
${Lang.queryJS('settings.authAccountPopulate.uuid')}
+
UUID
${acc.uuid}
- +
- +
@@ -736,7 +739,7 @@ function parseModulesForUI(mdls, submodules, servConf){ for(const mdl of mdls){ - if(mdl.rawModule.type === Type.ForgeMod || mdl.rawModule.type === Type.LiteMod || mdl.rawModule.type === Type.LiteLoader || mdl.rawModule.type === Type.FabricMod){ + if(mdl.rawModule.type === Type.ForgeMod || mdl.rawModule.type === Type.LiteMod || mdl.rawModule.type === Type.LiteLoader){ if(mdl.getRequired().value){ @@ -870,7 +873,7 @@ async function resolveDropinModsForUI(){
${dropin.name}
- +
@@ -898,9 +901,9 @@ function bindDropinModsRemoveButton(){ document.getElementById(fullName).remove() } else { setOverlayContent( - Lang.queryJS('settings.dropinMods.deleteFailedTitle', { fullName }), - Lang.queryJS('settings.dropinMods.deleteFailedMessage'), - Lang.queryJS('settings.dropinMods.okButton') + `Failed to Delete
Drop-in Mod ${fullName}`, + 'Make sure the file is not in use and try again.', + 'Okay' ) setOverlayHandler(null) toggleOverlay(true) @@ -953,9 +956,9 @@ function saveDropinModConfiguration(){ DropinModUtil.toggleDropinMod(CACHE_SETTINGS_MODS_DIR, dropin.fullName, dropinUIEnabled).catch(err => { if(!isOverlayVisible()){ setOverlayContent( - Lang.queryJS('settings.dropinMods.failedToggleTitle'), + 'Failed to Toggle
One or More Drop-in Mods', err.message, - Lang.queryJS('settings.dropinMods.okButton') + 'Okay' ) setOverlayHandler(null) toggleOverlay(true) @@ -1090,7 +1093,7 @@ async function loadSelectedServerOnModsTab(){ - ${Lang.queryJS('settings.serverListing.mainServer')} + Main Server ` : ''} @@ -1341,19 +1344,19 @@ async function populateJavaExecDetails(execPath){ const details = await validateSelectedJvm(ensureJavaDirIsRoot(execPath), server.effectiveJavaOptions.supported) if(details != null) { - settingsJavaExecDetails.innerHTML = Lang.queryJS('settings.java.selectedJava', { version: details.semverStr, vendor: details.vendor }) + settingsJavaExecDetails.innerHTML = `Selected: Java ${details.semverStr} (${details.vendor})` } else { - settingsJavaExecDetails.innerHTML = Lang.queryJS('settings.java.invalidSelection') + settingsJavaExecDetails.innerHTML = 'Invalid Selection' } } function populateJavaReqDesc(server) { - settingsJavaReqDesc.innerHTML = Lang.queryJS('settings.java.requiresJava', { major: server.effectiveJavaOptions.suggestedMajor }) + settingsJavaReqDesc.innerHTML = `Requires Java ${server.effectiveJavaOptions.suggestedMajor} x64.` } function populateJvmOptsLink(server) { const major = server.effectiveJavaOptions.suggestedMajor - settingsJvmOptsLink.innerHTML = Lang.queryJS('settings.java.availableOptions', { major: major }) + settingsJvmOptsLink.innerHTML = `Available Options for Java ${major} (HotSpot VM)` if(major >= 12) { settingsJvmOptsLink.href = `https://docs.oracle.com/en/java/javase/${major}/docs/specs/man/java.html#extra-options-for-java` } @@ -1430,11 +1433,11 @@ function isPrerelease(version){ function populateVersionInformation(version, valueElement, titleElement, checkElement){ valueElement.innerHTML = version if(isPrerelease(version)){ - titleElement.innerHTML = Lang.queryJS('settings.about.preReleaseTitle') + titleElement.innerHTML = 'Pre-release' titleElement.style.color = '#ff886d' checkElement.style.background = '#ff886d' } else { - titleElement.innerHTML = Lang.queryJS('settings.about.stableReleaseTitle') + titleElement.innerHTML = 'Stable Release' titleElement.style.color = null checkElement.style.background = null } @@ -1473,7 +1476,7 @@ function populateReleaseNotes(){ }, timeout: 2500 }).catch(err => { - settingsAboutChangelogText.innerHTML = Lang.queryJS('settings.about.releaseNotesFailed') + settingsAboutChangelogText.innerHTML = 'Failed to load release notes.' }) } @@ -1521,27 +1524,27 @@ function settingsUpdateButtonStatus(text, disabled = false, handler = null){ */ function populateSettingsUpdateInformation(data){ if(data != null){ - settingsUpdateTitle.innerHTML = isPrerelease(data.version) ? Lang.queryJS('settings.updates.newPreReleaseTitle') : Lang.queryJS('settings.updates.newReleaseTitle') + settingsUpdateTitle.innerHTML = `New ${isPrerelease(data.version) ? 'Pre-release' : 'Release'} Available` settingsUpdateChangelogCont.style.display = null settingsUpdateChangelogTitle.innerHTML = data.releaseName settingsUpdateChangelogText.innerHTML = data.releaseNotes populateVersionInformation(data.version, settingsUpdateVersionValue, settingsUpdateVersionTitle, settingsUpdateVersionCheck) if(process.platform === 'darwin'){ - settingsUpdateButtonStatus(Lang.queryJS('settings.updates.downloadButton'), false, () => { + settingsUpdateButtonStatus('Download from GitHubClose the launcher and run the dmg to update.', false, () => { shell.openExternal(data.darwindownload) }) } else { - settingsUpdateButtonStatus(Lang.queryJS('settings.updates.downloadingButton'), true) + settingsUpdateButtonStatus('Downloading..', true) } } else { - settingsUpdateTitle.innerHTML = Lang.queryJS('settings.updates.latestVersionTitle') + settingsUpdateTitle.innerHTML = 'You Are Running the Latest Version' settingsUpdateChangelogCont.style.display = 'none' populateVersionInformation(remote.app.getVersion(), settingsUpdateVersionValue, settingsUpdateVersionTitle, settingsUpdateVersionCheck) - settingsUpdateButtonStatus(Lang.queryJS('settings.updates.checkForUpdatesButton'), false, () => { + settingsUpdateButtonStatus('Check for Updates', false, () => { if(!isDev){ ipcRenderer.send('autoUpdateAction', 'checkForUpdate') - settingsUpdateButtonStatus(Lang.queryJS('settings.updates.checkingForUpdatesButton'), true) + settingsUpdateButtonStatus('Checking for Updates..', true) } }) } diff --git a/app/assets/js/scripts/uibinder.js b/app/assets/js/scripts/uibinder.js index 29e65862..8d75f94b 100644 --- a/app/assets/js/scripts/uibinder.js +++ b/app/assets/js/scripts/uibinder.js @@ -9,6 +9,7 @@ const { Type } = require('helios-distribution-types') const AuthManager = require('./assets/js/authmanager') const ConfigManager = require('./assets/js/configmanager') const { DistroAPI } = require('./assets/js/distromanager') +const Lang = require('./assets/js/langloader') let rscShouldLoad = false let fatalStartupError = false @@ -114,9 +115,9 @@ function showFatalStartupError(){ $('#loadingContainer').fadeOut(250, () => { document.getElementById('overlayContainer').style.background = 'none' setOverlayContent( - Lang.queryJS('uibinder.startup.fatalErrorTitle'), - Lang.queryJS('uibinder.startup.fatalErrorMessage'), - Lang.queryJS('uibinder.startup.closeButton') + 'Fatal Error: Unable to Load Distribution Index', + 'A connection could not be established to our servers to download the distribution index. No local copies were available to load.

The distribution index is an essential file which provides the latest server information. The launcher is unable to start without it. Ensure you are connected to the internet and relaunch the application.', + 'Close' ) setOverlayHandler(() => { const window = remote.getCurrentWindow() @@ -163,7 +164,7 @@ function syncModConfigurations(data){ for(let mdl of mdls){ const type = mdl.rawModule.type - if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader || type === Type.FabricMod){ + if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader){ if(!mdl.getRequired().value){ const mdlID = mdl.getVersionlessMavenIdentifier() if(modsOld[mdlID] == null){ @@ -198,7 +199,7 @@ function syncModConfigurations(data){ for(let mdl of mdls){ const type = mdl.rawModule.type - if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader || type === Type.FabricMod){ + if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader){ if(!mdl.getRequired().value){ mods[mdl.getVersionlessMavenIdentifier()] = scanOptionalSubModules(mdl.subModules, mdl) } else { @@ -253,7 +254,7 @@ function scanOptionalSubModules(mdls, origin){ for(let mdl of mdls){ const type = mdl.rawModule.type // Optional types. - if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader || type === Type.FabricMod){ + if(type === Type.ForgeMod || type === Type.LiteMod || type === Type.LiteLoader){ // It is optional. if(!mdl.getRequired().value){ mods[mdl.getVersionlessMavenIdentifier()] = scanOptionalSubModules(mdl.subModules, mdl) @@ -332,12 +333,10 @@ async function validateSelectedAccount(){ ConfigManager.save() const accLen = Object.keys(ConfigManager.getAuthAccounts()).length setOverlayContent( - Lang.queryJS('uibinder.validateAccount.failedMessageTitle'), - accLen > 0 - ? Lang.queryJS('uibinder.validateAccount.failedMessage', { 'account': selectedAcc.displayName }) - : Lang.queryJS('uibinder.validateAccount.failedMessageSelectAnotherAccount', { 'account': selectedAcc.displayName }), - Lang.queryJS('uibinder.validateAccount.loginButton'), - Lang.queryJS('uibinder.validateAccount.selectAnotherAccountButton') + 'Failed to Refresh Login', + `We were unable to refresh the login for ${selectedAcc.displayName}. Please ${accLen > 0 ? 'select another account or ' : ''} login again.`, + 'Login', + 'Select Another Account' ) setOverlayHandler(() => { diff --git a/app/assets/js/scripts/uicore.js b/app/assets/js/scripts/uicore.js index 02e9b5da..c35771ad 100644 --- a/app/assets/js/scripts/uicore.js +++ b/app/assets/js/scripts/uicore.js @@ -10,7 +10,6 @@ const {ipcRenderer, shell, webFrame} = require('electron') const remote = require('@electron/remote') const isDev = require('./assets/js/isdev') const { LoggerUtil } = require('helios-core') -const Lang = require('./assets/js/langloader') const loggerUICore = LoggerUtil.getLogger('UICore') const loggerAutoUpdater = LoggerUtil.getLogger('AutoUpdater') @@ -43,7 +42,7 @@ if(!isDev){ switch(arg){ case 'checking-for-update': loggerAutoUpdater.info('Checking for update..') - settingsUpdateButtonStatus(Lang.queryJS('uicore.autoUpdate.checkingForUpdateButton'), true) + settingsUpdateButtonStatus('Checking for Updates..', true) break case 'update-available': loggerAutoUpdater.info('New update available', info.version) @@ -57,7 +56,7 @@ if(!isDev){ break case 'update-downloaded': loggerAutoUpdater.info('Update ' + info.version + ' ready to be installed.') - settingsUpdateButtonStatus(Lang.queryJS('uicore.autoUpdate.installNowButton'), false, () => { + settingsUpdateButtonStatus('Install Now', false, () => { if(!isDev){ ipcRenderer.send('autoUpdateAction', 'installUpdateNow') } @@ -66,7 +65,7 @@ if(!isDev){ break case 'update-not-available': loggerAutoUpdater.info('No new update found.') - settingsUpdateButtonStatus(Lang.queryJS('uicore.autoUpdate.checkForUpdatesButton')) + settingsUpdateButtonStatus('Check for Updates') break case 'ready': updateCheckListener = setInterval(() => { diff --git a/app/assets/lang/_custom.toml b/app/assets/lang/_custom.toml deleted file mode 100644 index da17faf9..00000000 --- a/app/assets/lang/_custom.toml +++ /dev/null @@ -1,20 +0,0 @@ -# Custom Language File for Launcher Customizer - -[ejs.app] -title = "Helios Launcher" - -[ejs.landing] -mediaGitHubURL = "https://github.com/dscalzi/HeliosLauncher" -mediaTwitterURL = "#" -mediaInstagramURL = "#" -mediaYouTubeURL = "#" -mediaDiscordURL = "https://discord.gg/zNWUXdt" - -[ejs.settings] -sourceGithubLink = "https://github.com/dscalZi/HeliosLauncher" -supportLink = "https://github.com/dscalZi/HeliosLauncher/issues" - -[ejs.welcome] -welcomeHeader = "WELCOME TO WESTEROSCRAFT" -welcomeDescription = "Our mission is to recreate the universe imagined by author George RR Martin in his fantasy series, A Song of Ice and Fire. Through the collaborative effort of thousands of community members, we have sought to create Westeros as accurately and precisely as possible within Minecraft. The world we are creating is yours to explore. Journey from Dorne to Castle Black, and if you aren’t afraid, beyond the Wall itself, but best not delay. As the words of House Stark ominously warn: Winter is Coming." -welcomeDescCTA = "You are just a few clicks away from Westeros." diff --git a/app/assets/lang/en_US.json b/app/assets/lang/en_US.json new file mode 100644 index 00000000..25b34c24 --- /dev/null +++ b/app/assets/lang/en_US.json @@ -0,0 +1,49 @@ +{ + "html": { + "avatarOverlay": "Edit" + }, + "js": { + "login": { + "error": { + "invalidValue": "* Invalid Value", + "requiredValue": "* Required", + "userMigrated": { + "title": "Error During Login:
Invalid Credentials", + "desc": "You've attempted to login with a migrated account. Try again using the account email as the username." + }, + "invalidCredentials": { + "title": "Error During Login:
Invalid Credentials", + "desc": "The email or password you've entered is incorrect. Please try again." + }, + "rateLimit": { + "title": "Error During Login:
Too Many Attempts", + "desc": "There have been too many login attempts with this account recently. Please try again later." + }, + "noInternet": { + "title": "Error During Login:
No Internet Connection", + "desc": "You must be connected to the internet in order to login. Please connect and try again." + }, + "authDown": { + "title": "Error During Login:
Authentication Server Offline", + "desc": "Mojang's authentication server is currently offline or unreachable. Please wait a bit and try again. You can check the status of the server on Mojang's help portal." + }, + "notPaid": { + "title": "Error During Login:
Game Not Purchased", + "desc": "The account you are trying to login with has not purchased a copy of Minecraft.
You may purchase a copy on Minecraft.net" + }, + "unknown": { + "title": "Error During Login:
Unknown Error" + } + }, + "login": "LOGIN", + "loggingIn": "LOGGING IN", + "success": "SUCCESS", + "tryAgain": "Try Again" + }, + "landing": { + "launch": { + "pleaseWait": "Please wait.." + } + } + } +} \ No newline at end of file diff --git a/app/loginOptions.ejs b/app/loginOptions.ejs index 20aa67cc..36af37e0 100644 --- a/app/loginOptions.ejs +++ b/app/loginOptions.ejs @@ -1,7 +1,7 @@ -->
- <%- lang('welcome.welcomeHeader') %> - <%- lang('welcome.welcomeDescription') %> + WELCOME TO WESTEROSCRAFT + Our mission is to recreate the universe imagined by author George RR Martin in his fantasy series, A Song of Ice and Fire. Through the collaborative effort of thousands of community members, we have sought to create Westeros as accurately and precisely as possible within Minecraft. The world we are creating is yours to explore. Journey from Dorne to Castle Black, and if you aren’t afraid, beyond the Wall itself, but best not delay. As the words of House Stark ominously warn: Winter is Coming.
- <%- lang('welcome.welcomeDescCTA') %> + You are just a few clicks away from Westeros.