mirror of https://github.com/OpenTTD/OpenTTD
Codechange: use StoryPageID instead of uint16_t
parent
7b091000b0
commit
c74e385145
|
@ -136,7 +136,7 @@ struct GoalListWindow : public Window {
|
|||
CompanyID story_company = StoryPage::Get(s->dst)->company;
|
||||
if (goal_company == INVALID_COMPANY ? story_company != INVALID_COMPANY : story_company != INVALID_COMPANY && story_company != goal_company) return;
|
||||
|
||||
ShowStoryBook((CompanyID)this->window_number, s->dst);
|
||||
ShowStoryBook(static_cast<CompanyID>(this->window_number), static_cast<StoryPageID>(s->dst));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ void ShowGoalsList(CompanyID company);
|
|||
void ShowGoalQuestion(uint16_t id, uint8_t type, uint32_t button_mask, const std::string &question);
|
||||
|
||||
/* story_gui.cpp */
|
||||
void ShowStoryBook(CompanyID company, uint16_t page_id = INVALID_STORY_PAGE, bool centered = false);
|
||||
void ShowStoryBook(CompanyID company, StoryPageID page_id = INVALID_STORY_PAGE, bool centered = false);
|
||||
|
||||
/* viewport_gui.cpp */
|
||||
void ShowExtraViewportWindow(TileIndex tile = INVALID_TILE);
|
||||
|
|
|
@ -240,7 +240,7 @@ static void HandleLinkClick(Link link)
|
|||
case LT_STORY_PAGE: {
|
||||
if (!StoryPage::IsValidID(link.target)) return;
|
||||
CompanyID story_company = StoryPage::Get(link.target)->company;
|
||||
ShowStoryBook(story_company, link.target);
|
||||
ShowStoryBook(story_company, static_cast<StoryPageID>(link.target));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -630,7 +630,7 @@ public:
|
|||
* Sets the selected page.
|
||||
* @param page_index pool index of the page to select.
|
||||
*/
|
||||
void SetSelectedPage(uint16_t page_index)
|
||||
void SetSelectedPage(StoryPageID page_index)
|
||||
{
|
||||
if (this->selected_page_id != page_index) {
|
||||
if (this->active_button_id) ResetObjectToPlace();
|
||||
|
@ -845,7 +845,7 @@ public:
|
|||
if (widget != WID_SB_SEL_PAGE) return;
|
||||
|
||||
/* index (which is set in BuildDropDownList) is the page id. */
|
||||
this->SetSelectedPage(index);
|
||||
this->SetSelectedPage(static_cast<StoryPageID>(index));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1048,7 +1048,7 @@ static CursorID TranslateStoryPageButtonCursor(StoryPageButtonCursor cursor)
|
|||
* @param page_id Page to open, may be #INVALID_STORY_PAGE.
|
||||
* @param centered Whether to open the window centered.
|
||||
*/
|
||||
void ShowStoryBook(CompanyID company, uint16_t page_id, bool centered)
|
||||
void ShowStoryBook(CompanyID company, StoryPageID page_id, bool centered)
|
||||
{
|
||||
if (!Company::IsValidID(company)) company = (CompanyID)INVALID_COMPANY;
|
||||
|
||||
|
|
Loading…
Reference in New Issue