summaryrefslogtreecommitdiff
path: root/src/story_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/story_gui.cpp')
-rw-r--r--src/story_gui.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/story_gui.cpp b/src/story_gui.cpp
index 62ec3606a..64782b90e 100644
--- a/src/story_gui.cpp
+++ b/src/story_gui.cpp
@@ -23,6 +23,7 @@
#include "sortlist_type.h"
#include "goal_base.h"
#include "viewport_func.h"
+#include "window_func.h"
#include "widgets/story_widget.h"
@@ -725,7 +726,11 @@ static WindowDesc _story_book_desc(
_nested_story_book_widgets, lengthof(_nested_story_book_widgets)
);
-void ShowStoryBook()
+void ShowStoryBook(uint16 page_id)
{
- AllocateWindowDescFront<StoryBookWindow>(&_story_book_desc, 0);
+ StoryBookWindow *w = AllocateWindowDescFront<StoryBookWindow>(&_story_book_desc, 0);
+ if (page_id != INVALID_STORY_PAGE) {
+ if (w == NULL) w = (StoryBookWindow *)FindWindowById(WC_STORY_BOOK, 0);
+ w->SetSelectedPage(page_id);
+ }
}