* Builds the page selector drop down list. */
| 244 | * Builds the page selector drop down list. |
| 245 | */ |
| 246 | DropDownList BuildDropDownList() const |
| 247 | { |
| 248 | DropDownList list; |
| 249 | uint16_t page_num = 1; |
| 250 | for (const StoryPage *p : this->story_pages) { |
| 251 | bool current_page = p->index == this->selected_page_id; |
| 252 | if (!p->title.empty()) { |
| 253 | list.push_back(MakeDropDownListStringItem(p->title.GetDecodedString(), p->index.base(), current_page)); |
| 254 | } else { |
| 255 | /* No custom title => use a generic page title with page number. */ |
| 256 | list.push_back(MakeDropDownListStringItem(GetString(STR_STORY_BOOK_GENERIC_PAGE_ITEM, page_num), p->index.base(), current_page)); |
| 257 | } |
| 258 | page_num++; |
| 259 | } |
| 260 | |
| 261 | return list; |
| 262 | } |
| 263 | |
| 264 | /** |
| 265 | * Get the width available for displaying content on the page panel. |
no test coverage detected