mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r18932) -Codechange: Don't constantly redraw drop drop list.
This commit is contained in:
parent
ea8a44f5cd
commit
f403166a56
@ -260,10 +260,17 @@ struct DropdownWindow : Window {
|
|||||||
|
|
||||||
virtual void OnTick()
|
virtual void OnTick()
|
||||||
{
|
{
|
||||||
|
if (this->scrolling != 0) {
|
||||||
|
int pos = this->vscroll.GetPosition();
|
||||||
|
|
||||||
this->vscroll.UpdatePosition(this->scrolling);
|
this->vscroll.UpdatePosition(this->scrolling);
|
||||||
this->scrolling = 0;
|
this->scrolling = 0;
|
||||||
|
|
||||||
|
if (pos != this->vscroll.GetPosition()) {
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual void OnMouseLoop()
|
virtual void OnMouseLoop()
|
||||||
{
|
{
|
||||||
@ -310,10 +317,12 @@ struct DropdownWindow : Window {
|
|||||||
if (!this->GetDropDownItem(item)) return;
|
if (!this->GetDropDownItem(item)) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->selected_index != item) {
|
||||||
this->selected_index = item;
|
this->selected_index = item;
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void ShowDropDownList(Window *w, DropDownList *list, int selected, int button, uint width, bool auto_width, bool instant_close)
|
void ShowDropDownList(Window *w, DropDownList *list, int selected, int button, uint width, bool auto_width, bool instant_close)
|
||||||
|
Loading…
Reference in New Issue
Block a user