Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement NoShadow rules key to hide Techno's shadow #92

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/TSMapEditor/Models/TechnoType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public TechnoType(string iniName) : base(iniName)

public string Image { get; set; }
public string Owner { get; set; }
public bool NoShadow { get; set; }

public Weapon Primary { get; set; }
public Weapon Secondary { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ protected override void Render(Structure gameObject, int yDrawPointWithoutCellHe

if (commonDrawParams.Graphics != null)
{
DrawShadow(gameObject, commonDrawParams, drawPoint, yDrawPointWithoutCellHeight);
if (!gameObject.ObjectType.NoShadow)
DrawShadow(gameObject, commonDrawParams, drawPoint, yDrawPointWithoutCellHeight);

DrawObjectImage(gameObject, commonDrawParams, commonDrawParams.Graphics,
gameObject.GetFrameIndex(commonDrawParams.Graphics.Frames.Length),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ protected override void Render(Infantry gameObject, int yDrawPointWithoutCellHei
break;
}

DrawShadow(gameObject, commonDrawParams, drawPoint, yDrawPointWithoutCellHeight);
if (!gameObject.ObjectType.NoShadow)
DrawShadow(gameObject, commonDrawParams, drawPoint, yDrawPointWithoutCellHeight);

DrawObjectImage(gameObject, commonDrawParams, commonDrawParams.Graphics,
gameObject.GetFrameIndex(commonDrawParams.Graphics.Frames.Length),
Expand Down
3 changes: 2 additions & 1 deletion src/TSMapEditor/Rendering/ObjectRenderers/UnitRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ protected override CommonDrawParams GetDrawParams(Unit gameObject)

protected override void Render(Unit gameObject, int yDrawPointWithoutCellHeight, Point2D drawPoint, CommonDrawParams commonDrawParams)
{
DrawShadow(gameObject, commonDrawParams, drawPoint, yDrawPointWithoutCellHeight);
if (!gameObject.ObjectType.NoShadow)
DrawShadow(gameObject, commonDrawParams, drawPoint, yDrawPointWithoutCellHeight);

DrawObjectImage(gameObject, commonDrawParams, commonDrawParams.Graphics,
gameObject.GetFrameIndex(commonDrawParams.Graphics.Frames.Length),
Expand Down
Loading