OpenTTD: src/story_gui.cpp File Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Data Structures | Typedefs | Functions | Variables
story_gui.cpp File Reference

GUI for stories. More...

`#include "stdafx.h"`
`#include "window_gui.h"`
`#include "strings_func.h"`
`#include "date_func.h"`
`#include "gui.h"`
`#include "story_base.h"`
`#include "core/geometry_func.hpp"`
`#include "company_func.h"`
`#include "command_func.h"`
`#include "widgets/dropdown_type.h"`
`#include "widgets/dropdown_func.h"`
`#include "sortlist_type.h"`
`#include "goal_base.h"`
`#include "viewport_func.h"`
`#include "window_func.h"`
`#include "company_base.h"`
`#include "widgets/story_widget.h"`
`#include "table/strings.h"`
`#include "table/sprites.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | StoryBookWindow

## Typedefs
typedef GUIList< const StoryPage * > | GUIStoryPageList
typedef GUIList< const StoryPageElement * > | GUIStoryPageElementList

## Functions
void | ShowStoryBook (CompanyID company, uint16 page_id)
| Raise or create the story book window for company, at page page_id.

## Variables
static const NWidgetPart | _nested_story_book_widgets []
static WindowDesc | _story_book_desc (WDP_CENTER,"view_story", 400, 300, WC_STORY_BOOK, WC_NONE, 0, _nested_story_book_widgets, lengthof(_nested_story_book_widgets))

## Detailed Description

GUI for stories.

Definition in file story_gui.cpp.

## Function Documentation

void ShowStoryBook | ( | CompanyID | company,
|  | uint16 | page_id
| ) |  |

Raise or create the story book window for company, at page page_id.

Parameters

  company | 'Owner' of the story book, may be INVALID_COMPANY.
  page_id | Page to open, may be INVALID_STORY_PAGE.

Definition at line 766 of file story_gui.cpp.

References INVALID_COMPANY, INVALID_STORY_PAGE, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), and StoryBookWindow::SetSelectedPage().

Referenced by CmdShowStoryPage(), GoalListWindow::HandleClick(), MenuClickStory(), and MainToolbarWindow::OnHotkey().

## Variable Documentation

const NWidgetPart _nested_story_book_widgets[]
| static

Initial value:
{
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_SB_CAPTION), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
EndContainer(),
NWidget(NWID_HORIZONTAL), SetFill(1, 1),
NWidget(NWID_VERTICAL), SetFill(1, 1),
NWidget(WWT_PANEL, COLOUR_BROWN, WID_SB_PAGE_PANEL), SetResize(1, 1), SetScrollbar(WID_SB_SCROLLBAR), EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_TEXTBTN, COLOUR_BROWN, WID_SB_PREV_PAGE), SetMinimalSize(100, 0), SetFill(0, 0), SetDataTip(STR_STORY_BOOK_PREV_PAGE, STR_STORY_BOOK_PREV_PAGE_TOOLTIP),
NWidget(NWID_BUTTON_DROPDOWN, COLOUR_BROWN, WID_SB_SEL_PAGE), SetMinimalSize(93, 12), SetFill(1, 0),
SetDataTip(STR_BLACK_RAW_STRING, STR_STORY_BOOK_SEL_PAGE_TOOLTIP), SetResize(1, 0),
NWidget(WWT_TEXTBTN, COLOUR_BROWN, WID_SB_NEXT_PAGE), SetMinimalSize(100, 0), SetFill(0, 0), SetDataTip(STR_STORY_BOOK_NEXT_PAGE, STR_STORY_BOOK_NEXT_PAGE_TOOLTIP),
EndContainer(),
EndContainer(),
NWidget(NWID_VERTICAL), SetFill(0, 1),
NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, WID_SB_SCROLLBAR),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
EndContainer(),
EndContainer(),
}

Definition at line 729 of file story_gui.cpp.