Skip to content

Commit

Permalink
Draw indexes of base nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Jul 24, 2024
1 parent 61cabb6 commit 525b5d6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/TSMapEditor/Rendering/MapView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,8 @@ private void DrawBaseNode(GraphicalBaseNode graphicalBaseNode)
// buildingRenderer.Draw(graphicalBaseNode.Structure, true);
// return;

int baseNodeIndex = graphicalBaseNode.Owner.BaseNodes.FindIndex(bn => bn == graphicalBaseNode.BaseNode);
Color baseNodeIndexColor = Color.White * 0.7f;

Point2D drawPoint = CellMath.CellTopLeftPointFromCellCoords_3D(graphicalBaseNode.BaseNode.Position, Map);

Expand All @@ -1065,7 +1067,10 @@ private void DrawBaseNode(GraphicalBaseNode graphicalBaseNode)

if ((graphics == null || graphics.GetFrame(frameIndex) == null) && (bibGraphics == null || bibGraphics.GetFrame(0) == null))
{
DrawStringWithShadow(iniName, 1, drawPoint.ToXNAVector(), replacementColor, 1.0f);
DrawStringWithShadow(iniName, Constants.UIBoldFont, drawPoint.ToXNAVector(), replacementColor, 1.0f);

DrawStringWithShadow("#" + baseNodeIndex, Constants.UIBoldFont, drawPoint.ToXNAVector() + new Vector2(0f, 20f), baseNodeIndexColor);

return;
}

Expand Down Expand Up @@ -1112,7 +1117,10 @@ private void DrawBaseNode(GraphicalBaseNode graphicalBaseNode)

var frame = graphics.GetFrame(frameIndex);
if (frame == null)
{
DrawStringWithShadow("#" + baseNodeIndex, Constants.UIBoldFont, drawPoint.ToXNAVector(), baseNodeIndexColor);
return;
}

texture = frame.Texture;

Expand All @@ -1133,6 +1141,8 @@ private void DrawBaseNode(GraphicalBaseNode graphicalBaseNode)
palettedColorDrawEffect.Parameters["UseRemap"].SetValue(true);
DrawTexture(graphics.GetRemapFrame(frameIndex).Texture, drawRectangle, remapColor);
}

DrawStringWithShadow("#" + baseNodeIndex, Constants.UIBoldFont, drawPoint.ToXNAVector(), baseNodeIndexColor);
}

private void DrawWaypoint(Waypoint waypoint)
Expand Down

0 comments on commit 525b5d6

Please sign in to comment.