mirror of
				https://github.com/earthjasonlin/zzz-signal-search-export.git
				synced 2025-10-31 08:30:08 +08:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 8a9c7a3b56 | ||
|  | 2a670c7023 | ||
|  | d732d523a8 | 
| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "star-rail-warp-export", | ||||
|   "version": "0.0.4", | ||||
|   "version": "0.0.6", | ||||
|   "main": "./dist/electron/main/main.js", | ||||
|   "author": "biuuu <https://github.com/biuuu>", | ||||
|   "license": "MIT", | ||||
|   | ||||
| @@ -115,7 +115,7 @@ const readLog = async () => { | ||||
|     } | ||||
|     const promises = logPaths.map(async logpath => { | ||||
|       const logText = await fs.readFile(logpath, 'utf8') | ||||
|       const gamePathMch = logText.match(/\w:\/.*?(Star\sRail\/Game\/StarRail_Data)/) | ||||
|       const gamePathMch = logText.match(/\w:\/.*?(Star\sRail\/Games?\/StarRail_Data)/) | ||||
|       if (gamePathMch) { | ||||
|         const cacheText = await fs.readFile(path.join(gamePathMch[0], '/webCaches/Cache/Cache_Data/data_2'), 'utf8') | ||||
|         const urlMch = cacheText.match(/https.+?&auth_appid=webview_gacha&.+?authkey=.+?&game_biz=hkrpg_.+?&plat_type=pc/g) | ||||
| @@ -456,7 +456,7 @@ ipcMain.handle('READ_DATA', async () => { | ||||
| }) | ||||
|  | ||||
| ipcMain.handle('CHANGE_UID', (event, uid) => { | ||||
|   config.current = uid | ||||
|   changeCurrent(uid) | ||||
| }) | ||||
|  | ||||
| ipcMain.handle('GET_CONFIG', () => { | ||||
|   | ||||
| @@ -42,14 +42,24 @@ const parseData = (data) => { | ||||
|   return result | ||||
| } | ||||
|  | ||||
| const assignData = (objA, objB) => { | ||||
|   const temp = { ...objA } | ||||
|   for (let key in objB) { | ||||
|     if (objB[key]) { | ||||
|       temp[key] = objB[key] | ||||
|     } | ||||
|   } | ||||
|   return temp | ||||
| } | ||||
|  | ||||
| const i18nMap = new Map() | ||||
| const prepareData = () => { | ||||
|   for (let key in raw) { | ||||
|     let temp = {} | ||||
|     if (key === 'zh-tw') { | ||||
|       Object.assign(temp, raw['zh-cn'], raw[key]) | ||||
|       temp = assignData(raw['zh-cn'], raw[key]) | ||||
|     } else { | ||||
|       Object.assign(temp, raw['zh-cn'], raw['en-us'], raw[key]) | ||||
|       temp = assignData(raw['zh-cn'], assignData(raw['en-us'], raw[key])) | ||||
|     } | ||||
|     i18nMap.set(key, parseData(temp)) | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user