Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
a2dcda6be0 | |||
dcaad1d544 | |||
69042728da | |||
0103a0fb4b | |||
1052a4bffb | |||
2fd8730cdd | |||
bbc52af184 | |||
38ed348865 | |||
29548310c5 | |||
3617599d32 | |||
c724727886 | |||
d324aee160 | |||
5a5a7c1327 | |||
77a1d611be | |||
3dbb746a38 | |||
b88b57ae62 |
@ -15,7 +15,9 @@
|
|||||||
## 使用说明
|
## 使用说明
|
||||||
|
|
||||||
1. 下载工具后解压 - 下载地址: [Github](https://github.com/biuuu/star-rail-warp-export/releases/latest/download/StarRailWarpExport.zip) / [蓝奏云](https://wwvt.lanzoum.com/b022mikwh) 密码:f1iy
|
1. 下载工具后解压 - 下载地址: [Github](https://github.com/biuuu/star-rail-warp-export/releases/latest/download/StarRailWarpExport.zip) / [蓝奏云](https://wwvt.lanzoum.com/b022mikwh) 密码:f1iy
|
||||||
2. 打开游戏的跃迁历史记录
|
2. 打开游戏的跃迁详情页面
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
3. 点击工具的“加载数据”按钮
|
3. 点击工具的“加载数据”按钮
|
||||||
|
|
||||||
|
@ -17,7 +17,9 @@ If you feel that the existing translation is inappropriate, you can send a pull
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
1. Unzip after downloading the tool - [Download](https://github.com/biuuu/star-rail-warp-export/releases/latest/download/StarRailWarpExport.zip)
|
1. Unzip after downloading the tool - [Download](https://github.com/biuuu/star-rail-warp-export/releases/latest/download/StarRailWarpExport.zip)
|
||||||
2. Open the warp history of the game
|
2. Open the warp details page of the game
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
3. Click the tool's "Load data" button
|
3. Click the tool's "Load data" button
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 55 KiB |
BIN
docs/preview.png
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 46 KiB |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "star-rail-warp-export",
|
"name": "star-rail-warp-export",
|
||||||
"version": "0.0.7",
|
"version": "0.0.16",
|
||||||
"main": "./dist/electron/main/main.js",
|
"main": "./dist/electron/main/main.js",
|
||||||
"author": "biuuu <https://github.com/biuuu>",
|
"author": "biuuu <https://github.com/biuuu>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
275
src/gachaType.json
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
[
|
||||||
|
[
|
||||||
|
"de-de",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "Figuren-Aktionswarp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "Lichtkegel-Aktionswarp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "Standardwarp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "Einsteigerwarp"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"ru-ru",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "Прыжок события: Персонаж"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "Прыжок события: Световой конус"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "Стандартный прыжок"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "Прыжок новичка"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"th-th",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "กิจกรรมวาร์ปตัวละคร"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "กิจกรรมวาร์ป Light Cone"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "วาร์ปถาวร"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "วาร์ปสำหรับมือใหม่"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"zh-cn",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "角色活动跃迁"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "光锥活动跃迁"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "常驻跃迁"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "新手跃迁"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"zh-tw",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "角色活動躍遷"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "光錐活動躍遷"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "常駐躍遷"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "新手躍遷"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"en-us",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "Character Event Warp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "Light Cone Event Warp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "Regular Warp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "Starter Warp"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"es-es",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "Salto de evento de personaje"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "Salto de evento de cono de luz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "Salto normal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "Salto de principiante"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"fr-fr",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "Saut hyperespace événement de personnage"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "Saut hyperespace événement de cônes de lumière"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "Saut hyperespace classique"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "Saut hyperespace de départ"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"id-id",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "Event Warp Karakter"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "Event Warp Light Cone"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "Warp Reguler"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "Warp Pemula"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"ja-jp",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "イベント跳躍・キャラクター"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "イベント跳躍・光円錐"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "恒常跳躍"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "初心者跳躍"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"ko-kr",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "캐릭터 이벤트 워프"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "광추 이벤트 워프"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "상시 워프"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "초보자 워프"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"pt-pt",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "Salto Hiperespacial de Evento de Personagem"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "Salto Hiperespacial de Evento de Cone de Luz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "Salto Hiperespacial Permanente"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "Salto Hiperespacial Inicial"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"vi-vn",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "11",
|
||||||
|
"name": "Bước Nhảy Sự Kiện Nhân Vật"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "12",
|
||||||
|
"name": "Bước Nhảy Sự Kiện Nón Ánh Sáng"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "1",
|
||||||
|
"name": "Bước Nhảy Vĩnh Viễn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "2",
|
||||||
|
"name": "Bước Nhảy Tân Thủ"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
@ -30,9 +30,9 @@
|
|||||||
"ui.data.average": "5 star on average",
|
"ui.data.average": "5 star on average",
|
||||||
"ui.data.chara5": "5 star character",
|
"ui.data.chara5": "5 star character",
|
||||||
"ui.data.chara4": "4 star character",
|
"ui.data.chara4": "4 star character",
|
||||||
"ui.data.weapon5": "5 star light cone",
|
"ui.data.weapon5": "5 star Light Cone",
|
||||||
"ui.data.weapon4": "4 star light cone",
|
"ui.data.weapon4": "4 star Light Cone",
|
||||||
"ui.data.weapon3": "3 star light cone",
|
"ui.data.weapon3": "3 star Light Cone",
|
||||||
"ui.setting.title": "Settings",
|
"ui.setting.title": "Settings",
|
||||||
"ui.setting.language": "Language",
|
"ui.setting.language": "Language",
|
||||||
"ui.setting.languageHint": "When the translation is missing, English will be displayed by default.",
|
"ui.setting.languageHint": "When the translation is missing, English will be displayed by default.",
|
||||||
@ -42,7 +42,7 @@
|
|||||||
"ui.setting.seaServer": "Global server",
|
"ui.setting.seaServer": "Global server",
|
||||||
"ui.setting.logTypeHint": "Choose which server generated logs to be used first when acquiring URL from game logs",
|
"ui.setting.logTypeHint": "Choose which server generated logs to be used first when acquiring URL from game logs",
|
||||||
"ui.setting.autoUpdate": "Auto update",
|
"ui.setting.autoUpdate": "Auto update",
|
||||||
"ui.setting.hideNovice": "Hide Departure Warp",
|
"ui.setting.hideNovice": "Hide Starter Warp",
|
||||||
"ui.setting.proxyMode": "Proxy mode",
|
"ui.setting.proxyMode": "Proxy mode",
|
||||||
"ui.setting.proxyModeHint": "When we fail to get the URL from system logs, use the system proxy",
|
"ui.setting.proxyModeHint": "When we fail to get the URL from system logs, use the system proxy",
|
||||||
"ui.setting.fetchFullHistory": "Get complete data",
|
"ui.setting.fetchFullHistory": "Get complete data",
|
||||||
@ -84,5 +84,5 @@
|
|||||||
"excel.filePrefix": "Star Rail Warp logger",
|
"excel.filePrefix": "Star Rail Warp logger",
|
||||||
"excel.fileType": "Excel file",
|
"excel.fileType": "Excel file",
|
||||||
"ui.extra.cacheClean": "1. Confirm whether the warp history in the game has been opened, and if the error \"User authentication expired\" still appears, try the following steps \n2. Close the game window of Star Rail \n3. Click the \"Open Web Cache Folder\" button above to open the \"Cache\" folder \n4. Delete the \"Cache_ Data\" folder \n5. Start the Star Rail game and open the warp history page in the game \n6. Close this dialog and click the \"Update Data\" button",
|
"ui.extra.cacheClean": "1. Confirm whether the warp history in the game has been opened, and if the error \"User authentication expired\" still appears, try the following steps \n2. Close the game window of Star Rail \n3. Click the \"Open Web Cache Folder\" button above to open the \"Cache\" folder \n4. Delete the \"Cache_ Data\" folder \n5. Start the Star Rail game and open the warp history page in the game \n6. Close this dialog and click the \"Update Data\" button",
|
||||||
"ui.extra.findCacheFolder": "If the \"Open cache folder\" button does not respond, you can manually find the game's web cache folder. The directory is \"Your game installation path/Star Rail/Game/StarRail_Data/webCaches/Cache/\""
|
"ui.extra.findCacheFolder": "If the \"Open cache folder\" button does not respond, you can manually find the game's web cache folder. The directory is \"Your game installation path/Star Rail/Games/StarRail_Data/webCaches/Cache/\""
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"ui.data.sum": "合計",
|
"ui.data.sum": "合計",
|
||||||
"ui.data.no5star": "連星5取得しません",
|
"ui.data.no5star": "連星5取得しません",
|
||||||
"ui.data.character": "キャラ",
|
"ui.data.character": "キャラ",
|
||||||
"ui.data.weapon": "武器",
|
"ui.data.weapon": "光円錐",
|
||||||
"ui.data.star5": "星5",
|
"ui.data.star5": "星5",
|
||||||
"ui.data.star4": "星4",
|
"ui.data.star4": "星4",
|
||||||
"ui.data.star3": "星3",
|
"ui.data.star3": "星3",
|
||||||
@ -26,9 +26,9 @@
|
|||||||
"ui.data.average": "星5取得平均回数",
|
"ui.data.average": "星5取得平均回数",
|
||||||
"ui.data.chara5": "星5キャラ",
|
"ui.data.chara5": "星5キャラ",
|
||||||
"ui.data.chara4": "星4キャラ",
|
"ui.data.chara4": "星4キャラ",
|
||||||
"ui.data.weapon5": "星5武器",
|
"ui.data.weapon5": "星5光円錐",
|
||||||
"ui.data.weapon4": "星4武器",
|
"ui.data.weapon4": "星4光円錐",
|
||||||
"ui.data.weapon3": "星3武器",
|
"ui.data.weapon3": "星3光円錐",
|
||||||
"ui.setting.title": "設定",
|
"ui.setting.title": "設定",
|
||||||
"ui.setting.language": "言語",
|
"ui.setting.language": "言語",
|
||||||
"ui.setting.languageHint": "翻訳されていない場合は、デフォルトで英語が表示されます。",
|
"ui.setting.languageHint": "翻訳されていない場合は、デフォルトで英語が表示されます。",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"ui.data.sum": "已累计",
|
"ui.data.sum": "已累计",
|
||||||
"ui.data.no5star": "抽未出5星",
|
"ui.data.no5star": "抽未出5星",
|
||||||
"ui.data.character": "角色",
|
"ui.data.character": "角色",
|
||||||
"ui.data.weapon": "武器",
|
"ui.data.weapon": "光锥",
|
||||||
"ui.data.star5": "5星",
|
"ui.data.star5": "5星",
|
||||||
"ui.data.star4": "4星",
|
"ui.data.star4": "4星",
|
||||||
"ui.data.star3": "3星",
|
"ui.data.star3": "3星",
|
||||||
@ -30,9 +30,9 @@
|
|||||||
"ui.data.average": "5星平均出货次数为",
|
"ui.data.average": "5星平均出货次数为",
|
||||||
"ui.data.chara5": "5星角色",
|
"ui.data.chara5": "5星角色",
|
||||||
"ui.data.chara4": "4星角色",
|
"ui.data.chara4": "4星角色",
|
||||||
"ui.data.weapon5": "5星武器",
|
"ui.data.weapon5": "5星光锥",
|
||||||
"ui.data.weapon4": "4星武器",
|
"ui.data.weapon4": "4星光锥",
|
||||||
"ui.data.weapon3": "3星武器",
|
"ui.data.weapon3": "3星光锥",
|
||||||
"ui.setting.title": "设置",
|
"ui.setting.title": "设置",
|
||||||
"ui.setting.language": "语言",
|
"ui.setting.language": "语言",
|
||||||
"ui.setting.languageHint": "缺少翻译时,会默认显示简体中文",
|
"ui.setting.languageHint": "缺少翻译时,会默认显示简体中文",
|
||||||
@ -42,7 +42,7 @@
|
|||||||
"ui.setting.seaServer": "外服",
|
"ui.setting.seaServer": "外服",
|
||||||
"ui.setting.logTypeHint": "使用游戏日志获取URL时,优先选择哪种服务器生成的日志文件。",
|
"ui.setting.logTypeHint": "使用游戏日志获取URL时,优先选择哪种服务器生成的日志文件。",
|
||||||
"ui.setting.autoUpdate": "自动更新",
|
"ui.setting.autoUpdate": "自动更新",
|
||||||
"ui.setting.hideNovice": "隐藏始发跃迁",
|
"ui.setting.hideNovice": "隐藏新手跃迁",
|
||||||
"ui.setting.proxyMode": "代理模式",
|
"ui.setting.proxyMode": "代理模式",
|
||||||
"ui.setting.proxyModeHint": "通过设置系统代理来获取URL,无法从日志中获取到有效的URL时才会启动代理服务器。",
|
"ui.setting.proxyModeHint": "通过设置系统代理来获取URL,无法从日志中获取到有效的URL时才会启动代理服务器。",
|
||||||
"ui.setting.fetchFullHistory": "获取完整数据",
|
"ui.setting.fetchFullHistory": "获取完整数据",
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
"ui.button.setting": "設定",
|
"ui.button.setting": "設定",
|
||||||
"ui.button.option": "選項",
|
"ui.button.option": "選項",
|
||||||
"ui.button.startProxy": "Proxy 模式",
|
"ui.button.startProxy": "Proxy 模式",
|
||||||
"ui.button.solution": "解決方案",
|
"ui.button.solution": "解決方法",
|
||||||
"ui.button.cacheFolder": "開啟快取資料夾",
|
"ui.button.cacheFolder": "開啟快取資料夾",
|
||||||
"ui.select.newAccount": "新帳號",
|
"ui.select.newAccount": "新帳號",
|
||||||
"ui.hint.newAccount": "從其他帳號匯出資料",
|
"ui.hint.newAccount": "從其他帳號匯出資料",
|
||||||
@ -16,13 +16,13 @@
|
|||||||
"ui.hint.lastUpdate": "上次資料更新時間為",
|
"ui.hint.lastUpdate": "上次資料更新時間為",
|
||||||
"ui.hint.relaunchHint": "更新已完成,按下按鈕重新啟動工具後生效",
|
"ui.hint.relaunchHint": "更新已完成,按下按鈕重新啟動工具後生效",
|
||||||
"ui.hint.failed": "作業失敗",
|
"ui.hint.failed": "作業失敗",
|
||||||
"ui.win.title": "",
|
"ui.win.title": "崩壞:星穹鐵道 躍遷記錄匯出工具",
|
||||||
"ui.data.total": "總計",
|
"ui.data.total": "總計",
|
||||||
"ui.data.times": "抽",
|
"ui.data.times": "抽",
|
||||||
"ui.data.sum": "已累計",
|
"ui.data.sum": "已累計",
|
||||||
"ui.data.no5star": "抽未出5星",
|
"ui.data.no5star": "抽未出5星",
|
||||||
"ui.data.character": "角色",
|
"ui.data.character": "角色",
|
||||||
"ui.data.weapon": "武器",
|
"ui.data.weapon": "光錐",
|
||||||
"ui.data.star5": "5星",
|
"ui.data.star5": "5星",
|
||||||
"ui.data.star4": "4星",
|
"ui.data.star4": "4星",
|
||||||
"ui.data.star3": "3星",
|
"ui.data.star3": "3星",
|
||||||
@ -30,9 +30,9 @@
|
|||||||
"ui.data.average": "5星平均出貨次數為",
|
"ui.data.average": "5星平均出貨次數為",
|
||||||
"ui.data.chara5": "5星角色",
|
"ui.data.chara5": "5星角色",
|
||||||
"ui.data.chara4": "4星角色",
|
"ui.data.chara4": "4星角色",
|
||||||
"ui.data.weapon5": "5星武器",
|
"ui.data.weapon5": "5星光錐",
|
||||||
"ui.data.weapon4": "4星武器",
|
"ui.data.weapon4": "4星光錐",
|
||||||
"ui.data.weapon3": "3星武器",
|
"ui.data.weapon3": "3星光錐",
|
||||||
"ui.setting.title": "設定",
|
"ui.setting.title": "設定",
|
||||||
"ui.setting.language": "語言",
|
"ui.setting.language": "語言",
|
||||||
"ui.setting.languageHint": "缺少翻譯時,預設會顯示簡體中文。",
|
"ui.setting.languageHint": "缺少翻譯時,預設會顯示簡體中文。",
|
||||||
@ -42,7 +42,7 @@
|
|||||||
"ui.setting.seaServer": "國際服",
|
"ui.setting.seaServer": "國際服",
|
||||||
"ui.setting.logTypeHint": "使用遊戲記錄取得 URL 時,優先選擇哪種伺服器產生的記錄檔案。",
|
"ui.setting.logTypeHint": "使用遊戲記錄取得 URL 時,優先選擇哪種伺服器產生的記錄檔案。",
|
||||||
"ui.setting.autoUpdate": "自動更新",
|
"ui.setting.autoUpdate": "自動更新",
|
||||||
"ui.setting.hideNovice": "",
|
"ui.setting.hideNovice": "隱藏新手躍遷",
|
||||||
"ui.setting.proxyMode": "Proxy 模式",
|
"ui.setting.proxyMode": "Proxy 模式",
|
||||||
"ui.setting.proxyModeHint": "透過設定系統 Proxy 以取得 URL,將會在從系統記錄中取得 URL 失敗時啟動。",
|
"ui.setting.proxyModeHint": "透過設定系統 Proxy 以取得 URL,將會在從系統記錄中取得 URL 失敗時啟動。",
|
||||||
"ui.setting.fetchFullHistory": "取得完整資料",
|
"ui.setting.fetchFullHistory": "取得完整資料",
|
||||||
@ -81,8 +81,8 @@
|
|||||||
"excel.header.remark": "備註",
|
"excel.header.remark": "備註",
|
||||||
"excel.wish2": "躍遷-2",
|
"excel.wish2": "躍遷-2",
|
||||||
"excel.customFont": "微軟正黑體",
|
"excel.customFont": "微軟正黑體",
|
||||||
"excel.filePrefix": "",
|
"excel.filePrefix": "星穹鐵道躍遷紀錄",
|
||||||
"excel.fileType": "Excel 檔案",
|
"excel.fileType": "Excel 檔案",
|
||||||
"ui.extra.cacheClean": "1. 確認是否已經開啟遊戲內的躍遷歷史紀錄,如果仍然出現「身分驗證已過期」的錯誤,再嘗試下面的步驟\n2. 關閉原神的遊戲視窗\n3. 按一下上方的「開啟快取資料夾」按鈕,開啟「Cache」資料夾\n4. 刪除「Cache_Data」資料夾\n5. 啟動原神遊戲,開啟遊戲內躍遷歷史紀錄頁面\n6. 關閉這個對話方塊,再按下「更新資料」按鈕",
|
"ui.extra.cacheClean": "1. 確認是否已經開啟遊戲內的躍遷歷史紀錄,如果仍然出現「身分驗證已過期」的錯誤,再嘗試下面的步驟\n2. 關閉「崩壞:星穹鐵道」的遊戲視窗\n3. 按一下上方的「開啟快取資料夾」按鈕,開啟「Cache」資料夾\n4. 刪除「Cache_Data」資料夾\n5. 啟動「崩壞:星穹鐵道」遊戲,開啟遊戲內躍遷歷史紀錄頁面\n6. 關閉這個對話方塊,再按下「更新資料」按鈕",
|
||||||
"ui.extra.findCacheFolder": "如果按下「開啟快取資料夾」按鈕沒有回應,可以手動找到遊戲的網頁快取資料夾,目錄為「您的遊戲安裝路徑/Star Rail/Game/StarRail_Data/webCaches/Cache/」"
|
"ui.extra.findCacheFolder": "如果按下「開啟快取資料夾」按鈕沒有回應,可以手動找到遊戲的網頁快取資料夾,目錄為「您的遊戲安裝路徑/Star Rail/Games/StarRail_Data/webCaches/Cache/」"
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const { readJSON, saveJSON, decipherAes, cipherAes, detectLocale } = require('./utils')
|
const { readJSON, saveJSON, decipherAes, cipherAes, detectLocale, userDataPath, globalUserDataPath } = require('./utils')
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
urls: [],
|
urls: [],
|
||||||
@ -13,7 +13,10 @@ const config = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getLocalConfig = async () => {
|
const getLocalConfig = async () => {
|
||||||
const localConfig = await readJSON('config.json')
|
let localConfig = await readJSON(userDataPath, 'config.json')
|
||||||
|
if (!localConfig) {
|
||||||
|
localConfig = await readJSON(globalUserDataPath, 'config.json')
|
||||||
|
}
|
||||||
if (!localConfig) return
|
if (!localConfig) return
|
||||||
const configTemp = {}
|
const configTemp = {}
|
||||||
for (let key in localConfig) {
|
for (let key in localConfig) {
|
||||||
|
@ -4,7 +4,6 @@ const { app, ipcMain, dialog } = require('electron')
|
|||||||
const fs = require('fs-extra')
|
const fs = require('fs-extra')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const i18n = require('./i18n')
|
const i18n = require('./i18n')
|
||||||
const cloneDeep = require('lodash-es/cloneDeep').default
|
|
||||||
|
|
||||||
function pad(num) {
|
function pad(num) {
|
||||||
return `${num}`.padStart(2, "0");
|
return `${num}`.padStart(2, "0");
|
||||||
@ -87,7 +86,7 @@ const start = async () => {
|
|||||||
arr.push(total)
|
arr.push(total)
|
||||||
arr.push(pity)
|
arr.push(pity)
|
||||||
temp.push(arr)
|
temp.push(arr)
|
||||||
if (log.rank_type === 5) {
|
if (log.rank_type === '5') {
|
||||||
pity = 0
|
pity = 0
|
||||||
}
|
}
|
||||||
// if (key === '301') {
|
// if (key === '301') {
|
||||||
|
@ -3,12 +3,13 @@ const util = require('util')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const { URL } = require('url')
|
const { URL } = require('url')
|
||||||
const { app, ipcMain, shell } = require('electron')
|
const { app, ipcMain, shell } = require('electron')
|
||||||
const { sleep, request, sendMsg, readJSON, saveJSON, detectLocale, userDataPath, userPath, localIp, langMap } = require('./utils')
|
const { sleep, request, sendMsg, readJSON, saveJSON, detectLocale, userDataPath, userPath, localIp, langMap, globalUserDataPath } = require('./utils')
|
||||||
const config = require('./config')
|
const config = require('./config')
|
||||||
const i18n = require('./i18n')
|
const i18n = require('./i18n')
|
||||||
const { enableProxy, disableProxy } = require('./module/system-proxy')
|
const { enableProxy, disableProxy } = require('./module/system-proxy')
|
||||||
const mitmproxy = require('./module/node-mitmproxy')
|
const mitmproxy = require('./module/node-mitmproxy')
|
||||||
const { mergeData } = require('./utils/mergeData')
|
const { mergeData } = require('./utils/mergeData')
|
||||||
|
const gachaTypeRaw = require('../gachaType.json')
|
||||||
|
|
||||||
const dataMap = new Map()
|
const dataMap = new Map()
|
||||||
const order = ['11', '12', '1', '2']
|
const order = ['11', '12', '1', '2']
|
||||||
@ -17,7 +18,6 @@ let apiDomain = 'https://api-takumi.mihoyo.com'
|
|||||||
const saveData = async (data, url) => {
|
const saveData = async (data, url) => {
|
||||||
const obj = Object.assign({}, data)
|
const obj = Object.assign({}, data)
|
||||||
obj.result = [...obj.result]
|
obj.result = [...obj.result]
|
||||||
obj.typeMap = [...obj.typeMap]
|
|
||||||
await config.save()
|
await config.save()
|
||||||
await saveJSON(`gacha-list-${data.uid}.json`, obj)
|
await saveJSON(`gacha-list-${data.uid}.json`, obj)
|
||||||
}
|
}
|
||||||
@ -25,21 +25,39 @@ const saveData = async (data, url) => {
|
|||||||
const defaultTypeMap = new Map([
|
const defaultTypeMap = new Map([
|
||||||
['11', '角色活动跃迁'],
|
['11', '角色活动跃迁'],
|
||||||
['12', '光锥活动跃迁'],
|
['12', '光锥活动跃迁'],
|
||||||
['1', '群星跃迁'],
|
['1', '常驻跃迁'],
|
||||||
['2', '始发跃迁']
|
['2', '新手跃迁']
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const findDataFiles = async (dataPath, fileMap) => {
|
||||||
|
const files = await readdir(dataPath)
|
||||||
|
if (files?.length) {
|
||||||
|
for (let name of files) {
|
||||||
|
if (/^gacha-list-\d+\.json$/.test(name) && !fileMap.has(name)) {
|
||||||
|
fileMap.set(name, dataPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const collectDataFiles = async () => {
|
||||||
|
await fs.ensureDir(userDataPath)
|
||||||
|
await fs.ensureDir(globalUserDataPath)
|
||||||
|
const fileMap = new Map()
|
||||||
|
await findDataFiles(userDataPath, fileMap)
|
||||||
|
await findDataFiles(globalUserDataPath, fileMap)
|
||||||
|
return fileMap
|
||||||
|
}
|
||||||
|
|
||||||
let localDataReaded = false
|
let localDataReaded = false
|
||||||
const readdir = util.promisify(fs.readdir)
|
const readdir = util.promisify(fs.readdir)
|
||||||
const readData = async () => {
|
const readData = async () => {
|
||||||
if (localDataReaded) return
|
if (localDataReaded) return
|
||||||
localDataReaded = true
|
localDataReaded = true
|
||||||
await fs.ensureDir(userDataPath)
|
const fileMap = await collectDataFiles()
|
||||||
const files = await readdir(userDataPath)
|
for (let [name, dataPath] of fileMap) {
|
||||||
for (let name of files) {
|
|
||||||
if (/^gacha-list-\d+\.json$/.test(name)) {
|
|
||||||
try {
|
try {
|
||||||
const data = await readJSON(name)
|
const data = await readJSON(dataPath, name)
|
||||||
data.typeMap = new Map(data.typeMap) || defaultTypeMap
|
data.typeMap = new Map(data.typeMap) || defaultTypeMap
|
||||||
data.result = new Map(data.result)
|
data.result = new Map(data.result)
|
||||||
if (data.uid) {
|
if (data.uid) {
|
||||||
@ -49,7 +67,6 @@ const readData = async () => {
|
|||||||
sendMsg(e, 'ERROR')
|
sendMsg(e, 'ERROR')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ((!config.current && dataMap.size) || (config.current && dataMap.size && !dataMap.has(config.current))) {
|
if ((!config.current && dataMap.size) || (config.current && dataMap.size && !dataMap.has(config.current))) {
|
||||||
await changeCurrent(dataMap.keys().next().value)
|
await changeCurrent(dataMap.keys().next().value)
|
||||||
}
|
}
|
||||||
@ -66,7 +83,7 @@ const detectGameLocale = async (userPath) => {
|
|||||||
const arr = ['/miHoYo/崩坏:星穹铁道/', '/Cognosphere/Star Rail/']
|
const arr = ['/miHoYo/崩坏:星穹铁道/', '/Cognosphere/Star Rail/']
|
||||||
arr.forEach(str => {
|
arr.forEach(str => {
|
||||||
try {
|
try {
|
||||||
const pathname = path.join(userPath, '/AppData/LocalLow/', str, 'Player-prev.log')
|
const pathname = path.join(userPath, '/AppData/LocalLow/', str, 'Player.log')
|
||||||
fs.accessSync(pathname, fs.constants.F_OK)
|
fs.accessSync(pathname, fs.constants.F_OK)
|
||||||
list.push(pathname)
|
list.push(pathname)
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
@ -115,7 +132,7 @@ const readLog = async () => {
|
|||||||
}
|
}
|
||||||
const promises = logPaths.map(async logpath => {
|
const promises = logPaths.map(async logpath => {
|
||||||
const logText = await fs.readFile(logpath, 'utf8')
|
const logText = await fs.readFile(logpath, 'utf8')
|
||||||
const gamePathMch = logText.match(/\w:\/.*?\/StarRail_Data\//)
|
const gamePathMch = logText.match(/\w:\/.*?\/StarRail_Data\//i)
|
||||||
if (gamePathMch) {
|
if (gamePathMch) {
|
||||||
let cacheText = ''
|
let cacheText = ''
|
||||||
try {
|
try {
|
||||||
@ -146,7 +163,7 @@ const getGachaLog = async ({ key, page, name, retryCount, url, endId }) => {
|
|||||||
const text = i18n.log
|
const text = i18n.log
|
||||||
try {
|
try {
|
||||||
const res = await request(`${url}&gacha_type=${key}&page=${page}&size=${20}${endId ? '&end_id=' + endId : ''}`)
|
const res = await request(`${url}&gacha_type=${key}&page=${page}&size=${20}${endId ? '&end_id=' + endId : ''}`)
|
||||||
return res.data.list
|
return res?.data
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (retryCount) {
|
if (retryCount) {
|
||||||
sendMsg(i18n.parse(text.fetch.retry, { name, page, count: 6 - retryCount }))
|
sendMsg(i18n.parse(text.fetch.retry, { name, page, count: 6 - retryCount }))
|
||||||
@ -164,7 +181,8 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
|||||||
const text = i18n.log
|
const text = i18n.log
|
||||||
let page = 1
|
let page = 1
|
||||||
let list = []
|
let list = []
|
||||||
let res = []
|
let res = null
|
||||||
|
let logs = []
|
||||||
let uid = ''
|
let uid = ''
|
||||||
let region = ''
|
let region = ''
|
||||||
let region_time_zone = ''
|
let region_time_zone = ''
|
||||||
@ -178,8 +196,9 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
|||||||
sendMsg(i18n.parse(text.fetch.current, { name, page }))
|
sendMsg(i18n.parse(text.fetch.current, { name, page }))
|
||||||
res = await getGachaLog({ key, page, name, url, endId, retryCount: 5 })
|
res = await getGachaLog({ key, page, name, url, endId, retryCount: 5 })
|
||||||
await sleep(0.3)
|
await sleep(0.3)
|
||||||
if (!uid && res.length) {
|
logs = res?.list || []
|
||||||
uid = res[0].uid
|
if (!uid && logs.length) {
|
||||||
|
uid = logs[0].uid
|
||||||
}
|
}
|
||||||
if (!region) {
|
if (!region) {
|
||||||
region = res.region
|
region = res.region
|
||||||
@ -187,14 +206,14 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
|||||||
if (!region_time_zone) {
|
if (!region_time_zone) {
|
||||||
region_time_zone = res.region_time_zone
|
region_time_zone = res.region_time_zone
|
||||||
}
|
}
|
||||||
list.push(...res)
|
list.push(...logs)
|
||||||
page += 1
|
page += 1
|
||||||
|
|
||||||
if (res.length) {
|
if (logs.length) {
|
||||||
endId = res[res.length - 1].id
|
endId = logs[logs.length - 1].id
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.fetchFullHistory && res.length && uid && dataMap.has(uid)) {
|
if (!config.fetchFullHistory && logs.length && uid && dataMap.has(uid)) {
|
||||||
const result = dataMap.get(uid).result
|
const result = dataMap.get(uid).result
|
||||||
if (result.has(key)) {
|
if (result.has(key)) {
|
||||||
const arr = result.get(key)
|
const arr = result.get(key)
|
||||||
@ -202,7 +221,7 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
|||||||
const localLatestId = arr[arr.length - 1].id
|
const localLatestId = arr[arr.length - 1].id
|
||||||
if (localLatestId) {
|
if (localLatestId) {
|
||||||
let shouldBreak = false
|
let shouldBreak = false
|
||||||
res.forEach(item => {
|
logs.forEach(item => {
|
||||||
if (item.id === localLatestId) {
|
if (item.id === localLatestId) {
|
||||||
shouldBreak = true
|
shouldBreak = true
|
||||||
}
|
}
|
||||||
@ -214,7 +233,7 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (res.length > 0)
|
} while (logs.length > 0)
|
||||||
return { list, uid, region, region_time_zone }
|
return { list, uid, region, region_time_zone }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +257,6 @@ const tryGetUid = async (queryString) => {
|
|||||||
try {
|
try {
|
||||||
for (let [key] of defaultTypeMap) {
|
for (let [key] of defaultTypeMap) {
|
||||||
const res = await request(`${url}&gacha_type=${key}&page=1&size=6`)
|
const res = await request(`${url}&gacha_type=${key}&page=1&size=6`)
|
||||||
checkResStatus(res)
|
|
||||||
if (res.data.list && res.data.list.length) {
|
if (res.data.list && res.data.list.length) {
|
||||||
return res.data.list[0].uid
|
return res.data.list[0].uid
|
||||||
}
|
}
|
||||||
@ -247,7 +265,7 @@ const tryGetUid = async (queryString) => {
|
|||||||
return config.current
|
return config.current
|
||||||
}
|
}
|
||||||
|
|
||||||
const gachaTypeMap = new Map(JSON.parse('[["de-de",[{"key":"11","name":"Figuren-Aktionswarp"},{"key":"12","name":"Lichtkegel-Aktionswarp"},{"key":"1","name":"Stellarwarp"},{"key":"2","name":"Startwarp"}]],["ru-ru",[{"key":"11","name":"Прыжок события: Персонаж"},{"key":"12","name":"Прыжок события: Световой конус"},{"key":"1","name":"Звёздный Прыжок"},{"key":"2","name":"Отправной Прыжок"}]],["th-th",[{"key":"11","name":"กิจกรรมวาร์ปตัวละคร"},{"key":"12","name":"กิจกรรมวาร์ป Light Cone"},{"key":"1","name":"วาร์ปสู่ดวงดาว"},{"key":"2","name":"ก้าวแรกแห่งการวาร์ป"}]],["zh-cn",[{"key":"11","name":"角色活动跃迁"},{"key":"12","name":"光锥活动跃迁"},{"key":"1","name":"群星跃迁"},{"key":"2","name":"始发跃迁"}]],["zh-tw",[{"key":"11","name":"角色活動躍遷"},{"key":"12","name":"光錐活動躍遷"},{"key":"1","name":"群星躍遷"},{"key":"2","name":"始發躍遷"}]],["en-us",[{"key":"11","name":"Character Event Warp"},{"key":"12","name":"Light Cone Event Warp"},{"key":"1","name":"Stellar Warp"},{"key":"2","name":"Departure Warp"}]],["es-es",[{"key":"11","name":"Salto de evento de personaje"},{"key":"12","name":"Salto de evento de cono de luz"},{"key":"1","name":"Salto estelar"},{"key":"2","name":"Salto de partida"}]],["fr-fr",[{"key":"11","name":"Saut hyperespace événement de personnage"},{"key":"12","name":"Saut hyperespace événement de cônes de lumière"},{"key":"1","name":"Saut stellaire"},{"key":"2","name":"Saut hyperespace de départ"}]],["id-id",[{"key":"11","name":"Event Warp Karakter"},{"key":"12","name":"Event Warp Light Cone"},{"key":"1","name":"Warp Bintang-Bintang"},{"key":"2","name":"Warp Keberangkatan"}]],["ja-jp",[{"key":"11","name":"イベント跳躍・キャラクター"},{"key":"12","name":"イベント跳躍・光円錐"},{"key":"1","name":"群星跳躍"},{"key":"2","name":"始発跳躍"}]],["ko-kr",[{"key":"11","name":"캐릭터 이벤트 워프"},{"key":"12","name":"광추 이벤트 워프"},{"key":"1","name":"뭇별의 워프"},{"key":"2","name":"초행길 워프"}]],["pt-pt",[{"key":"11","name":"Salto Hiperespacial de Evento de Personagem"},{"key":"12","name":"Salto Hiperespacial de Evento de Cone de Luz"},{"key":"1","name":"Salto Hiperespacial Estelar"},{"key":"2","name":"Salto Hiperespacial de Novatos"}]],["vi-vn",[{"key":"11","name":"Bước Nhảy Sự Kiện Nhân Vật"},{"key":"12","name":"Bước Nhảy Sự Kiện Nón Ánh Sáng"},{"key":"1","name":"Bước Nhảy Chòm Sao"},{"key":"2","name":"Bước Nhảy Đầu Tiên"}]]]'))
|
const gachaTypeMap = new Map(gachaTypeRaw)
|
||||||
const getGachaType = (lang) => {
|
const getGachaType = (lang) => {
|
||||||
const locale = detectLocale(lang)
|
const locale = detectLocale(lang)
|
||||||
return gachaTypeMap.get(locale || lang)
|
return gachaTypeMap.get(locale || lang)
|
||||||
@ -336,10 +354,7 @@ const tryRequest = async (url, retry = false) => {
|
|||||||
const gachaTypeUrl = `${apiDomain}/common/gacha_record/api/getGachaLog?${queryString}&page=1&size=5&gacha_type=1&end_id=0`
|
const gachaTypeUrl = `${apiDomain}/common/gacha_record/api/getGachaLog?${queryString}&page=1&size=5&gacha_type=1&end_id=0`
|
||||||
try {
|
try {
|
||||||
const res = await request(gachaTypeUrl)
|
const res = await request(gachaTypeUrl)
|
||||||
if (res.retcode !== 0) {
|
checkResStatus(res)
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code === 'ERR_PROXY_CONNECTION_FAILED' && !retry) {
|
if (e.code === 'ERR_PROXY_CONNECTION_FAILED' && !retry) {
|
||||||
await disableProxy()
|
await disableProxy()
|
||||||
@ -354,11 +369,6 @@ const getUrl = async () => {
|
|||||||
let url = await readLog()
|
let url = await readLog()
|
||||||
if (!url && config.proxyMode) {
|
if (!url && config.proxyMode) {
|
||||||
url = await useProxy()
|
url = await useProxy()
|
||||||
} else if (url) {
|
|
||||||
const result = await tryRequest(url)
|
|
||||||
if (!result && config.proxyMode) {
|
|
||||||
url = await useProxy()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
@ -375,6 +385,9 @@ const fetchData = async (urlOverride) => {
|
|||||||
sendMsg(message)
|
sendMsg(message)
|
||||||
throw new Error(message)
|
throw new Error(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await tryRequest(url)
|
||||||
|
|
||||||
const searchParams = getQuerystring(url)
|
const searchParams = getQuerystring(url)
|
||||||
if (!searchParams) {
|
if (!searchParams) {
|
||||||
const message = text.url.incorrect
|
const message = text.url.incorrect
|
||||||
@ -415,7 +428,7 @@ const fetchData = async (urlOverride) => {
|
|||||||
originTimeZone = region_time_zone
|
originTimeZone = region_time_zone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const data = { result, time: Date.now(), typeMap, uid: originUid, lang, region: originRegion, region_time_zone: originTimeZone }
|
const data = { result, typeMap, time: Date.now(), uid: originUid, lang, region: originRegion, region_time_zone: originTimeZone }
|
||||||
const localData = dataMap.get(originUid)
|
const localData = dataMap.get(originUid)
|
||||||
const mergedResult = mergeData(localData, data)
|
const mergedResult = mergeData(localData, data)
|
||||||
data.result = mergedResult
|
data.result = mergedResult
|
||||||
|
@ -6,13 +6,13 @@ const crypto = require('crypto')
|
|||||||
const unhandled = require('electron-unhandled')
|
const unhandled = require('electron-unhandled')
|
||||||
const windowStateKeeper = require('electron-window-state')
|
const windowStateKeeper = require('electron-window-state')
|
||||||
const debounce = require('lodash/debounce')
|
const debounce = require('lodash/debounce')
|
||||||
const Registry = require('winreg')
|
|
||||||
|
|
||||||
const isDev = !app.isPackaged
|
const isDev = !app.isPackaged
|
||||||
|
|
||||||
const userPath = app.getPath('userData')
|
const userPath = app.getPath('userData')
|
||||||
const appRoot = isDev ? path.resolve(__dirname, '..', '..') : userPath
|
const appRoot = isDev ? path.resolve(__dirname, '..', '..') : path.resolve(app.getAppPath(), '..', '..')
|
||||||
const userDataPath = path.resolve(appRoot, 'userData')
|
const userDataPath = path.resolve(appRoot, 'userData')
|
||||||
|
const globalUserDataPath = path.resolve(userPath, 'userData')
|
||||||
|
|
||||||
let win = null
|
let win = null
|
||||||
const initWindow = () => {
|
const initWindow = () => {
|
||||||
@ -25,6 +25,7 @@ const initWindow = () => {
|
|||||||
y: mainWindowState.y,
|
y: mainWindowState.y,
|
||||||
width: mainWindowState.width,
|
width: mainWindowState.width,
|
||||||
height: mainWindowState.height,
|
height: mainWindowState.height,
|
||||||
|
backgroundColor: '#fff',
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
contextIsolation:false,
|
contextIsolation:false,
|
||||||
nodeIntegration: true
|
nodeIntegration: true
|
||||||
@ -56,7 +57,7 @@ const saveLog = () => {
|
|||||||
const text = item[2]
|
const text = item[2]
|
||||||
return `[${type}][${time}]${text}`
|
return `[${type}][${time}]${text}`
|
||||||
}).join('\r\n')
|
}).join('\r\n')
|
||||||
fs.outputFileSync(path.join(userDataPath, 'log.txt'), text)
|
fs.outputFile(path.join(userDataPath, 'log.txt'), text)
|
||||||
}
|
}
|
||||||
|
|
||||||
const authkeyMask = (text = '') => {
|
const authkeyMask = (text = '') => {
|
||||||
@ -134,7 +135,7 @@ const detectLocale = (value) => {
|
|||||||
const locale = value || app.getLocale()
|
const locale = value || app.getLocale()
|
||||||
let result = 'zh-cn'
|
let result = 'zh-cn'
|
||||||
for (let [key, list] of localeMap) {
|
for (let [key, list] of localeMap) {
|
||||||
if (list.includes(locale)) {
|
if (locale === key || list.includes(locale)) {
|
||||||
result = key
|
result = key
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -144,19 +145,20 @@ const detectLocale = (value) => {
|
|||||||
|
|
||||||
const saveJSON = async (name, data) => {
|
const saveJSON = async (name, data) => {
|
||||||
try {
|
try {
|
||||||
await fs.outputJSON(path.join(userDataPath, name), data, {
|
await fs.outputJSON(path.join(userDataPath, name), data)
|
||||||
spaces: 2
|
if (!isDev) {
|
||||||
})
|
await fs.outputJSON(path.join(globalUserDataPath, name), data)
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
sendMsg(e, 'ERROR')
|
sendMsg(e, 'ERROR')
|
||||||
await sleep(3)
|
await sleep(3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const readJSON = async (name) => {
|
const readJSON = async (dataPath, name) => {
|
||||||
let data = null
|
let data = null
|
||||||
try {
|
try {
|
||||||
data = await fs.readJSON(path.join(userDataPath, name))
|
data = await fs.readJSON(path.join(dataPath, name))
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
@ -203,5 +205,5 @@ const localIp = () => {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
sleep, request, hash, cipherAes, decipherAes, saveLog,
|
sleep, request, hash, cipherAes, decipherAes, saveLog,
|
||||||
sendMsg, readJSON, saveJSON, initWindow, getWin, localIp, userPath, detectLocale, langMap,
|
sendMsg, readJSON, saveJSON, initWindow, getWin, localIp, userPath, detectLocale, langMap,
|
||||||
appRoot, userDataPath
|
appRoot, userDataPath, globalUserDataPath
|
||||||
}
|
}
|
@ -55,10 +55,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog :title="ui.button.solution" v-model="state.showCacheCleanDlg" width="90%" custom-class="max-w-md">
|
<el-dialog :title="ui.button.solution" v-model="state.showCacheCleanDlg" width="90%" custom-class="max-w-md cache-clean-dialog">
|
||||||
<el-button plain icon="folder" type="primary" @click="openCacheFolder">{{ui.button.cacheFolder}}</el-button>
|
<el-button plain icon="folder" type="success" @click="openCacheFolder">{{ui.button.cacheFolder}}</el-button>
|
||||||
<p class="my-4 leading-2 text-gray-600 text-sm whitespace-pre-line">{{ui.extra.cacheClean}}</p>
|
<p class="my-2 flex flex-col text-teal-800 text-[13px]">
|
||||||
<p class="my-2 text-gray-400 text-xs">{{ui.extra.findCacheFolder}}</p>
|
<span class="my-1" v-for="txt of cacheCleanTextList">{{ txt }}</span>
|
||||||
|
</p>
|
||||||
|
<p class="my-2 text-gray-500 text-xs">{{ui.extra.findCacheFolder}}</p>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer text-center">
|
<div class="dialog-footer text-center">
|
||||||
<el-button type="primary" @click="state.showCacheCleanDlg = false" class="focus:outline-none">{{ui.common.ok}}</el-button>
|
<el-button type="primary" @click="state.showCacheCleanDlg = false" class="focus:outline-none">{{ui.common.ok}}</el-button>
|
||||||
@ -77,6 +79,7 @@ import GachaDetail from './components/GachaDetail.vue'
|
|||||||
import Setting from './components/Setting.vue'
|
import Setting from './components/Setting.vue'
|
||||||
import gachaDetail from './gachaDetail'
|
import gachaDetail from './gachaDetail'
|
||||||
import { version } from '../../package.json'
|
import { version } from '../../package.json'
|
||||||
|
import gachaType from '../gachaType.json'
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
status: 'init',
|
status: 'init',
|
||||||
@ -99,6 +102,13 @@ const ui = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const cacheCleanTextList = computed(() => {
|
||||||
|
if (ui.value) {
|
||||||
|
return ui.value.extra?.cacheClean?.split('\n')
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
})
|
||||||
|
|
||||||
const gachaData = computed(() => {
|
const gachaData = computed(() => {
|
||||||
return state.dataMap.get(state.current)
|
return state.dataMap.get(state.current)
|
||||||
})
|
})
|
||||||
@ -149,11 +159,19 @@ const detail = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const typeMap = computed(() => {
|
const typeMap = computed(() => {
|
||||||
const data = state.dataMap.get(state.current)
|
const gachaTypeMap = new Map(gachaType)
|
||||||
return data.typeMap
|
const type = gachaTypeMap.get(state.config.lang)
|
||||||
|
const result = new Map()
|
||||||
|
if (type) {
|
||||||
|
for (let { key, name } of type) {
|
||||||
|
result.set(key, name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
})
|
})
|
||||||
|
|
||||||
const fetchData = async (url) => {
|
const fetchData = async (url) => {
|
||||||
|
state.log = ''
|
||||||
state.status = 'loading'
|
state.status = 'loading'
|
||||||
const data = await ipcRenderer.invoke('FETCH_DATA', url)
|
const data = await ipcRenderer.invoke('FETCH_DATA', url)
|
||||||
if (data) {
|
if (data) {
|
||||||
|
@ -14,3 +14,9 @@
|
|||||||
@apply rounded-full bg-gray-300;
|
@apply rounded-full bg-gray-300;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@layer utilities {
|
||||||
|
.cache-clean-dialog .el-dialog__body {
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
}
|