From 9e4718847fa3d3016d5bd612de2e3cdc5b1e6563 Mon Sep 17 00:00:00 2001 From: Benjamin Sutas Date: Tue, 19 Mar 2024 22:48:02 +1100 Subject: [PATCH] add disabled track flags to bridge object add disabled track flags to bridge object --- Core/Objects/BridgeObject.cs | 20 +++++++++++++++++++- Core/Objects/TrackExtraObject.cs | 2 +- Core/Objects/TrackObject.cs | 7 +++---- Core/Objects/TrainStationObject.cs | 2 +- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Core/Objects/BridgeObject.cs b/Core/Objects/BridgeObject.cs index 09edf692..cef742de 100644 --- a/Core/Objects/BridgeObject.cs +++ b/Core/Objects/BridgeObject.cs @@ -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)] @@ -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, diff --git a/Core/Objects/TrackExtraObject.cs b/Core/Objects/TrackExtraObject.cs index 7a7a967b..b823956a 100644 --- a/Core/Objects/TrackExtraObject.cs +++ b/Core/Objects/TrackExtraObject.cs @@ -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, diff --git a/Core/Objects/TrackObject.cs b/Core/Objects/TrackObject.cs index a269c9d8..89e0396a 100644 --- a/Core/Objects/TrackObject.cs +++ b/Core/Objects/TrackObject.cs @@ -21,8 +21,7 @@ public enum TrackObjectPieceFlags : uint16_t SlopedCurve = 1 << 8, SBend = 1 << 9, Junction = 1 << 10, - - }; + } public enum TrackObjectFlags : uint16_t { @@ -30,7 +29,7 @@ public enum TrackObjectFlags : uint16_t unk_00 = 1 << 0, unk_01 = 1 << 1, unk_02 = 1 << 2, - }; + } [TypeConverter(typeof(ExpandableObjectConverter))] [LocoStructSize(0x36)] @@ -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, diff --git a/Core/Objects/TrainStationObject.cs b/Core/Objects/TrainStationObject.cs index 44b83fdd..ce0f58be 100644 --- a/Core/Objects/TrainStationObject.cs +++ b/Core/Objects/TrainStationObject.cs @@ -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,