From 9ab6f6056ce040a31e368a6ba12c37d4472321fc Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Mon, 29 Jan 2024 21:58:59 +0800 Subject: [PATCH] =?UTF-8?q?https://github.com/StarCitizenToolBox/app/issue?= =?UTF-8?q?s/1=20=E6=B1=89=E5=8C=96=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/conf/url_conf.dart | 2 + lib/ui/about/about_ui.dart | 3 +- lib/ui/home/localization/localization_ui.dart | 41 +++++++++++++------ .../localization/localization_ui_model.dart | 11 +++-- 4 files changed, 41 insertions(+), 16 deletions(-) diff --git a/lib/common/conf/url_conf.dart b/lib/common/conf/url_conf.dart index d98bbe9..9326b4f 100644 --- a/lib/common/conf/url_conf.dart +++ b/lib/common/conf/url_conf.dart @@ -22,4 +22,6 @@ class URLConf { static const rssTextUrl1 = "$_rssHomeUrl/bilibili/user/article/40102960"; static const rssTextUrl2 = "$_rssHomeUrl/baidu/tieba/user/%E7%81%AC%E7%81%ACG%E7%81%AC%E7%81%AC&"; + + static const feedbackUrl = "https://txc.qq.com/products/614843"; } diff --git a/lib/ui/about/about_ui.dart b/lib/ui/about/about_ui.dart index 91640b3..0a39016 100644 --- a/lib/ui/about/about_ui.dart +++ b/lib/ui/about/about_ui.dart @@ -1,6 +1,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:starcitizen_doctor/base/ui.dart'; import 'package:starcitizen_doctor/common/conf/app_conf.dart'; +import 'package:starcitizen_doctor/common/conf/url_conf.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'about_ui_model.dart'; @@ -59,7 +60,7 @@ class AboutUI extends BaseUI { ], ), onPressed: () { - launchUrlString("https://txc.qq.com/products/614843"); + launchUrlString(URLConf.feedbackUrl); }, ), const SizedBox(width: 24), diff --git a/lib/ui/home/localization/localization_ui.dart b/lib/ui/home/localization/localization_ui.dart index dfb5d47..83ef1c2 100644 --- a/lib/ui/home/localization/localization_ui.dart +++ b/lib/ui/home/localization/localization_ui.dart @@ -64,18 +64,35 @@ class LocalizationUI extends BaseUI { Text("已安装版本:${model.patchStatus?.value}"), const Spacer(), if (model.patchStatus?.value != "游戏内置") - Button( - onPressed: model.doDelIniFile(), - child: const Padding( - padding: EdgeInsets.all(4), - child: Row( - children: [ - Icon(FluentIcons.delete), - SizedBox(width: 6), - Text("删除"), - ], - ), - )), + Row( + children: [ + Button( + onPressed: model.goFeedback, + child: const Padding( + padding: EdgeInsets.all(4), + child: Row( + children: [ + Icon(FluentIcons.feedback), + SizedBox(width: 6), + Text("汉化反馈"), + ], + ), + )), + const SizedBox(width: 16), + Button( + onPressed: model.doDelIniFile(), + child: const Padding( + padding: EdgeInsets.all(4), + child: Row( + children: [ + Icon(FluentIcons.delete), + SizedBox(width: 6), + Text("卸载汉化"), + ], + ), + )), + ], + ), ], ), AnimatedSize( diff --git a/lib/ui/home/localization/localization_ui_model.dart b/lib/ui/home/localization/localization_ui_model.dart index 9c209dd..0341ac1 100644 --- a/lib/ui/home/localization/localization_ui_model.dart +++ b/lib/ui/home/localization/localization_ui_model.dart @@ -11,6 +11,7 @@ import 'package:starcitizen_doctor/common/conf/app_conf.dart'; import 'package:starcitizen_doctor/common/conf/url_conf.dart'; import 'package:starcitizen_doctor/common/helper/system_helper.dart'; import 'package:starcitizen_doctor/data/sc_localization_data.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class LocalizationUIModel extends BaseUIModel { final String scInstallPath; @@ -273,9 +274,9 @@ class LocalizationUIModel extends BaseUIModel { } VoidCallback? doDelIniFile() { - final iniFile = File( - "${scDataDir.absolute.path}\\Localization\\$selectedLanguage\\global.ini"); return () async { + final iniFile = File( + "${scDataDir.absolute.path}\\Localization\\$selectedLanguage\\global.ini"); if (await iniFile.exists()) await iniFile.delete(); await updateLangCfg(false); await _updateStatus(); @@ -372,7 +373,7 @@ class LocalizationUIModel extends BaseUIModel { for (var element in AppConf.gameChannels) { if (v.key.contains("StarCitizen\\$element")) { return MapEntry(element, true); - }else { + } else { return const MapEntry("", true); } } @@ -380,4 +381,8 @@ class LocalizationUIModel extends BaseUIModel { } return null; } + + void goFeedback() { + launchUrlString(URLConf.feedbackUrl); + } }