Skip to content

Commit

Permalink
Add EditorZAdjust for BuildingTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Oct 13, 2024
1 parent 67571ec commit 14bc5d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/TSMapEditor/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace TSMapEditor
{
public static class Constants
{
public const string ReleaseVersion = "1.3.1";
public const string ReleaseVersion = "1.3.2";

public static int CellSizeX = 48;
public static int CellSizeY = 24;
Expand Down
1 change: 1 addition & 0 deletions src/TSMapEditor/Models/BuildingType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public BuildingType(string iniName) : base(iniName)
public double LightRedTint { get; set; }
public double LightGreenTint { get; set; }
public double LightBlueTint { get; set; }
public int EditorZAdjust { get; set; }

public BuildingArtConfig ArtConfig { get; set; } = new BuildingArtConfig();
public IArtConfig GetArtConfig() => ArtConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ protected override bool ShouldRenderReplacementText(Structure gameObject)

protected override float GetDepthAddition(Structure gameObject)
{
return Constants.DepthEpsilon * ObjectDepthAdjustments.Building;
float buildingAdditionalDepth = gameObject.ObjectType.EditorZAdjust / (float)Map.HeightInPixelsWithCellHeight;
return buildingAdditionalDepth + (Constants.DepthEpsilon * ObjectDepthAdjustments.Building);
}

private void DrawBibGraphics(Structure gameObject, ShapeImage bibGraphics, Point2D drawPoint, in CommonDrawParams drawParams, bool affectedByLighting)
Expand Down

0 comments on commit 14bc5d4

Please sign in to comment.