1
- using System . ComponentModel ;
1
+ using System . ComponentModel ;
2
2
using Core . Objects ;
3
3
using OpenLoco . ObjectEditor . Data ;
4
4
using OpenLoco . ObjectEditor . DatFileParsing ;
@@ -38,15 +38,15 @@ public record BuildingObject(
38
38
[ property: LocoStructOffset ( 0x9D ) ] Colour ScaffoldingColour ,
39
39
[ property: LocoStructOffset ( 0x9E ) ] uint8_t GeneratorFunction ,
40
40
[ property: LocoStructOffset ( 0x9F ) ] uint8_t var_9F ,
41
- // [property: LocoStructOffset(0xA0), LocoStructVariableLoad, LocoArrayLength(2)] List<uint8_t> ProducedQuantity ,
42
- // [property: LocoStructOffset(0xA2), LocoStructVariableLoad, LocoArrayLength(MaxProducedCargoType)] List<uint8_t> ProducedCargoType ,
43
- // [property: LocoStructOffset(0xA4), LocoStructVariableLoad, LocoArrayLength(MaxRequiredCargoType)] List<uint8_t> RequiredCargoType ,
41
+ [ property: LocoStructOffset ( 0xA0 ) , LocoStructVariableLoad , LocoArrayLength ( 2 ) ] List < uint8_t > _ProducedQuantity ,
42
+ [ property: LocoStructOffset ( 0xA2 ) , LocoStructVariableLoad , LocoArrayLength ( BuildingObject . MaxProducedCargoType ) , Browsable ( false ) ] List < object_id > _ProducedCargoType ,
43
+ [ property: LocoStructOffset ( 0xA4 ) , LocoStructVariableLoad , LocoArrayLength ( BuildingObject . MaxRequiredCargoType ) , Browsable ( false ) ] List < object_id > _RequiredCargoType ,
44
44
[ property: LocoStructOffset ( 0xA6 ) , LocoStructVariableLoad , LocoArrayLength ( 2 ) ] List < uint8_t > var_A6 ,
45
45
[ property: LocoStructOffset ( 0xA8 ) , LocoStructVariableLoad , LocoArrayLength ( 2 ) ] List < uint8_t > var_A8 ,
46
46
[ property: LocoStructOffset ( 0xA4 ) , LocoStructVariableLoad , LocoArrayLength ( 2 ) ] List < uint8_t > var_A4 , // Some type of Cargo
47
47
[ property: LocoStructOffset ( 0xAA ) ] int16_t DemolishRatingReduction ,
48
48
[ property: LocoStructOffset ( 0xAC ) ] uint8_t var_AC ,
49
- [ property: LocoStructOffset ( 0xAD ) ] uint8_t var_AD
49
+ [ property: LocoStructOffset ( 0xAD ) ] uint8_t NumAnimationSequences
50
50
//[property: LocoStructOffset(0xAE), LocoStructVariableLoad, LocoArrayLength(4)] uint8_t[][] var_AE // 0xAE ->0xB2->0xB6->0xBA->0xBE (4 byte pointers)
51
51
) : ILocoStruct , ILocoStructVariableData
52
52
{
@@ -57,7 +57,7 @@ public record BuildingObject(
57
57
public List < S5Header > ProducedCargo { get ; set ; } = [ ] ;
58
58
public List < S5Header > RequiredCargo { get ; set ; } = [ ] ;
59
59
60
- public List < uint8_t [ ] > var_AE { get ; set ; } = [ ] ;
60
+ public List < uint8_t [ ] > AnimationSequences { get ; set ; } = [ ] ;
61
61
62
62
// known issues:
63
63
// HOSPITL1.dat - loads without error but graphics are bugged
@@ -100,14 +100,14 @@ public ReadOnlySpan<byte> Load(ReadOnlySpan<byte> remainingData)
100
100
RequiredCargo = SawyerStreamReader . LoadVariableCountS5Headers ( remainingData , MaxRequiredCargoType ) ;
101
101
remainingData = remainingData [ ( S5Header . StructLength * MaxRequiredCargoType ) ..] ;
102
102
103
- // load ??
104
- var_AE . Clear ( ) ;
105
- for ( var i = 0 ; i < var_AD ; ++ i )
103
+ // animation sequences
104
+ AnimationSequences . Clear ( ) ;
105
+ for ( var i = 0 ; i < NumAnimationSequences ; ++ i )
106
106
{
107
107
var size = BitConverter . ToUInt16 ( remainingData [ ..2 ] ) ;
108
108
remainingData = remainingData [ 2 ..] ;
109
109
110
- var_AE . Add ( remainingData [ ..size ] . ToArray ( ) ) ;
110
+ AnimationSequences . Add ( remainingData [ ..size ] . ToArray ( ) ) ;
111
111
remainingData = remainingData [ size ..] ;
112
112
}
113
113
@@ -150,7 +150,7 @@ public ReadOnlySpan<byte> Save()
150
150
ms . Write ( obj . Write ( ) ) ;
151
151
}
152
152
153
- foreach ( var unk in var_AE )
153
+ foreach ( var unk in AnimationSequences )
154
154
{
155
155
ms . Write ( BitConverter . GetBytes ( ( uint16_t ) unk . Length ) ) ;
156
156
foreach ( var x in unk )
0 commit comments