File tree Expand file tree Collapse file tree
Gui/ViewModels/LocoTypes/Objects Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using Definitions . ObjectModels . Objects . Cargo ;
22using PropertyModels . ComponentModel . DataAnnotations ;
3+ using ReactiveUI ;
4+ using System . ComponentModel ;
35
46namespace Gui . ViewModels ;
57
@@ -15,7 +17,30 @@ public uint16_t CargoTransferTime
1517 public CargoCategory CargoCategory
1618 {
1719 get => Model . CargoCategory ;
18- set => Model . CargoCategory = value ;
20+ set
21+ {
22+ if ( Model . CargoCategory != value )
23+ {
24+ Model . CargoCategory = value ;
25+ this . RaisePropertyChanged ( nameof ( CargoCategory ) ) ;
26+ this . RaisePropertyChanged ( nameof ( CargoCategoryOverride ) ) ;
27+ }
28+ }
29+ }
30+
31+ [ Description ( "Allows the user to set a custom value for the cargo category." ) ]
32+ public uint16_t CargoCategoryOverride
33+ {
34+ get => ( uint16_t ) Model . CargoCategory ;
35+ set
36+ {
37+ if ( ( uint16_t ) Model . CargoCategory != value )
38+ {
39+ Model . CargoCategory = ( CargoCategory ) value ;
40+ this . RaisePropertyChanged ( nameof ( CargoCategory ) ) ;
41+ this . RaisePropertyChanged ( nameof ( CargoCategoryOverride ) ) ;
42+ }
43+ }
1944 }
2045
2146 [ EnumProhibitValues < CargoObjectFlags > ( CargoObjectFlags . None ) ]
You can’t perform that action at this time.
0 commit comments