Skip to content

Commit 01eba04

Browse files
committed
Merge branch 'add-base-nodes-to-tooltips-view'
2 parents ecdd18c + 218c616 commit 01eba04

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/TSMapEditor/UI/TileInfoDisplay.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,13 @@ private void AddBaseNodeInformation(BaseNode baseNode)
295295
return;
296296

297297
var nodeBuildingType = map.Rules.BuildingTypes.Find(bt => bt.ININame == baseNode.StructureTypeName);
298+
var house = map.Houses.Find(house => house.BaseNodes.Contains(baseNode));
299+
300+
if (nodeBuildingType == null || house == null)
301+
return;
298302

299303
textRenderer.AddTextLine(new XNATextPart("Base Node: ", Constants.UIDefaultFont, Color.Gray));
300-
textRenderer.AddTextPart(new XNATextPart(nodeBuildingType.Name + " (" + nodeBuildingType.ININame + ")", Constants.UIDefaultFont, Color.White));
304+
textRenderer.AddTextPart(new XNATextPart($"{nodeBuildingType.Name} ({nodeBuildingType.ININame}) ({house.ININame})", Constants.UIDefaultFont, Color.White));
301305
}
302306

303307
private void AddTerrainObjectInformation(TerrainObject terrainObject)
@@ -306,7 +310,7 @@ private void AddTerrainObjectInformation(TerrainObject terrainObject)
306310
return;
307311

308312
textRenderer.AddTextLine(new XNATextPart("Terrain Object: ", Constants.UIDefaultFont, Color.Gray));
309-
textRenderer.AddTextPart(new XNATextPart(terrainObject.TerrainType.Name + " (" + terrainObject.TerrainType.ININame + ")", Constants.UIDefaultFont, Color.White));
313+
textRenderer.AddTextPart(new XNATextPart($"{terrainObject.TerrainType.Name} (${terrainObject.TerrainType.ININame})", Constants.UIDefaultFont, Color.White));
310314
}
311315
}
312316
}

0 commit comments

Comments
 (0)