mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-12 17:19:09 +00:00
Change: Show full station/roadstop/object class name as tooltip in class list.
This commit is contained in:
@@ -510,6 +510,19 @@ public:
|
||||
if (wid->UpdateVerticalSize(this->name.height)) this->ReInit(0, 0);
|
||||
}
|
||||
|
||||
bool OnTooltip([[maybe_unused]] Point pt, WidgetID widget, TooltipCloseCondition close_cond) override
|
||||
{
|
||||
if (widget != WID_BO_CLASS_LIST) return false;
|
||||
|
||||
auto it = this->vscroll->GetScrolledItemFromWidget(this->object_classes, pt.y, this, WID_BO_CLASS_LIST);
|
||||
if (it == this->object_classes.end()) return false;
|
||||
|
||||
StringID str = ObjectClass::Get(*it)->name;
|
||||
GuiShowTooltips(this, str, close_cond, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
|
||||
{
|
||||
switch (widget) {
|
||||
|
@@ -1336,6 +1336,19 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool OnTooltip([[maybe_unused]] Point pt, WidgetID widget, TooltipCloseCondition close_cond) override
|
||||
{
|
||||
if (widget != WID_BRAS_NEWST_LIST) return false;
|
||||
|
||||
auto it = this->vscroll->GetScrolledItemFromWidget(this->station_classes, pt.y, this, WID_BRAS_NEWST_LIST);
|
||||
if (it == this->station_classes.end()) return false;
|
||||
|
||||
StringID str = StationClass::Get(*it)->name;
|
||||
GuiShowTooltips(this, str, close_cond, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
|
||||
{
|
||||
switch (widget) {
|
||||
|
@@ -1512,6 +1512,19 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool OnTooltip([[maybe_unused]] Point pt, WidgetID widget, TooltipCloseCondition close_cond) override
|
||||
{
|
||||
if (widget != WID_BROS_NEWST_LIST) return false;
|
||||
|
||||
auto it = this->vscrollList->GetScrolledItemFromWidget(this->roadstop_classes, pt.y, this, WID_BROS_NEWST_LIST);
|
||||
if (it == this->roadstop_classes.end()) return false;
|
||||
|
||||
StringID str = RoadStopClass::Get(*it)->name;
|
||||
GuiShowTooltips(this, str, close_cond, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
|
||||
{
|
||||
switch (widget) {
|
||||
|
Reference in New Issue
Block a user