diff --git a/electron/main/index.ts b/electron/main/index.ts index 1ac0ff43..33379edb 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -152,10 +152,12 @@ async function createWindow() { function convertObjectToJson(obj: any) { if (typeof obj !== "object" || obj === null || obj === undefined) return obj; const entries = Object.entries(obj) - .filter(([key, value]) => !key.startsWith("_") && !(value instanceof EnkaClient)) // filter out private properties and EnkaClient instance, which has circular object + // filter out private properties and EnkaClient instance, which has circular object + .filter(([key, value]) => !key.startsWith("_") && !(value instanceof EnkaClient)) .map(([key, value]) => [key, convertObjectToJson(value)]); if (obj instanceof TextAssets) { - entries.push(["text", obj instanceof DynamicTextAssets ? obj.getNullableReplacedText() : obj.getNullable()]); // convert TextAssets to string + // convert TextAssets to string + entries.push(["text", obj instanceof DynamicTextAssets ? obj.getNullableReplacedText() : obj.getNullable()]); } if (obj instanceof Array) { const arr = [] diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index e6559395..e71872c8 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -47,6 +47,8 @@ "mainpage_title": "miHoYo miXeD Launcher", "mainpage_buttonText": "Launch {game}", "genshin_launcherContentsUrl": "https://sdk-os-static.mihoyo.com/hk4e_global/mdk/launcher/api/content?filter_adv=false&key=gcStgarh&language=en-us&launcher_id=10", + "gs_apiChangeTitle": "Welcome to miXeD!", + "gs_apiChangeText": "Due to API change, this update will wipe your Genshin Impact player data, please retrieve again. Apologies for inconvenience!", "gs_enkaLangCode": "en", "gs_emptyPlayerTip": "Player details will be displayed here", "gs_showcaseTip": "Player details unavailable, please enable 'Show Character Details' in game and try again.", diff --git a/src/i18n/fr_FR.json b/src/i18n/fr_FR.json index 7d364ff9..85ccf212 100644 --- a/src/i18n/fr_FR.json +++ b/src/i18n/fr_FR.json @@ -47,6 +47,8 @@ "mainpage_title": "miHoYo miXeD Launcher", "mainpage_buttonText": "Lancer {game}", "genshin_launcherContentsUrl": "https://sdk-os-static.mihoyo.com/hk4e_global/mdk/launcher/api/content?filter_adv=false&key=gcStgarh&language=fr-fr&launcher_id=10", + "gs_apiChangeTitle": "Welcome to miXeD!", + "gs_apiChangeText": "Due to API change, this update will wipe your Genshin Impact player data, please retrieve again. Apologies for inconvenience!", "gs_enkaLangCode": "fr", "gs_emptyPlayerTip": "Les détails du joueur s'afficheront ici", "gs_showcaseTip": "Player details unavailable, please enable 'Show Character Details' in game and try again.", diff --git a/src/i18n/ja_JP.json b/src/i18n/ja_JP.json index ccf66cc1..40a34de9 100644 --- a/src/i18n/ja_JP.json +++ b/src/i18n/ja_JP.json @@ -47,6 +47,8 @@ "mainpage_title": "miHoYo miXeD ランチャー", "mainpage_buttonText": "{game}を起動!", "genshin_launcherContentsUrl": "https://sdk-os-static.mihoyo.com/hk4e_global/mdk/launcher/api/content?filter_adv=false&key=gcStgarh&language=ja-jp&launcher_id=10", + "gs_apiChangeTitle": "Welcome to miXeD!", + "gs_apiChangeText": "Due to API change, this update will wipe your Genshin Impact player data, please retrieve again. Apologies for inconvenience!", "gs_enkaLangCode": "ja", "gs_emptyPlayerTip": "キャラの詳細がここに表示されます", "gs_showcaseTip": "キャラの詳細情報が利用できません。ゲーム内で「キャラクターの詳細を表示」を有効にして、もう一度お試しください。", diff --git a/src/i18n/ru_RU.json b/src/i18n/ru_RU.json index ffdf13ee..e6bc3afd 100644 --- a/src/i18n/ru_RU.json +++ b/src/i18n/ru_RU.json @@ -47,6 +47,8 @@ "mainpage_title": "Запуск miHoYo miXeD", "mainpage_buttonText": "Запустить {game}", "genshin_launcherContentsUrl": "https://sdk-os-static.mihoyo.com/hk4e_global/mdk/launcher/api/content?filter_adv=false&key=gcStgarh&language=ru-ru&launcher_id=10", + "gs_apiChangeTitle": "Welcome to miXeD!", + "gs_apiChangeText": "Due to API change, this update will wipe your Genshin Impact player data, please retrieve again. Apologies for inconvenience!", "gs_enkaLangCode": "ru", "gs_emptyPlayerTip": "Информация о игроке будет отображена здесь", "gs_showcaseTip": "Информация о игроке недоступна. Включите 'Отображение деталей персонажей' в игре и попробуйте снова.", diff --git a/src/i18n/zh_CN.json b/src/i18n/zh_CN.json index a24c4970..6e54af9d 100644 --- a/src/i18n/zh_CN.json +++ b/src/i18n/zh_CN.json @@ -47,6 +47,8 @@ "mainpage_title": "米哈游聚合启动器", "mainpage_buttonText": "{game}启动", "genshin_launcherContentsUrl": "https://sdk-static.mihoyo.com/hk4e_cn/mdk/launcher/api/content?filter_adv=false&key=eYd89JmJ&language=zh-cn&launcher_id=18", + "gs_apiChangeTitle": "欢迎使用miXeD!", + "gs_apiChangeText": "由于API变更,此次更新将清除您的原神账号信息,请您重新获取。为您带来不便敬请谅解!", "gs_enkaLangCode": "chs", "gs_emptyPlayerTip": "此处将显示角色的详细信息", "gs_showcaseTip": "当前暂无详细信息,请在游戏内打开“显示角色详情”后再试。", diff --git a/src/i18n/zh_TW.json b/src/i18n/zh_TW.json index 5abf2f0c..26c283d0 100644 --- a/src/i18n/zh_TW.json +++ b/src/i18n/zh_TW.json @@ -47,6 +47,8 @@ "mainpage_title": "米哈游聚合啓動器", "mainpage_buttonText": "{game}啓動", "genshin_launcherContentsUrl": "https://sdk-os-static.mihoyo.com/hk4e_global/mdk/launcher/api/content?filter_adv=false&key=gcStgarh&language=zh-tw&launcher_id=10", + "gs_apiChangeTitle": "歡迎使用miXeD!", + "gs_apiChangeText": "由於API變更,此次更新將清除您的原神賬戶信息,請您重新獲取。爲您帶來不便敬請諒解!", "gs_enkaLangCode": "zh-TW", "gs_emptyPlayerTip": "此處將顯示角色的詳細信息", "gs_showcaseTip": "當前暫無詳細信息,請在游戲内打開”顯示角色詳情“后再試。", diff --git a/src/pages/MainPage.vue b/src/pages/MainPage.vue index a50cb152..0b39385e 100644 --- a/src/pages/MainPage.vue +++ b/src/pages/MainPage.vue @@ -34,20 +34,14 @@ onMounted(async () => { window.store.get('newApi').then((resp: boolean) => { if (!resp) { useDialog(dialogComponent(dialogStyle.value), {}, { - title: '欢迎使用miXeD!', - msg: '由于API变更,此次更新将清除您的原神账号信息,请您重新获取。为您带来不便敬请谅解!', + title: translate('gs_apiChangeTitle'), + msg: translate('gs_apiChangeText'), showCancel: false }) window.store.delete('genshinInfo') window.store.set('newApi', true, false) } }) - - // window.enka.getGenshinPlayer('193320369', 'chs').then((resp: any) => { - // console.log(resp) - // }).catch((err) => { - // console.error(err) - // }) }) const genshin = async () => {