返回提交历史
Modified
SpaceEngineersBlueprintEditor/App.xaml.cs
+2
-2
Modified
SpaceEngineersBlueprintEditor/Strings/en-us/Resources.resw
+127
-7
Modified
SpaceEngineersBlueprintEditor/ViewModels/BlueprintDetailPageViewModel.cs
+33
-34
Modified
SpaceEngineersBlueprintEditor/ViewModels/SettingPageViewModel.cs
+1
-1
Modified
SpaceEngineersBlueprintEditor/Views/AppShellPage.xaml.cs
+2
-2
SpaceEngineersModDev/SpaceEngineersBlueprintEditorInWinUI
完善蓝图细节页面的en本地化
b1dad4d
代码差异
5 个文件
+165
-46
@@ -33,7 +33,7 @@ public partial class App : Application
33
33
}
34
34
catch (Exception ex)
35
35
{
36
GlobalServiceManager.GetService<IMessageService>()?.ShowMessage($"加载定义时发生错误:{ex.Message}", "未能加载定义", InfoBarSeverity.Error);
36
GlobalServiceManager.GetService<IMessageService>()?.ShowMessage($"{"Error_LoadingDefinitions".GetLocalized()}: {ex.Message}", "Error_LoadingDefinitions_Title".GetLocalized(), InfoBarSeverity.Error);
37
37
}
38
38
});
39
39
UnhandledException += App_UnhandledException;
@@ -43,7 +43,7 @@ public partial class App : Application
43
43
{
44
44
if (GlobalServiceManager.GetService<IMessageService>() is IMessageService messageService)
45
45
{
46
messageService.ShowMessage(e.Message, "错误", InfoBarSeverity.Error);
46
messageService.ShowMessage(e.Message, "Error".GetLocalized(), InfoBarSeverity.Error);
47
47
e.Handled = true;
48
48
}
49
49
}
@@ -149,8 +149,64 @@
149
149
<value>SpaceEngineersBlueprintEditor</value>
150
150
<comment>太空工程师蓝图修改器</comment>
151
151
</data>
152
<data name="GameDefinitionsLoading" xml:space="preserve">
153
<value>Loading game definitions...</value>
154
<comment>游戏定义集加载中...</comment>
155
</data>
156
<data name="GameDefinitionsLoadingComplete" xml:space="preserve">
157
<value>Game definitions load complete</value>
158
<comment>游戏定义集加载完成</comment>
159
</data>
160
<data name="LoadingBlueprint" xml:space="preserve">
161
<value>Loading blueprint</value>
162
<comment>加载蓝图中</comment>
163
</data>
164
<data name="CalculatingBlueprint" xml:space="preserve">
165
<value>Calculating blueprint</value>
166
<comment>计算蓝图中</comment>
167
</data>
168
<data name="BlueprintLoadComplete" xml:space="preserve">
169
<value>Blueprint load complete</value>
170
<comment>蓝图加载完成</comment>
171
</data>
172
<data name="Error_LoadingDefinitions" xml:space="preserve">
173
<value>An error occurred while loading the definitions</value>
174
<comment>加载定义时发生错误</comment>
175
</data>
176
<data name="Error_LoadingDefinitions_Title" xml:space="preserve">
177
<value>Can't load definitions</value>
178
<comment>未能加载定义</comment>
179
</data>
180
<data name="Error_CantLoadingBlueprint" xml:space="preserve">
181
<value>Can't load definitions</value>
182
<comment>未能加载蓝图</comment>
183
</data>
184
<data name="Warning_BlueprintContainsNoFile" xml:space="preserve">
185
<value>Blueprint doesn't have any file (bp.sbc)</value>
186
<comment>该蓝图不包含蓝图文件(bp.sbc)</comment>
187
</data>
188
<data name="Complete" xml:space="preserve">
189
<value>Complete</value>
190
<comment>完成</comment>
191
</data>
192
<data name="Warning" xml:space="preserve">
193
<value>Warning</value>
194
<comment>警告</comment>
195
</data>
196
<data name="Error" xml:space="preserve">
197
<value>Error</value>
198
<comment>错误</comment>
199
</data>
200
<data name="Loading" xml:space="preserve">
201
<value>Loading</value>
202
<comment>正在加载</comment>
203
</data>
204
<data name="None" xml:space="preserve">
205
<value>None</value>
206
<comment>无</comment>
207
</data>
152
208
<data name="DragFileToEditorText" xml:space="preserve">
153
<value>Drag Blueprint Here</value>
209
<value>Drag blueprint here</value>
154
210
<comment>拖动蓝图文件至此处</comment>
155
211
</data>
156
212
<data name="SettingPage_AppInfo_Author.Header" xml:space="preserve">
@@ -158,7 +214,7 @@
158
214
<comment>作者</comment>
159
215
</data>
160
216
<data name="SettingPage_AppInfo_Contact.Header" xml:space="preserve">
161
<value>Contact Us</value>
217
<value>Contact us</value>
162
218
<comment>联系我们</comment>
163
219
</data>
164
220
<data name="SettingPage_AppInfo_Expander.Description" xml:space="preserve">
@@ -166,11 +222,11 @@
166
222
<comment>版权所有 © 2024 XFEstudio. All rights reserved.</comment>
167
223
</data>
168
224
<data name="SettingPage_AppInfo_Expander.Header" xml:space="preserve">
169
<value>SpaceEngineers Blueprint Editor</value>
225
<value>SpaceEngineers blueprint editor</value>
170
226
<comment>太空工程师蓝图修改器</comment>
171
227
</data>
172
228
<data name="SettingPage_AppInfo_GithubProject.Header" xml:space="preserve">
173
<value>Github Repo</value>
229
<value>Github repo</value>
174
230
<comment>Github仓库</comment>
175
231
</data>
176
232
<data name="SettingPage_AppInfo_Contact_Bilibili.Content" xml:space="preserve">
@@ -182,7 +238,7 @@
182
238
<comment>Github</comment>
183
239
</data>
184
240
<data name="SettingPage_AppInfo_Contact_QQ.Content" xml:space="preserve">
185
<value>SpaceEnginners Group</value>
241
<value>SpaceEnginners group</value>
186
242
<comment>太空工程师交流群</comment>
187
243
</data>
188
244
<data name="SettingPage_AppInfo_Contact_Twitter.Content" xml:space="preserve">
@@ -194,7 +250,7 @@
194
250
<comment>油管</comment>
195
251
</data>
196
252
<data name="AppShell_AppTitle.Text" xml:space="preserve">
197
<value>SpaceEngineers Blueprint Editor</value>
253
<value>SpaceEngineers blueprint editor</value>
198
254
<comment>太空工程师蓝图修改器</comment>
199
255
</data>
200
256
<data name="SettingPage_AppTheme.Header" xml:space="preserve">
@@ -322,9 +378,73 @@
322
378
<comment>在编辑器中打开</comment>
323
379
</data>
324
380
<data name="BlueprintDetailPage_BlueprintBaseInfo.Text" xml:space="preserve">
325
<value>Blueprint's base info</value>
381
<value>Blueprint base info</value>
326
382
<comment>蓝图基本信息</comment>
327
383
</data>
384
<data name="BlueprintDetailPage_BlueprintAuthor" xml:space="preserve">
385
<value>Author</value>
386
<comment>蓝图作者</comment>
387
</data>
388
<data name="BlueprintDetailPage_BlueprintSize" xml:space="preserve">
389
<value>File size</value>
390
<comment>蓝图大小</comment>
391
</data>
392
<data name="BlueprintDetailPage_BlueprintPath" xml:space="preserve">
393
<value>Blueprint path</value>
394
<comment>蓝图路径</comment>
395
</data>
396
<data name="BlueprintDetailPage_BlueprintDestructible" xml:space="preserve">
397
<value>Desturctible</value>
398
<comment>可被破坏</comment>
399
</data>
400
<data name="BlueprintDetailPage_BlueprintEditable" xml:space="preserve">
401
<value>Editable in game</value>
402
<comment>可在游戏内编辑</comment>
403
</data>
404
<data name="BlueprintDetailPage_BlueprintTotalGrids" xml:space="preserve">
405
<value>Total cube grids</value>
406
<comment>网格总数</comment>
407
</data>
408
<data name="BlueprintDetailPage_BlueprintTotalCubes" xml:space="preserve">
409
<value>Total cube blocks</value>
410
<comment>方块总数</comment>
411
</data>
412
<data name="BlueprintDetailPage_PartiallyDestructible" xml:space="preserve">
413
<value>Partially destructible</value>
414
<comment>部分可破坏</comment>
415
</data>
416
<data name="BlueprintDetailPage_OverallIndestructible" xml:space="preserve">
417
<value>Overall indestructible</value>
418
<comment>整体不可破坏</comment>
419
</data>
420
<data name="BlueprintDetailPage_Destructible" xml:space="preserve">
421
<value>Destructible</value>
422
<comment>可破坏</comment>
423
</data>
424
<data name="BlueprintDetailPage_PartiallyEditable" xml:space="preserve">
425
<value>Partially editable</value>
426
<comment>部分可编辑</comment>
427
</data>
428
<data name="BlueprintDetailPage_OverallNonEditable" xml:space="preserve">
429
<value>Overall non-editable</value>
430
<comment>整体不可编辑</comment>
431
</data>
432
<data name="BlueprintDetailPage_Editable" xml:space="preserve">
433
<value>Editable</value>
434
<comment>可编辑</comment>
435
</data>
436
<data name="BlueprintDetailPage_GridName" xml:space="preserve">
437
<value>Grid name</value>
438
<comment>网格名称</comment>
439
</data>
440
<data name="BlueprintDetailPage_CubeCount" xml:space="preserve">
441
<value>Cube counts</value>
442
<comment>方块数量</comment>
443
</data>
444
<data name="BlueprintDetailPage_CantFindGrid" xml:space="preserve">
445
<value>Can't find any grid</value>
446
<comment>未找到网格</comment>
447
</data>
328
448
<data name="BlueprintEditSubPage_File.Title" xml:space="preserve">
329
449
<value>File</value>
330
450
<comment>文件</comment>
@@ -9,8 +9,6 @@ using SpaceEngineersBlueprintEditor.Model;
9
9
using SpaceEngineersBlueprintEditor.Utilities;
10
10
using SpaceEngineersBlueprintEditor.Views;
11
11
using System.Collections.ObjectModel;
12
using System.Diagnostics.CodeAnalysis;
13
using System.Reflection.Metadata;
14
12
using VRage.Game;
15
13
16
14
namespace SpaceEngineersBlueprintEditor.ViewModels;
@@ -18,19 +16,19 @@ namespace SpaceEngineersBlueprintEditor.ViewModels;
18
16
public partial class BlueprintDetailPageViewModel : ViewModelBase
19
17
{
20
18
[ObservableProperty]
21
private string authorName = "蓝图作者:加载中...";
19
private string authorName = $"{"BlueprintDetailPage_BlueprintAuthor".GetLocalized()}: {"Loading".GetLocalized()}...";
22
20
[ObservableProperty]
23
private string blueprintFileSize = "蓝图大小:加载中...";
21
private string blueprintFileSize = $"{"BlueprintDetailPage_BlueprintSize".GetLocalized()}: {"Loading".GetLocalized()}...";
24
22
[ObservableProperty]
25
private string blueprintPath = "蓝图路径:加载中...";
23
private string blueprintPath = $"{"BlueprintDetailPage_BlueprintPath".GetLocalized()}: {"Loading".GetLocalized()}...";
26
24
[ObservableProperty]
27
private string isBlueprintDestructible = "是否可被破坏:加载中...";
25
private string isBlueprintDestructible = $"{"BlueprintDetailPage_BlueprintDestructible".GetLocalized()}: {"Loading".GetLocalized()}...";
28
26
[ObservableProperty]
29
private string isBlueprintEditable = "是否可在游戏内编辑:加载中...";
27
private string isBlueprintEditable = $"{"BlueprintDetailPage_BlueprintEditable".GetLocalized()}: {"Loading".GetLocalized()}...";
30
28
[ObservableProperty]
31
private string totalGridNumber = "网格总数:加载中...";
29
private string totalGridNumber = $"{"BlueprintDetailPage_BlueprintTotalGrids".GetLocalized()}: {"Loading".GetLocalized()}...";
32
30
[ObservableProperty]
33
private string totalCubeNumber = "方块总数:加载中...";
31
private string totalCubeNumber = $"{"BlueprintDetailPage_BlueprintTotalCubes".GetLocalized()}: {"Loading".GetLocalized()}...";
34
32
private BlueprintInfoViewData? currentBlueprintInfoViewData;
35
33
private MyObjectBuilder_Definitions? currentDefinitions;
36
34
private MyObjectBuilder_ShipBlueprintDefinition? currentBlueprint;
@@ -50,53 +48,54 @@ public partial class BlueprintDetailPageViewModel : ViewModelBase
50
48
if (e is null) return;
51
49
if (navigationViewService is not null) navigationViewService.Header = e.Name;
52
50
BackgroundImageService?.SetBackgroundImage(e.BlueprintImage);
53
AuthorName = "蓝图作者:加载中...";
54
BlueprintFileSize = "蓝图大小:加载中...";
55
BlueprintPath = "蓝图路径:加载中...";
56
IsBlueprintDestructible = "是否可被破坏:加载中...";
57
IsBlueprintEditable = "是否可在游戏内编辑:加载中...";
58
TotalGridNumber = "网格总数:加载中...";
59
TotalCubeNumber = "方块总数:加载中...";
51
AuthorName = $"{"BlueprintDetailPage_BlueprintAuthor".GetLocalized()}: {"Loading".GetLocalized()}...";
52
BlueprintFileSize = $"{"BlueprintDetailPage_BlueprintSize".GetLocalized()}: {"Loading".GetLocalized()}...";
53
BlueprintPath = $"{"BlueprintDetailPage_BlueprintPath".GetLocalized()}: {"Loading".GetLocalized()}...";
54
IsBlueprintDestructible = $"{"BlueprintDetailPage_BlueprintDestructible".GetLocalized()}: {"Loading".GetLocalized()}...";
55
IsBlueprintEditable = $"{"BlueprintDetailPage_BlueprintEditable".GetLocalized()}: {"Loading".GetLocalized()}...";
56
TotalGridNumber = $"{"BlueprintDetailPage_BlueprintTotalGrids".GetLocalized()}: {"Loading".GetLocalized()}...";
57
TotalCubeNumber = $"{"BlueprintDetailPage_BlueprintTotalCubes".GetLocalized()}: {"Loading".GetLocalized()}...";
60
58
DLCList.Clear();
61
59
CubeGridList.Clear();
62
60
ComponentList.Clear();
63
61
if (!NavigationParameterService.SameAsLast)
64
62
{
65
63
IsLoadingInProgress = true;
66
loadingService?.StartLoading<BlueprintDetailPage>("Loading blueprint...");
64
loadingService?.StartLoading<BlueprintDetailPage>($"{"LoadingBlueprint".GetLocalized()}...");
67
65
currentBlueprintInfoViewData = e;
68
66
await Helper.Wait(() => SpaceEngineersHelper.IsLoadComplete);
69
67
currentDefinitions = await SpaceEngineersHelper.LoadBlueprintAsync(currentBlueprintInfoViewData.FilePath);
70
68
if (currentDefinitions is not null && currentDefinitions.ShipBlueprints is not null && currentDefinitions.ShipBlueprints.Length > 0)
71
69
currentBlueprint = currentDefinitions.ShipBlueprints[0];
72
messageService?.ShowMessage("蓝图加载完成", "完成", InfoBarSeverity.Success);
70
messageService?.ShowMessage("BlueprintLoadComplete".GetLocalized(), "Complete".GetLocalized(), InfoBarSeverity.Success);
73
71
loadingService?.StopLoading<BlueprintDetailPage>();
74
72
IsLoadingInProgress = false;
73
IsLoadingInProgress = false;
75
74
}
76
75
await Helper.Wait(() => !IsLoadingInProgress);
77
loadingService?.StartLoading<BlueprintDetailPage>("Calculating blueprint...");
76
loadingService?.StartLoading<BlueprintDetailPage>($"{"CalculatingBlueprint".GetLocalized()}...");
78
77
if (e.NoBlueprint)
79
78
{
80
messageService?.ShowMessage("该蓝图不包含蓝图文件(bp.sbc)", "警告", InfoBarSeverity.Warning);
81
BlueprintFileSize = $"蓝图大小:{currentBlueprintInfoViewData!.FileSize}";
82
BlueprintPath = $"蓝图路径:{currentBlueprintInfoViewData!.FilePath}";
79
messageService?.ShowMessage("Warning_BlueprintContainsNoFile".GetLocalized(), "Warning".GetLocalized(), InfoBarSeverity.Warning);
80
BlueprintFileSize = $"{"BlueprintDetailPage_BlueprintSize".GetLocalized()}: {currentBlueprintInfoViewData!.FileSize}";
81
BlueprintPath = $"{"BlueprintDetailPage_BlueprintPath".GetLocalized()}: {currentBlueprintInfoViewData!.FilePath}";
83
82
loadingService?.StopLoading<BlueprintDetailPage>();
84
83
return;
85
84
}
86
85
if (currentBlueprint is not null)
87
86
{
88
AuthorName = $"蓝图作者:{currentBlueprint.DisplayName}(Steam ID: {currentBlueprint.OwnerSteamId})";
89
BlueprintFileSize = $"蓝图大小:{currentBlueprintInfoViewData!.FileSize}";
90
BlueprintPath = $"蓝图路径:{currentBlueprintInfoViewData!.FilePath}";
91
IsBlueprintDestructible = $"是否可被破坏:{(currentBlueprint.CubeGrids.Any(grid => !grid.DestructibleBlocks) ? currentBlueprint.CubeGrids.Any(grid => grid.DestructibleBlocks) ? "部分可被破坏" : "整体不可破坏" : "可被破坏")}";
92
IsBlueprintEditable = $"是否可在游戏内编辑:{(currentBlueprint.CubeGrids.Any(grid => !grid.Editable) ? currentBlueprint.CubeGrids.Any(grid => grid.Editable) ? "部分可编辑" : "整体不可编辑" : "可编辑")}";
87
AuthorName = $"{"BlueprintDetailPage_BlueprintAuthor".GetLocalized()}: {currentBlueprint.DisplayName}(Steam ID: {currentBlueprint.OwnerSteamId})";
88
BlueprintFileSize = $"{"BlueprintDetailPage_BlueprintSize".GetLocalized()}: {currentBlueprintInfoViewData!.FileSize}";
89
BlueprintPath = $"{"BlueprintDetailPage_BlueprintPath".GetLocalized()}: {currentBlueprintInfoViewData!.FilePath}";
90
IsBlueprintDestructible = $"{"BlueprintDetailPage_BlueprintDestructible".GetLocalized()}: {(currentBlueprint.CubeGrids.Any(grid => !grid.DestructibleBlocks) ? currentBlueprint.CubeGrids.Any(grid => grid.DestructibleBlocks) ? "BlueprintDetailPage_PartiallyDestructible".GetLocalized() : "BlueprintDetailPage_OverallIndestructible".GetLocalized() : "BlueprintDetailPage_Destructible".GetLocalized())}";
91
IsBlueprintEditable = $"{"BlueprintDetailPage_BlueprintEditable".GetLocalized()}: {(currentBlueprint.CubeGrids.Any(grid => !grid.Editable) ? currentBlueprint.CubeGrids.Any(grid => grid.Editable) ? "BlueprintDetailPage_PartiallyEditable".GetLocalized() : "BlueprintDetailPage_OverallNonEditable".GetLocalized() : "BlueprintDetailPage_Editable".GetLocalized())}";
93
92
CalculateDLC();
94
93
CalculateCubeGrids();
95
94
CalculateComponent();
96
95
}
97
96
else
98
97
{
99
messageService?.ShowMessage("未能加载蓝图", "错误", InfoBarSeverity.Error);
98
messageService?.ShowMessage("Error_CantLoadingBlueprint".GetLocalized(), "Error".GetLocalized(), InfoBarSeverity.Error);
100
99
}
101
100
loadingService?.StopLoading<BlueprintDetailPage>();
102
101
}
@@ -112,18 +111,18 @@ public partial class BlueprintDetailPageViewModel : ViewModelBase
112
111
if (grid is not null)
113
112
{
114
113
totalCubeCount += grid.CubeBlocks.Count;
115
CubeGridList.Add(new($"网格名称:{grid.DisplayName}", $"方块数量:{grid.CubeBlocks.Count}"));
114
CubeGridList.Add(new($"{"BlueprintDetailPage_GridName".GetLocalized()}: {grid.DisplayName}", $"{"BlueprintDetailPage_CubeCount".GetLocalized()}: {grid.CubeBlocks.Count}"));
116
115
}
117
TotalCubeNumber = $"方块总数:{totalCubeCount}";
118
TotalGridNumber = $"网格总数:{currentBlueprint.CubeGrids.Length}";
116
TotalCubeNumber = $"{"BlueprintDetailPage_BlueprintTotalCubes".GetLocalized()}: {totalCubeCount}";
117
TotalGridNumber = $"{"BlueprintDetailPage_BlueprintTotalGrids".GetLocalized()}: {currentBlueprint.CubeGrids.Length}";
119
118
}
120
119
else if (currentBlueprint.CubeGrid is not null)
121
120
{
122
CubeGridList.Add(new($"网格名称:{currentBlueprint.CubeGrid.DisplayName}", $"方块数量:{currentBlueprint.CubeGrid.CubeBlocks.Count}"));
121
CubeGridList.Add(new($"{"BlueprintDetailPage_GridName".GetLocalized()}: {currentBlueprint.CubeGrid.DisplayName}", $"{"BlueprintDetailPage_CubeCount".GetLocalized()}: {currentBlueprint.CubeGrid.CubeBlocks.Count}"));
123
122
}
124
123
else
125
124
{
126
CubeGridList.Add(new("未找到网格", "方块数量:无"));
125
CubeGridList.Add(new("BlueprintDetailPage_CantFindGrid".GetLocalized(), $"{"BlueprintDetailPage_CubeCount".GetLocalized()}: {"None".GetLocalized()}"));
127
126
}
128
127
}
129
128
}
@@ -173,7 +172,7 @@ public partial class BlueprintDetailPageViewModel : ViewModelBase
173
172
}
174
173
else
175
174
{
176
DLCList.Add("无DLC");
175
DLCList.Add("None".GetLocalized());
177
176
}
178
177
}
179
178
@@ -30,7 +30,7 @@ public partial class SettingPageViewModel : ViewModelBase
30
30
AppCachePath = AppPath.AppCache;
31
31
if (System.Reflection.Assembly.GetEntryAssembly()?.GetName().Version is Version version)
32
32
{
33
CurrentVersion = version.ToString();
33
CurrentVersion = version.ToString(3);
34
34
}
35
35
AppCacheSize = FileHelper.GetDirectorySize(new(AppPath.AppCache)).FileSize();
36
36
}
@@ -78,10 +78,10 @@ public sealed partial class AppShellPage : Page
78
78
79
79
private async void Page_Loaded(object sender, RoutedEventArgs e)
80
80
{
81
ViewModel.MessageService.ShowMessage("��Ϸ���弯������...", "���ڼ���");
81
ViewModel.MessageService.ShowMessage("GameDefinitionsLoading".GetLocalized(), "Loading".GetLocalized());
82
82
AppThemeHelper.ChangeTheme(SystemProfile.Theme);
83
83
navigationView.PaneDisplayMode = SystemProfile.NavigationStyle;
84
SpaceEngineersHelper.LoadComplete += (sender, e) => ViewModel.MessageService?.ShowMessage("��Ϸ������������", "���", InfoBarSeverity.Success); ;
84
SpaceEngineersHelper.LoadComplete += (sender, e) => ViewModel.MessageService?.ShowMessage("GameDefinitionsLoadingComplete".GetLocalized(), "Complete".GetLocalized(), InfoBarSeverity.Success); ;
85
85
await SpaceEngineersHelper.LoadDefinitionViewDataListAsync();
86
86
}
87
87