OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
31 #include "table/strings.h"
49 typedef std::vector<LayoutCacheElement> LayoutCache;
51 enum class ElementFloat {
74 this->story_pages.clear();
77 if (this->IsPageAvailable(p)) {
78 this->story_pages.push_back(p);
82 this->story_pages.shrink_to_fit();
86 this->story_pages.
Sort();
99 this->story_page_elements.clear();
104 if (pe->page == p->
index) {
105 this->story_page_elements.push_back(pe);
110 this->story_page_elements.shrink_to_fit();
114 this->story_page_elements.
Sort();
129 bool IsPageAvailable(
const StoryPage *page)
const
151 for (
const StoryPage *p : this->story_pages) {
152 if (p->index == this->selected_page_id) {
166 if (!_story_page_pool.
IsValidID(this->selected_page_id))
return false;
177 if (!_story_page_pool.
IsValidID(this->selected_page_id))
return false;
179 if (this->story_pages.size() <= 1)
return true;
180 const StoryPage *last = this->story_pages.back();
191 if (page !=
nullptr && page->
title ==
nullptr) {
212 if (!_story_page_pool.
IsValidID(this->selected_page_id))
return;
216 last_available =
nullptr;
217 for (
const StoryPage *p : this->story_pages) {
218 if (p->index == this->selected_page_id) {
219 if (last_available ==
nullptr)
return;
232 if (!_story_page_pool.
IsValidID(this->selected_page_id))
return;
235 for (
auto iter = this->story_pages.begin(); iter != this->story_pages.end(); iter++) {
237 if (p->
index == this->selected_page_id) {
240 if (iter != this->story_pages.end()) {
255 for (
const StoryPage *p : this->story_pages) {
258 if (p->title !=
nullptr) {
264 str_item->SetParam(0, page_num);
268 list.emplace_back(item);
293 if (page ==
nullptr)
return 0;
315 if (g ==
nullptr)
return SPR_IMG_GOAL_BROKEN_REF;
316 return g->
completed ? SPR_IMG_GOAL_COMPLETED : SPR_IMG_GOAL;
319 return SPR_IMG_VIEW_LOCATION;
341 return sprite_dim.height;
369 if (
flags & SPBF_FLOAT_LEFT)
return ElementFloat::Left;
370 if (
flags & SPBF_FLOAT_RIGHT)
return ElementFloat::Right;
371 return ElementFloat::None;
375 return ElementFloat::None;
402 this->layout_cache.clear();
409 if (!this->layout_cache.empty())
return;
412 if (page ==
nullptr)
return;
421 int right_y = main_y;
426 std::vector<size_t> left_floats;
427 std::vector<size_t> right_floats;
433 if (fl == ElementFloat::None) {
436 int left_offset = (left_width == 0) ? 0 : (left_width + element_dist);
437 int right_offset = (right_width == 0) ? 0 : (right_width + element_dist);
438 if (left_offset + right_offset + min_required_width >= max_width) {
440 main_y = std::max(main_y, left_y);
441 main_y = std::max(main_y, right_y);
442 left_width = right_width = 0;
443 left_offset = right_offset = 0;
447 const int available_width = max_width - left_offset - right_offset;
450 if (left_offset == 0 && right_offset == 0) {
455 left_offset = right_offset = available_width / 5;
463 ce.bounds.left = left_offset;
464 ce.bounds.right = max_width - right_offset;
465 ce.bounds.top = main_y;
467 ce.bounds.bottom = main_y;
468 this->layout_cache.push_back(ce);
469 main_y += element_dist;
471 left_width = right_width = 0;
472 left_y = right_y = main_y = std::max({main_y, left_y, right_y});
474 right_floats.clear();
477 int &cur_width = (fl == ElementFloat::Left) ? left_width : right_width;
478 int &cur_y = (fl == ElementFloat::Left) ? left_y : right_y;
479 std::vector<size_t> &cur_floats = (fl == ElementFloat::Left) ? left_floats : right_floats;
483 ce.bounds.left = (fl == ElementFloat::Left) ? 0 : (max_width - cur_width);
484 ce.bounds.right = (fl == ElementFloat::Left) ? cur_width : max_width;
485 ce.bounds.top = cur_y;
487 ce.bounds.bottom = cur_y;
488 cur_floats.push_back(this->layout_cache.size());
489 this->layout_cache.push_back(ce);
490 cur_y += element_dist;
492 for (
size_t index : cur_floats) {
494 ce.bounds.left = (fl == ElementFloat::Left) ? 0 : (max_width - cur_width);
495 ce.bounds.right = (fl == ElementFloat::Left) ? cur_width : max_width;
510 uint max_y = std::accumulate(this->layout_cache.begin(), this->layout_cache.end(), 0, [](uint max_y,
const LayoutCacheElement &ce) -> uint { return std::max<uint>(max_y, ce.bounds.bottom); });
529 uint element_height = std::max(sprite_dim.height, (uint)line_height);
531 uint sprite_top = y_offset + (element_height - sprite_dim.height) / 2;
532 uint text_top = y_offset + (element_height - line_height) / 2;
534 DrawSprite(action_sprite, PAL_NONE, 0, sprite_top);
537 y_offset += element_height;
565 this->active_button_id = pe.
index;
573 if (this->active_button_id == pe.
index) {
579 this->active_button_id = pe.
index;
585 if (this->active_button_id == pe.
index) {
591 this->active_button_id = pe.
index;
609 this->story_pages.
SetSortFuncs(StoryBookWindow::page_sorter_funcs);
612 this->story_page_elements.
SetSortFuncs(StoryBookWindow::page_element_sorter_funcs);
619 this->selected_generic_title[0] =
'\0';
644 if (this->selected_page_id != page_index) {
647 this->selected_page_id = page_index;
663 SetDParam(0, STR_STORY_BOOK_SPECTATOR_CAPTION);
678 if (this->vscroll->
GetCount() != this->GetContentHeight()) {
692 if (page ==
nullptr)
return;
708 const int scrollpos = this->vscroll->
GetPosition();
709 int y_offset = -scrollpos;
714 DrawString(0, right - x, y_offset, STR_JUST_DATE_LONG, TC_BLACK);
716 y_offset += line_height;
725 y_offset = ce.bounds.top - scrollpos;
726 switch (ce.pe->type) {
729 y_offset =
DrawStringMultiLine(ce.bounds.left, ce.bounds.right, ce.bounds.top - scrollpos, ce.bounds.bottom - scrollpos, STR_JUST_RAW_STRING, TC_BLACK,
SA_TOP |
SA_LEFT);
734 StringID string_id = g ==
nullptr ? STR_STORY_BOOK_INVALID_GOAL_REF : STR_JUST_RAW_STRING;
752 DrawFrameRect(ce.bounds.left, ce.bounds.top - scrollpos, ce.bounds.right, ce.bounds.bottom - scrollpos - 1, bgcolour, frame);
759 default: NOT_REACHED();
779 for (
size_t i = 0; i < this->story_pages.size(); i++) {
780 const StoryPage *s = this->story_pages[i];
782 if (s->
title !=
nullptr) {
789 if (title_d.width > d.width) {
790 d.width = title_d.width;
794 d.width += padding.width;
795 d.height += padding.height;
825 for (
size_t i = 0; i < this->story_pages.size(); i++) {
826 const StoryPage *p = this->story_pages[i];
827 if (p->
index == this->selected_page_id)
break;
849 if (clicked_y >= ce.bounds.top && clicked_y < ce.bounds.bottom && pt.x >= ce.bounds.left && pt.x < ce.bounds.right) {
875 if (!gui_scope)
return;
885 if (this->story_pages.size() == 0) {
886 this->selected_generic_title[0] =
'\0';
890 if (!_story_page_pool.
IsValidID(this->selected_page_id)) {
903 }
else if (data >= 0 && this->selected_page_id == data) {
928 bool OnVehicleSelect(
const Vehicle *v)
override
940 VehicleType wanted_vehtype = data.GetVehicleType();
941 if (wanted_vehtype !=
VEH_INVALID && wanted_vehtype != v->
type)
return false;
960 &PageElementOrderSorter,
963 static const NWidgetPart _nested_story_book_widgets[] = {
992 _nested_story_book_widgets,
lengthof(_nested_story_book_widgets)
999 case SPBC_ZZZ:
return SPR_CURSOR_ZZZ;
1000 case SPBC_BUOY:
return SPR_CURSOR_BUOY;
1001 case SPBC_QUERY:
return SPR_CURSOR_QUERY;
1002 case SPBC_HQ:
return SPR_CURSOR_HQ;
1003 case SPBC_SHIP_DEPOT:
return SPR_CURSOR_SHIP_DEPOT;
1004 case SPBC_SIGN:
return SPR_CURSOR_SIGN;
1005 case SPBC_TREE:
return SPR_CURSOR_TREE;
1006 case SPBC_BUY_LAND:
return SPR_CURSOR_BUY_LAND;
1007 case SPBC_LEVEL_LAND:
return SPR_CURSOR_LEVEL_LAND;
1008 case SPBC_TOWN:
return SPR_CURSOR_TOWN;
1009 case SPBC_INDUSTRY:
return SPR_CURSOR_INDUSTRY;
1010 case SPBC_ROCKY_AREA:
return SPR_CURSOR_ROCKY_AREA;
1011 case SPBC_DESERT:
return SPR_CURSOR_DESERT;
1012 case SPBC_TRANSMITTER:
return SPR_CURSOR_TRANSMITTER;
1013 case SPBC_AIRPORT:
return SPR_CURSOR_AIRPORT;
1014 case SPBC_DOCK:
return SPR_CURSOR_DOCK;
1015 case SPBC_CANAL:
return SPR_CURSOR_CANAL;
1016 case SPBC_LOCK:
return SPR_CURSOR_LOCK;
1017 case SPBC_RIVER:
return SPR_CURSOR_RIVER;
1018 case SPBC_AQUEDUCT:
return SPR_CURSOR_AQUEDUCT;
1019 case SPBC_BRIDGE:
return SPR_CURSOR_BRIDGE;
1020 case SPBC_RAIL_STATION:
return SPR_CURSOR_RAIL_STATION;
1021 case SPBC_TUNNEL_RAIL:
return SPR_CURSOR_TUNNEL_RAIL;
1022 case SPBC_TUNNEL_ELRAIL:
return SPR_CURSOR_TUNNEL_ELRAIL;
1023 case SPBC_TUNNEL_MONO:
return SPR_CURSOR_TUNNEL_MONO;
1024 case SPBC_TUNNEL_MAGLEV:
return SPR_CURSOR_TUNNEL_MAGLEV;
1025 case SPBC_AUTORAIL:
return SPR_CURSOR_AUTORAIL;
1026 case SPBC_AUTOELRAIL:
return SPR_CURSOR_AUTOELRAIL;
1027 case SPBC_AUTOMONO:
return SPR_CURSOR_AUTOMONO;
1028 case SPBC_AUTOMAGLEV:
return SPR_CURSOR_AUTOMAGLEV;
1029 case SPBC_WAYPOINT:
return SPR_CURSOR_WAYPOINT;
1030 case SPBC_RAIL_DEPOT:
return SPR_CURSOR_RAIL_DEPOT;
1031 case SPBC_ELRAIL_DEPOT:
return SPR_CURSOR_ELRAIL_DEPOT;
1032 case SPBC_MONO_DEPOT:
return SPR_CURSOR_MONO_DEPOT;
1033 case SPBC_MAGLEV_DEPOT:
return SPR_CURSOR_MAGLEV_DEPOT;
1034 case SPBC_CONVERT_RAIL:
return SPR_CURSOR_CONVERT_RAIL;
1035 case SPBC_CONVERT_ELRAIL:
return SPR_CURSOR_CONVERT_ELRAIL;
1036 case SPBC_CONVERT_MONO:
return SPR_CURSOR_CONVERT_MONO;
1037 case SPBC_CONVERT_MAGLEV:
return SPR_CURSOR_CONVERT_MAGLEV;
1038 case SPBC_AUTOROAD:
return SPR_CURSOR_AUTOROAD;
1039 case SPBC_AUTOTRAM:
return SPR_CURSOR_AUTOTRAM;
1040 case SPBC_ROAD_DEPOT:
return SPR_CURSOR_ROAD_DEPOT;
1041 case SPBC_BUS_STATION:
return SPR_CURSOR_BUS_STATION;
1042 case SPBC_TRUCK_STATION:
return SPR_CURSOR_TRUCK_STATION;
1043 case SPBC_ROAD_TUNNEL:
return SPR_CURSOR_ROAD_TUNNEL;
1044 case SPBC_CLONE_TRAIN:
return SPR_CURSOR_CLONE_TRAIN;
1045 case SPBC_CLONE_ROADVEH:
return SPR_CURSOR_CLONE_ROADVEH;
1046 case SPBC_CLONE_SHIP:
return SPR_CURSOR_CLONE_SHIP;
1047 case SPBC_CLONE_AIRPLANE:
return SPR_CURSOR_CLONE_AIRPLANE;
1053 default:
return SPR_CURSOR_QUERY;
1066 StoryBookWindow *w = AllocateWindowDescFront<StoryBookWindow>(&_story_book_desc, company,
true);
uint32 sort_value
A number that increases for every created story page element. Used for sorting. The id of a story pag...
bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
void SetTimeout()
Set the timeout flag of the window and initiate the timer.
@ SPET_TEXT
A text element.
uint32 TileIndex
The index/ID of a Tile.
Struct about goals, current and completed.
void OnClick(Point pt, int widget, int click_count) override
A click with the left mouse button has been made on the window.
int GetSelPageNum() const
Get the page number of selected page.
static Titem * Get(size_t index)
Returns Titem with given index.
bool ScrollMainWindowToTile(TileIndex tile, bool instant)
Scrolls the viewport of the main window to a given location.
void ShowGoalsList(CompanyID company)
Open a goal list window.
String list item with parameters.
void ShowExtraViewportWindow(TileIndex tile=INVALID_TILE)
Show a new Extra Viewport window.
Dimensions (a width and height) of a rectangle in 2D.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
bool Sort(Comp compare)
Sort the list.
const Scrollbar * GetScrollbar(uint widnum) const
Return the Scrollbar to a widget index.
void SetStringParameters(int widget) const override
Initialize string parameters for a widget.
void DrawWidget(const Rect &r, int widget) const override
Draw the contents of a nested widget.
static const CursorID ANIMCURSOR_RAISELAND
696 - 698 - raise land tool
StoryPageButtonFlags
Flags available for buttons.
int GetPageElementFloatWidth(const StoryPageElement &pe) const
Get the width a page element would use if it was floating left or right.
@ WID_SB_NEXT_PAGE
Next button.
std::vector< std::unique_ptr< const DropDownListItem > > DropDownList
A drop down list is a collection of drop down list items.
SpriteID GetPageElementSprite(const StoryPageElement &pe) const
Decides which sprite to display for a given page element.
uint GetAvailablePageContentWidth() const
Get the width available for displaying content on the page panel.
DropDownList BuildDropDownList() const
Builds the page selector drop down list.
FrameFlags
Flags to describe the look of the frame.
void CreateNestedTree(bool fill_nested=true)
Perform the first part of the initialization of a nested widget tree.
Tindex index
Index of this pool item.
List item containing a C char string.
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
static const CursorID ANIMCURSOR_BUILDSIGNALS
1292 - 1293 - build signal
@ SPET_BUTTON_PUSH
A push button that triggers an immediate event.
LayoutCache layout_cache
Cached element layout.
bool _ctrl_pressed
Is Ctrl pressed?
@ WD_FRAMETEXT_TOP
Top offset of the text of the frame.
void SelectNextPage()
Selects the next available page after the currently selected page.
int DrawString(int left, int right, int top, const char *str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly truncated to make it fit in its allocated space.
@ SPET_GOAL
An element that references a goal.
static const StoryPageElementID INVALID_STORY_PAGE_ELEMENT
Constant representing a non-existing story page element.
static const CursorID ANIMCURSOR_DEMOLISH
704 - 707 - demolish dynamite
uint32 sort_value
A number that increases for every created story page. Used for sorting. The id of a story page is the...
Owner owner
The owner of the content shown in this window. Company colour is acquired from this variable.
int32 WindowNumber
Number to differentiate different windows of the same class.
@ FR_LOWERED
If set the frame is lowered and the background colour brighter (ie. buttons when pressed)
Owner
Enum for all companies/owners.
void OnTimeout() override
Called when this window's timeout has been reached.
@ WD_FRAMETEXT_LEFT
Left offset of the text of the frame.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.
@ WID_SB_PAGE_PANEL
Page body.
Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize)
Return the string dimension in pixels.
uint32 referenced_id
Id of referenced object (location, goal etc.)
int DrawStringMultiLine(int left, int right, int top, int bottom, const char *str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly over multiple lines.
char selected_generic_title[255]
If the selected page doesn't have a custom title, this buffer is used to store a generic page title.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
@ SPET_BUTTON_VEHICLE
A button that allows the player to select a vehicle, and triggers an event wih the vehicle.
High level window description.
@ WC_STORY_BOOK
Story book; Window numbers:
static const CursorID ANIMCURSOR_PICKSTATION
716 - 718 - goto-order icon
Scrollbar * vscroll
Scrollbar of the page text.
@ SPET_BUTTON_TILE
A button that allows the player to select a tile, and triggers an event with the tile.
ResizeInfo resize
Resize information.
StoryPageElementType type
Type of page element.
uint32 CursorID
The number of the cursor (sprite)
bool DoCommandP(const CommandContainer *container, bool my_cmd)
Shortcut for the long DoCommandP when having a container with the data.
@ FS_NORMAL
Index of the normal font in the font tables.
@ SA_TOP
Top align the text.
GUIStoryPageElementList story_page_elements
Sorted list of page elements that belong to the current page.
int height
Height of the window (number of pixels down in y direction)
uint16 StoryPageID
ID of a story page.
bool SortFunction(const const StoryPage * &, const const StoryPage * &)
Signature of sort function.
void SelectPrevPage()
Selects the previous available page before the currently selected page.
StoryPage * GetSelPage() const
Get instance of selected page.
@ WD_FRAMETEXT_BOTTOM
Bottom offset of the text of the frame.
void ShowDropDownList(Window *w, DropDownList &&list, int selected, int button, uint width, bool auto_width, bool instant_close)
Show a drop down list.
void InvalidateStoryPageElementLayout()
Invalidate the current page layout.
Struct about stories, current and completed.
void RefreshSelectedPage()
Updates the content of selected page.
void SetWidgetDisabledState(byte widget_index, bool disab_stat)
Sets the enabled/disabled status of a widget.
uint GetHeadHeight(int max_width) const
Counts how many pixels of height that are used by Date and Title (excluding marginal after Title,...
@ WID_SB_CAPTION
Caption of the window.
void OnPageElementClick(const StoryPageElement &pe)
Internal event handler for when a page element is clicked.
void OnPlaceObjectAbort() override
The user cancelled a tile highlight mode that has been set.
WindowFlags flags
Window flags.
@ VEH_INVALID
Non-existing type of vehicle.
StoryPageID selected_page_id
Pool index of selected page.
@ SPET_LOCATION
An element that references a tile along with a one-line text.
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
@ CMD_STORY_PAGE_BUTTON
selection via story page button
void SetSelectedPage(uint16 page_index)
Sets the selected page.
Coordinates of a point in 2D.
StoryPageButtonCursor
Mouse cursors usable by story page buttons.
uint GetPageElementHeight(const StoryPageElement &pe, int max_width) const
Get the height in pixels used by a page element.
@ WD_FRAMETEXT_RIGHT
Right offset of the text of the frame.
WindowNumber window_number
Window number within the window class.
VehicleType
Available vehicle types.
char * title
Title of story page.
Titem * Get(size_t index)
Returns Titem with given index.
void ShowStoryBook(CompanyID company, uint16 page_id)
Raise or create the story book window for company, at page page_id.
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
@ SA_HOR_CENTER
Horizontally center the text.
void OnDropdownSelect(int widget, int index) override
A dropdown option associated to this window has been selected.
@ HT_VEHICLE
vehicle is accepted as target as well (bitmask)
bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height)
Set up a clipping area for only drawing into a certain area.
int GetStringHeight(const char *str, int maxw, FontSize fontsize)
Calculates height of string (in pixels).
Dimension GetSpriteSize(SpriteID sprid, Point *offset, ZoomLevel zoom)
Get the size of a sprite.
bool NeedRebuild() const
Check if a rebuild is needed.
bool IsFirstPageSelected()
Check if the selected page is also the first available page.
void DrawActionElement(int &y_offset, int width, int line_height, SpriteID action_sprite, StringID string_id=STR_JUST_RAW_STRING) const
Draws a page element that is composed of a sprite to the left and a single line of text after that.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
static bool PageElementOrderSorter(const StoryPageElement *const &a, const StoryPageElement *const &b)
Sort story page elements by order value.
static const Date INVALID_DATE
Representation of an invalid date.
@ WD_BEVEL_RIGHT
Width of right bevel border.
#define FONT_HEIGHT_NORMAL
Height of characters in the normal (FS_NORMAL) font.
bool completed
Is the goal completed or not?
@ WID_SB_PREV_PAGE
Prev button.
void OnResize() override
Called after the window got resized.
GUIStoryPageList story_pages
Sorted list of pages.
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
Update size and resize step of a widget in the window.
uint16 StoryPageElementID
ID of a story page element.
@ HT_RECT
rectangle (stations, depots, ...)
Struct about story page elements.
void FinishInitNested(WindowNumber window_number=0)
Perform the second part of the initialization of a nested widget tree.
@ SA_LEFT
Left align the text.
@ WD_BEVEL_TOP
Height of top bevel border.
@ WD_BEVEL_LEFT
Width of left bevel border.
void ForceRebuild()
Force that a rebuild is needed.
@ SA_CENTER
Center both horizontally and vertically.
#define lengthof(x)
Return the length of an fixed size array.
int width
width of the window (number of pixels to the right in x direction)
static const StoryPageID INVALID_STORY_PAGE
Constant representing a non-existing story page.
void OnPlaceObject(Point pt, TileIndex tile) override
The user clicked some place on the map when a tile highlight mode has been set.
void SetObjectToPlaceWnd(CursorID icon, PaletteID pal, HighLightStyle mode, Window *w)
Change the cursor and mouse click/drag handling to a mode for performing special operations like tile...
@ INVALID_COMPANY
An invalid company.
char * text
Static content text of page element.
static const CursorID SPR_CURSOR_MOUSE
Cursor sprite numbers.
Helper to construct packed "id" values for button-type StoryPageElement.
static bool PageOrderSorter(const StoryPage *const &a, const StoryPage *const &b)
Sort story pages by order value.
Data structure for an opened window.
void RebuildDone()
Notify the sortlist that the rebuild is done.
@ WID_SB_SEL_PAGE
Page selector.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
VehicleType type
Type of vehicle.
void DrawWidgets() const
Paint all widgets of a window.
void UpdatePrevNextDisabledState()
Updates the disabled state of the prev/next buttons.
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
void BuildStoryPageList()
(Re)Build story page list.
void SetWidgetDirty(byte widget_index) const
Invalidate a widget, i.e.
@ WID_SB_SCROLLBAR
Scrollbar of the goal list.
uint16 GoalID
ID of a goal.
Specification of a rectangle with absolute coordinates of all edges.
uint GetContentHeight()
Get the total height of the content displayed in this window.
Date date
Date when the page was created.
@ WD_BEVEL_BOTTOM
Height of bottom bevel border.
#define lastof(x)
Get the last element of an fixed size array.
CompanyID company
StoryPage is for a specific company; INVALID_COMPANY if it is global.
bool IsLastPageSelected()
Check if the selected page is also the last available page.
void ResetObjectToPlace()
Reset the cursor and mouse mode handling back to default (normal cursor, only clicking in windows).
@ WDP_CENTER
Center the window.
void OnPaint() override
The window must be repainted.
ElementFloat GetPageElementFloat(const StoryPageElement &pe) const
Get the float style of a page element.
char * text
Text of the goal.
void SetDParamStr(uint n, const char *str)
This function is used to "bind" a C string to a OpenTTD dparam slot.
void BuildStoryPageElementList()
(Re)Build story page element list.
void SetSortFuncs(SortFunction *const *n_funcs)
Hand the array of sort function pointers to the sort list.
Data about how and where to blit pixels.
void EnsureStoryPageElementLayout() const
Create the page layout if it is missing.
StoryPageElementID active_button_id
Which button element the player is currently using.
static const CursorID ANIMCURSOR_LOWERLAND
699 - 701 - lower land tool