增加汉化提示

This commit is contained in:
xkeyC 2023-10-12 20:50:50 +08:00
parent d7c70d7efc
commit 4b2461bd9a
3 changed files with 48 additions and 7 deletions

View File

@ -1,8 +1,9 @@
/// enable : false /// enable : true
/// versionName : "3.21.0(PU)_CN_V0" /// versionName : "3.20.0(PU)_CN_V1"
/// updateAt : "2023-10-5: 10:15:00" /// updateAt : "2023-10-11: 11:10:00"
/// info : "简体中文汉化" /// info : "简体中文汉化"
/// channel : "PTU" /// channel : "PU"
/// node : "已知问题:\n3D中文字体不显示临时解决方法将交互恢复成英文但由于数量繁多难免有遗漏汉化组正在尽力找\n·角色抬头显示器(HUD)的中文字体不显示\n·某些元素字体过小\n·搜索栏无法输入中文\n·部位文本未翻译(在翻了,在翻了!)"
class ScLocalizationData { class ScLocalizationData {
ScLocalizationData({ ScLocalizationData({
@ -10,7 +11,8 @@ class ScLocalizationData {
this.versionName, this.versionName,
this.updateAt, this.updateAt,
this.info, this.info,
this.channel,}); this.channel,
this.node,});
ScLocalizationData.fromJson(dynamic json) { ScLocalizationData.fromJson(dynamic json) {
enable = json['enable']; enable = json['enable'];
@ -18,12 +20,14 @@ class ScLocalizationData {
updateAt = json['updateAt']; updateAt = json['updateAt'];
info = json['info']; info = json['info'];
channel = json['channel']; channel = json['channel'];
node = json['node'];
} }
bool? enable; bool? enable;
String? versionName; String? versionName;
String? updateAt; String? updateAt;
String? info; String? info;
String? channel; String? channel;
String? node;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
@ -32,6 +36,7 @@ class ScLocalizationData {
map['updateAt'] = updateAt; map['updateAt'] = updateAt;
map['info'] = info; map['info'] = info;
map['channel'] = channel; map['channel'] = channel;
map['node'] = node;
return map; return map;
} }

View File

@ -6,6 +6,7 @@ import 'localization_ui_model.dart';
class LocalizationUI extends BaseUI<LocalizationUIModel> { class LocalizationUI extends BaseUI<LocalizationUIModel> {
@override @override
Widget? buildBody(BuildContext context, LocalizationUIModel model) { Widget? buildBody(BuildContext context, LocalizationUIModel model) {
final curInstallInfo = model.apiLocalizationData?[model.patchStatus?.value];
return ContentDialog( return ContentDialog(
title: makeTitle(context, model), title: makeTitle(context, model),
constraints: BoxConstraints( constraints: BoxConstraints(
@ -77,6 +78,42 @@ class LocalizationUI extends BaseUI<LocalizationUIModel> {
)), )),
], ],
), ),
AnimatedSize(
duration: const Duration(milliseconds: 130),
child: (curInstallInfo != null &&
curInstallInfo.node != null &&
curInstallInfo.node!.isNotEmpty)
? Padding(
padding: const EdgeInsets.only(top: 12),
child: Container(
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: FluentTheme.of(context).cardColor,
borderRadius: BorderRadius.circular(7)),
child: Padding(
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"备注:",
style: TextStyle(fontSize: 18),
),
const SizedBox(height: 6),
Text(
"${curInstallInfo.node}",
style: TextStyle(
color: Colors.white.withOpacity(.8)),
)
],
),
),
),
)
: SizedBox(
width: MediaQuery.of(context).size.width,
),
),
], ],
]), ]),
makeListContainer("社区汉化", [ makeListContainer("社区汉化", [
@ -175,7 +212,6 @@ class LocalizationUI extends BaseUI<LocalizationUIModel> {
], ],
), ),
), ),
const SizedBox(height: 12),
], ],
), ),
), ),

View File

@ -24,7 +24,7 @@ class PerformanceUI extends BaseUI<PerformanceUIModel> {
InfoBar( InfoBar(
title: const Text("图形优化提示"), title: const Text("图形优化提示"),
content: const Text( content: const Text(
"该功能对优化显卡瓶颈有很大帮助,但对 CPU 瓶颈可能起效果,如果您显卡性能强劲,可以尝试使用更好的画质来获得更高的显卡利用率。", "该功能对优化显卡瓶颈有很大帮助,但对 CPU 瓶颈可能起效果,如果您显卡性能强劲,可以尝试使用更好的画质来获得更高的显卡利用率。",
), ),
onClose: () => model.closeTip(), onClose: () => model.closeTip(),
), ),