[Feature] Added station viewport tooltips.

This commit is contained in:
RoqueDeicide
2023-07-01 22:59:00 +04:00
parent 1071235aee
commit 5af7be6d17
7 changed files with 99 additions and 0 deletions

View File

@@ -257,6 +257,16 @@ void ShowDepotTooltip(Window *w, const TileIndex tile, char *buffer_position, co
GuiShowTooltips(w, STR_DEPOT_VIEW_INFO_TOOLTIP, 0, nullptr, TCC_HOVER_VIEWPORT);
}
bool GetStationViewportTooltipString(TileIndex tile, char *buffer_position, const char *buffer_tail);
void ShowStationViewportTooltip(Window *w, const TileIndex tile, char *buffer_position, const char *buffer_tail)
{
if (!GetStationViewportTooltipString(tile, buffer_position, buffer_tail)) return;
SetDParamStr(0, buffer_position);
GuiShowTooltips(w, STR_STATION_VIEW_INFO_TOOLTIP, 0, nullptr, TCC_HOVER_VIEWPORT);
}
void ShowTooltipForTile(Window *w, const TileIndex tile)
{
static char buffer[1024];
@@ -291,6 +301,8 @@ void ShowTooltipForTile(Window *w, const TileIndex tile)
case MP_STATION: {
if (IsHangar(tile)) {
ShowDepotTooltip(w, tile, buffer_start, buffer_tail);
} else {
ShowStationViewportTooltip(w, tile, buffer_start, buffer_tail);
}
break;
}