MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ScrollToSelectedServer

Method ScrollToSelectedServer

src/network/network_gui.cpp:427–431  ·  view source on GitHub ↗

* Scroll the list up or down to the currently selected server. * If the server is below the currently displayed servers, it will * scroll down an amount so that the server appears at the bottom. * If the server is above the currently displayed servers, it will * scroll up so that the server appears at the top. */

Source from the content-addressed store, hash-verified

425 * scroll up so that the server appears at the top.
426 */
427 void ScrollToSelectedServer()
428 {
429 if (this->list_pos == SLP_INVALID) return; // no server selected
430 this->vscroll->ScrollTowards(this->list_pos);
431 }
432
433public:
434 NetworkGameWindow(WindowDesc &desc) : Window(desc), name_editbox(NETWORK_CLIENT_NAME_LENGTH), filter_editbox(120)

Callers 3

OnClickMethod · 0.95
OnKeyPressMethod · 0.95
OnEditboxChangedMethod · 0.95

Calls 1

ScrollTowardsMethod · 0.80

Tested by

no test coverage detected