From 022fd6578bfbfd3aadf44ab83fef040470509198 Mon Sep 17 00:00:00 2001 From: Maroxy Date: Sun, 28 Nov 2021 18:52:58 +0100 Subject: [PATCH 1/6] Completed most of the stuff --- entry.js | 17 +++++++++-- public/html/settings.html | 6 ++++ src/ts/index.ts | 11 ++++++-- src/ts/lib/LauncherLib.ts | 1 + src/ts/lib/PrefixSelector.ts | 55 ++++++++++++++++++++++++++++++++++++ src/ts/settings.ts | 14 +++++++++ 6 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 src/ts/lib/PrefixSelector.ts diff --git a/entry.js b/entry.js index 425f615..60e2567 100644 --- a/entry.js +++ b/entry.js @@ -5,14 +5,15 @@ const { Notification, shell, nativeImage, - nativeTheme + nativeTheme, + dialog } = require('electron'); const path = require('path'); require('electron-store').initRenderer(); -let mainWindow, analyticsWindow; +let mainWindow, analyticsWindow, settingsWindow; ipcMain.handle('hide-window', () => mainWindow.hide()); ipcMain.handle('show-window', () => mainWindow.show()); @@ -26,7 +27,7 @@ ipcMain.on('notification', (event, args) => { ipcMain.on('is-window-dark', (e) => e.returnValue = nativeTheme.shouldUseDarkColors); ipcMain.handle('open-settings', () => { - const settingsWindow = new BrowserWindow ({ + settingsWindow = new BrowserWindow ({ width: 900, height: 600, webPreferences: { @@ -120,6 +121,16 @@ app.whenReady().then(() => { mainWindow.webContents.send('change-voicepack'); }); + ipcMain.on('prefix-con', async () => { + const result = await dialog.showOpenDialog({ properties: ['openDirectory'] }); + if(result.filePaths.length == 0) return; + mainWindow.webContents.send('change-prefix', { 'dir': result.filePaths[0] }); + }); + + ipcMain.on('prefix-changed', async () => { + settingsWindow.webContents.send('prefix-changed'); + }); + ipcMain.on('rpc-toggle', () => mainWindow.webContents.send('rpc-toggle')); }); diff --git a/public/html/settings.html b/public/html/settings.html index 91bac00..1fb5e96 100644 --- a/public/html/settings.html +++ b/public/html/settings.html @@ -112,6 +112,12 @@ +
+ empty + + +
+
System diff --git a/src/ts/index.ts b/src/ts/index.ts index 0f0909c..fdf0309 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -13,12 +13,13 @@ import LauncherLib from './lib/LauncherLib'; import LauncherUI from './lib/LauncherUI'; import Tools from './lib/Tools'; import DiscordRPC from './lib/DiscordRPC'; +import PrefixSelector from './lib/PrefixSelector'; import SwitcherooControl from './lib/SwitcherooControl'; const launcher_version = require('../../package.json').version; -if (!fs.existsSync(constants.prefixDir)) - fs.mkdirSync(constants.prefixDir, { recursive: true }); +if (!fs.existsSync(LauncherLib.getConfig('prefix'))) + fs.mkdirSync(LauncherLib.getConfig('prefix'), { recursive: true }); if (!fs.existsSync(constants.runnersDir)) fs.mkdirSync(constants.runnersDir, { recursive: true }); @@ -59,6 +60,12 @@ $(() => { LauncherUI.updateLauncherState(); }); + ipcRenderer.on('change-prefix', (event: void, data: any) => { + PrefixSelector.set(data.dir); + LauncherUI.updateLauncherState(); + ipcRenderer.send('prefix-changed'); + }); + Tools.getGitTags(constants.uri.launcher).then(tags => { const latestVersion = tags[tags.length - 1].tag; diff --git a/src/ts/lib/LauncherLib.ts b/src/ts/lib/LauncherLib.ts index 46db0b3..4ec68e0 100644 --- a/src/ts/lib/LauncherLib.ts +++ b/src/ts/lib/LauncherLib.ts @@ -27,6 +27,7 @@ const config = new store ({ file: null }, version: null, // Installed game version + prefix: path.join(os.homedir(), '.local', 'share', 'anime-game-launcher', 'game'), // Default Prefix patch: null, // Installed patch info ({ version, state } - related game's version and patch's state) runner: null, // Selected runner ({ folder, executable }) rpc: false, // Discord RPC diff --git a/src/ts/lib/PrefixSelector.ts b/src/ts/lib/PrefixSelector.ts new file mode 100644 index 0000000..16a214e --- /dev/null +++ b/src/ts/lib/PrefixSelector.ts @@ -0,0 +1,55 @@ +const fs = require('fs'); +import LauncherLib from "./LauncherLib"; +const path = require('path'); +const os = require('os'); + +export default class PrefixSelector +{ + protected static prefix: string = LauncherLib.getConfig('prefix'); + + public static set(location: string) { + if (this.prefix == location) return console.log('Can\'t set already selected prefix as new prefix'); + + if (fs.existsSync(path.join(location, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'Persistent'))) { + const version = fs.readFileSync(path.join(location, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'Persistent', 'ScriptVersion'), { encoding: 'UTF-8' }).toString(); + + LauncherLib.updateConfig('version', version); + LauncherLib.updateConfig('prefix', location); + this.prefix = location; + } else if (fs.existsSync(path.join(location, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'))) { + const config = fs.readFileSync(path.join(location, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'), { encoding: 'ascii' }); + const version = /([1-9]+\.[0-9]+\.[0-9]+)_[\d]+_[\d]+/.exec(config)![1]; + console.log(version); + LauncherLib.updateConfig('prefix', location); + this.prefix = location; + } else { + console.log('Game not found.'); + + // Unset version if game is not found. + LauncherLib.updateConfig('version', null); + LauncherLib.updateConfig('prefix', location); + this.prefix = location; + } + } + + public static Default() { + const dp = path.join(os.homedir(), '.local', 'share', 'anime-game-launcher', 'game'); + + if (this.prefix == dp) return console.log('Can\'t set already selected prefix as new prefix'); + + if (fs.existsSync(path.join(dp, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'Persistent'))) { + const version = fs.readFileSync(path.join(dp, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'Persistent', 'ScriptVersion'), { encoding: 'UTF-8' }).toString(); + console.log(version); + } else if (fs.existsSync(path.join(dp, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'))) { + const config = fs.readFileSync(path.join(dp, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'), { encoding: 'ascii' }); + const version = /([1-9]+\.[0-9]+\.[0-9]+)_[\d]+_[\d]+/.exec(config)![1]; + console.log(version); + } else { + console.log('Game not found.'); + + // Unset version if game is not found. + LauncherLib.updateConfig('version', null); + } + } + +} \ No newline at end of file diff --git a/src/ts/settings.ts b/src/ts/settings.ts index 71104af..3328ded 100644 --- a/src/ts/settings.ts +++ b/src/ts/settings.ts @@ -54,6 +54,20 @@ $(() => { } }); + /** + * Prefix + */ + + $('#prefixloc span').text(LauncherLib.getConfig('prefix')); + + ipcRenderer.on('prefix-changed', () => { + $('#prefixloc span').text(LauncherLib.getConfig('prefix')); + }) + + $('#prefixloc #prefixdir').on('click', () => { + ipcRenderer.send('prefix-con'); + }) + /** * Game voice language */ From 391d2935552afc72814e336028e0cca21890686d Mon Sep 17 00:00:00 2001 From: Maroxy Date: Sun, 28 Nov 2021 18:55:58 +0100 Subject: [PATCH 2/6] Replace an console.log with setting --- src/ts/lib/PrefixSelector.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ts/lib/PrefixSelector.ts b/src/ts/lib/PrefixSelector.ts index 16a214e..0248315 100644 --- a/src/ts/lib/PrefixSelector.ts +++ b/src/ts/lib/PrefixSelector.ts @@ -19,7 +19,8 @@ export default class PrefixSelector } else if (fs.existsSync(path.join(location, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'))) { const config = fs.readFileSync(path.join(location, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'), { encoding: 'ascii' }); const version = /([1-9]+\.[0-9]+\.[0-9]+)_[\d]+_[\d]+/.exec(config)![1]; - console.log(version); + + LauncherLib.updateConfig('version', version); LauncherLib.updateConfig('prefix', location); this.prefix = location; } else { From b5a7007baa112c734998337bcd1692ea36547116 Mon Sep 17 00:00:00 2001 From: Maroxy Date: Sun, 28 Nov 2021 19:02:23 +0100 Subject: [PATCH 3/6] Configure reset to default --- entry.js | 6 +++++- public/html/settings.html | 1 + src/ts/index.ts | 3 ++- src/ts/lib/PrefixSelector.ts | 14 +++++++++++--- src/ts/settings.ts | 6 +++++- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/entry.js b/entry.js index 60e2567..84f0f41 100644 --- a/entry.js +++ b/entry.js @@ -124,7 +124,11 @@ app.whenReady().then(() => { ipcMain.on('prefix-con', async () => { const result = await dialog.showOpenDialog({ properties: ['openDirectory'] }); if(result.filePaths.length == 0) return; - mainWindow.webContents.send('change-prefix', { 'dir': result.filePaths[0] }); + mainWindow.webContents.send('change-prefix', { 'type': 'change', 'dir': result.filePaths[0] }); + }); + + ipcMain.on('prefix-reset', async () => { + mainWindow.webContents.send('change-prefix', { 'type': 'reset' }); }); ipcMain.on('prefix-changed', async () => { diff --git a/public/html/settings.html b/public/html/settings.html index 1fb5e96..21d67d2 100644 --- a/public/html/settings.html +++ b/public/html/settings.html @@ -116,6 +116,7 @@ empty +
diff --git a/src/ts/index.ts b/src/ts/index.ts index fdf0309..a9b3213 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -61,7 +61,8 @@ $(() => { }); ipcRenderer.on('change-prefix', (event: void, data: any) => { - PrefixSelector.set(data.dir); + if(data.type == 'change') PrefixSelector.set(data.dir); + if(data.type == 'reset') PrefixSelector.Default(); LauncherUI.updateLauncherState(); ipcRenderer.send('prefix-changed'); }); diff --git a/src/ts/lib/PrefixSelector.ts b/src/ts/lib/PrefixSelector.ts index 0248315..e96a439 100644 --- a/src/ts/lib/PrefixSelector.ts +++ b/src/ts/lib/PrefixSelector.ts @@ -19,7 +19,7 @@ export default class PrefixSelector } else if (fs.existsSync(path.join(location, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'))) { const config = fs.readFileSync(path.join(location, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'), { encoding: 'ascii' }); const version = /([1-9]+\.[0-9]+\.[0-9]+)_[\d]+_[\d]+/.exec(config)![1]; - + LauncherLib.updateConfig('version', version); LauncherLib.updateConfig('prefix', location); this.prefix = location; @@ -40,16 +40,24 @@ export default class PrefixSelector if (fs.existsSync(path.join(dp, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'Persistent'))) { const version = fs.readFileSync(path.join(dp, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'Persistent', 'ScriptVersion'), { encoding: 'UTF-8' }).toString(); - console.log(version); + + LauncherLib.updateConfig('version', version); + LauncherLib.updateConfig('prefix', dp); + this.prefix = dp; } else if (fs.existsSync(path.join(dp, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'))) { const config = fs.readFileSync(path.join(dp, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'), { encoding: 'ascii' }); const version = /([1-9]+\.[0-9]+\.[0-9]+)_[\d]+_[\d]+/.exec(config)![1]; - console.log(version); + + LauncherLib.updateConfig('version', version); + LauncherLib.updateConfig('prefix', dp); + this.prefix = dp; } else { console.log('Game not found.'); // Unset version if game is not found. LauncherLib.updateConfig('version', null); + LauncherLib.updateConfig('prefix', dp); + this.prefix = dp; } } diff --git a/src/ts/settings.ts b/src/ts/settings.ts index 3328ded..68db7b7 100644 --- a/src/ts/settings.ts +++ b/src/ts/settings.ts @@ -59,7 +59,7 @@ $(() => { */ $('#prefixloc span').text(LauncherLib.getConfig('prefix')); - + ipcRenderer.on('prefix-changed', () => { $('#prefixloc span').text(LauncherLib.getConfig('prefix')); }) @@ -68,6 +68,10 @@ $(() => { ipcRenderer.send('prefix-con'); }) + $('#prefixloc #defprefix').on('click', () => { + ipcRenderer.send('prefix-reset'); + }) + /** * Game voice language */ From acfa96c4ae3566cda6e6fb5dae5befd226e4a664 Mon Sep 17 00:00:00 2001 From: Maroxy Date: Sun, 28 Nov 2021 19:13:42 +0100 Subject: [PATCH 4/6] Fix Constants --- src/ts/lib/PrefixSelector.ts | 7 +++++++ src/ts/lib/constants.ts | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ts/lib/PrefixSelector.ts b/src/ts/lib/PrefixSelector.ts index e96a439..f4cde0f 100644 --- a/src/ts/lib/PrefixSelector.ts +++ b/src/ts/lib/PrefixSelector.ts @@ -1,5 +1,6 @@ const fs = require('fs'); import LauncherLib from "./LauncherLib"; +import constants from "./constants"; const path = require('path'); const os = require('os'); @@ -15,6 +16,7 @@ export default class PrefixSelector LauncherLib.updateConfig('version', version); LauncherLib.updateConfig('prefix', location); + constants.prefixDir = location; this.prefix = location; } else if (fs.existsSync(path.join(location, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'))) { const config = fs.readFileSync(path.join(location, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'), { encoding: 'ascii' }); @@ -22,6 +24,7 @@ export default class PrefixSelector LauncherLib.updateConfig('version', version); LauncherLib.updateConfig('prefix', location); + constants.prefixDir = location; this.prefix = location; } else { console.log('Game not found.'); @@ -29,6 +32,7 @@ export default class PrefixSelector // Unset version if game is not found. LauncherLib.updateConfig('version', null); LauncherLib.updateConfig('prefix', location); + constants.prefixDir = location; this.prefix = location; } } @@ -43,6 +47,7 @@ export default class PrefixSelector LauncherLib.updateConfig('version', version); LauncherLib.updateConfig('prefix', dp); + constants.prefixDir = dp; this.prefix = dp; } else if (fs.existsSync(path.join(dp, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'))) { const config = fs.readFileSync(path.join(dp, 'drive_c', 'Program Files', 'Genshin Impact', 'GenshinImpact_Data', 'globalgamemanagers'), { encoding: 'ascii' }); @@ -50,6 +55,7 @@ export default class PrefixSelector LauncherLib.updateConfig('version', version); LauncherLib.updateConfig('prefix', dp); + constants.prefixDir = dp; this.prefix = dp; } else { console.log('Game not found.'); @@ -57,6 +63,7 @@ export default class PrefixSelector // Unset version if game is not found. LauncherLib.updateConfig('version', null); LauncherLib.updateConfig('prefix', dp); + constants.prefixDir = dp; this.prefix = dp; } } diff --git a/src/ts/lib/constants.ts b/src/ts/lib/constants.ts index 66ec63c..23cb4cc 100644 --- a/src/ts/lib/constants.ts +++ b/src/ts/lib/constants.ts @@ -1,5 +1,6 @@ const path = require('path'); const os = require('os'); +import LauncherLib from "./LauncherLib"; export default class constants { @@ -44,7 +45,7 @@ export default class constants public static readonly launcherDir: string = path.join(os.homedir(), '.local', 'share', 'anime-game-launcher'); - public static readonly prefixDir: string = path.join(this.launcherDir, 'game'); + public static prefixDir: string = LauncherLib.getConfig('prefix'); public static readonly gameDir: string = path.join(this.prefixDir, 'drive_c', 'Program Files', this.placeholders.uppercase.full); public static readonly voiceDir: string = path.join(this.gameDir, `${this.placeholders.uppercase.first + this.placeholders.uppercase.second}_Data`, 'StreamingAssets', 'Audio', 'GeneratedSoundBanks', 'Windows'); From e5ac400bd474a7a1598cb03e5cb5bb9bf8764a4c Mon Sep 17 00:00:00 2001 From: Maroxy Date: Sun, 28 Nov 2021 19:22:21 +0100 Subject: [PATCH 5/6] Update Locales --- public/locales/de.json | 4 +++- public/locales/en-us.json | 4 +++- public/locales/en.json | 4 +++- public/locales/es.json | 4 +++- public/locales/fr.json | 4 +++- public/locales/id.json | 4 +++- public/locales/ja.json | 4 +++- public/locales/ko.json | 4 +++- public/locales/pt.json | 4 +++- public/locales/ru.json | 4 +++- public/locales/th.json | 4 +++- public/locales/vi.json | 4 +++- public/locales/zh-cn.json | 4 +++- public/locales/zh-tw.json | 4 +++- 14 files changed, 42 insertions(+), 14 deletions(-) diff --git a/public/locales/de.json b/public/locales/de.json index 9a7da1b..b217a32 100644 --- a/public/locales/de.json +++ b/public/locales/de.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "Überspingen und nicht noch mal fragen", "LauncherUpdateTitle": "Launcher update verfügbar: ", "LauncherUpdateBody": "Sie können eine neue Version des Launchers aus dem Repository des Projekts unter {uri.launcher} herunterladen.", - "TelemetryNotDisabled": "{placeholders.uppercase.company} Telemetrieserver sind nicht deaktiviert!" + "TelemetryNotDisabled": "{placeholders.uppercase.company} Telemetrieserver sind nicht deaktiviert!", + "DefPrefix": "Zurücksetzen zum Standard-Prefix", + "ChangePrefix": "Prefix ändern" } \ No newline at end of file diff --git a/public/locales/en-us.json b/public/locales/en-us.json index 507f966..6e1c2a9 100644 --- a/public/locales/en-us.json +++ b/public/locales/en-us.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "Skip and don't ask again", "LauncherUpdateTitle": "Launcher update available: ", "LauncherUpdateBody": "You can download a new version of the launcher from the project's repository at {uri.launcher}", - "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!" + "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/en.json b/public/locales/en.json index ce7be2d..d30d4ba 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "Skip and don't ask again", "LauncherUpdateTitle": "Launcher update available: ", "LauncherUpdateBody": "You can download a new version of the launcher from the project's repository at {uri.launcher}", - "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!" + "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/es.json b/public/locales/es.json index ce7be2d..d30d4ba 100644 --- a/public/locales/es.json +++ b/public/locales/es.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "Skip and don't ask again", "LauncherUpdateTitle": "Launcher update available: ", "LauncherUpdateBody": "You can download a new version of the launcher from the project's repository at {uri.launcher}", - "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!" + "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/fr.json b/public/locales/fr.json index ce7be2d..d30d4ba 100644 --- a/public/locales/fr.json +++ b/public/locales/fr.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "Skip and don't ask again", "LauncherUpdateTitle": "Launcher update available: ", "LauncherUpdateBody": "You can download a new version of the launcher from the project's repository at {uri.launcher}", - "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!" + "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/id.json b/public/locales/id.json index 4c69165..1ea318d 100644 --- a/public/locales/id.json +++ b/public/locales/id.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "Lewati dan jangan tanya lagi", "LauncherUpdateTitle": "Pembaruan Peluncur tersedia: ", "LauncherUpdateBody": "Kamu dapat mengunduh versi baru peluncur dari repositori di {uri.launcher}", - "TelemetryNotDisabled": "Peladen telemetri {placeholders.uppercase.company} tidak dimatikan!" + "TelemetryNotDisabled": "Peladen telemetri {placeholders.uppercase.company} tidak dimatikan!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/ja.json b/public/locales/ja.json index 58b1de4..723256b 100644 --- a/public/locales/ja.json +++ b/public/locales/ja.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "スキップして二度と聞かない", "LauncherUpdateTitle": "ランチャーのアップデートが可能 ", "LauncherUpdateBody": "ランチャーの新バージョンは、プロジェクトのリポジトリ({uri.launcher})からダウンロードできます。", - "TelemetryNotDisabled": "{placeholders.uppercase.company}のテレメトリサーバは無効になっていません!" + "TelemetryNotDisabled": "{placeholders.uppercase.company}のテレメトリサーバは無効になっていません!", + "DefPrefix": "デフォルトへのリセット", + "ChangePrefix": "プレフィックスを変更" } \ No newline at end of file diff --git a/public/locales/ko.json b/public/locales/ko.json index 49c245c..8ff12fa 100644 --- a/public/locales/ko.json +++ b/public/locales/ko.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "건너 뛰고 다시 묻지 마십시오", "LauncherUpdateTitle": "실행기 업데이트 가능: ", "LauncherUpdateBody": "에서 프로젝트의 저장소에서 실행기의 새 버전을 다운로드 할 수 있습니다 {uri.launcher}", - "TelemetryNotDisabled": "{placeholders.uppercase.company} 의 원격 측정 서버가 비활성화되지 않음!" + "TelemetryNotDisabled": "{placeholders.uppercase.company} 의 원격 측정 서버가 비활성화되지 않음!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/pt.json b/public/locales/pt.json index ce7be2d..d30d4ba 100644 --- a/public/locales/pt.json +++ b/public/locales/pt.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "Skip and don't ask again", "LauncherUpdateTitle": "Launcher update available: ", "LauncherUpdateBody": "You can download a new version of the launcher from the project's repository at {uri.launcher}", - "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!" + "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/ru.json b/public/locales/ru.json index 209e3aa..a7d2f75 100644 --- a/public/locales/ru.json +++ b/public/locales/ru.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "Пропустить и не спрашивать", "LauncherUpdateTitle": "Доступно обновление лаунчера: ", "LauncherUpdateBody": "Вы можете скачать новую версию лаунчера с репозитория проекта: {uri.launcher}", - "TelemetryNotDisabled": "Серверы сбора телеметрии {placeholders.uppercase.company} не отключены!" + "TelemetryNotDisabled": "Серверы сбора телеметрии {placeholders.uppercase.company} не отключены!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/th.json b/public/locales/th.json index ce7be2d..d30d4ba 100644 --- a/public/locales/th.json +++ b/public/locales/th.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "Skip and don't ask again", "LauncherUpdateTitle": "Launcher update available: ", "LauncherUpdateBody": "You can download a new version of the launcher from the project's repository at {uri.launcher}", - "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!" + "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/vi.json b/public/locales/vi.json index ce7be2d..d30d4ba 100644 --- a/public/locales/vi.json +++ b/public/locales/vi.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "Skip and don't ask again", "LauncherUpdateTitle": "Launcher update available: ", "LauncherUpdateBody": "You can download a new version of the launcher from the project's repository at {uri.launcher}", - "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!" + "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/zh-cn.json b/public/locales/zh-cn.json index 9bc346f..22c47c8 100644 --- a/public/locales/zh-cn.json +++ b/public/locales/zh-cn.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "跳过,不要再问", "LauncherUpdateTitle": "启动器更新可用:", "LauncherUpdateBody": "你可以从项目的资源库中下载新版本的启动器,网址是:{uri.launcher}", - "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!" + "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file diff --git a/public/locales/zh-tw.json b/public/locales/zh-tw.json index 240d73e..aba8b3d 100644 --- a/public/locales/zh-tw.json +++ b/public/locales/zh-tw.json @@ -53,5 +53,7 @@ "SkipAndDontAsk": "跳過,不要再詢問我", "LauncherUpdateTitle": "啟動器有新的更新可用:", "LauncherUpdateBody": "您可以從此專案的資源庫中下載新版本的啟動器,網址是:{uri.launcher}", - "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!" + "TelemetryNotDisabled": "{placeholders.uppercase.company}'s telemetry servers don't disabled!", + "DefPrefix": "Reset to Default", + "ChangePrefix": "Change Prefix" } \ No newline at end of file From f82abf9d34513d576f5e42042e057cb88b87940e Mon Sep 17 00:00:00 2001 From: Maroxy Date: Sun, 28 Nov 2021 19:28:17 +0100 Subject: [PATCH 6/6] fix stacking issue --- public/html/settings.html | 17 +++++++++++------ src/ts/settings.ts | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/public/html/settings.html b/public/html/settings.html index 21d67d2..3983699 100644 --- a/public/html/settings.html +++ b/public/html/settings.html @@ -112,12 +112,6 @@
-
- empty - - - -
System @@ -136,6 +130,17 @@
+
+ +
+ Prefix: + + empty + +     + +
+

diff --git a/src/ts/settings.ts b/src/ts/settings.ts index 68db7b7..e95e705 100644 --- a/src/ts/settings.ts +++ b/src/ts/settings.ts @@ -58,10 +58,10 @@ $(() => { * Prefix */ - $('#prefixloc span').text(LauncherLib.getConfig('prefix')); + $('#prefixloc #currentprefix').text(LauncherLib.getConfig('prefix')); ipcRenderer.on('prefix-changed', () => { - $('#prefixloc span').text(LauncherLib.getConfig('prefix')); + $('#prefixloc #currentprefix').text(LauncherLib.getConfig('prefix')); }) $('#prefixloc #prefixdir').on('click', () => {