Show ctrl-click function of shared orders button in tooltip

This commit is contained in:
Jonathan G Rennison
2023-05-25 20:02:29 +01:00
parent 9f24895480
commit 23ab1cb3d0
3 changed files with 25 additions and 0 deletions

View File

@@ -3517,6 +3517,22 @@ public:
}
}
bool OnTooltip(Point pt, int widget, TooltipCloseCondition close_cond) override
{
switch (widget) {
case WID_O_SHARED_ORDER_LIST: {
if (this->vehicle->owner == _local_company) {
uint64 args[] = { STR_ORDERS_VEH_WITH_SHARED_ORDERS_LIST_TOOLTIP };
GuiShowTooltips(this, STR_ORDERS_VEH_WITH_SHARED_ORDERS_LIST_TOOLTIP_EXTRA, lengthof(args), args, close_cond);
return true;
}
return false;
}
default:
return false;
}
}
const Vehicle *GetVehicle()
{
return this->vehicle;