diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index 4996be2836..504687dc13 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -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(this->window_number), static_cast(s->dst)); return; } diff --git a/src/gui.h b/src/gui.h index 87df7a3283..d06b2714a1 100644 --- a/src/gui.h +++ b/src/gui.h @@ -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); diff --git a/src/league_gui.cpp b/src/league_gui.cpp index 0c1b801d32..c6b5daf32a 100644 --- a/src/league_gui.cpp +++ b/src/league_gui.cpp @@ -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(link.target)); return; } diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 3e2396ca8d..ddc0e365b1 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -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(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;