mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-22 03:42:41 +01:00
Codechange: Add OnClick handler for dropdown items.
This allows each dropdown item to indicate if something different should happen depending on where in the item was clicked.
This commit is contained in:
committed by
Peter Nelson
parent
04e07dff84
commit
984d864c72
@@ -491,14 +491,14 @@ struct ScriptSettingsWindow : public Window {
|
||||
SetValue(*value);
|
||||
}
|
||||
|
||||
void OnDropdownSelect(WidgetID widget, int index) override
|
||||
void OnDropdownSelect(WidgetID widget, int index, int) override
|
||||
{
|
||||
if (widget != WID_SCRS_SETTING_DROPDOWN) return;
|
||||
assert(this->clicked_dropdown);
|
||||
SetValue(index);
|
||||
}
|
||||
|
||||
void OnDropdownClose(Point, WidgetID widget, int, bool) override
|
||||
void OnDropdownClose(Point, WidgetID widget, int, int, bool) override
|
||||
{
|
||||
if (widget != WID_SCRS_SETTING_DROPDOWN) return;
|
||||
/* We cannot raise the dropdown button just yet. OnClick needs some hint, whether
|
||||
|
||||
Reference in New Issue
Block a user