16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-20 02:09:19 +02:00

Add isolation list to track tooltips

If a track is hovered when debug mode is on, it will now also show the names of isolated circuits the track belongs to, if any.
This commit is contained in:
jakubg1
2025-09-04 03:37:50 +02:00
parent b28ea826c5
commit baadd5f14c
5 changed files with 30 additions and 14 deletions

View File

@@ -2364,6 +2364,19 @@ TTrack::export_as_text_( std::ostream &Output ) const {
<< "\n";
}
// Returns the tooltip of this Track, which may contain a list of isolations if the track belongs to any.
std::string TTrack::tooltip() const
{
std::string tooltip = this->name();
if (!Isolated.empty())
{
tooltip += "\nIsolated:";
for (const auto isolation : Isolated)
tooltip += " " + isolation->asName;
}
return tooltip;
}
// locates specified profile in the profile database, potentially loading it from a file
// returns: pair <profile name, profile handle>
std::pair<std::string, int>