(svn r25352) -Feature: GameScript API for selecting a story page to view

This commit is contained in:
zuu
2013-06-09 12:57:22 +00:00
parent a49a4eec6e
commit 33ad9774fb
8 changed files with 55 additions and 3 deletions

View File

@@ -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);
}
}