|
1 |
| -using OpenLoco.Dat.Data; |
2 | 1 | using OpenLoco.Dat.Objects;
|
3 | 2 | using OpenLoco.Dat.Types;
|
4 | 3 | using ReactiveUI;
|
|
9 | 8 |
|
10 | 9 | namespace OpenLoco.Gui.ViewModels
|
11 | 10 | {
|
12 |
| - [TypeConverter(typeof(ExpandableObjectConverter))] |
13 |
| - public class S5ViewModel : ReactiveObject //, IObjectViewModel<S5Header> |
14 |
| - { |
15 |
| - public S5ViewModel(string name, uint checksum, SourceGame sourceGame, ObjectType objectType) |
16 |
| - { |
17 |
| - Name = name; |
18 |
| - Checksum = checksum; |
19 |
| - SourceGame = sourceGame; |
20 |
| - ObjectType = objectType; |
21 |
| - } |
22 |
| - public S5ViewModel(S5Header s5Header) |
23 |
| - { |
24 |
| - Name = s5Header.Name; |
25 |
| - Checksum = s5Header.Checksum; |
26 |
| - SourceGame = s5Header.SourceGame; |
27 |
| - ObjectType = s5Header.ObjectType; |
28 |
| - } |
29 |
| - |
30 |
| - public string Name { get; set; } |
31 |
| - public uint32_t Checksum { get; set; } |
32 |
| - public SourceGame SourceGame { get; set; } |
33 |
| - |
34 |
| - public ObjectType ObjectType { get; set; } |
35 |
| - |
36 |
| - public S5Header GetAsUnderlyingType() |
37 |
| - => new(Name, Checksum) |
38 |
| - { |
39 |
| - ObjectType = ObjectType, |
40 |
| - SourceGame = SourceGame |
41 |
| - }; |
42 |
| - } |
43 |
| - |
44 | 11 | public class VehicleViewModel : ReactiveObject, IObjectViewModel<ILocoStruct>
|
45 | 12 | {
|
46 | 13 | [Reactive, Category("Stats")] public TransportMode Mode { get; set; }
|
@@ -81,7 +48,7 @@ public class VehicleViewModel : ReactiveObject, IObjectViewModel<ILocoStruct>
|
81 | 48 | [Reactive, Category("Sound")] public FrictionSound? FrictionSound { get; set; }
|
82 | 49 | [Reactive, Category("Sound")] public Engine1Sound? Engine1Sound { get; set; }
|
83 | 50 | [Reactive, Category("Sound")] public Engine2Sound? Engine2Sound { get; set; }
|
84 |
| - [Reactive, Category("Sound")] public BindingList<S5ViewModel> StartSounds { get; set; } |
| 51 | + [Reactive, Category("Sound")] public BindingList<S5HeaderViewModel> StartSounds { get; set; } |
85 | 52 |
|
86 | 53 | public VehicleViewModel(VehicleObject veh)
|
87 | 54 | {
|
@@ -117,7 +84,7 @@ public VehicleViewModel(VehicleObject veh)
|
117 | 84 | RackRail = veh.RackRail;
|
118 | 85 | Sound = veh.Sound;
|
119 | 86 | SoundType = veh.DrivingSoundType;
|
120 |
| - StartSounds = new(veh.StartSounds.ConvertAll(x => new S5ViewModel(x))); |
| 87 | + StartSounds = new(veh.StartSounds.ConvertAll(x => new S5HeaderViewModel(x))); |
121 | 88 | FrictionSound = veh.SoundPropertyFriction;
|
122 | 89 | Engine1Sound = veh.SoundPropertyEngine1;
|
123 | 90 | Engine2Sound = veh.SoundPropertyEngine2;
|
|
0 commit comments