ui optimization

This commit is contained in:
xkeyC 2024-09-23 21:03:45 +08:00
parent 6a6360540b
commit 8c6c980bb8
10 changed files with 68 additions and 50 deletions

View File

@ -719,8 +719,8 @@ class MessageLookup extends MessageLookupByLibrary {
"localization_info_remove_incompatible_translation_params": "localization_info_remove_incompatible_translation_params":
MessageLookupByLibrary.simpleMessage( MessageLookupByLibrary.simpleMessage(
"Whether to remove incompatible Localization parameters"), "Whether to remove incompatible Localization parameters"),
"localization_info_translation_status": "localization_info_translation":
MessageLookupByLibrary.simpleMessage("Localization status"), MessageLookupByLibrary.simpleMessage("Game localization"),
"localization_info_unavailable": "localization_info_unavailable":
MessageLookupByLibrary.simpleMessage("Unavailable"), MessageLookupByLibrary.simpleMessage("Unavailable"),
"localization_info_update_time": m40, "localization_info_update_time": m40,

View File

@ -646,8 +646,8 @@ class MessageLookup extends MessageLookupByLibrary {
"localization_info_note": MessageLookupByLibrary.simpleMessage("备注:"), "localization_info_note": MessageLookupByLibrary.simpleMessage("备注:"),
"localization_info_remove_incompatible_translation_params": "localization_info_remove_incompatible_translation_params":
MessageLookupByLibrary.simpleMessage("是否移除不兼容的汉化参数"), MessageLookupByLibrary.simpleMessage("是否移除不兼容的汉化参数"),
"localization_info_translation_status": "localization_info_translation":
MessageLookupByLibrary.simpleMessage("汉化状态"), MessageLookupByLibrary.simpleMessage("游戏汉化"),
"localization_info_unavailable": "localization_info_unavailable":
MessageLookupByLibrary.simpleMessage("不可用"), MessageLookupByLibrary.simpleMessage("不可用"),
"localization_info_update_time": m40, "localization_info_update_time": m40,

View File

@ -649,8 +649,8 @@ class MessageLookup extends MessageLookupByLibrary {
"localization_info_note": MessageLookupByLibrary.simpleMessage("備註:"), "localization_info_note": MessageLookupByLibrary.simpleMessage("備註:"),
"localization_info_remove_incompatible_translation_params": "localization_info_remove_incompatible_translation_params":
MessageLookupByLibrary.simpleMessage("是否移除不相容的翻譯參數"), MessageLookupByLibrary.simpleMessage("是否移除不相容的翻譯參數"),
"localization_info_translation_status": "localization_info_translation":
MessageLookupByLibrary.simpleMessage("翻譯狀態"), MessageLookupByLibrary.simpleMessage("遊戲翻譯"),
"localization_info_unavailable": "localization_info_unavailable":
MessageLookupByLibrary.simpleMessage("無法使用"), MessageLookupByLibrary.simpleMessage("無法使用"),
"localization_info_update_time": m40, "localization_info_update_time": m40,

View File

@ -1661,11 +1661,11 @@ class S {
); );
} }
/// `Localization status` /// `Game localization`
String get localization_info_translation_status { String get localization_info_translation {
return Intl.message( return Intl.message(
'Localization status', 'Game localization',
name: 'localization_info_translation_status', name: 'localization_info_translation',
desc: '', desc: '',
args: [], args: [],
); );

View File

@ -323,8 +323,8 @@
"@home_action_info_warning": {}, "@home_action_info_warning": {},
"localization_info_machine_translation_warning": "You are using the game built -in text. The official text is currently a machine translation (as of 3.21.0), and it is recommended that you install community Localization below.", "localization_info_machine_translation_warning": "You are using the game built -in text. The official text is currently a machine translation (as of 3.21.0), and it is recommended that you install community Localization below.",
"@localization_info_machine_translation_warning": {}, "@localization_info_machine_translation_warning": {},
"localization_info_translation_status": "Localization status", "localization_info_translation": "Game localization",
"@localization_info_translation_status": {}, "@localization_info_translation": {},
"localization_info_enabled": "Enable ({v0}):", "localization_info_enabled": "Enable ({v0}):",
"@localization_info_enabled": {}, "@localization_info_enabled": {},
"localization_info_installed_version": "The installed version: {v0}", "localization_info_installed_version": "The installed version: {v0}",

View File

@ -322,8 +322,8 @@
"@home_action_info_warning": {}, "@home_action_info_warning": {},
"localization_info_machine_translation_warning": "您正在使用游戏内置文本官方文本目前为机器翻译截至3.21.0),建议您在下方安装社区汉化。", "localization_info_machine_translation_warning": "您正在使用游戏内置文本官方文本目前为机器翻译截至3.21.0),建议您在下方安装社区汉化。",
"@localization_info_machine_translation_warning": {}, "@localization_info_machine_translation_warning": {},
"localization_info_translation_status": "汉化状态", "localization_info_translation": "游戏汉化",
"@localization_info_translation_status": {}, "@localization_info_translation": {},
"localization_info_enabled": "启用({v0}", "localization_info_enabled": "启用({v0}",
"@localization_info_enabled": {}, "@localization_info_enabled": {},
"localization_info_installed_version": "已安装版本:{v0}", "localization_info_installed_version": "已安装版本:{v0}",

View File

@ -322,8 +322,8 @@
"@home_action_info_warning": {}, "@home_action_info_warning": {},
"localization_info_machine_translation_warning": "您目前正在使用遊戲內建翻譯文件,官方內建文件截止至 3.21.0 都是機器翻譯,建議安裝下方提供的社群翻譯或是來自其他來源的社群翻譯文件。", "localization_info_machine_translation_warning": "您目前正在使用遊戲內建翻譯文件,官方內建文件截止至 3.21.0 都是機器翻譯,建議安裝下方提供的社群翻譯或是來自其他來源的社群翻譯文件。",
"@localization_info_machine_translation_warning": {}, "@localization_info_machine_translation_warning": {},
"localization_info_translation_status": "翻譯狀態", "localization_info_translation": "遊戲翻譯",
"@localization_info_translation_status": {}, "@localization_info_translation": {},
"localization_info_enabled": "啟用({v0}", "localization_info_enabled": "啟用({v0}",
"@localization_info_enabled": {}, "@localization_info_enabled": {},
"localization_info_installed_version": "已安裝:{v0}", "localization_info_installed_version": "已安裝:{v0}",

View File

@ -7,7 +7,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:starcitizen_doctor/api/analytics.dart'; import 'package:starcitizen_doctor/api/analytics.dart';
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
import 'package:starcitizen_doctor/ui/tools/tools_ui_model.dart'; import 'package:starcitizen_doctor/ui/tools/tools_ui_model.dart';
import 'package:starcitizen_doctor/widgets/widgets.dart'; import 'package:starcitizen_doctor/widgets/widgets.dart';
import 'package:url_launcher/url_launcher_string.dart'; import 'package:url_launcher/url_launcher_string.dart';
@ -168,15 +167,6 @@ class HomeUI extends HookConsumerWidget {
), ),
)), )),
const SizedBox(width: 12), const SizedBox(width: 12),
Button(
onPressed: () =>
SystemHelper.openDir("${homeState.scInstalledPath}"),
child: const Padding(
padding: EdgeInsets.all(6),
child: Icon(FluentIcons.folder_open),
),
),
const SizedBox(width: 12),
Button( Button(
onPressed: model.reScanPath, onPressed: model.reScanPath,
child: const Padding( child: const Padding(

View File

@ -77,8 +77,9 @@ class LocalizationDialogUI extends HookConsumerWidget {
}), }),
), ),
), ),
makeToolsListContainer(context, model, state),
makeListContainer( makeListContainer(
S.current.localization_info_translation_status, S.current.localization_info_translation,
[ [
if (state.patchStatus == null) if (state.patchStatus == null)
makeLoading(context) makeLoading(context)
@ -140,30 +141,41 @@ class LocalizationDialogUI extends HookConsumerWidget {
), ),
], ],
), ),
], const SizedBox(height: 12),
], Container(
context), color: Colors.white.withOpacity(.1),
makeListContainer( height: 1,
S.current.localization_info_community_translation, ),
[ const SizedBox(height: 12),
if (state.apiLocalizationData == null) if (state.apiLocalizationData == null)
makeLoading(context) makeLoading(context)
else if (state.apiLocalizationData!.isEmpty) else if (state.apiLocalizationData!.isEmpty)
Center( Center(
child: Text( child: Text(
S.current.localization_info_no_translation_available, S.current
.localization_info_no_translation_available,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13,
color: Colors.white.withOpacity(.8)), color: Colors.white.withOpacity(.8)),
), ),
) )
else else
for (final item in state.apiLocalizationData!.entries) AlignedGridView.count(
makeRemoteList(context, model, item, state), crossAxisCount: 2,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
itemBuilder: (BuildContext context, int index) {
final item = state.apiLocalizationData!.entries
.elementAt(index);
return makeRemoteList(context, model, item, state);
},
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: state.apiLocalizationData?.length ?? 0,
)
], ],
context, ],
gridViewMode: true), context),
makeToolsListContainer(context, model, state),
], ],
), ),
), ),

View File

@ -220,7 +220,14 @@ class ToolsUI extends HookConsumerWidget {
padding: EdgeInsets.all(6), padding: EdgeInsets.all(6),
child: Icon(FluentIcons.folder_open), child: Icon(FluentIcons.folder_open),
), ),
onPressed: () => model.openDir(state.scInstalledPath)) onPressed: () {
if (state.scInstalledPath.trim().isEmpty) {
showToast(context,
S.current.tools_action_info_star_citizen_not_found);
return;
}
model.openDir(state.scInstalledPath);
})
], ],
); );
} }
@ -258,7 +265,16 @@ class ToolsUI extends HookConsumerWidget {
padding: EdgeInsets.all(6), padding: EdgeInsets.all(6),
child: Icon(FluentIcons.folder_open), child: Icon(FluentIcons.folder_open),
), ),
onPressed: () => model.openDir(state.rsiLauncherInstalledPath)) onPressed: () {
if (state.scInstalledPath.trim().isEmpty) {
showToast(
context,
S.current
.tools_rsi_launcher_enhance_msg_error_launcher_notfound);
return;
}
model.openDir(state.rsiLauncherInstalledPath);
})
], ],
); );
} }