Skip to content

Commit 53ebfa8

Browse files
committed
add hex string display to headers
1 parent 4a57928 commit 53ebfa8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Gui/ViewModels/DatTypes/S5HeaderViewModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using OpenLoco.Dat.Types;
33
using ReactiveUI;
44
using ReactiveUI.Fody.Helpers;
5+
using System;
56
using System.ComponentModel;
67
using System.ComponentModel.DataAnnotations;
78

@@ -29,6 +30,9 @@ public S5HeaderViewModel(S5Header s5Header)
2930
Checksum = s5Header.Checksum;
3031
SourceGame = s5Header.SourceGame;
3132
ObjectType = s5Header.ObjectType;
33+
34+
_ = this.WhenAnyValue(o => o.Checksum)
35+
.Subscribe(_ => this.RaisePropertyChanged(nameof(ChecksumHex)));
3236
}
3337

3438
[Reactive, MaxLength(8)]
@@ -37,6 +41,9 @@ public S5HeaderViewModel(S5Header s5Header)
3741
[Reactive]
3842
public uint32_t Checksum { get; set; }
3943

44+
[MinLength(8), MaxLength(8)]
45+
public string ChecksumHex => string.Format($"{Checksum:X}");
46+
4047
[Reactive]
4148
public SourceGame SourceGame { get; set; }
4249

0 commit comments

Comments
 (0)