1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 11:44:17 +01:00

Codechange: Use GetString() with argument parameters in simple cases. (#13551)

Avoids using global string parameters.
This commit is contained in:
Peter Nelson
2025-02-14 00:10:56 +00:00
committed by GitHub
parent c3d5e6d2a0
commit 20e57a02a2
26 changed files with 79 additions and 170 deletions

View File

@@ -384,10 +384,8 @@ bool LinkGraphOverlay::ShowTooltip(Point pt, TooltipCloseCondition close_cond)
const auto &back = k->second;
back_time = back.time;
if (back.Usage() > 0) {
SetDParam(0, back.cargo);
SetDParam(1, back.Usage());
SetDParam(2, back.Usage() * 100 / (back.capacity + 1));
tooltip_extension = GetString(STR_LINKGRAPH_STATS_TOOLTIP_RETURN_EXTENSION);
tooltip_extension = GetString(STR_LINKGRAPH_STATS_TOOLTIP_RETURN_EXTENSION,
back.cargo, back.Usage(), back.Usage() * 100 / (back.capacity + 1));
}
}
/* Add information about the travel time if known. */