OpenTTD
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. More...
 

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

◆ ShowStoryBook()

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_idPage to open, may be INVALID_STORY_PAGE.

Definition at line 766 of file story_gui.cpp.

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

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

Variable Documentation

◆ _nested_story_book_widgets

const NWidgetPart _nested_story_book_widgets[]
static
Initial value:
= {
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),
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),
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),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
}
Page body.
Definition: story_widget.h:20
Caption of the window.
Definition: story_widget.h:18
static NWidgetPart SetResize(int16 dx, int16 dy)
Widget part function for setting the resize step.
Definition: widget_type.h:930
Horizontal container.
Definition: widget_type.h:75
Resize box (normally at bottom-right of a window)
Definition: widget_type.h:68
Close box (at top-left of a window)
Definition: widget_type.h:69
Page selector.
Definition: story_widget.h:19
Default window size box (at top-right of a window, between WWT_SHADEBOX and WWT_STICKYBOX) ...
Definition: widget_type.h:65
static NWidgetPart SetDataTip(uint32 data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1014
static NWidgetPart SetMinimalSize(int16 x, int16 y)
Widget part function for setting the minimal size.
Definition: widget_type.h:947
Simple depressed panel.
Definition: widget_type.h:50
static NWidgetPart NWidget(WidgetType tp, Colours col, int16 idx=-1)
Widget part function for starting a new &#39;real&#39; widget.
Definition: widget_type.h:1114
Next button.
Definition: story_widget.h:23
Button with a drop-down.
Definition: widget_type.h:82
Window caption (window title between closebox and stickybox)
Definition: widget_type.h:61
Vertical container.
Definition: widget_type.h:77
static NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME, WWT_INSET, or WWT_PANEL).
Definition: widget_type.h:999
Scrollbar of the goal list.
Definition: story_widget.h:21
Sticky box (at top-right of a window, after WWT_DEFSIZEBOX)
Definition: widget_type.h:66
static NWidgetPart SetFill(uint fill_x, uint fill_y)
Widget part function for setting filling.
Definition: widget_type.h:983
Vertical scrollbar.
Definition: widget_type.h:84
static NWidgetPart SetScrollbar(int index)
Attach a scrollbar to a widget.
Definition: widget_type.h:1095
Shade box (at top-right of a window, between WWT_DEBUGBOX and WWT_DEFSIZEBOX)
Definition: widget_type.h:64
Prev button.
Definition: story_widget.h:22
(Toggle) Button with text
Definition: widget_type.h:55

Definition at line 729 of file story_gui.cpp.