Fix tooltip string parameters, change function signatures to match upstream
This commit is contained in:
@@ -423,9 +423,7 @@ public:
|
||||
}
|
||||
|
||||
/* Build tooltipstring */
|
||||
static char details[1024];
|
||||
details[0] = '\0';
|
||||
char *pos = details;
|
||||
std::string details;
|
||||
|
||||
for (CargoID cargo_type = 0; cargo_type < NUM_CARGO; cargo_type++) {
|
||||
if (capacity[cargo_type] == 0) continue;
|
||||
@@ -434,14 +432,13 @@ public:
|
||||
SetDParam(1, loaded[cargo_type]); // {CARGO} #2
|
||||
SetDParam(2, cargo_type); // {SHORTCARGO} #1
|
||||
SetDParam(3, capacity[cargo_type]); // {SHORTCARGO} #2
|
||||
pos = GetString(pos, STR_DEPOT_VEHICLE_TOOLTIP_CARGO, lastof(details));
|
||||
details = GetString(STR_DEPOT_VEHICLE_TOOLTIP_CARGO);
|
||||
}
|
||||
|
||||
/* Show tooltip window */
|
||||
uint64 args[2];
|
||||
args[0] = (whole_chain ? num : v->engine_type);
|
||||
args[1] = (uint64)(size_t)details;
|
||||
GuiShowTooltips(this, whole_chain ? STR_DEPOT_VEHICLE_TOOLTIP_CHAIN : STR_DEPOT_VEHICLE_TOOLTIP, 2, args, TCC_RIGHT_CLICK);
|
||||
SetDParam(0, whole_chain ? num : v->engine_type);
|
||||
SetDParamStr(1, std::move(details));
|
||||
GuiShowTooltips(this, whole_chain ? STR_DEPOT_VEHICLE_TOOLTIP_CHAIN : STR_DEPOT_VEHICLE_TOOLTIP, TCC_RIGHT_CLICK, 2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user