VPet.Solution 更新

This commit is contained in:
Hakoyu 2024-01-13 23:47:51 +08:00
parent 04b150ebd9
commit 71e5816a80
4 changed files with 13 additions and 10 deletions

View File

@ -168,13 +168,16 @@ public class SaveModel : ObservableClass<SaveModel>
#endregion
#region HashCode
private long _hashCode;
#region HashChecked
private bool _hashChecked;
public long HashCode
/// <summary>
/// Hash已检查
/// </summary>
public bool HashChecked
{
get => _hashCode;
set => SetProperty(ref _hashCode, value);
get => _hashChecked;
set => SetProperty(ref _hashChecked, value);
}
#endregion
@ -202,6 +205,7 @@ public class SaveModel : ObservableClass<SaveModel>
LoadSave(save.GameSave);
if (save.Statistics.Data.TryGetValue("stat_total_time", out var time))
TotalTime = time.GetInteger64();
HashChecked = save.HashCheck;
foreach (var data in save.Statistics.Data)
{
Statistics.Add(

View File

@ -106,9 +106,8 @@ public class SaveWindowVM : ObservableClass<SaveWindowVM>
foreach (var file in Directory.EnumerateFiles(saveDirectory).Where(s => s.EndsWith(".lps")))
{
var lps = new LPS(File.ReadAllText(file));
var hashCode = lps.FindLine("hash")?.InfoToInt64 is long hash ? hash : 0;
var save = new GameSave_v2(lps);
var saveModel = new SaveModel(file, save) { HashCode = hashCode };
var saveModel = new SaveModel(file, save);
_saves.Add(saveModel);
}
}

View File

@ -90,9 +90,9 @@
<DockPanel>
<Label
h:ElementHelper.UniformMinWidthGroup="A"
Content="{ll:Str 哈希}"
Content="{ll:Str 哈希检查}"
Style="{DynamicResource Label_BaseStyle}" />
<TextBlock Style="{DynamicResource TextBlock_LeftCenter}" Text="{Binding Save.HashCode}" />
<TextBlock Style="{DynamicResource TextBlock_LeftCenter}" Text="{Binding Save.HashChecked}" />
</DockPanel>
</StackPanel>
</ScrollViewer>

View File

@ -68,7 +68,7 @@
Header="{ll:Str 名称}"
IsReadOnly="True" />
<DataGridTextColumn
Binding="{Binding DateSaved}"
Binding="{Binding DateSaved, StringFormat='yyyy/MM/dd HH:mm:ss'}"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 保存时间}"
IsReadOnly="True" />