Skip to content

Commit

Permalink
add disabled track flags to bridge object
Browse files Browse the repository at this point in the history
add disabled track flags to bridge object
  • Loading branch information
LeftofZen committed Mar 19, 2024
1 parent f278dbd commit 9e47188
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
20 changes: 19 additions & 1 deletion Core/Objects/BridgeObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@

namespace OpenLoco.ObjectEditor.Objects
{
[Flags]
public enum BridgeDisabledTrackFlags : uint16_t
{
None = 0,
Slope = 1 << 0,
SteepSlope = 1 << 1,
CurveSlope = 1 << 2,
Diagonal = 1 << 3,
VerySmallCurve = 1 << 4,
SmallCurve = 1 << 5,
Curve = 1 << 6,
LargeCurve = 1 << 7,
SBendCurve = 1 << 8,
OneSided = 1 << 9,
StartsAtHalfHeight = 1 << 10, // Not used. From RCT2
Junction = 1 << 11,
}

[TypeConverter(typeof(ExpandableObjectConverter))]
[LocoStructSize(0x2C)]
[LocoStructType(ObjectType.Bridge)]
Expand All @@ -22,7 +40,7 @@ public record BridgeObject(
[property: LocoStructOffset(0x0E)] int16_t BaseCostFactor,
[property: LocoStructOffset(0x10)] int16_t HeightCostFactor,
[property: LocoStructOffset(0x12)] int16_t SellCostFactor,
[property: LocoStructOffset(0x14)] uint16_t DisabledTrackCfg,
[property: LocoStructOffset(0x14)] BridgeDisabledTrackFlags DisabledTrackFlags,
[property: LocoStructOffset(0x16), Browsable(false)] image_id Image,
[property: LocoStructOffset(0x1A), LocoPropertyMaybeUnused] uint8_t NumCompatibleTrackMods,
[property: LocoStructOffset(0x1B), LocoStructVariableLoad, LocoArrayLength(BridgeObject.MaxNumTrackMods), LocoPropertyMaybeUnused, Browsable(false)] object_id[] TrackModHeaderIds,
Expand Down
2 changes: 1 addition & 1 deletion Core/Objects/TrackExtraObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace OpenLoco.ObjectEditor.Objects
[LocoStringTable("Name")]
public record TrackExtraObject(
[property: LocoStructOffset(0x00), LocoString, Browsable(false)] string_id Name,
[property: LocoStructOffset(0x02)] uint16_t TrackPieces,
[property: LocoStructOffset(0x02)] TrackObjectPieceFlags TrackPieces,
[property: LocoStructOffset(0x04)] uint8_t PaintStyle,
[property: LocoStructOffset(0x05)] uint8_t CostIndex,
[property: LocoStructOffset(0x06)] int16_t BuildCostFactor,
Expand Down
7 changes: 3 additions & 4 deletions Core/Objects/TrackObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ public enum TrackObjectPieceFlags : uint16_t
SlopedCurve = 1 << 8,
SBend = 1 << 9,
Junction = 1 << 10,

};
}

public enum TrackObjectFlags : uint16_t
{
None = 0,
unk_00 = 1 << 0,
unk_01 = 1 << 1,
unk_02 = 1 << 2,
};
}

[TypeConverter(typeof(ExpandableObjectConverter))]
[LocoStructSize(0x36)]
Expand All @@ -39,7 +38,7 @@ public enum TrackObjectFlags : uint16_t
public record TrackObject(
[property: LocoStructOffset(0x00), LocoString, Browsable(false)] string_id Name,
[property: LocoStructOffset(0x02)] TrackObjectPieceFlags TrackPieces,
[property: LocoStructOffset(0x04)] uint16_t StationTrackPieces,
[property: LocoStructOffset(0x04)] TrackObjectPieceFlags StationTrackPieces,
[property: LocoStructOffset(0x06)] uint8_t var_06,
[property: LocoStructOffset(0x07)] uint8_t NumCompatible,
[property: LocoStructOffset(0x08)] uint8_t NumMods,
Expand Down
2 changes: 1 addition & 1 deletion Core/Objects/TrainStationObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public record TrainStationObject(
[property: LocoStructOffset(0x00), LocoString, Browsable(false)] string_id Name,
[property: LocoStructOffset(0x02)] uint8_t DrawStyle,
[property: LocoStructOffset(0x03)] uint8_t Height,
[property: LocoStructOffset(0x04)] uint16_t TrackPieces,
[property: LocoStructOffset(0x04)] TrackObjectPieceFlags TrackPieces,
[property: LocoStructOffset(0x06)] int16_t BuildCostFactor,
[property: LocoStructOffset(0x08)] int16_t SellCostFactor,
[property: LocoStructOffset(0x0A)] uint8_t CostIndex,
Expand Down

0 comments on commit 9e47188

Please sign in to comment.