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

Method SelectNextPage

src/story_gui.cpp:225–241  ·  view source on GitHub ↗

* Selects the next available page after the currently selected page. */

Source from the content-addressed store, hash-verified

223 * Selects the next available page after the currently selected page.
224 */
225 void SelectNextPage()
226 {
227 if (!StoryPage::IsValidID(this->selected_page_id)) return;
228
229 /* Find selected page. */
230 for (auto iter = this->story_pages.begin(); iter != this->story_pages.end(); iter++) {
231 const StoryPage *p = *iter;
232 if (p->index == this->selected_page_id) {
233 /* Select the page after selected page. */
234 iter++;
235 if (iter != this->story_pages.end()) {
236 this->SetSelectedPage((*iter)->index);
237 }
238 return;
239 }
240 }
241 }
242
243 /**
244 * Builds the page selector drop down list.

Callers 1

OnClickMethod · 0.95

Calls 3

SetSelectedPageMethod · 0.95
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected