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

Method RefreshSelectedPage

src/story_gui.cpp:183–200  ·  view source on GitHub ↗

* Updates the content of selected page. */

Source from the content-addressed store, hash-verified

181 * Updates the content of selected page.
182 */
183 void RefreshSelectedPage()
184 {
185 /* Generate generic title if selected page have no custom title. */
186 StoryPage *page = this->GetSelPage();
187 if (page != nullptr && page->title.empty()) {
188 selected_generic_title = GetString(STR_STORY_BOOK_GENERIC_PAGE_ITEM, GetSelPageNum() + 1);
189 }
190
191 this->story_page_elements.ForceRebuild();
192 this->BuildStoryPageElementList();
193
194 if (this->active_button_id != StoryPageElementID::Invalid()) ResetObjectToPlace();
195
196 this->vscroll->SetCount(this->GetContentHeight());
197 this->SetWidgetDirty(WID_SB_SCROLLBAR);
198 this->SetWidgetDirty(WID_SB_SEL_PAGE);
199 this->SetWidgetDirty(WID_SB_PAGE_PANEL);
200 }
201
202 /**
203 * Selects the previous available page before the currently selected page.

Callers 2

SetSelectedPageMethod · 0.95
OnInvalidateDataMethod · 0.95

Calls 10

GetSelPageMethod · 0.95
GetContentHeightMethod · 0.95
InvalidFunction · 0.85
ResetObjectToPlaceFunction · 0.85
ForceRebuildMethod · 0.80
SetWidgetDirtyMethod · 0.80
GetStringFunction · 0.70
emptyMethod · 0.45
SetCountMethod · 0.45

Tested by

no test coverage detected