From 5e5cbda0d559cee28a4d808458582ec8d434bef5 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:12:35 +0800 Subject: [PATCH 01/39] Update install.js --- Electron/AMAI-release/install.js | 42 +++++++++++++++++--------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/Electron/AMAI-release/install.js b/Electron/AMAI-release/install.js index 95bd469c7..b7aa1cb25 100644 --- a/Electron/AMAI-release/install.js +++ b/Electron/AMAI-release/install.js @@ -3,7 +3,8 @@ const path = require("path"); const { takeHeapSnapshot } = require("process"); const spawnSync = require("child_process").spawnSync; const arrayOfFiles = []; - +let totalFiles = 0; +let currentFileIndex = 0; /** uncomment to debbug */ // const ls = spawnSync( @@ -33,17 +34,15 @@ const installOnDirectory = async () => { const args = process.argv.slice(2); const response = args[0]; const commander = args[1]; - const ver = args[2] - const language = args[3] - const installCommander = commander == 1 - const vsAICommander = commander == 2 - let bj = 'Blizzard.j' - if (vsAICommander) { bj = 'vsai\\Blizzard.j'} - + const ver = args[2]; + const language = args[3]; + const installCommander = commander == 1; + const vsAICommander = commander == 2; + let bj = 'Blizzard.j'; + if (vsAICommander) {bj = 'vsai\\Blizzard.j'} const commonAIPath = `Scripts\\${ver}\\common.ai` const blizzardPath =`Scripts\\${ver}\\Blizzard.j` - - process.send(`#### Installing AMAI for ${ver} Commander ${commander > 0 ? bj : 'None'} forcing ai language to ${language || 'default'} ####`); + process.send(`#### Installing AMAI for ${ver} Commander ${installCommander ? 'install' : (vsAICommander ? 'install VS AI' : 'none')} , forcing ai language to ${args[3]} ####`); // TODO: change to receive array of maps if (fs.statSync(response).isDirectory()) { @@ -71,8 +70,6 @@ const installOnDirectory = async () => { return } - - if (language !== '-') { setLanguage(commonAIPath, language); if (installCommander) { @@ -85,8 +82,9 @@ const installOnDirectory = async () => { } } - if(arrayOfFiles) { + totalFiles = arrayOfFiles.length; + //process.send({ type: 'progress', current: currentFileIndex, total: totalFiles }); for (const file of arrayOfFiles) { /** uncomment to debbug */ // process.send(`path.extname(file): ${path.extname(file)}`); @@ -94,6 +92,15 @@ const installOnDirectory = async () => { const ext = path.extname(file).toLowerCase(); if(ext.indexOf(`w3m`) >= 0 || ext.indexOf(`w3x`) >= 0) { + currentFileIndex++; + // Send complete progress data including both current and total + if (process.send) { + process.send({ + type: 'progress', + current: currentFileIndex, + total: totalFiles, + }); + } process.send(`#### Installing ${ver} into file: ${file} ####`); } else { process.send(`skip file: ${file}`); @@ -128,7 +135,7 @@ const installOnDirectory = async () => { process.send(mpqEditor.error.message) : process.send(`Resize map hashtable size ${file}`); - const f1AddToMPQ = spawnSync( + const f1AddToMPQ = spawnSync( `MPQEditor.exe`, [ 'a', @@ -178,16 +185,15 @@ const installOnDirectory = async () => { f1AddVSAIToMPQ.error ? process.send(f1AddVSAIToMPQ.error.message) : process.send(`Installing VS Vanilla AI Scripts ${file}`); - } - const f2AddToMPQ = spawnSync( + const f2AddToMPQ = spawnSync( `MPQEditor.exe`, [ 'a', file, `Scripts\\${ver}\\${bj}`, - `Scripts\\Blizzard.j`, + `Scripts\\Blizzard.j` ], { encoding : `utf8` } ); @@ -206,7 +212,6 @@ const installOnDirectory = async () => { f2AddToMPQ.error ? process.send(f2AddToMPQ.error.message) : process.send(installCommander ? `Installing commander ${file}` : `Installing VS Vanilla AI commander ${file}`); - } const f3AddToMPQ = spawnSync( @@ -239,7 +244,6 @@ const installOnDirectory = async () => { } } - function setLanguage(file, language) { let data = fs.readFileSync(file, 'utf8'); const searchFor = /string language = "([^"]*)"/; From ddb2390c9f90f873a5d2d30c5fc20e4eb876c7bb Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:16:44 +0800 Subject: [PATCH 02/39] Set minimum window size and enhance message handling Added minimum width and height for the browser window and improved message handling for installation progress updates. --- Electron/app/main.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Electron/app/main.ts b/Electron/app/main.ts index 6d045bc0f..42d34444c 100644 --- a/Electron/app/main.ts +++ b/Electron/app/main.ts @@ -25,13 +25,14 @@ const isDev = () => { const createWindow = (): BrowserWindow => { const size = screen.getPrimaryDisplay().workAreaSize; - // Create the browser window. win = new BrowserWindow({ x: 0, y: 0, width: size.width, height: size.height, + minWidth: 1280, + minHeight: 940, webPreferences: { devTools: true, nodeIntegration: true, @@ -156,10 +157,16 @@ const execInstall = async (signal, commander: number = 1, isMap: boolean = false } ); - // send messages to modal on front child.on('message', (message) => { - win.webContents.send('on-install-message', message); + if (typeof message === 'object' && message.type === 'progress') { + // Send progress updates via dedicated channel + console.log('progress:', message); + win.webContents.send('on-install-progress', message); + } else { + // Send regular messages via standard channel + win.webContents.send('on-install-message', message); + } }); // close modal on process finishes From e10f2f18dc4ea774f772dbb0cccff50ae2400e19 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:19:38 +0800 Subject: [PATCH 03/39] Add installation progress tracking to app component --- Electron/src/app/app.component.ts | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/Electron/src/app/app.component.ts b/Electron/src/app/app.component.ts index 289b43199..e070e6752 100644 --- a/Electron/src/app/app.component.ts +++ b/Electron/src/app/app.component.ts @@ -14,6 +14,9 @@ export class AppComponent implements AfterViewChecked { public active = false; public couldClose = false; public messages = []; + public currentFile = 0; + public totalFiles = 0; + public installingText = ''; @ViewChild('logareawrapper') private readonly logContainer: ElementRef; @@ -44,16 +47,29 @@ export class AppComponent implements AfterViewChecked { }) this.cdr.detectChanges(); }); - if (electronService.isElectron) { this.menuService.createMenu(); + this.electronService.ipcRenderer.on('on-install-progress', (_, args: { current: number, total: number }) => { + // console.log('totalFiles-in:', args.total, 'currentFile-in:', args.current); + if ( args.total > 0 && this.totalFiles < args.total) { + this.totalFiles = args.total; + } + if (this.currentFile < this.totalFiles) { + this.currentFile++; + this.title = '(' + this.currentFile + '/' + this.totalFiles + ') ' + this.installingText; + } + // console.log('totalFiles-out:', this.totalFiles, 'currentFile-out:', this.currentFile); + this.cdr.detectChanges(); + }); + // TODO: add 'push notification'/'notification' this.electronService.ipcRenderer.on('on-install-init', (_, args: InstallModel) => { console.log('args-install-init', args) this.translate.get(t_('PAGES.APP.INSTALLING'), {path: args.response}).subscribe((res: string) => { - this.title = res + this.title = '(0/X) ' + res; + this.installingText = res; }); this.active = true; this.couldClose = false; @@ -77,16 +93,19 @@ export class AppComponent implements AfterViewChecked { console.log('args-install-empty', args); this.active = false; this.couldClose = true; + this.totalFiles = 0; + this.currentFile = 0; this.cdr.detectChanges(); }); // TODO: add 'push notification'/'notification' this.electronService.ipcRenderer.on('on-install-exit', (_, args) => { this.translate.get(t_('PAGES.APP.INSTALL_DONE')).subscribe((res: string) => { - this.title = res; + this.title = '(' + this.currentFile + '/' + this.totalFiles + ')' + ' ' + res; }); this.couldClose = true; - + this.totalFiles = 0; + this.currentFile = 0; this .menuService .changeEnabledMenuState(true); @@ -104,7 +123,8 @@ export class AppComponent implements AfterViewChecked { this.electronService.ipcRenderer.on('on-install-error', (_, args) => { console.log('args-install-error', args); this.couldClose = true; - + this.totalFiles = 0; + this.currentFile = 0; this .menuService .changeEnabledMenuState(true); From a9663c7f3a5454bd15a89afe029d4599b911aec1 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sat, 14 Feb 2026 15:40:43 +0800 Subject: [PATCH 04/39] Update install.js --- Electron/AMAI-release/install.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Electron/AMAI-release/install.js b/Electron/AMAI-release/install.js index b7aa1cb25..3c9790a6a 100644 --- a/Electron/AMAI-release/install.js +++ b/Electron/AMAI-release/install.js @@ -42,7 +42,7 @@ const installOnDirectory = async () => { if (vsAICommander) {bj = 'vsai\\Blizzard.j'} const commonAIPath = `Scripts\\${ver}\\common.ai` const blizzardPath =`Scripts\\${ver}\\Blizzard.j` - process.send(`#### Installing AMAI for ${ver} Commander ${installCommander ? 'install' : (vsAICommander ? 'install VS AI' : 'none')} , forcing ai language to ${args[3]} ####`); + process.send(`#### Installing AMAI for ${ver} Commander ${commander > 0 ? bj : 'None'} forcing ai language to ${language || 'default'} ####`); // TODO: change to receive array of maps if (fs.statSync(response).isDirectory()) { From 5a5cad72915db24d506e276edf46c197505f6aea Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sat, 21 Feb 2026 19:46:23 +0800 Subject: [PATCH 05/39] Add files via upload --- Electron/src/assets/i18n/de.json | 4 +++- Electron/src/assets/i18n/en.json | 4 +++- Electron/src/assets/i18n/es.json | 4 +++- Electron/src/assets/i18n/fr.json | 4 +++- Electron/src/assets/i18n/no.json | 4 +++- Electron/src/assets/i18n/pt.json | 4 +++- Electron/src/assets/i18n/ro.json | 4 +++- Electron/src/assets/i18n/ru.json | 4 +++- Electron/src/assets/i18n/sv.json | 4 +++- Electron/src/assets/i18n/zh.json | 6 ++++-- 10 files changed, 31 insertions(+), 11 deletions(-) diff --git a/Electron/src/assets/i18n/de.json b/Electron/src/assets/i18n/de.json index 173d3d31f..d34a6400c 100644 --- a/Electron/src/assets/i18n/de.json +++ b/Electron/src/assets/i18n/de.json @@ -10,7 +10,9 @@ "INCLUDE_COMMANDER_VSAI": "Gegen Vanilla KI", "INCLUDE_COMMANDER_OFF": "Kein Kommandant", "OPTIMISE": "Optimierte Skripte verwenden", - "FORCELANG": "AI Chat Sprache überschreiben" + "FORCELANG": "AI Chat Sprache überschreiben", + "CAN_NOT_GET_DEFAULT_PATH":"Kann den Standardspeicherort nicht abrufen", + "DEFAULT_PATH":"Standardpfad: " }, "APP": { "INSTALLING": "Installation in {{path}}", diff --git a/Electron/src/assets/i18n/en.json b/Electron/src/assets/i18n/en.json index 2a176ceb0..c2b4ff105 100644 --- a/Electron/src/assets/i18n/en.json +++ b/Electron/src/assets/i18n/en.json @@ -10,7 +10,9 @@ "INCLUDE_COMMANDER_VSAI": "Vs Vanilla AI", "INCLUDE_COMMANDER_OFF": "No Commander", "OPTIMISE": "Use Optimised Scripts", - "FORCELANG": "Override AI Chat Language" + "FORCELANG": "Override AI Chat Language", + "CAN_NOT_GET_DEFAULT_PATH":"Can not get default path", + "DEFAULT_PATH":"Default path: " }, "APP": { "INSTALLING": "Installing into {{path}}", diff --git a/Electron/src/assets/i18n/es.json b/Electron/src/assets/i18n/es.json index ffdf3bdc8..5948f236e 100644 --- a/Electron/src/assets/i18n/es.json +++ b/Electron/src/assets/i18n/es.json @@ -10,7 +10,9 @@ "INCLUDE_COMMANDER_VSAI": "Contra IA Vanilla", "INCLUDE_COMMANDER_OFF": "Sin Comandante", "OPTIMISE": "Usar scripts optimizados", - "FORCELANG": "Cubrir el lenguaje de chat de Ia" + "FORCELANG": "Cubrir el lenguaje de chat de Ia", + "CAN_NOT_GET_DEFAULT_PATH":"No se puede obtener la ruta predeterminada", + "DEFAULT_PATH":"Ruta predeterminada: " }, "APP": { "INSTALLING": "Instalando en {{path}}", diff --git a/Electron/src/assets/i18n/fr.json b/Electron/src/assets/i18n/fr.json index 341b472f4..309bd5b57 100644 --- a/Electron/src/assets/i18n/fr.json +++ b/Electron/src/assets/i18n/fr.json @@ -10,7 +10,9 @@ "INCLUDE_COMMANDER_VSAI": "Contre IA Vanilla", "INCLUDE_COMMANDER_OFF": "Pas de Commandant", "OPTIMISE": "Utiliser des scripts optimisés", - "FORCELANG": "Couvrir le langage de chat ai" + "FORCELANG": "Couvrir le langage de chat ai", + "CAN_NOT_GET_DEFAULT_PATH":"Ne peut pas obtenir le chemin par défaut", + "DEFAULT_PATH":"Chemin par défaut: " }, "APP": { "INSTALLING": "Installation dans {{path}}", diff --git a/Electron/src/assets/i18n/no.json b/Electron/src/assets/i18n/no.json index 370a2f190..e83d9c71a 100644 --- a/Electron/src/assets/i18n/no.json +++ b/Electron/src/assets/i18n/no.json @@ -10,7 +10,9 @@ "INCLUDE_COMMANDER_VSAI": "Mot Vanilla AI", "INCLUDE_COMMANDER_OFF": "Ingen Kommandant", "OPTIMISE": "Bruk optimaliserte skript", - "FORCELANG": "Overskriv AI-samtalespråk" + "FORCELANG": "Overskriv AI-samtalespråk", + "CAN_NOT_GET_DEFAULT_PATH":"Kan ikke få standardstien", + "DEFAULT_PATH":"Standardstiendeveis: " }, "APP": { "INSTALLING": "Installerer i {{path}}", diff --git a/Electron/src/assets/i18n/pt.json b/Electron/src/assets/i18n/pt.json index acdbf0c2a..a5e85cfea 100644 --- a/Electron/src/assets/i18n/pt.json +++ b/Electron/src/assets/i18n/pt.json @@ -10,7 +10,9 @@ "INCLUDE_COMMANDER_VSAI": "Contra IA Vanilla", "INCLUDE_COMMANDER_OFF": "Sem Comandante", "OPTIMISE": "Usar scripts otimizados", - "FORCELANG": "Substituir a linguagem de conversação AI" + "FORCELANG": "Substituir a linguagem de conversação AI", + "CAN_NOT_GET_DEFAULT_PATH":"Can not get caminho padrão", + "DEFAULT_PATH":"caminho padrão: " }, "APP": { "INSTALLING": "Instalando em {{path}}", diff --git a/Electron/src/assets/i18n/ro.json b/Electron/src/assets/i18n/ro.json index 0330126b4..272ca4dc2 100644 --- a/Electron/src/assets/i18n/ro.json +++ b/Electron/src/assets/i18n/ro.json @@ -10,7 +10,9 @@ "INCLUDE_COMMANDER_VSAI": "Împotriva AI Vanilla", "INCLUDE_COMMANDER_OFF": "Fără comandant", "OPTIMISE": "Utilizați scripturi optimizate", - "FORCELANG": "Suprascrie limbajul de chat AI" + "FORCELANG": "Suprascrie limbajul de chat AI", + "CAN_NOT_GET_DEFAULT_PATH":"Nu se poate obține calea implicită", + "DEFAULT_PATH":"Căi implicită: " }, "APP": { "INSTALLING": "Instalare în curs la {{path}}", diff --git a/Electron/src/assets/i18n/ru.json b/Electron/src/assets/i18n/ru.json index 86b1c6cc3..e4fe6a06f 100644 --- a/Electron/src/assets/i18n/ru.json +++ b/Electron/src/assets/i18n/ru.json @@ -10,7 +10,9 @@ "INCLUDE_COMMANDER_VSAI": "Против Vanilla ИИ", "INCLUDE_COMMANDER_OFF": "Без командира", "OPTIMISE": "Использовать оптимизированные скрипты", - "FORCELANG": "Скачать язык разговора" + "FORCELANG": "Скачать язык разговора", + "CAN_NOT_GET_DEFAULT_PATH":"Не удается получить путь по умолчанию", + "DEFAULT_PATH":"Nути по умолчанию: " }, "APP": { "INSTALLING": "Установка в {{path}}", diff --git a/Electron/src/assets/i18n/sv.json b/Electron/src/assets/i18n/sv.json index 084909b1e..843a4e772 100644 --- a/Electron/src/assets/i18n/sv.json +++ b/Electron/src/assets/i18n/sv.json @@ -10,7 +10,9 @@ "INCLUDE_COMMANDER_VSAI": "Mot Vanilla AI", "INCLUDE_COMMANDER_OFF": "Ingen befälhavare", "OPTIMISE": "Använd optimerade skript", - "FORCELANG": "Skriv över AI-chattspråk" + "FORCELANG": "Skriv över AI-chattspråk", + "CAN_NOT_GET_DEFAULT_PATH":"Kan inte få standardvägen", + "DEFAULT_PATH":"Standardväg: " }, "APP": { "INSTALLING": "Installerar i {{path}}", diff --git a/Electron/src/assets/i18n/zh.json b/Electron/src/assets/i18n/zh.json index 6107cf9fd..ee38b9edb 100644 --- a/Electron/src/assets/i18n/zh.json +++ b/Electron/src/assets/i18n/zh.json @@ -7,10 +7,12 @@ "INSTALL_ON_FOLDER": "按文件夹安装", "INSTALL_ON_MAP": "按地图安装", "INCLUDE_COMMANDER": "安装控制台", - "INCLUDE_COMMANDER_VSAI": "AMAI VS 暴雪AI", + "INCLUDE_COMMANDER_VSAI": "AMAI VS 暴雪AI 控制台", "INCLUDE_COMMANDER_OFF": "不安装控制台", "OPTIMISE": "使用优化脚本", - "FORCELANG": "覆盖AI聊天语言" + "FORCELANG": "覆盖AI聊天语言", + "CAN_NOT_GET_DEFAULT_PATH":"找不到默认路径", + "DEFAULT_PATH":"默认路径:" }, "APP": { "INSTALLING": "正在安装 {{path}}", From 5961992eedc5c11b847702112a28b8a84916c750 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sat, 21 Feb 2026 19:49:10 +0800 Subject: [PATCH 06/39] Update main.ts --- Electron/app/main.ts | 100 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 91 insertions(+), 9 deletions(-) diff --git a/Electron/app/main.ts b/Electron/app/main.ts index 42d34444c..6c945bccc 100644 --- a/Electron/app/main.ts +++ b/Electron/app/main.ts @@ -9,6 +9,7 @@ const cp = require('child_process'); let win: BrowserWindow = null; let translations : { [key: string]: string } = {}; let currentLanguage: string = "English"; +let defaultPath: string | null = null; const args = process.argv.slice(1), serve = args.some(val => val === '--serve'); @@ -77,16 +78,65 @@ const createWindow = (): BrowserWindow => { const execInstall = async (signal, commander: number = 1, isMap: boolean = false, ver: string = "REFORGED", forceLang: boolean) => { const controller = new AbortController(); - const response = dialog.showOpenDialogSync(win, { - // TODO: add i18n here - title : isMap ? translations["PAGES.ELECTRON.OPEN_MAP"] || '': translations["PAGES.ELECTRON.OPEN_DIR"] || '', - // TODO: Change to let multiples selections when is map - properties: isMap ? ['openFile'] : ['openDirectory'], - // TODO: add i18n here - filters: isMap ? [ + let response; + try { + const settingsPath = path.join(app.getPath('userData'), 'settings.json'); + if (fs.existsSync(settingsPath)) { + const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); + defaultPath = settings.defaultPath || null; + console.log('get default Path :',defaultPath); + } + } catch (err) { + console.error('Failed to load default path:', err); + } + // Handle folder mode (isMap = false) + if (!isMap) { + // If default path exists, use it directly + if (defaultPath) { + response = [defaultPath]; + } else { + // Show dialog and save selected path as default + response = dialog.showOpenDialogSync(win, { + title: translations["PAGES.ELECTRON.OPEN_DIR"] || '', + properties: ['openDirectory'], + }); + + // Save the selected path as default if not canceled + if (response && response.length > 0) { + defaultPath = response[0]; + console.log('set default Path :',defaultPath); + // Save to settings.json directly in main process + const settingsPath = path.join(app.getPath('userData'), 'settings.json'); + const settings = { + defaultPath: defaultPath + }; + fs.writeFileSync(settingsPath, JSON.stringify(settings)); + } + } + } else { + // Handle map mode (isMap = true) + const documentsPath = app.getPath('documents'); + response = dialog.showOpenDialogSync(win, { + title: translations["PAGES.ELECTRON.OPEN_MAP"] || '', + properties: ['openFile'], + filters: [ { name: translations["PAGES.ELECTRON.MAPFILE"] || '', extensions: ['w3x', 'w3m'] }, - ] : null, - }); + ], + // Use default path if available, otherwise open "documents" + defaultPath: defaultPath || documentsPath, + }); + // 选择文件后自动将文件所在目录设为默认路径 + if (response && response.length > 0) { + const filePath = response[0]; + const folderPath = path.dirname(filePath); + defaultPath = folderPath; + const settingsPath = path.join(app.getPath('userData'), 'settings.json'); + const settings = { defaultPath: folderPath }; + fs.writeFileSync(settingsPath, JSON.stringify(settings)); + console.log('Default path updated to:', folderPath); + } + console.log('default Path :',defaultPath); + } let child; @@ -178,6 +228,37 @@ const execInstall = async (signal, commander: number = 1, isMap: boolean = false } } + +const setupFileOperations = () => { + ipcMain?.handle('file-operations', async (_, { operation, payload }) => { + switch(operation) { + case 'load-default-path': + const settingsPath = path.join(app.getPath('userData'), 'settings.json'); + if (fs.existsSync(settingsPath)) { + return JSON.parse(fs.readFileSync(settingsPath, 'utf8')).defaultPath; + } + return null; + + case 'select-folder': + const result = dialog.showOpenDialogSync(win, { + title: translations["PAGES.ELECTRON.OPEN_DIR"] || '', + defaultPath: payload?.defaultPath, + properties: ['openDirectory'], + }); + return result && result.length > 0 ? result[0] : null; + + case 'save-default-path': { + const settingsPath = path.join(app.getPath('userData'), 'settings.json'); + fs.writeFileSync(settingsPath, JSON.stringify({ defaultPath: payload })); + return true; + } + + default: + throw new Error(`unknow: ${operation}`); + } + }); +} + const installProcess = () => { let signal = {}; @@ -274,4 +355,5 @@ const installTrans = () => { init(); installTrans(); +setupFileOperations(); installProcess(); From f93b9bb698f8b21b573a0c7ffed126d3f85bf255 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sat, 21 Feb 2026 20:02:41 +0800 Subject: [PATCH 07/39] Add files via upload --- Electron/src/app/home/home.component.html | 24 +- Electron/src/app/home/home.component.scss | 420 ++++++++++++---------- Electron/src/app/home/home.component.ts | 119 ++++-- 3 files changed, 341 insertions(+), 222 deletions(-) diff --git a/Electron/src/app/home/home.component.html b/Electron/src/app/home/home.component.html index 0711661b8..ff0419972 100644 --- a/Electron/src/app/home/home.component.html +++ b/Electron/src/app/home/home.component.html @@ -7,20 +7,20 @@

REFSelected REF - 1.33+ - Optimal:2.0.4 + 2.0.3+ + {{ 'PAGES.HOME.REF_BEST_GAME_VERSION' | translate }}
TFTSelected TFT - 1.24+ - Optimal:1.24-1.28 + 1.24e+ + {{ 'PAGES.HOME.TFT_BEST_GAME_VERSION' | translate }}
ROCSelected ROC - 1.24 - 1.31 - Optimal:1.24-1.28 + 1.24e+ ~ 1.31 + {{ 'PAGES.HOME.ROC_BEST_GAME_VERSION' | translate }}
@@ -50,4 +50,14 @@

{{ 'PAGES.HOME.FORCELANG' | translate }} - +
+ + {{ 'PAGES.HOME.DEFAULT_PATH' | translate }} + + +
+ \ No newline at end of file diff --git a/Electron/src/app/home/home.component.scss b/Electron/src/app/home/home.component.scss index 1529c2215..605cc393e 100644 --- a/Electron/src/app/home/home.component.scss +++ b/Electron/src/app/home/home.component.scss @@ -1,223 +1,265 @@ :host { - :root { - --switch-width: 300px; /* 最大宽度 */ - } + :root { + --switch-width: 300px; /* 最大宽度 */ + } - .center-container { - text-align: center; - justify-content: center; - align-items: center; - margin: auto; - max-width: 100%; - } + .center-container { + text-align: center; + justify-content: center; + align-items: center; + margin: auto; + max-width: 100%; + } - .container { - color: white; - } + .container { + color: white; + } - .headtitle-text { - text-align: center; - font-size: 2rem; - font-weight: bold; - } + .headtitle-text { + text-align: center; + font-size: 2rem; + font-weight: bold; + } - .subtitle-text { - text-align: center; - font-size: 2rem; - font-weight: bold; - margin-top: 4rem; - } + .subtitle-text { + text-align: center; + font-size: 2rem; + font-weight: bold; + margin-top: 4rem; + } - .ContainerLattice { - display: flex; - text-align: center; - justify-content: space-around; - align-items: center; - max-width: inherit; /* 继承父元素(.center-container)的最大宽度 */ - width: 100%; - gap: 10px; - margin-top: 2rem; - } + .ContainerLattice { + display: flex; + text-align: center; + justify-content: space-around; + align-items: center; + max-width: inherit; /* 继承父元素(.center-container)的最大宽度 */ + width: 100%; + gap: 10px; + margin-top: 2rem; + } - .AdvancedSettings, - .MoreSettings { - background-color: black; - } + .AdvancedSettings, + .MoreSettings { + background-color: black; + } - .MoreSettings { - margin-top: 1rem; - } + .MoreSettings { + margin-top: 1rem; + } - .imageContainerROC, - .imageContainerTFT, - .imageContainerREF { - display: block; - align-items: center; - justify-content: center; - max-width: 512px; - width: 50%; - height: auto; - background-color: black; - min-width: 200px; + .imageContainerROC, + .imageContainerTFT, + .imageContainerREF { + display: block; + align-items: center; + justify-content: center; + max-width: 512px; + width: 50%; + height: auto; + background-color: black; + min-width: 200px; + } + + .imageContainerROC span, + .imageContainerTFT span, + .imageContainerREF span { + background-color: black; + font-size: 2rem; + } + + .reccomendations { + font-size: 14pt; + display: block; + color: gold; + } + + /* 当屏幕宽度小于等于800px时,减小字体大小 */ + @media (max-width: 800px) { + .headtitle-text, .subtitle-text { + font-size: 1rem; } .imageContainerROC span, .imageContainerTFT span, .imageContainerREF span { - background-color: black; - font-size: 2rem; + font-size: 1rem; } .reccomendations { - font-size: 14pt; - display: block; - color: gold; + font-size: 10pt; } + } - /* 当屏幕宽度小于等于800px时,减小字体大小 */ - @media (max-width: 800px) { - .headtitle-text, .subtitle-text { - font-size: 1rem; - } - - .imageContainerROC span, - .imageContainerTFT span, - .imageContainerREF span { - font-size: 1rem; - } - - .reccomendations { - font-size: 10pt; - } + @media (max-width: 1600px) { + .ContainerLattice img { + width: 100%; } + } - @media (max-width: 1600px) { - .ContainerLattice img { - width: 100%; - } - } + .commander-group { + display: flex; + justify-content: center; + text-align: start; + align-items: center; + position: relative; + cursor: pointer; + width: 30%; + font-size: 1rem; + transform: scale(1.5); + min-width: 200px; + } - .commander-group { - display: flex; - justify-content: center; - text-align: start; - align-items: center; - position: relative; - cursor: pointer; - width: 30%; - font-size: 1rem; - transform: scale(1.5); - min-width: 200px; - } + .checkboxbj { + display: flex; + justify-content: center; + text-align: start; + align-items: center; + position: relative; + cursor: pointer; + width: 30%; + font-size: 1rem; + transform: scale(1.5); + min-width: 200px; + padding: 4px 10px; + border-radius: 12px; + background-color: black; + color: #FFFFFF; + } - .checkboxbj { - display: flex; - justify-content: center; - text-align: start; - align-items: center; - position: relative; - cursor: pointer; - width: 30%; - font-size: 1rem; - transform: scale(1.5); - min-width: 200px; - padding: 4px 10px; - border-radius: 12px; - background-color: black; - color: #FFFFFF; - } + .radio-btn { + display: inline-flex; /* 使用 flex 布局来更好地控制内部元素 */ + align-items: center; /* 垂直居中文本 */ + justify-content: center; /* 水平居中文本 */ + padding: 4px 10px; /* 内边距,根据需要调整 */ + border-radius: 12px; /* 圆角 */ + font-weight: bold; + background-color: #AAAAAA; /* 未选中时背景色 */ + cursor: pointer; /* 鼠标悬停时显示指针 */ + transition: background-color 0.3s, font-size 0.3s; /* 背景色变化过渡效果和字体大小变化过渡效果 */ + width: 220px; /* 固定宽度 */ + white-space: nowrap; /* 防止文本换行 */ + overflow: hidden; /* 隐藏超出部分 */ + text-overflow: ellipsis; /* 显示省略号 */ + box-sizing: border-box; /* 包含padding和border */ + font-size: calc(100% - 2px); /* 初始字体大小 */ + max-width: 100%; /* 最大宽度 */ + } - .radio-btn { - display: inline-flex; /* 使用 flex 布局来更好地控制内部元素 */ - align-items: center; /* 垂直居中文本 */ - justify-content: center; /* 水平居中文本 */ - padding: 4px 10px; /* 内边距,根据需要调整 */ - border-radius: 12px; /* 圆角 */ - font-weight: bold; - background-color: #AAAAAA; /* 未选中时背景色 */ - cursor: pointer; /* 鼠标悬停时显示指针 */ - transition: background-color 0.3s, font-size 0.3s; /* 背景色变化过渡效果和字体大小变化过渡效果 */ - // width: 220px; /* 固定宽度 */ - white-space: nowrap; /* 防止文本换行 */ - overflow: visible; /* 隐藏超出部分 */ - text-overflow: ellipsis; /* 显示省略号 */ - box-sizing: border-box; /* 包含padding和border */ - font-size: calc(100% - 2px); /* 初始字体大小 */ - max-width: 100%; /* 最大宽度 */ - } + /* 鼠标悬停样式 */ + .radio-btn:hover { + color: #FFFFFF; /* 悬停时文字颜色 */ + background-color: #47A4F9; /* 悬停时背景色 */ + } - /* 鼠标悬停样式 */ - .radio-btn:hover { - color: #FFFFFF; /* 悬停时文字颜色 */ - background-color: #47A4F9; /* 悬停时背景色 */ - } + input[type="radio"]:checked + .radio-btn { + background-color: rgb(33, 4, 251); /* 选中时背景色 */ + color: #FFFFFF; /* 选中时文字颜色 */ + } - input[type="radio"]:checked + .radio-btn { - background-color: rgb(33, 4, 251); /* 选中时背景色 */ - color: #FFFFFF; /* 选中时文字颜色 */ - } + .switch { + display: flex; + justify-content: center; + align-items: center; + text-align: center; + position: relative; + max-width: var(--switch-width); + width: 36%; + height: 32px; + border: 3px solid #5c5c5c; /* 添加边框 */ + box-sizing: border-box; /* 包含边框和内填充在内的总宽度 */ + border-radius: 26px; + min-width: 400px; + } - .switch { - display: flex; - justify-content: center; - align-items: center; - text-align: center; - position: relative; - max-width: var(--switch-width); - width: 36%; - height: 32px; - border: 3px solid #5c5c5c; /* 添加边框 */ - box-sizing: border-box; /* 包含边框和内填充在内的总宽度 */ - border-radius: 26px; - min-width: 400px; - } + .slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgb(33, 4, 251); + border-radius: 26px; + -webkit-transition: .4s; + transition: .4s; - .slider { - position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgb(33, 4, 251); - border-radius: 26px; - -webkit-transition: .4s; - transition: .4s; - - color: #ffffff; - font-size: 1rem; - font-weight: bold; - display: flex; - align-items: center; - justify-content: space-around; - } + color: #ffffff; + font-size: 1rem; + font-weight: bold; + display: flex; + align-items: center; + justify-content: space-around; + } - .slider:before { - position: absolute; - display: flex; /* 将其转换为弹性布局容器 */ - align-items: center; - justify-content: center; - content: ""; - white-space: nowrap; - left: 1px; - height: 100%; - width: 50%; - background-color: #ffffff; - border-radius: 26px; - -webkit-transition: .4s; - transition: .4s; - } + .slider:before { + position: absolute; + display: flex; /* 将其转换为弹性布局容器 */ + align-items: center; + justify-content: center; + content: ""; + white-space: nowrap; + left: 1px; + height: 100%; + width: 50%; + background-color: #ffffff; + border-radius: 26px; + -webkit-transition: .4s; + transition: .4s; + } - input:checked + .slider { - background-color: #36b61a; - } + input:checked + .slider { + background-color: #36b61a; + } + + input:checked + .slider:before { + content: ""; + -webkit-transform: translateX(100%); + -ms-transform: translateX(100%); + transform: translateX(100%); + margin-left: -1px; + } - input:checked + .slider:before { - content: ""; - -webkit-transform: translateX(100%); - -ms-transform: translateX(100%); - transform: translateX(100%); - margin-left: -1px; + .default-folder-container { + width: 100%; + margin: 1.5rem 0; + padding: 0.2rem; + background-color: #000000; + border-radius: 0; + color: white; + cursor: pointer; + text-align: center; + transition: background-color 0.2s ease; + display: none; + + &:has(.underlined-path) { + display: block; } + + &:hover { + background-color: #47A4F9; + } + + .default-folder-text { + display: block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } + + .underlined-path { + text-decoration: underline; + text-decoration-skip-ink: none; + text-underline-position: under; + text-decoration-thickness: 1px; + text-decoration-color: currentColor; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100%; + display: inline-block; + vertical-align: middle; + } } \ No newline at end of file diff --git a/Electron/src/app/home/home.component.ts b/Electron/src/app/home/home.component.ts index f57e5b9e6..769d80dbe 100644 --- a/Electron/src/app/home/home.component.ts +++ b/Electron/src/app/home/home.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit, ViewChild, ElementRef, HostListener, Injectable } from '@angular/core'; import { Router } from '@angular/router'; import { ElectronService } from '../core/services/electron/electron.service'; +import { TranslateService, LangChangeEvent } from "@codeandweb/ngx-translate"; @Injectable({ providedIn: 'root' @@ -12,6 +13,75 @@ import { ElectronService } from '../core/services/electron/electron.service'; styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { + defaultPath: string | null = null; + defaultPathText: string = ''; + + constructor(private electronService: ElectronService, private translate: TranslateService) {} + + ngOnInit(): void { + console.log('HomeComponent INIT'); + this.loadDefaultPath(); + } + + loadDefaultPath(): void { + if (this.electronService.isElectron) { + this.electronService.ipcRenderer.invoke('file-operations', { + operation: 'load-default-path' + }).then((path: string | null) => { + console.log('Loaded default path:', path); + this.defaultPath = path; + if (path) { + this.defaultPathText = this.formatPath(path); + this.defaultPath = path; + } else { + this.defaultPathText = ''; + this.defaultPath = null; + } + }).catch(error => { + console.error('Error loading default path:', error); + this.defaultPathText = this.translate.instant('PAGES.HOME.CAN_NOT_GET_DEFAULT_PATH'); + }); + } + } + + private formatPath(path: string, maxLength = 30): string { + if (path.length <= maxLength) return path; + + const parts = path.split(/[\\/]/); + if (parts.length <= 2) return path; + + const firstPart = parts[0]; + const lastPart = parts[parts.length - 1]; + const middleLength = maxLength - (firstPart.length + lastPart.length + 5); + + if (middleLength > 0) { + return `${firstPart}/.../${lastPart}`; + } + return `${firstPart}/...${lastPart}`; + } + async selectDefaultFolder(event: Event): Promise { + event.stopPropagation(); + try { + if (this.electronService.isElectron) { + console.log('try select folder'); + const result = await this.electronService.ipcRenderer.invoke('file-operations', { + operation: 'select-folder', + payload: this.defaultPath + }); + if (result && result.length > 0) { + this.defaultPath = result[0]; + this.defaultPathText = this.formatPath(result[0]); + await this.electronService.ipcRenderer.invoke('file-operations', { + operation: 'save-default-path', + payload: result[0] + }); + console.log('selected folder:', result[0]); + } + } + } catch (error) { + console.error('select folder fail:', error); + } + } Images_ROC_Shown: boolean = false; Images_TFT_Shown: boolean = false; @@ -29,10 +99,6 @@ export class HomeComponent implements OnInit { forcelang: boolean = false; installEvent: string = 'install' - ngOnInit(): void { - console.log('HomeComponent INIT'); - } - @HostListener('mouseenter', ['$event', '$event.target.dataset.action']) onMouseEnter(event: MouseEvent, action: string) { if (this.isInteractive) { @@ -56,7 +122,6 @@ export class HomeComponent implements OnInit { }; } - @HostListener('mouseout', ['$event', '$event.target.dataset.action']) onMouseLeave(event: MouseEvent, action: string) { if (this.isInteractive) { @@ -79,8 +144,6 @@ export class HomeComponent implements OnInit { } }; } - - @HostListener('click', ['$event', '$event.target.dataset.action']) onClick(event: MouseEvent, action: string) { @@ -89,6 +152,9 @@ export class HomeComponent implements OnInit { case 'Roc': if (!this.ROCInstall) { this.message = `install${this.modeState}${this.bjState}-ROC`; + this.Images_ROC_Shown = true; + this.Images_TFT_Shown = false; + this.Images_REF_Shown = false; this.TFTInstall = false; this.REFInstall = false; this.ROCInstall = !this.ROCInstall; @@ -99,6 +165,9 @@ export class HomeComponent implements OnInit { case 'Tft': if (!this.TFTInstall) { this.message = `install${this.modeState}${this.bjState}-TFT`; + this.Images_ROC_Shown = false; + this.Images_TFT_Shown = true; + this.Images_REF_Shown = false; this.ROCInstall = false; this.REFInstall = false; this.TFTInstall = !this.TFTInstall; @@ -109,6 +178,9 @@ export class HomeComponent implements OnInit { case 'Ref': if (!this.REFInstall) { this.message = `install${this.modeState}${this.bjState}`; + this.Images_ROC_Shown = false; + this.Images_TFT_Shown = false; + this.Images_REF_Shown = true; this.ROCInstall = false; this.TFTInstall = false; this.REFInstall = !this.REFInstall; @@ -135,20 +207,20 @@ export class HomeComponent implements OnInit { console.log('mode',this.modeState,this.Mode_State); break; case 'BJoptionOn': - this.bjState = ''; - this.BJ_State = 1; - console.log('BJ',this.bjState); - break; + this.bjState = ''; + this.BJ_State = 1; + console.log('BJ',this.bjState); + break; case 'BJoptionVsAI': - this.bjState = '-vai'; - this.BJ_State = 2; - console.log('BJ',this.bjState); - break; + this.bjState = '-vai'; + this.BJ_State = 2; + console.log('BJ',this.bjState); + break; case 'BJoptionOff': - this.bjState = '-noc'; - this.BJ_State = 0; - console.log('BJ',this.bjState); - break; + this.bjState = '-noc'; + this.BJ_State = 0; + console.log('BJ',this.bjState); + break; case 'Optimise': this.optimize = !this.optimize; if (this.optimize) { @@ -160,13 +232,8 @@ export class HomeComponent implements OnInit { if (this.forcelang) { this.optimize = false; } - break; + break; } }; } - - constructor( - private router: Router, - private electronService: ElectronService, - ) { } -} +} \ No newline at end of file From de8800b39dbc18f51bfd747d84fb3ff8ccf9ab89 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 16:10:36 +0800 Subject: [PATCH 08/39] Update main.ts --- Electron/app/main.ts | 202 +++++++++++++++++++++++++------------------ 1 file changed, 116 insertions(+), 86 deletions(-) diff --git a/Electron/app/main.ts b/Electron/app/main.ts index 6c945bccc..9749581ca 100644 --- a/Electron/app/main.ts +++ b/Electron/app/main.ts @@ -1,4 +1,4 @@ -import {app, BrowserWindow, dialog, Menu, screen } from 'electron'; +import { app, BrowserWindow, dialog, Menu, screen } from 'electron'; import * as path from 'path'; import * as fs from 'fs'; import * as remote from '@electron/remote/main'; @@ -6,10 +6,17 @@ import { InstallModel } from '../commons/models'; const ipcMain = require('electron').ipcMain; const cp = require('child_process'); +type Settings = { + TFT_PATH?: string | null; + ROC_PATH?: string | null; + REFORGED_PATH?: string | null; + [key: string]: any; +}; + let win: BrowserWindow = null; -let translations : { [key: string]: string } = {}; +let translations: { [key: string]: string } = {}; let currentLanguage: string = "English"; -let defaultPath: string | null = null; +const documentsPath = app.getPath('documents'); const args = process.argv.slice(1), serve = args.some(val => val === '--serve'); @@ -76,66 +83,58 @@ const createWindow = (): BrowserWindow => { return win; } -const execInstall = async (signal, commander: number = 1, isMap: boolean = false, ver: string = "REFORGED", forceLang: boolean) => { +const getversionpath = (pathver: string, settings: Settings): string => { + win.webContents.send('on-install-console', `get version path : ${JSON.stringify(settings)}, settings path : ${settings[`${pathver}_PATH`]}`); + if (pathver == "REFORGED") { + return settings.REFORGED_PATH || ''; + } else if (pathver == "TFT") { + return settings.TFT_PATH || ''; + } else if (pathver == "ROC") { + return settings.ROC_PATH || ''; + } + return ''; +} + +const execInstall = async (signal, commander: number = 1, isMap: boolean = false, ver: string = "REFORGED", forceLang: boolean, pathver: string = "REFORGED") => { const controller = new AbortController(); let response; - try { - const settingsPath = path.join(app.getPath('userData'), 'settings.json'); - if (fs.existsSync(settingsPath)) { - const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); - defaultPath = settings.defaultPath || null; - console.log('get default Path :',defaultPath); - } - } catch (err) { - console.error('Failed to load default path:', err); + const settingsPath = path.join(app.getPath('userData'), 'settings.json'); + let settings: Settings = {}; + let usepath = null; + if (fs.existsSync(settingsPath)) { + settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); + usepath = getversionpath(pathver, settings); + win.webContents.send('on-install-console', `${pathver} default path : ${usepath}`); } - // Handle folder mode (isMap = false) - if (!isMap) { - // If default path exists, use it directly - if (defaultPath) { - response = [defaultPath]; - } else { - // Show dialog and save selected path as default + if (usepath !== null && usepath !== undefined && usepath !== '') { + if (isMap) { response = dialog.showOpenDialogSync(win, { - title: translations["PAGES.ELECTRON.OPEN_DIR"] || '', - properties: ['openDirectory'], + title: translations["PAGES.ELECTRON.OPEN_MAP"] || '', + properties: ['openFile'] , + filters: [ + { name: translations["PAGES.ELECTRON.MAPFILE"] || '', extensions: ['w3x', 'w3m'] }, + ], + defaultPath: usepath, }); - - // Save the selected path as default if not canceled - if (response && response.length > 0) { - defaultPath = response[0]; - console.log('set default Path :',defaultPath); - // Save to settings.json directly in main process - const settingsPath = path.join(app.getPath('userData'), 'settings.json'); - const settings = { - defaultPath: defaultPath - }; - fs.writeFileSync(settingsPath, JSON.stringify(settings)); + if (response && (response?.length > 0)) { + usepath = null; // wait updata path , maybe selected other path } + } else { + response = [usepath]; } } else { - // Handle map mode (isMap = true) - const documentsPath = app.getPath('documents'); + win.webContents.send('on-install-console', 'Choose path'); response = dialog.showOpenDialogSync(win, { - title: translations["PAGES.ELECTRON.OPEN_MAP"] || '', - properties: ['openFile'], - filters: [ - { name: translations["PAGES.ELECTRON.MAPFILE"] || '', extensions: ['w3x', 'w3m'] }, - ], - // Use default path if available, otherwise open "documents" - defaultPath: defaultPath || documentsPath, + // TODO: add i18n here + title: isMap ? translations["PAGES.ELECTRON.OPEN_MAP"] || '': translations["PAGES.ELECTRON.OPEN_DIR"] || '', + // TODO: Change to let multiples selections when is map + properties: isMap ? ['openFile'] : ['openDirectory'], + // TODO: add i18n here + filters: isMap ? [ + { name: translations["PAGES.ELECTRON.MAPFILE"] || '', extensions: ['w3x', 'w3m'] }, + ] : null, + defaultPath: documentsPath, }); - // 选择文件后自动将文件所在目录设为默认路径 - if (response && response.length > 0) { - const filePath = response[0]; - const folderPath = path.dirname(filePath); - defaultPath = folderPath; - const settingsPath = path.join(app.getPath('userData'), 'settings.json'); - const settings = { defaultPath: folderPath }; - fs.writeFileSync(settingsPath, JSON.stringify(settings)); - console.log('Default path updated to:', folderPath); - } - console.log('default Path :',defaultPath); } let child; @@ -146,7 +145,7 @@ const execInstall = async (signal, commander: number = 1, isMap: boolean = false let currentExecDir = `./AMAI-release/`, currentScriptDir = './AMAI-release/'; - if(!isDev()) { + if (!isDev()) { currentExecDir = `./AMAI/`; currentScriptDir = path.join( __dirname, @@ -167,11 +166,23 @@ const execInstall = async (signal, commander: number = 1, isMap: boolean = false // win.webContents.send('on-install-message', 'currentExecDir: ' + currentExecDir); // win.webContents.send('on-install-message', `install js path: ../${currentExecDir}install.js`); - if(!response || (response?.length === 0)) { + if (!response || (response?.length === 0)) { win.webContents.send('on-install-empty'); return; } + if (usepath === null) { + if (!isMap) { + usepath = response[0]; + } else { + usepath = path.dirname(response[0]); + } + const finalPath = usepath ? path.resolve(usepath) : null; + settings[`${pathver}_PATH`] = finalPath; + fs.writeFileSync(settingsPath, JSON.stringify(settings)); + win.webContents.send('on-install-console', `Default path updated to: ${finalPath}`); + win.webContents.send('path-updated', { pathver: pathver, path: finalPath }); + } // open modal on front win.webContents.send('on-install-init', { response: response[0], @@ -183,14 +194,13 @@ const execInstall = async (signal, commander: number = 1, isMap: boolean = false // MPQEditor and AddToMPQ only work when files and folders are in same directory try { process.chdir(currentScriptDir); - } catch(err) { + } catch (err) { console.log('error:', err.message); /** uncomment to debbug */ // win.webContents.send('on-install-message', 'Error: ' + err.message); } - // init install proccess try { child = cp.fork( @@ -223,38 +233,56 @@ const execInstall = async (signal, commander: number = 1, isMap: boolean = false child.on('exit', () => { win.webContents.send('on-install-exit'); }); - } catch(err) { + } catch (err) { win.webContents.send('on-install-error', err.message); } } +const GetDefaultPath = () => { + ipcMain?.handle('load-path', async (_) => { + const settingsPath = path.join(app.getPath('userData'), 'settings.json'); + let settings: Settings = {}; + if (fs.existsSync(settingsPath)) { + settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); + win.webContents.send('on-install-console',`Loaded paths : REFORGED : ${settings.REFORGED_PATH} , TFT : ${settings.TFT_PATH} , ROC : ${settings.ROC_PATH}`); + return { REFORGED_PATH: settings.REFORGED_PATH || null, TFT_PATH: settings.TFT_PATH || null, ROC_PATH: settings.ROC_PATH || null }; + } + win.webContents.send('on-install-console', `Loading path file failed , using defaults`); + return { REFORGED_PATH: null, TFT_PATH: null, ROC_PATH: null }; + }); +} -const setupFileOperations = () => { - ipcMain?.handle('file-operations', async (_, { operation, payload }) => { - switch(operation) { - case 'load-default-path': - const settingsPath = path.join(app.getPath('userData'), 'settings.json'); - if (fs.existsSync(settingsPath)) { - return JSON.parse(fs.readFileSync(settingsPath, 'utf8')).defaultPath; - } - return null; - - case 'select-folder': - const result = dialog.showOpenDialogSync(win, { - title: translations["PAGES.ELECTRON.OPEN_DIR"] || '', - defaultPath: payload?.defaultPath, - properties: ['openDirectory'], - }); - return result && result.length > 0 ? result[0] : null; - - case 'save-default-path': { - const settingsPath = path.join(app.getPath('userData'), 'settings.json'); - fs.writeFileSync(settingsPath, JSON.stringify({ defaultPath: payload })); - return true; +const SetDefaultPath = () => { + ipcMain?.on('set-path', async (_event, pathver ) => { + const settingsPath = path.join(app.getPath('userData'), 'settings.json'); + let settings: Settings = {}; + let usepath = documentsPath; + win.webContents.send('on-install-console', `Selecting folder , version : ${pathver}`); + if (fs.existsSync(settingsPath)) { + win.webContents.send('on-install-console', `Get default path`); + settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); + usepath = getversionpath(pathver, settings); + if (!usepath || usepath === '' || usepath === null || !fs.existsSync(usepath)) { + usepath = documentsPath; } - - default: - throw new Error(`unknow: ${operation}`); + } + const result = dialog.showOpenDialogSync(win, { + title: translations["PAGES.ELECTRON.OPEN_DIR"] || '', + properties: ['openDirectory'], + defaultPath: usepath + }); + if (result && (result?.length > 0)) { + usepath = result[0] ? path.resolve(result[0]) : null; + settings[`${pathver}_PATH`] = usepath; + win.webContents.send('on-install-console', `Set path : ${usepath}`); + try { + fs.writeFileSync(settingsPath, JSON.stringify(settings)); + win.webContents.send('path-updated', { pathver: pathver, path: usepath }); + } catch (err) { + win.webContents.send('on-install-console', `Set path failed: ${err.message}`); + } + } else { + win.webContents.send('on-install-console', `Folder selection was cancelled`); } }); } @@ -262,8 +290,9 @@ const setupFileOperations = () => { const installProcess = () => { let signal = {}; - ipcMain?.on('install', async (_event, ver: string, toFolder: boolean, commander: number, optimize: boolean, forceLang : boolean) => { - execInstall(signal, commander, !toFolder, optimize ? `OPT${ver}` : ver, forceLang); + ipcMain?.on('install', async (_event, ver: string, toFolder: boolean, commander: number, optimize: boolean, forceLang: boolean) => { + const pathver = ver; + execInstall(signal, commander, !toFolder, optimize ? `OPT${ver}` : ver, forceLang, pathver); }); // TODO: stop process with signal @@ -355,5 +384,6 @@ const installTrans = () => { init(); installTrans(); -setupFileOperations(); installProcess(); +GetDefaultPath(); +SetDefaultPath(); From b72d157f18edc41565b89d1b55290d43c43c2c3f Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 16:11:32 +0800 Subject: [PATCH 09/39] Update main.ts --- Electron/app/main.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Electron/app/main.ts b/Electron/app/main.ts index 9749581ca..aab42acb5 100644 --- a/Electron/app/main.ts +++ b/Electron/app/main.ts @@ -7,10 +7,10 @@ const ipcMain = require('electron').ipcMain; const cp = require('child_process'); type Settings = { - TFT_PATH?: string | null; - ROC_PATH?: string | null; - REFORGED_PATH?: string | null; - [key: string]: any; + TFT_PATH?: string | null; + ROC_PATH?: string | null; + REFORGED_PATH?: string | null; + [key: string]: any; }; let win: BrowserWindow = null; From 81f3d073bceb02fcdaad2e959b5e8c59c10e13b4 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 16:16:04 +0800 Subject: [PATCH 10/39] Update home.component.html --- Electron/src/app/home/home.component.html | 98 ++++++++++++++--------- 1 file changed, 60 insertions(+), 38 deletions(-) diff --git a/Electron/src/app/home/home.component.html b/Electron/src/app/home/home.component.html index ff0419972..f86cfa96a 100644 --- a/Electron/src/app/home/home.component.html +++ b/Electron/src/app/home/home.component.html @@ -4,60 +4,82 @@

{{ 'PAGES.HOME.CHOOSE_GAME_VERSION' | translate }}
-
- REFSelected - REF - 2.0.3+ - {{ 'PAGES.HOME.REF_BEST_GAME_VERSION' | translate }} +
+
+ REFSelected + REF + 2.0.3+ + {{ 'PAGES.HOME.REF_BEST_GAME_VERSION' | translate }} +
+
+ {{gamePaths.REFORGED.displayText}} + edit +
-
- TFTSelected - TFT - 1.24e+ - {{ 'PAGES.HOME.TFT_BEST_GAME_VERSION' | translate }} +
+
+ TFTSelected + TFT + 1.24e+ + {{ 'PAGES.HOME.TFT_BEST_GAME_VERSION' | translate }} +
+
+ {{gamePaths.TFT.displayText}} + edit +
-
- ROCSelected - ROC - 1.24e+ ~ 1.31 - {{ 'PAGES.HOME.ROC_BEST_GAME_VERSION' | translate }} +
+
+ ROCSelected + ROC + 1.24e+ ~ 1.31 + {{ 'PAGES.HOME.ROC_BEST_GAME_VERSION' | translate }} +
+
+ {{gamePaths.ROC.displayText}} + edit +
-
{{ 'PAGES.HOME.ADVANCED_SETTING' | translate }}
-
+
+
-
+
-
- - {{ 'PAGES.HOME.DEFAULT_PATH' | translate }} - - -
-
\ No newline at end of file +
From dcb43c1a9a46faddeae363bebd685edb8a4260fa Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 16:23:58 +0800 Subject: [PATCH 11/39] Update home.component.scss --- Electron/src/app/home/home.component.scss | 104 +++++++++++++--------- 1 file changed, 63 insertions(+), 41 deletions(-) diff --git a/Electron/src/app/home/home.component.scss b/Electron/src/app/home/home.component.scss index 605cc393e..67a36aa49 100644 --- a/Electron/src/app/home/home.component.scss +++ b/Electron/src/app/home/home.component.scss @@ -37,7 +37,7 @@ max-width: inherit; /* 继承父元素(.center-container)的最大宽度 */ width: 100%; gap: 10px; - margin-top: 2rem; + margin-top: 1.8rem; } .AdvancedSettings, @@ -75,9 +75,10 @@ color: gold; } - /* 当屏幕宽度小于等于800px时,减小字体大小 */ - @media (max-width: 800px) { - .headtitle-text, .subtitle-text { + @media (max-width: 800px) { /* 当屏幕宽度小于等于800px时,减小字体大小 */ + + .headtitle-text, + .subtitle-text { font-size: 1rem; } @@ -90,6 +91,15 @@ .reccomendations { font-size: 10pt; } + + .underlined-path { + font-size: 10pt; + } + + .icon-handle { + font-size: 10pt; + } + } @media (max-width: 1600px) { @@ -147,13 +157,12 @@ max-width: 100%; /* 最大宽度 */ } - /* 鼠标悬停样式 */ .radio-btn:hover { color: #FFFFFF; /* 悬停时文字颜色 */ background-color: #47A4F9; /* 悬停时背景色 */ } - input[type="radio"]:checked + .radio-btn { + input[type="radio"]:checked+.radio-btn { background-color: rgb(33, 4, 251); /* 选中时背景色 */ color: #FFFFFF; /* 选中时文字颜色 */ } @@ -184,7 +193,6 @@ border-radius: 26px; -webkit-transition: .4s; transition: .4s; - color: #ffffff; font-size: 1rem; font-weight: bold; @@ -209,57 +217,71 @@ transition: .4s; } - input:checked + .slider { + input:checked+.slider { background-color: #36b61a; } - input:checked + .slider:before { + input:checked+.slider:before { content: ""; -webkit-transform: translateX(100%); -ms-transform: translateX(100%); - transform: translateX(100%); - margin-left: -1px; + transform: translateX(100%); + margin-left: -1px; } - .default-folder-container { + .game-path-item { + display: flex; + align-items: center; /* 垂直居中 */ + justify-content: space-between; /* 两端对齐 */ + padding: 0.6rem; width: 100%; - margin: 1.5rem 0; - padding: 0.2rem; - background-color: #000000; - border-radius: 0; + min-width: 200px; + max-width: 512px; + height: 60px; + background-color: black; + border-radius: 4px; color: white; cursor: pointer; - text-align: center; - transition: background-color 0.2s ease; - display: none; + transition: all 0.2s ease; + position: relative; + overflow: hidden; + } - &:has(.underlined-path) { - display: block; - } - - &:hover { - background-color: #47A4F9; - } - - .default-folder-text { - display: block; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } + .game-path-item:hover { + background-color: rgb(33, 4, 251); } - + .underlined-path { text-decoration: underline; - text-decoration-skip-ink: none; - text-underline-position: under; - text-decoration-thickness: 1px; - text-decoration-color: currentColor; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - max-width: 100%; display: inline-block; - vertical-align: middle; + position: relative; + font-size: 14pt; + flex-grow: 1; + margin-right: 8px; } -} \ No newline at end of file + + .game-version-container { + display: flex; + flex-direction: column; + flex: 1; + max-width: 512px; + min-width: 200px; + justify-content: center; + align-items: center; + overflow: hidden; + + &:hover { + border-color: #007bff; + box-shadow: 0 0 10px rgba(0, 123, 255, 0.3); + } + } + + .icon-handle { + font-size: 14pt; + cursor: pointer; + } + +} From d20ea6a8000a2759b97f68fb0ffea08160cba172 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 16:26:07 +0800 Subject: [PATCH 12/39] Update home.component.ts --- Electron/src/app/home/home.component.ts | 159 +++++++++++++----------- 1 file changed, 85 insertions(+), 74 deletions(-) diff --git a/Electron/src/app/home/home.component.ts b/Electron/src/app/home/home.component.ts index 769d80dbe..e42b7b858 100644 --- a/Electron/src/app/home/home.component.ts +++ b/Electron/src/app/home/home.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, ViewChild, ElementRef, HostListener, Injectable } from '@angular/core'; +import { Component, OnInit, OnDestroy , ViewChild, ElementRef, HostListener, Injectable } from '@angular/core'; import { Router } from '@angular/router'; import { ElectronService } from '../core/services/electron/electron.service'; -import { TranslateService, LangChangeEvent } from "@codeandweb/ngx-translate"; @Injectable({ providedIn: 'root' @@ -13,92 +12,104 @@ import { TranslateService, LangChangeEvent } from "@codeandweb/ngx-translate"; styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { - defaultPath: string | null = null; - defaultPathText: string = ''; + private pathUpdateListener: any; + Images_ROC_Shown: boolean = false; + Images_TFT_Shown: boolean = false; + Images_REF_Shown: boolean = false; + ROCInstall: boolean = false; + TFTInstall: boolean = false; + REFInstall: boolean = false; + Mode_State: boolean = true; + BJ_State: number = 1; + isInteractive: boolean = true; + modeState: string = '-folder'; + bjState: string = ''; + message: string = ''; + optimize: boolean = true; + forcelang: boolean = false; + installEvent: string = 'install' + gamePaths = { + TFT: { + PATH: null as string | null, + displayText: '--', + }, + REFORGED: { + PATH: null as string | null, + displayText: '--', + }, + ROC: { + PATH: null as string | null, + displayText: '--', + } + }; - constructor(private electronService: ElectronService, private translate: TranslateService) {} + constructor( + private electronService: ElectronService, + ) {} ngOnInit(): void { console.log('HomeComponent INIT'); - this.loadDefaultPath(); + void this.loadDefaultPath(); + this.UpdateDefaultPath(); } - loadDefaultPath(): void { - if (this.electronService.isElectron) { - this.electronService.ipcRenderer.invoke('file-operations', { - operation: 'load-default-path' - }).then((path: string | null) => { - console.log('Loaded default path:', path); - this.defaultPath = path; - if (path) { - this.defaultPathText = this.formatPath(path); - this.defaultPath = path; - } else { - this.defaultPathText = ''; - this.defaultPath = null; - } - }).catch(error => { - console.error('Error loading default path:', error); - this.defaultPathText = this.translate.instant('PAGES.HOME.CAN_NOT_GET_DEFAULT_PATH'); - }); + ngOnDestroy(): void { + if (this.pathUpdateListener) { + this.electronService.ipcRenderer.removeListener('path-updated', this.pathUpdateListener); } } - private formatPath(path: string, maxLength = 30): string { + private UpdateDefaultPath(): void { + this.pathUpdateListener = (event: any, { pathver, path = '' }) => { + console.log(`Path updated for ${pathver} : `, path); + if (pathver in this.gamePaths) { + this.gamePaths[pathver].PATH = path || null; + this.gamePaths[pathver].displayText = this.formatPath(path); + console.log('updated ver Path to : ', this.gamePaths[pathver].PATH, 'Display:', this.gamePaths[pathver].displayText); + } + }; + this.electronService.ipcRenderer.on('path-updated', this.pathUpdateListener); + } + + private async loadDefaultPath(): Promise { + const settings = await this.electronService.ipcRenderer.invoke('load-path'); + if (settings) { + console.log('Loaded paths settings:', settings); + this.gamePaths.TFT.PATH = settings.TFT_PATH; + this.gamePaths.REFORGED.PATH = settings.REFORGED_PATH; + this.gamePaths.ROC.PATH = settings.ROC_PATH; + this.gamePaths.TFT.displayText = this.gamePaths.TFT.PATH ? this.formatPath(this.gamePaths.TFT.PATH) : '--'; + this.gamePaths.REFORGED.displayText = this.gamePaths.REFORGED.PATH ? this.formatPath(this.gamePaths.REFORGED.PATH) : '--'; + this.gamePaths.ROC.displayText = this.gamePaths.ROC.PATH ? this.formatPath(this.gamePaths.ROC.PATH) : '--'; + console.log('REFORGED Path:', this.gamePaths.REFORGED.PATH, 'Display:', this.gamePaths.REFORGED.displayText); + console.log('TFT Path:', this.gamePaths.TFT.PATH, 'Display:', this.gamePaths.TFT.displayText); + console.log('ROC Path:', this.gamePaths.ROC.PATH, 'Display:', this.gamePaths.ROC.displayText); + } else { + console.error('Error loading paths:', settings); + } + } + + private formatPath(path: string, maxLength = 20): string { + if (!path) return '--'; if (path.length <= maxLength) return path; - const parts = path.split(/[\\/]/); if (parts.length <= 2) return path; - const firstPart = parts[0]; const lastPart = parts[parts.length - 1]; const middleLength = maxLength - (firstPart.length + lastPart.length + 5); - if (middleLength > 0) { return `${firstPart}/.../${lastPart}`; } return `${firstPart}/...${lastPart}`; } - async selectDefaultFolder(event: Event): Promise { - event.stopPropagation(); - try { - if (this.electronService.isElectron) { - console.log('try select folder'); - const result = await this.electronService.ipcRenderer.invoke('file-operations', { - operation: 'select-folder', - payload: this.defaultPath - }); - if (result && result.length > 0) { - this.defaultPath = result[0]; - this.defaultPathText = this.formatPath(result[0]); - await this.electronService.ipcRenderer.invoke('file-operations', { - operation: 'save-default-path', - payload: result[0] - }); - console.log('selected folder:', result[0]); - } - } - } catch (error) { - console.error('select folder fail:', error); + + async selectGameFolder(pathver: 'REFORGED' | 'TFT' | 'ROC') { + if (this.isInteractive) { + console.log(`Selecting folder for ${pathver}`); + this.electronService.ipcRenderer.send('set-path', pathver); } } - Images_ROC_Shown: boolean = false; - Images_TFT_Shown: boolean = false; - Images_REF_Shown: boolean = false; - ROCInstall: boolean = false; - TFTInstall: boolean = false; - REFInstall: boolean = false; - Mode_State: boolean = true; - BJ_State: number = 1; - isInteractive: boolean = true; - modeState: string = '-folder'; - bjState: string = ''; - message: string = ''; - optimize: boolean = true; - forcelang: boolean = false; - installEvent: string = 'install' - @HostListener('mouseenter', ['$event', '$event.target.dataset.action']) onMouseEnter(event: MouseEvent, action: string) { if (this.isInteractive) { @@ -159,7 +170,7 @@ export class HomeComponent implements OnInit { this.REFInstall = false; this.ROCInstall = !this.ROCInstall; this.electronService.ipcRenderer.send(this.installEvent, 'ROC', this.Mode_State, this.BJ_State, this.optimize, this.forcelang); - console.log('message',this.message); + console.log('message', this.message); } break; case 'Tft': @@ -172,7 +183,7 @@ export class HomeComponent implements OnInit { this.REFInstall = false; this.TFTInstall = !this.TFTInstall; this.electronService.ipcRenderer.send(this.installEvent, 'TFT', this.Mode_State, this.BJ_State, this.optimize, this.forcelang); - console.log('message',this.message); + console.log('message', this.message); } break; case 'Ref': @@ -185,7 +196,7 @@ export class HomeComponent implements OnInit { this.TFTInstall = false; this.REFInstall = !this.REFInstall; this.electronService.ipcRenderer.send(this.installEvent, 'REFORGED', this.Mode_State, this.BJ_State, this.optimize, this.forcelang); - console.log('message',this.message); + console.log('message', this.message); } break; } @@ -204,22 +215,22 @@ export class HomeComponent implements OnInit { case 'ModeSwitch': this.Mode_State = !this.Mode_State; this.modeState = this.Mode_State ? '-folder' : '-map'; - console.log('mode',this.modeState,this.Mode_State); + console.log('mode', this.modeState, this.Mode_State); break; case 'BJoptionOn': this.bjState = ''; this.BJ_State = 1; - console.log('BJ',this.bjState); + console.log('BJ', this.bjState); break; case 'BJoptionVsAI': this.bjState = '-vai'; this.BJ_State = 2; - console.log('BJ',this.bjState); + console.log('BJ', this.bjState); break; case 'BJoptionOff': this.bjState = '-noc'; this.BJ_State = 0; - console.log('BJ',this.bjState); + console.log('BJ', this.bjState); break; case 'Optimise': this.optimize = !this.optimize; @@ -232,8 +243,8 @@ export class HomeComponent implements OnInit { if (this.forcelang) { this.optimize = false; } - break; + break; } }; } -} \ No newline at end of file +} From 12d310c2269d62ac506d6d951ea244e19f722fce Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 16:27:15 +0800 Subject: [PATCH 13/39] Update app.component.ts --- Electron/src/app/app.component.ts | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Electron/src/app/app.component.ts b/Electron/src/app/app.component.ts index e070e6752..f571e0041 100644 --- a/Electron/src/app/app.component.ts +++ b/Electron/src/app/app.component.ts @@ -18,11 +18,11 @@ export class AppComponent implements AfterViewChecked { public totalFiles = 0; public installingText = ''; - @ViewChild('logareawrapper') private readonly logContainer: ElementRef; - - ngAfterViewChecked() { this.scrollToBottom(); } - - private scrollToBottom(): void { this.logContainer.nativeElement.scrollTop = this.logContainer.nativeElement.scrollHeight; } + @ViewChild('logareawrapper') private readonly logContainer: ElementRef; + + ngAfterViewChecked() { this.scrollToBottom(); } + + private scrollToBottom(): void { this.logContainer.nativeElement.scrollTop = this.logContainer.nativeElement.scrollHeight; } constructor( private readonly electronService: ElectronService, @@ -36,13 +36,13 @@ export class AppComponent implements AfterViewChecked { // Refresh app when language changes this.translate.onDefaultLangChange.subscribe((event: LangChangeEvent) => { - this.translate.get([t_('PAGES.HOME.TITLE'),t_('PAGES.ELECTRON.OPEN_MAP'), t_('PAGES.ELECTRON.OPEN_DIR'), t_('PAGES.ELECTRON.MAPFILE')]).subscribe((translations: { [key: string]: string } ) => { + this.translate.get([t_('PAGES.HOME.TITLE'), t_('PAGES.ELECTRON.OPEN_MAP'), t_('PAGES.ELECTRON.OPEN_DIR'), t_('PAGES.ELECTRON.MAPFILE')]).subscribe((translations: { [key: string]: string }) => { this.electronService.ipcRenderer.send('Trans', event.lang, translations); }) this.cdr.detectChanges(); }); this.translate.onLangChange.subscribe((event: LangChangeEvent) => { - this.translate.get([t_('PAGES.HOME.TITLE'),t_('PAGES.ELECTRON.OPEN_MAP'), t_('PAGES.ELECTRON.OPEN_DIR'), t_('PAGES.ELECTRON.MAPFILE')]).subscribe((translations: { [key: string]: string } ) => { + this.translate.get([t_('PAGES.HOME.TITLE'), t_('PAGES.ELECTRON.OPEN_MAP'), t_('PAGES.ELECTRON.OPEN_DIR'), t_('PAGES.ELECTRON.MAPFILE')]).subscribe((translations: { [key: string]: string }) => { this.electronService.ipcRenderer.send('Trans', event.lang, translations); }) this.cdr.detectChanges(); @@ -53,7 +53,7 @@ export class AppComponent implements AfterViewChecked { this.electronService.ipcRenderer.on('on-install-progress', (_, args: { current: number, total: number }) => { // console.log('totalFiles-in:', args.total, 'currentFile-in:', args.current); - if ( args.total > 0 && this.totalFiles < args.total) { + if (args.total > 0 && this.totalFiles < args.total) { this.totalFiles = args.total; } if (this.currentFile < this.totalFiles) { @@ -119,6 +119,11 @@ export class AppComponent implements AfterViewChecked { this.cdr.detectChanges(); }); + this.electronService.ipcRenderer.on('on-install-console', (_, args) => { + console.log('args-install-console', args); // just console + this.cdr.detectChanges(); + }); + // TODO: add 'push notification'/'notification' this.electronService.ipcRenderer.on('on-install-error', (_, args) => { console.log('args-install-error', args); @@ -138,7 +143,7 @@ export class AppComponent implements AfterViewChecked { } public closeCmd() { - if (this.couldClose) { + if (this.couldClose) { this.active = false; } } From 02c7431d4cf7a36a7195670e296111787ab67df4 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 16:44:14 +0800 Subject: [PATCH 14/39] Update home.component.scss --- Electron/src/app/home/home.component.scss | 107 +++++++++------------- 1 file changed, 45 insertions(+), 62 deletions(-) diff --git a/Electron/src/app/home/home.component.scss b/Electron/src/app/home/home.component.scss index 67a36aa49..4d40e6fdc 100644 --- a/Electron/src/app/home/home.component.scss +++ b/Electron/src/app/home/home.component.scss @@ -28,7 +28,6 @@ margin-top: 4rem; } - .ContainerLattice { display: flex; text-align: center; @@ -40,15 +39,33 @@ margin-top: 1.8rem; } - .AdvancedSettings, - .MoreSettings { + .ContainerLattice-AdvancedSettings { background-color: black; } - .MoreSettings { + .ContainerLattice-MoreSettings { + background-color: black; margin-top: 1rem; } + .game-path-item { + display: flex; + align-items: center; /* 垂直居中 */ + justify-content: space-between; /* 两端对齐 */ + padding: 0.6rem; + width: 100%; + min-width: 200px; + max-width: 512px; + height: 60px; + background-color: black; + border-radius: 4px; + color: white; + cursor: pointer; + transition: all 0.2s ease; + position: relative; + overflow: hidden; + } + .imageContainerROC, .imageContainerTFT, .imageContainerREF { @@ -75,6 +92,27 @@ color: gold; } + .game-path-item:hover { + background-color: rgb(33, 4, 251); + } + + .underlined-path { + text-decoration: underline; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + position: relative; + font-size: 14pt; + flex-grow: 1; + margin-right: 8px; + } + + .icon-handle { + font-size: 14pt; + cursor: pointer; + } + @media (max-width: 800px) { /* 当屏幕宽度小于等于800px时,减小字体大小 */ .headtitle-text, @@ -162,7 +200,7 @@ background-color: #47A4F9; /* 悬停时背景色 */ } - input[type="radio"]:checked+.radio-btn { + input[type="radio"]:checked + .radio-btn { background-color: rgb(33, 4, 251); /* 选中时背景色 */ color: #FFFFFF; /* 选中时文字颜色 */ } @@ -217,11 +255,11 @@ transition: .4s; } - input:checked+.slider { + input:checked + .slider { background-color: #36b61a; } - input:checked+.slider:before { + input:checked + .slider:before { content: ""; -webkit-transform: translateX(100%); -ms-transform: translateX(100%); @@ -229,59 +267,4 @@ margin-left: -1px; } - .game-path-item { - display: flex; - align-items: center; /* 垂直居中 */ - justify-content: space-between; /* 两端对齐 */ - padding: 0.6rem; - width: 100%; - min-width: 200px; - max-width: 512px; - height: 60px; - background-color: black; - border-radius: 4px; - color: white; - cursor: pointer; - transition: all 0.2s ease; - position: relative; - overflow: hidden; - } - - .game-path-item:hover { - background-color: rgb(33, 4, 251); - } - - .underlined-path { - text-decoration: underline; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - display: inline-block; - position: relative; - font-size: 14pt; - flex-grow: 1; - margin-right: 8px; - } - - .game-version-container { - display: flex; - flex-direction: column; - flex: 1; - max-width: 512px; - min-width: 200px; - justify-content: center; - align-items: center; - overflow: hidden; - - &:hover { - border-color: #007bff; - box-shadow: 0 0 10px rgba(0, 123, 255, 0.3); - } - } - - .icon-handle { - font-size: 14pt; - cursor: pointer; - } - } From 87e7aba1d9a1e6545aafad068b90ba4a1855b073 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 18:03:01 +0800 Subject: [PATCH 15/39] Update home.component.html --- Electron/src/app/home/home.component.html | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Electron/src/app/home/home.component.html b/Electron/src/app/home/home.component.html index f86cfa96a..975670184 100644 --- a/Electron/src/app/home/home.component.html +++ b/Electron/src/app/home/home.component.html @@ -61,25 +61,25 @@

-
-
- - +
+ + +
From 95fbf23303ac148efce6a80566411c6230a9e941 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 18:04:05 +0800 Subject: [PATCH 16/39] Update home.component.scss --- Electron/src/app/home/home.component.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Electron/src/app/home/home.component.scss b/Electron/src/app/home/home.component.scss index 4d40e6fdc..0a955730d 100644 --- a/Electron/src/app/home/home.component.scss +++ b/Electron/src/app/home/home.component.scss @@ -73,7 +73,7 @@ align-items: center; justify-content: center; max-width: 512px; - width: 50%; + width: 100%; height: auto; background-color: black; min-width: 200px; @@ -105,7 +105,7 @@ position: relative; font-size: 14pt; flex-grow: 1; - margin-right: 8px; + max-width: 500px; } .icon-handle { From f4ff9e949b27e9d50df3d2093fefe9ed6ace45d4 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 18:25:47 +0800 Subject: [PATCH 17/39] Update package-lock.json --- Electron/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Electron/package-lock.json b/Electron/package-lock.json index f14696df2..679260ec9 100644 --- a/Electron/package-lock.json +++ b/Electron/package-lock.json @@ -19099,9 +19099,9 @@ "optional": true }, "node_modules/rollup": { - "version": "3.29.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.5.tgz", - "integrity": "sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==", + "version": "3.30.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.30.0.tgz", + "integrity": "sha512-kQvGasUgN+AlWGliFn2POSajRQEsULVYFGTvOZmK06d7vCD+YhZztt70kGk3qaeAXeWYL5eO7zx+rAubBc55eA==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -37206,9 +37206,9 @@ } }, "rollup": { - "version": "3.29.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.5.tgz", - "integrity": "sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==", + "version": "3.30.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.30.0.tgz", + "integrity": "sha512-kQvGasUgN+AlWGliFn2POSajRQEsULVYFGTvOZmK06d7vCD+YhZztt70kGk3qaeAXeWYL5eO7zx+rAubBc55eA==", "dev": true, "requires": { "fsevents": "~2.3.2" From f4e55ae15c14e2a189b2ede9c7d64e370ce6efda Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:31:27 +0800 Subject: [PATCH 18/39] Update home.component.html --- Electron/src/app/home/home.component.html | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Electron/src/app/home/home.component.html b/Electron/src/app/home/home.component.html index 975670184..a9e6f9ad3 100644 --- a/Electron/src/app/home/home.component.html +++ b/Electron/src/app/home/home.component.html @@ -12,7 +12,7 @@

REF 2.0.3+ - {{ 'PAGES.HOME.REF_BEST_GAME_VERSION' | translate }} + {{ 'PAGES.HOME.REF_BEST_GAME_VERSION' | translate }}:2.0.4+
{{gamePaths.REFORGED.displayText}} @@ -27,7 +27,7 @@

TFT 1.24e+ - {{ 'PAGES.HOME.TFT_BEST_GAME_VERSION' | translate }} + {{ 'PAGES.HOME.TFT_BEST_GAME_VERSION' | translate }}:1.24e ~ 1.28

{{gamePaths.TFT.displayText}} @@ -42,7 +42,7 @@

ROC 1.24e+ ~ 1.31 - {{ 'PAGES.HOME.ROC_BEST_GAME_VERSION' | translate }} + {{ 'PAGES.HOME.ROC_BEST_GAME_VERSION' | translate }}:1.24e ~ 1.31

{{gamePaths.ROC.displayText}} @@ -71,15 +71,15 @@

(input)="onInputChange(BJoptionOff.id)" hidden> -
- - -
+

+
+ +
From 8cc4e420fac84f05b54f973a01d623d40f16a14a Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:35:52 +0800 Subject: [PATCH 19/39] Update home.component.html --- Electron/src/app/home/home.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Electron/src/app/home/home.component.html b/Electron/src/app/home/home.component.html index a9e6f9ad3..210c8e535 100644 --- a/Electron/src/app/home/home.component.html +++ b/Electron/src/app/home/home.component.html @@ -12,7 +12,7 @@

REF 2.0.3+ - {{ 'PAGES.HOME.REF_BEST_GAME_VERSION' | translate }}:2.0.4+ + {{ 'PAGES.HOME.BEST_GAME_VERSION' | translate }}: 2.0.4+
{{gamePaths.REFORGED.displayText}} @@ -27,7 +27,7 @@

TFT 1.24e+ - {{ 'PAGES.HOME.TFT_BEST_GAME_VERSION' | translate }}:1.24e ~ 1.28 + {{ 'PAGES.HOME.BEST_GAME_VERSION' | translate }}: 1.24e ~ 1.28

{{gamePaths.TFT.displayText}} @@ -42,7 +42,7 @@

ROC 1.24e+ ~ 1.31 - {{ 'PAGES.HOME.ROC_BEST_GAME_VERSION' | translate }}:1.24e ~ 1.31 + {{ 'PAGES.HOME.BEST_GAME_VERSION' | translate }}: 1.24e ~ 1.31

{{gamePaths.ROC.displayText}} From d60e8965915df2fafa1026ec5c256e19101fb7bb Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:38:45 +0800 Subject: [PATCH 20/39] Update de.json --- Electron/src/assets/i18n/de.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Electron/src/assets/i18n/de.json b/Electron/src/assets/i18n/de.json index d34a6400c..19741f559 100644 --- a/Electron/src/assets/i18n/de.json +++ b/Electron/src/assets/i18n/de.json @@ -11,8 +11,7 @@ "INCLUDE_COMMANDER_OFF": "Kein Kommandant", "OPTIMISE": "Optimierte Skripte verwenden", "FORCELANG": "AI Chat Sprache überschreiben", - "CAN_NOT_GET_DEFAULT_PATH":"Kann den Standardspeicherort nicht abrufen", - "DEFAULT_PATH":"Standardpfad: " + "BEST_GAME_VERSION": "Optimal" }, "APP": { "INSTALLING": "Installation in {{path}}", From 973bcd0625a07597d43b2119b043366ee8e05048 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:39:05 +0800 Subject: [PATCH 21/39] Update en.json --- Electron/src/assets/i18n/en.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Electron/src/assets/i18n/en.json b/Electron/src/assets/i18n/en.json index c2b4ff105..1b7cad1fb 100644 --- a/Electron/src/assets/i18n/en.json +++ b/Electron/src/assets/i18n/en.json @@ -11,8 +11,7 @@ "INCLUDE_COMMANDER_OFF": "No Commander", "OPTIMISE": "Use Optimised Scripts", "FORCELANG": "Override AI Chat Language", - "CAN_NOT_GET_DEFAULT_PATH":"Can not get default path", - "DEFAULT_PATH":"Default path: " + "BEST_GAME_VERSION": "Optimal" }, "APP": { "INSTALLING": "Installing into {{path}}", From d10a7b57b4cfa3523f9af89ccc25fd57ce02a4e7 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:39:27 +0800 Subject: [PATCH 22/39] Update es.json --- Electron/src/assets/i18n/es.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Electron/src/assets/i18n/es.json b/Electron/src/assets/i18n/es.json index 5948f236e..831719c32 100644 --- a/Electron/src/assets/i18n/es.json +++ b/Electron/src/assets/i18n/es.json @@ -11,8 +11,7 @@ "INCLUDE_COMMANDER_OFF": "Sin Comandante", "OPTIMISE": "Usar scripts optimizados", "FORCELANG": "Cubrir el lenguaje de chat de Ia", - "CAN_NOT_GET_DEFAULT_PATH":"No se puede obtener la ruta predeterminada", - "DEFAULT_PATH":"Ruta predeterminada: " + "BEST_GAME_VERSION": "Óptimo" }, "APP": { "INSTALLING": "Instalando en {{path}}", From a863b2ac98c030bed64394bd553218ef335240a2 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:39:42 +0800 Subject: [PATCH 23/39] Update fr.json --- Electron/src/assets/i18n/fr.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Electron/src/assets/i18n/fr.json b/Electron/src/assets/i18n/fr.json index 309bd5b57..83705af56 100644 --- a/Electron/src/assets/i18n/fr.json +++ b/Electron/src/assets/i18n/fr.json @@ -11,8 +11,7 @@ "INCLUDE_COMMANDER_OFF": "Pas de Commandant", "OPTIMISE": "Utiliser des scripts optimisés", "FORCELANG": "Couvrir le langage de chat ai", - "CAN_NOT_GET_DEFAULT_PATH":"Ne peut pas obtenir le chemin par défaut", - "DEFAULT_PATH":"Chemin par défaut: " + "BEST_GAME_VERSION": "Optimal" }, "APP": { "INSTALLING": "Installation dans {{path}}", From c1020beb07915c54f9ef6f7c11449b00aad3854d Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:40:13 +0800 Subject: [PATCH 24/39] Update no.json --- Electron/src/assets/i18n/no.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Electron/src/assets/i18n/no.json b/Electron/src/assets/i18n/no.json index e83d9c71a..5093a37de 100644 --- a/Electron/src/assets/i18n/no.json +++ b/Electron/src/assets/i18n/no.json @@ -11,8 +11,7 @@ "INCLUDE_COMMANDER_OFF": "Ingen Kommandant", "OPTIMISE": "Bruk optimaliserte skript", "FORCELANG": "Overskriv AI-samtalespråk", - "CAN_NOT_GET_DEFAULT_PATH":"Kan ikke få standardstien", - "DEFAULT_PATH":"Standardstiendeveis: " + "BEST_GAME_VERSION": "Optimal" }, "APP": { "INSTALLING": "Installerer i {{path}}", From c9363d85213c69a3518f89d9c25254c9d09ac7f0 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:40:30 +0800 Subject: [PATCH 25/39] Update pt.json --- Electron/src/assets/i18n/pt.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Electron/src/assets/i18n/pt.json b/Electron/src/assets/i18n/pt.json index a5e85cfea..eb27da678 100644 --- a/Electron/src/assets/i18n/pt.json +++ b/Electron/src/assets/i18n/pt.json @@ -11,8 +11,7 @@ "INCLUDE_COMMANDER_OFF": "Sem Comandante", "OPTIMISE": "Usar scripts otimizados", "FORCELANG": "Substituir a linguagem de conversação AI", - "CAN_NOT_GET_DEFAULT_PATH":"Can not get caminho padrão", - "DEFAULT_PATH":"caminho padrão: " + "BEST_GAME_VERSION": "Optimal" }, "APP": { "INSTALLING": "Instalando em {{path}}", From 13b170d78154f70b28d9ffd9507c3b0cbc665a49 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:40:53 +0800 Subject: [PATCH 26/39] Update ro.json --- Electron/src/assets/i18n/ro.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Electron/src/assets/i18n/ro.json b/Electron/src/assets/i18n/ro.json index 272ca4dc2..8f94b5606 100644 --- a/Electron/src/assets/i18n/ro.json +++ b/Electron/src/assets/i18n/ro.json @@ -11,8 +11,7 @@ "INCLUDE_COMMANDER_OFF": "Fără comandant", "OPTIMISE": "Utilizați scripturi optimizate", "FORCELANG": "Suprascrie limbajul de chat AI", - "CAN_NOT_GET_DEFAULT_PATH":"Nu se poate obține calea implicită", - "DEFAULT_PATH":"Căi implicită: " + "BEST_GAME_VERSION": "Optim" }, "APP": { "INSTALLING": "Instalare în curs la {{path}}", From db3aa90b16dde42c79579e9c9396406ab489ea4d Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:41:12 +0800 Subject: [PATCH 27/39] Update ru.json --- Electron/src/assets/i18n/ru.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Electron/src/assets/i18n/ru.json b/Electron/src/assets/i18n/ru.json index e4fe6a06f..437a8c99e 100644 --- a/Electron/src/assets/i18n/ru.json +++ b/Electron/src/assets/i18n/ru.json @@ -11,8 +11,7 @@ "INCLUDE_COMMANDER_OFF": "Без командира", "OPTIMISE": "Использовать оптимизированные скрипты", "FORCELANG": "Скачать язык разговора", - "CAN_NOT_GET_DEFAULT_PATH":"Не удается получить путь по умолчанию", - "DEFAULT_PATH":"Nути по умолчанию: " + "BEST_GAME_VERSION": "Оптимальный" }, "APP": { "INSTALLING": "Установка в {{path}}", From 772f992ab6f38842277bb60bae5a5cdb28ed73e0 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:41:40 +0800 Subject: [PATCH 28/39] Update sv.json --- Electron/src/assets/i18n/sv.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Electron/src/assets/i18n/sv.json b/Electron/src/assets/i18n/sv.json index 843a4e772..04cf5ecfa 100644 --- a/Electron/src/assets/i18n/sv.json +++ b/Electron/src/assets/i18n/sv.json @@ -11,8 +11,7 @@ "INCLUDE_COMMANDER_OFF": "Ingen befälhavare", "OPTIMISE": "Använd optimerade skript", "FORCELANG": "Skriv över AI-chattspråk", - "CAN_NOT_GET_DEFAULT_PATH":"Kan inte få standardvägen", - "DEFAULT_PATH":"Standardväg: " + "BEST_GAME_VERSION": "Optimalt" }, "APP": { "INSTALLING": "Installerar i {{path}}", From ab2a989938e44a2336648103eef354b15d26b332 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:42:04 +0800 Subject: [PATCH 29/39] Update zh.json --- Electron/src/assets/i18n/zh.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Electron/src/assets/i18n/zh.json b/Electron/src/assets/i18n/zh.json index ee38b9edb..daa351f9f 100644 --- a/Electron/src/assets/i18n/zh.json +++ b/Electron/src/assets/i18n/zh.json @@ -11,8 +11,7 @@ "INCLUDE_COMMANDER_OFF": "不安装控制台", "OPTIMISE": "使用优化脚本", "FORCELANG": "覆盖AI聊天语言", - "CAN_NOT_GET_DEFAULT_PATH":"找不到默认路径", - "DEFAULT_PATH":"默认路径:" + "BEST_GAME_VERSION": "最佳版本" }, "APP": { "INSTALLING": "正在安装 {{path}}", From 76cc7ca5fdef377943ff04cffcbfbdc36557448e Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:51:28 +0800 Subject: [PATCH 30/39] Update package.json --- Electron/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Electron/package.json b/Electron/package.json index e9bcc5ab3..0cb928b59 100644 --- a/Electron/package.json +++ b/Electron/package.json @@ -46,7 +46,7 @@ "ip": "2.0.1", "tough-cookie": "4.1.3", "xml2js": "0.5.0", - "rollup": "3.29.5", + "rollup": "3.30.0", "body-parser": "1.20.3", "braces": "3.0.3", "ws": "8.17.1", From 8fcff9afe0adc6c9743be4157cae63d95033d6ba Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Mon, 2 Mar 2026 00:44:50 +0800 Subject: [PATCH 31/39] Update home.component.scss --- Electron/src/app/home/home.component.scss | 188 ++++++++++++---------- 1 file changed, 99 insertions(+), 89 deletions(-) diff --git a/Electron/src/app/home/home.component.scss b/Electron/src/app/home/home.component.scss index 0a955730d..a848a609b 100644 --- a/Electron/src/app/home/home.component.scss +++ b/Electron/src/app/home/home.component.scss @@ -33,19 +33,13 @@ text-align: center; justify-content: space-around; align-items: center; - max-width: inherit; /* 继承父元素(.center-container)的最大宽度 */ - width: 100%; gap: 10px; margin-top: 1.8rem; } - .ContainerLattice-AdvancedSettings { - background-color: black; - } - - .ContainerLattice-MoreSettings { - background-color: black; - margin-top: 1rem; + .game-version-container{ + max-width: 512px; + min-width: 200px; } .game-path-item { @@ -53,9 +47,6 @@ align-items: center; /* 垂直居中 */ justify-content: space-between; /* 两端对齐 */ padding: 0.6rem; - width: 100%; - min-width: 200px; - max-width: 512px; height: 60px; background-color: black; border-radius: 4px; @@ -64,6 +55,7 @@ transition: all 0.2s ease; position: relative; overflow: hidden; + box-sizing: border-box; /* 确保padding不影响总宽度 */ } .imageContainerROC, @@ -72,11 +64,8 @@ display: block; align-items: center; justify-content: center; - max-width: 512px; - width: 100%; height: auto; background-color: black; - min-width: 200px; } .imageContainerROC span, @@ -105,16 +94,37 @@ position: relative; font-size: 14pt; flex-grow: 1; - max-width: 500px; + box-sizing: border-box; + min-width: 0; /* 允许在flex容器中缩小 */ } .icon-handle { font-size: 14pt; cursor: pointer; + margin-right: 0.4rem; } - @media (max-width: 800px) { /* 当屏幕宽度小于等于800px时,减小字体大小 */ + .ContainerLattice-AdvancedSettings { + background-color: black; + display: flex; + text-align: center; + justify-content: space-around; + align-items: center; /* 垂直居中 */ + height: 48px; + margin-top: 1.4rem; + } + + .ContainerLattice-MoreSettings { + background-color: black; + display: flex; + text-align: center; + justify-content: space-around; + align-items: center; + height: 48px; + margin-top: 1.8rem; + } + @media (max-width: 800px) { /* 当屏幕宽度小于等于800px时,减小字体大小 */ .headtitle-text, .subtitle-text { font-size: 1rem; @@ -137,7 +147,6 @@ .icon-handle { font-size: 10pt; } - } @media (max-width: 1600px) { @@ -146,20 +155,70 @@ } } - .commander-group { - display: flex; - justify-content: center; - text-align: start; - align-items: center; - position: relative; - cursor: pointer; - width: 30%; - font-size: 1rem; - transform: scale(1.5); - min-width: 200px; - } +.switch { + display: flex; + justify-content: center; + align-items: center; + text-align: center; + position: relative; + max-width: var(--switch-width); + width: 36%; + height: 48px; + border: 3px solid #5c5c5c; /* 添加边框 */ + box-sizing: border-box; /* 包含边框和内填充在内的总宽度 */ + border-radius: 26px; + min-width: 400px; +} - .checkboxbj { +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgb(33, 4, 251); + border-radius: 26px; + -webkit-transition: .4s; + transition: .4s; + color: #ffffff; + font-size: 1rem; + font-weight: bold; + display: flex; + align-items: center; + justify-content: space-around; +} + +.slider:before { + position: absolute; + display: flex; + /* 将其转换为弹性布局容器 */ + align-items: center; + justify-content: center; + content: ""; + white-space: nowrap; + left: 1px; + height: 100%; + width: 50%; + background-color: #ffffff; + border-radius: 26px; + -webkit-transition: .4s; + transition: .4s; +} + +input:checked+.slider { + background-color: #36b61a; +} + +input:checked+.slider:before { + content: ""; + -webkit-transform: translateX(100%); + -ms-transform: translateX(100%); + transform: translateX(100%); + margin-left: -1px; +} + + .commander-group { display: flex; justify-content: center; text-align: start; @@ -170,10 +229,6 @@ font-size: 1rem; transform: scale(1.5); min-width: 200px; - padding: 4px 10px; - border-radius: 12px; - background-color: black; - color: #FFFFFF; } .radio-btn { @@ -205,66 +260,21 @@ color: #FFFFFF; /* 选中时文字颜色 */ } - .switch { + .checkboxbj { display: flex; justify-content: center; + text-align: start; align-items: center; - text-align: center; position: relative; - max-width: var(--switch-width); - width: 36%; - height: 32px; - border: 3px solid #5c5c5c; /* 添加边框 */ - box-sizing: border-box; /* 包含边框和内填充在内的总宽度 */ - border-radius: 26px; - min-width: 400px; - } - - .slider { - position: absolute; cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgb(33, 4, 251); - border-radius: 26px; - -webkit-transition: .4s; - transition: .4s; - color: #ffffff; + width: 30%; font-size: 1rem; - font-weight: bold; - display: flex; - align-items: center; - justify-content: space-around; - } - - .slider:before { - position: absolute; - display: flex; /* 将其转换为弹性布局容器 */ - align-items: center; - justify-content: center; - content: ""; - white-space: nowrap; - left: 1px; - height: 100%; - width: 50%; - background-color: #ffffff; - border-radius: 26px; - -webkit-transition: .4s; - transition: .4s; - } - - input:checked + .slider { - background-color: #36b61a; - } - - input:checked + .slider:before { - content: ""; - -webkit-transform: translateX(100%); - -ms-transform: translateX(100%); - transform: translateX(100%); - margin-left: -1px; + transform: scale(1.5); + min-width: 200px; + padding: 4px 10px; + border-radius: 12px; + background-color: black; + color: #FFFFFF; } } From 8c174125ddda4d4ba8966611fea78ee33dec2b73 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Mon, 2 Mar 2026 01:15:43 +0800 Subject: [PATCH 32/39] Update home.component.html --- Electron/src/app/home/home.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Electron/src/app/home/home.component.html b/Electron/src/app/home/home.component.html index 210c8e535..3cb976e5e 100644 --- a/Electron/src/app/home/home.component.html +++ b/Electron/src/app/home/home.component.html @@ -61,13 +61,13 @@

From 8028d8c98d8c46e1ced5b326231f5a962f1c8982 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Mon, 2 Mar 2026 01:18:04 +0800 Subject: [PATCH 33/39] Update home.component.scss --- Electron/src/app/home/home.component.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Electron/src/app/home/home.component.scss b/Electron/src/app/home/home.component.scss index a848a609b..c337f28cd 100644 --- a/Electron/src/app/home/home.component.scss +++ b/Electron/src/app/home/home.component.scss @@ -112,6 +112,7 @@ align-items: center; /* 垂直居中 */ height: 48px; margin-top: 1.4rem; + width: 100%; } .ContainerLattice-MoreSettings { @@ -122,6 +123,7 @@ align-items: center; height: 48px; margin-top: 1.8rem; + width: 100%; } @media (max-width: 800px) { /* 当屏幕宽度小于等于800px时,减小字体大小 */ From c961b034e307c4b65e3b37e85c65ef6311d683bc Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Mon, 2 Mar 2026 01:24:12 +0800 Subject: [PATCH 34/39] Update home.component.scss --- Electron/src/app/home/home.component.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/Electron/src/app/home/home.component.scss b/Electron/src/app/home/home.component.scss index c337f28cd..a9e788d20 100644 --- a/Electron/src/app/home/home.component.scss +++ b/Electron/src/app/home/home.component.scss @@ -35,6 +35,7 @@ align-items: center; gap: 10px; margin-top: 1.8rem; + width: 100%; } .game-version-container{ From 429612366b7d5e0ea35795e5c5b21f5d1cedbdb5 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Mon, 2 Mar 2026 01:26:14 +0800 Subject: [PATCH 35/39] Update home.component.scss --- Electron/src/app/home/home.component.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Electron/src/app/home/home.component.scss b/Electron/src/app/home/home.component.scss index a9e788d20..546f2f46b 100644 --- a/Electron/src/app/home/home.component.scss +++ b/Electron/src/app/home/home.component.scss @@ -30,12 +30,13 @@ .ContainerLattice { display: flex; - text-align: center; + text-align: center; justify-content: space-around; align-items: center; + max-width: inherit; /* 继承父元素(.center-container)的最大宽度 */ + width: 100%; gap: 10px; margin-top: 1.8rem; - width: 100%; } .game-version-container{ From 507a991a3cd848153e5d4684bc5a38ace18abef3 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Mon, 2 Mar 2026 01:27:22 +0800 Subject: [PATCH 36/39] Update home.component.scss --- Electron/src/app/home/home.component.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Electron/src/app/home/home.component.scss b/Electron/src/app/home/home.component.scss index 546f2f46b..1d2137af3 100644 --- a/Electron/src/app/home/home.component.scss +++ b/Electron/src/app/home/home.component.scss @@ -114,6 +114,7 @@ align-items: center; /* 垂直居中 */ height: 48px; margin-top: 1.4rem; + max-width: inherit; /* 继承父元素(.center-container)的最大宽度 */ width: 100%; } @@ -125,6 +126,7 @@ align-items: center; height: 48px; margin-top: 1.8rem; + max-width: inherit; /* 继承父元素(.center-container)的最大宽度 */ width: 100%; } From dacda734648ef40c6e5465f122dbd9331a924e87 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Tue, 3 Mar 2026 20:01:31 +0800 Subject: [PATCH 37/39] Add files via upload --- Electron/src/assets/i18n/de.json | 7 ++++--- Electron/src/assets/i18n/en.json | 5 +++-- Electron/src/assets/i18n/es.json | 7 ++++--- Electron/src/assets/i18n/fr.json | 7 ++++--- Electron/src/assets/i18n/no.json | 7 ++++--- Electron/src/assets/i18n/pt.json | 7 ++++--- Electron/src/assets/i18n/ro.json | 7 ++++--- Electron/src/assets/i18n/ru.json | 7 ++++--- Electron/src/assets/i18n/sv.json | 7 ++++--- Electron/src/assets/i18n/zh.json | 5 +++-- 10 files changed, 38 insertions(+), 28 deletions(-) diff --git a/Electron/src/assets/i18n/de.json b/Electron/src/assets/i18n/de.json index 19741f559..502cdd212 100644 --- a/Electron/src/assets/i18n/de.json +++ b/Electron/src/assets/i18n/de.json @@ -7,11 +7,12 @@ "INSTALL_ON_FOLDER": "Im Verzeichnis installieren", "INSTALL_ON_MAP": "Auf Karte installieren", "INCLUDE_COMMANDER": "Kommandant installieren", - "INCLUDE_COMMANDER_VSAI": "Gegen Vanilla KI", + "INCLUDE_COMMANDER_VSAI": "Gegen Vanilla KI", "INCLUDE_COMMANDER_OFF": "Kein Kommandant", - "OPTIMISE": "Optimierte Skripte verwenden", + "OPTIMISE": "Optimierte Skripte verwenden", "FORCELANG": "AI Chat Sprache überschreiben", - "BEST_GAME_VERSION": "Optimal" + "BEST_GAME_VERSION": "Optimal", + "SELECT_PATH": "Standardpfad ändern und installieren" }, "APP": { "INSTALLING": "Installation in {{path}}", diff --git a/Electron/src/assets/i18n/en.json b/Electron/src/assets/i18n/en.json index 1b7cad1fb..9456e25cd 100644 --- a/Electron/src/assets/i18n/en.json +++ b/Electron/src/assets/i18n/en.json @@ -4,14 +4,15 @@ "TITLE": "AMAI Installer", "CHOOSE_GAME_VERSION": "Choose Game Version", "ADVANCED_SETTING": "Advanced Settings", - "INSTALL_ON_FOLDER": "Install To Directory", + "INSTALL_ON_FOLDER": "Install To Directory", "INSTALL_ON_MAP": "Install To Map", "INCLUDE_COMMANDER": "Install Commander", "INCLUDE_COMMANDER_VSAI": "Vs Vanilla AI", "INCLUDE_COMMANDER_OFF": "No Commander", "OPTIMISE": "Use Optimised Scripts", "FORCELANG": "Override AI Chat Language", - "BEST_GAME_VERSION": "Optimal" + "BEST_GAME_VERSION": "Optimal", + "SELECT_PATH": "Change default path and install" }, "APP": { "INSTALLING": "Installing into {{path}}", diff --git a/Electron/src/assets/i18n/es.json b/Electron/src/assets/i18n/es.json index 831719c32..6d064b0a3 100644 --- a/Electron/src/assets/i18n/es.json +++ b/Electron/src/assets/i18n/es.json @@ -7,11 +7,12 @@ "INSTALL_ON_FOLDER": "Instalar en el directorio", "INSTALL_ON_MAP": "Instalar en el mapa", "INCLUDE_COMMANDER": "Incluir comandante", - "INCLUDE_COMMANDER_VSAI": "Contra IA Vanilla", + "INCLUDE_COMMANDER_VSAI": "Contra IA Vanilla", "INCLUDE_COMMANDER_OFF": "Sin Comandante", - "OPTIMISE": "Usar scripts optimizados", + "OPTIMISE": "Usar scripts optimizados", "FORCELANG": "Cubrir el lenguaje de chat de Ia", - "BEST_GAME_VERSION": "Óptimo" + "BEST_GAME_VERSION": "Óptimo", + "SELECT_PATH": "Cambiar la ruta predeterminada e instalar" }, "APP": { "INSTALLING": "Instalando en {{path}}", diff --git a/Electron/src/assets/i18n/fr.json b/Electron/src/assets/i18n/fr.json index 83705af56..e26d6ab74 100644 --- a/Electron/src/assets/i18n/fr.json +++ b/Electron/src/assets/i18n/fr.json @@ -7,11 +7,12 @@ "INSTALL_ON_FOLDER": "Installer dans le répertoire", "INSTALL_ON_MAP": "Installer sur la carte", "INCLUDE_COMMANDER": "Installer le commandant", - "INCLUDE_COMMANDER_VSAI": "Contre IA Vanilla", + "INCLUDE_COMMANDER_VSAI": "Contre IA Vanilla", "INCLUDE_COMMANDER_OFF": "Pas de Commandant", - "OPTIMISE": "Utiliser des scripts optimisés", + "OPTIMISE": "Utiliser des scripts optimisés", "FORCELANG": "Couvrir le langage de chat ai", - "BEST_GAME_VERSION": "Optimal" + "BEST_GAME_VERSION": "Optimal", + "SELECT_PATH": "Modifier le chemin par défaut et installer" }, "APP": { "INSTALLING": "Installation dans {{path}}", diff --git a/Electron/src/assets/i18n/no.json b/Electron/src/assets/i18n/no.json index 5093a37de..76290f419 100644 --- a/Electron/src/assets/i18n/no.json +++ b/Electron/src/assets/i18n/no.json @@ -7,11 +7,12 @@ "INSTALL_ON_FOLDER": "Installer i katalog", "INSTALL_ON_MAP": "Installer på kart", "INCLUDE_COMMANDER": "Inkluder kommandant", - "INCLUDE_COMMANDER_VSAI": "Mot Vanilla AI", + "INCLUDE_COMMANDER_VSAI": "Mot Vanilla AI", "INCLUDE_COMMANDER_OFF": "Ingen Kommandant", - "OPTIMISE": "Bruk optimaliserte skript", + "OPTIMISE": "Bruk optimaliserte skript", "FORCELANG": "Overskriv AI-samtalespråk", - "BEST_GAME_VERSION": "Optimal" + "BEST_GAME_VERSION": "Optimal", + "SELECT_PATH": "Endre default sti og installer" }, "APP": { "INSTALLING": "Installerer i {{path}}", diff --git a/Electron/src/assets/i18n/pt.json b/Electron/src/assets/i18n/pt.json index eb27da678..a90bfe9ff 100644 --- a/Electron/src/assets/i18n/pt.json +++ b/Electron/src/assets/i18n/pt.json @@ -7,11 +7,12 @@ "INSTALL_ON_FOLDER": "Instalar no diretório", "INSTALL_ON_MAP": "Instalar no mapa", "INCLUDE_COMMANDER": "Incluir comandante", - "INCLUDE_COMMANDER_VSAI": "Contra IA Vanilla", + "INCLUDE_COMMANDER_VSAI": "Contra IA Vanilla", "INCLUDE_COMMANDER_OFF": "Sem Comandante", - "OPTIMISE": "Usar scripts otimizados", + "OPTIMISE": "Usar scripts otimizados", "FORCELANG": "Substituir a linguagem de conversação AI", - "BEST_GAME_VERSION": "Optimal" + "BEST_GAME_VERSION": "Optimal", + "SELECT_PATH": "Alterar o caminho padrão e instalar" }, "APP": { "INSTALLING": "Instalando em {{path}}", diff --git a/Electron/src/assets/i18n/ro.json b/Electron/src/assets/i18n/ro.json index 8f94b5606..9b3dca028 100644 --- a/Electron/src/assets/i18n/ro.json +++ b/Electron/src/assets/i18n/ro.json @@ -7,11 +7,12 @@ "INSTALL_ON_FOLDER": "Instalează în director", "INSTALL_ON_MAP": "Instalează pe hartă", "INCLUDE_COMMANDER": "Include comandant", - "INCLUDE_COMMANDER_VSAI": "Împotriva AI Vanilla", + "INCLUDE_COMMANDER_VSAI": "Împotriva AI Vanilla", "INCLUDE_COMMANDER_OFF": "Fără comandant", - "OPTIMISE": "Utilizați scripturi optimizate", + "OPTIMISE": "Utilizați scripturi optimizate", "FORCELANG": "Suprascrie limbajul de chat AI", - "BEST_GAME_VERSION": "Optim" + "BEST_GAME_VERSION": "Optim", + "SELECT_PATH": "Schimbă calea implicită și instalează" }, "APP": { "INSTALLING": "Instalare în curs la {{path}}", diff --git a/Electron/src/assets/i18n/ru.json b/Electron/src/assets/i18n/ru.json index 437a8c99e..931b783ef 100644 --- a/Electron/src/assets/i18n/ru.json +++ b/Electron/src/assets/i18n/ru.json @@ -7,11 +7,12 @@ "INSTALL_ON_FOLDER": "Установить в папку", "INSTALL_ON_MAP": "Установить на карту", "INCLUDE_COMMANDER": "Включить командира", - "INCLUDE_COMMANDER_VSAI": "Против Vanilla ИИ", + "INCLUDE_COMMANDER_VSAI": "Против Vanilla ИИ", "INCLUDE_COMMANDER_OFF": "Без командира", - "OPTIMISE": "Использовать оптимизированные скрипты", + "OPTIMISE": "Использовать оптимизированные скрипты", "FORCELANG": "Скачать язык разговора", - "BEST_GAME_VERSION": "Оптимальный" + "BEST_GAME_VERSION": "Оптимальный", + "SELECT_PATH": "Изменить путь по умолчанию и установить" }, "APP": { "INSTALLING": "Установка в {{path}}", diff --git a/Electron/src/assets/i18n/sv.json b/Electron/src/assets/i18n/sv.json index 04cf5ecfa..ff0d3c8f0 100644 --- a/Electron/src/assets/i18n/sv.json +++ b/Electron/src/assets/i18n/sv.json @@ -7,11 +7,12 @@ "INSTALL_ON_FOLDER": "Installera i katalog", "INSTALL_ON_MAP": "Installera på karta", "INCLUDE_COMMANDER": "Inkludera befälhavare", - "INCLUDE_COMMANDER_VSAI": "Mot Vanilla AI", + "INCLUDE_COMMANDER_VSAI": "Mot Vanilla AI", "INCLUDE_COMMANDER_OFF": "Ingen befälhavare", - "OPTIMISE": "Använd optimerade skript", + "OPTIMISE": "Använd optimerade skript", "FORCELANG": "Skriv över AI-chattspråk", - "BEST_GAME_VERSION": "Optimalt" + "BEST_GAME_VERSION": "Optimalt", + "SELECT_PATH": "Ändra standardsökväg och installera" }, "APP": { "INSTALLING": "Installerar i {{path}}", diff --git a/Electron/src/assets/i18n/zh.json b/Electron/src/assets/i18n/zh.json index daa351f9f..819d005d9 100644 --- a/Electron/src/assets/i18n/zh.json +++ b/Electron/src/assets/i18n/zh.json @@ -9,9 +9,10 @@ "INCLUDE_COMMANDER": "安装控制台", "INCLUDE_COMMANDER_VSAI": "AMAI VS 暴雪AI 控制台", "INCLUDE_COMMANDER_OFF": "不安装控制台", - "OPTIMISE": "使用优化脚本", + "OPTIMISE": "使用优化脚本", "FORCELANG": "覆盖AI聊天语言", - "BEST_GAME_VERSION": "最佳版本" + "BEST_GAME_VERSION": "最佳版本", + "SELECT_PATH": "变更默认路径并安装" }, "APP": { "INSTALLING": "正在安装 {{path}}", From 3722960293869455bde0cf52d92fa0faa92e86df Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Tue, 3 Mar 2026 20:05:12 +0800 Subject: [PATCH 38/39] Add files via upload --- Electron/src/app/home/home.component.html | 17 ++++++-- Electron/src/app/home/home.component.scss | 52 ++++++++++++++++++----- Electron/src/app/home/home.component.ts | 8 ++-- 3 files changed, 58 insertions(+), 19 deletions(-) diff --git a/Electron/src/app/home/home.component.html b/Electron/src/app/home/home.component.html index 3cb976e5e..bd3890a2c 100644 --- a/Electron/src/app/home/home.component.html +++ b/Electron/src/app/home/home.component.html @@ -14,9 +14,12 @@

2.0.3+ {{ 'PAGES.HOME.BEST_GAME_VERSION' | translate }}: 2.0.4+ -
+
{{gamePaths.REFORGED.displayText}} edit +
+ {{ 'PAGES.HOME.SELECT_PATH' | translate }}
{{ gamePaths.REFORGED.displayText }} +
@@ -29,9 +32,12 @@

1.24e+ {{ 'PAGES.HOME.BEST_GAME_VERSION' | translate }}: 1.24e ~ 1.28

-
+
{{gamePaths.TFT.displayText}} edit +
+ {{ 'PAGES.HOME.SELECT_PATH' | translate }}
{{ gamePaths.TFT.displayText }} +
@@ -44,9 +50,12 @@

1.24e+ ~ 1.31 {{ 'PAGES.HOME.BEST_GAME_VERSION' | translate }}: 1.24e ~ 1.31

-
+
{{gamePaths.ROC.displayText}} edit +
+ {{ 'PAGES.HOME.SELECT_PATH' | translate }}
{{ gamePaths.ROC.displayText }} +
@@ -82,4 +91,4 @@

(input)="onInputChange(ForceLang.id)">{{ 'PAGES.HOME.FORCELANG' | translate }} - + \ No newline at end of file diff --git a/Electron/src/app/home/home.component.scss b/Electron/src/app/home/home.component.scss index 1d2137af3..61d7cb711 100644 --- a/Electron/src/app/home/home.component.scss +++ b/Electron/src/app/home/home.component.scss @@ -39,7 +39,7 @@ margin-top: 1.8rem; } - .game-version-container{ + .game-version-container { max-width: 512px; min-width: 200px; } @@ -56,10 +56,45 @@ cursor: pointer; transition: all 0.2s ease; position: relative; - overflow: hidden; + overflow: visible; box-sizing: border-box; /* 确保padding不影响总宽度 */ } + .tooltip { + position: absolute; + top: 100%; + left: 50%; + transform: translateX(-50%); + background-color: #1a1a1a; + color: #ffffff; + padding: 6px 12px; + border-radius: 6px; + white-space: nowrap; + font-size: 12px; + z-index: 1000; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); + pointer-events: none; + opacity: 0; + visibility: hidden; + transition: opacity 0.2s ease; + margin-top: 8px; + border: 3px solid #5c5c5c; + min-width: 200px; + max-width: 512px; + text-align: center; + word-break: break-word; /* 确保长单词也能换行 */ + line-height: 1.4; /* 增加行高提高可读性 */ + } + + .game-path-item:hover .tooltip { + opacity: 1; + visibility: visible; + } + + .game-path-item:hover { + background-color: rgb(33, 4, 251); + } + .imageContainerROC, .imageContainerTFT, .imageContainerREF { @@ -83,10 +118,6 @@ color: gold; } - .game-path-item:hover { - background-color: rgb(33, 4, 251); - } - .underlined-path { text-decoration: underline; white-space: nowrap; @@ -197,8 +228,7 @@ .slider:before { position: absolute; - display: flex; - /* 将其转换为弹性布局容器 */ + display: flex; /* 将其转换为弹性布局容器 */ align-items: center; justify-content: center; content: ""; @@ -212,11 +242,11 @@ transition: .4s; } -input:checked+.slider { +input:checked + .slider { background-color: #36b61a; } -input:checked+.slider:before { +input:checked + .slider:before { content: ""; -webkit-transform: translateX(100%); -ms-transform: translateX(100%); @@ -283,4 +313,4 @@ input:checked+.slider:before { color: #FFFFFF; } -} +} \ No newline at end of file diff --git a/Electron/src/app/home/home.component.ts b/Electron/src/app/home/home.component.ts index e42b7b858..aad3155b3 100644 --- a/Electron/src/app/home/home.component.ts +++ b/Electron/src/app/home/home.component.ts @@ -103,10 +103,10 @@ export class HomeComponent implements OnInit { return `${firstPart}/...${lastPart}`; } - async selectGameFolder(pathver: 'REFORGED' | 'TFT' | 'ROC') { + async selectPathAndInstall(pathver: 'REFORGED' | 'TFT' | 'ROC') { if (this.isInteractive) { - console.log(`Selecting folder for ${pathver}`); - this.electronService.ipcRenderer.send('set-path', pathver); + console.log(`Selecting path and install for ${pathver}`); + this.electronService.ipcRenderer.send('set-path-and-install', this.Mode_State, this.BJ_State, this.optimize, this.forcelang, pathver); } } @@ -247,4 +247,4 @@ export class HomeComponent implements OnInit { } }; } -} +} \ No newline at end of file From 5330ed4a9d0c7c2d54cc8053bae19f1f90fa54d8 Mon Sep 17 00:00:00 2001 From: jzy-chitong56 <48715223+jzy-chitong56@users.noreply.github.com> Date: Tue, 3 Mar 2026 20:06:31 +0800 Subject: [PATCH 39/39] Add files via upload --- Electron/app/main.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Electron/app/main.ts b/Electron/app/main.ts index aab42acb5..e338a70dd 100644 --- a/Electron/app/main.ts +++ b/Electron/app/main.ts @@ -31,7 +31,6 @@ const isDev = () => { } const createWindow = (): BrowserWindow => { - const size = screen.getPrimaryDisplay().workAreaSize; // Create the browser window. win = new BrowserWindow({ @@ -111,7 +110,7 @@ const execInstall = async (signal, commander: number = 1, isMap: boolean = false response = dialog.showOpenDialogSync(win, { title: translations["PAGES.ELECTRON.OPEN_MAP"] || '', properties: ['openFile'] , - filters: [ + filters: [ { name: translations["PAGES.ELECTRON.MAPFILE"] || '', extensions: ['w3x', 'w3m'] }, ], defaultPath: usepath, @@ -253,36 +252,43 @@ const GetDefaultPath = () => { } const SetDefaultPath = () => { - ipcMain?.on('set-path', async (_event, pathver ) => { + ipcMain?.on('set-path-and-install', async (_event, toFolder: boolean, commander: number, optimize: boolean, forceLang: boolean, pathver: string = "REFORGED") => { const settingsPath = path.join(app.getPath('userData'), 'settings.json'); let settings: Settings = {}; let usepath = documentsPath; - win.webContents.send('on-install-console', `Selecting folder , version : ${pathver}`); + let result; + let signal = {}; + win.webContents.send('on-install-console', `Selecting path and install , version : ${pathver}`); + if (toFolder) { if (fs.existsSync(settingsPath)) { win.webContents.send('on-install-console', `Get default path`); settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); usepath = getversionpath(pathver, settings); - if (!usepath || usepath === '' || usepath === null || !fs.existsSync(usepath)) { + if (!usepath || usepath === '' || usepath === null || !fs.existsSync(usepath)) { usepath = documentsPath; } } - const result = dialog.showOpenDialogSync(win, { + result = dialog.showOpenDialogSync(win, { title: translations["PAGES.ELECTRON.OPEN_DIR"] || '', properties: ['openDirectory'], defaultPath: usepath }); if (result && (result?.length > 0)) { - usepath = result[0] ? path.resolve(result[0]) : null; + usepath = result[0] ? path.resolve(result[0]) : documentsPath; settings[`${pathver}_PATH`] = usepath; win.webContents.send('on-install-console', `Set path : ${usepath}`); try { fs.writeFileSync(settingsPath, JSON.stringify(settings)); win.webContents.send('path-updated', { pathver: pathver, path: usepath }); + execInstall(signal, commander, !toFolder, optimize ? `OPT${pathver}` : pathver, forceLang, pathver); } catch (err) { win.webContents.send('on-install-console', `Set path failed: ${err.message}`); } } else { - win.webContents.send('on-install-console', `Folder selection was cancelled`); + win.webContents.send('on-install-console', `Path selection was cancelled`); + } + } else { + execInstall(signal, commander, !toFolder, optimize ? `OPT${pathver}` : pathver, forceLang, pathver); } }); } @@ -386,4 +392,4 @@ init(); installTrans(); installProcess(); GetDefaultPath(); -SetDefaultPath(); +SetDefaultPath(); \ No newline at end of file