|
OpenTTD Source 20251117-master-g7398d2e290
|
Command definitions related to stories. More...
#include "command_type.h"#include "company_type.h"#include "story_type.h"#include "vehicle_type.h"Go to the source code of this file.
Functions | |
| std::tuple< CommandCost, StoryPageID > | CmdCreateStoryPage (DoCommandFlags flags, CompanyID company, const EncodedString &text) |
| Create a new story page. | |
| std::tuple< CommandCost, StoryPageElementID > | CmdCreateStoryPageElement (DoCommandFlags flags, TileIndex tile, StoryPageID page_id, StoryPageElementType type, uint32_t reference, const EncodedString &text) |
| Create a new story page element. | |
| CommandCost | CmdUpdateStoryPageElement (DoCommandFlags flags, TileIndex tile, StoryPageElementID page_element_id, uint32_t reference, const EncodedString &text) |
| Update a new story page element. | |
| CommandCost | CmdSetStoryPageTitle (DoCommandFlags flags, StoryPageID page_id, const EncodedString &text) |
| Update title of a story page. | |
| CommandCost | CmdSetStoryPageDate (DoCommandFlags flags, StoryPageID page_id, TimerGameCalendar::Date date) |
| Update date of a story page. | |
| CommandCost | CmdShowStoryPage (DoCommandFlags flags, StoryPageID page_id) |
| Display a story page for all clients that are allowed to view the story page. | |
| CommandCost | CmdRemoveStoryPage (DoCommandFlags flags, StoryPageID page_id) |
| Remove a story page and associated story page elements. | |
| CommandCost | CmdRemoveStoryPageElement (DoCommandFlags flags, StoryPageElementID page_element_id) |
| Remove a story page element. | |
| CommandCost | CmdStoryPageButton (DoCommandFlags flags, TileIndex tile, StoryPageElementID page_element_id, VehicleID reference) |
| Clicked/used a button on a story page. | |
Command definitions related to stories.
Definition in file story_cmd.h.
| std::tuple< CommandCost, StoryPageID > CmdCreateStoryPage | ( | DoCommandFlags | flags, |
| CompanyID | company, | ||
| const EncodedString & | text | ||
| ) |
Create a new story page.
| flags | type of operation |
| company | Company for which this story page belongs to. |
| text | Title of the story page. Null is allowed in which case a generic page title is provided by OpenTTD. |
Definition at line 218 of file story.cpp.
References _current_company, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::CanAllocateItem(), CMD_ERROR, TimerGameCalendar::date, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::GetNumItems(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, InvalidateWindowClassesData(), InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), WC_MAIN_TOOLBAR, and WC_STORY_BOOK.
| std::tuple< CommandCost, StoryPageElementID > CmdCreateStoryPageElement | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| StoryPageID | page_id, | ||
| StoryPageElementType | type, | ||
| uint32_t | reference, | ||
| const EncodedString & | text | ||
| ) |
Create a new story page element.
| flags | type of operation |
| tile | Tile location if it is a location page element, otherwise unused. |
| page_id | The page which the element belongs to. |
| type | Page element type |
| reference | Id of referenced object |
| text | Text content in case it is a text or location page element |
Definition at line 253 of file story.cpp.
References _current_company, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_element_pool >::CanAllocateItem(), CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_element_pool >::GetNumItems(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, InvalidateWindowClassesData(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_element_pool >::Iterate(), OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), UpdateElement(), VerifyElementContentParameters(), and WC_STORY_BOOK.
| CommandCost CmdRemoveStoryPage | ( | DoCommandFlags | flags, |
| StoryPageID | page_id | ||
| ) |
Remove a story page and associated story page elements.
| flags | type of operation |
| page_id | StoryPageID to remove. |
Definition at line 384 of file story.cpp.
References _current_company, CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::GetNumItems(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, InvalidateWindowClassesData(), InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_element_pool >::Iterate(), OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), WC_MAIN_TOOLBAR, and WC_STORY_BOOK.
| CommandCost CmdRemoveStoryPageElement | ( | DoCommandFlags | flags, |
| StoryPageElementID | page_element_id | ||
| ) |
Remove a story page element.
| flags | type of operation |
| page_element_id | StoryPageElementID to remove. |
Definition at line 413 of file story.cpp.
References _current_company, CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_element_pool >::Get(), InvalidateWindowClassesData(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_element_pool >::IsValidID(), OWNER_DEITY, StoryPageElement::page, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and WC_STORY_BOOK.
| CommandCost CmdSetStoryPageDate | ( | DoCommandFlags | flags, |
| StoryPageID | page_id, | ||
| TimerGameCalendar::Date | date | ||
| ) |
Update date of a story page.
| flags | type of operation |
| page_id | StoryPageID to update. |
| date | date |
Definition at line 344 of file story.cpp.
References _current_company, CMD_ERROR, StoryPage::date, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::Get(), InvalidateWindowClassesData(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::IsValidID(), OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and WC_STORY_BOOK.
| CommandCost CmdSetStoryPageTitle | ( | DoCommandFlags | flags, |
| StoryPageID | page_id, | ||
| const EncodedString & | text | ||
| ) |
Update title of a story page.
| flags | type of operation |
| page_id | StoryPageID to update. |
| text | title text of the story page. |
Definition at line 322 of file story.cpp.
References _current_company, CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::Get(), InvalidateWindowClassesData(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::IsValidID(), OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), StoryPage::title, and WC_STORY_BOOK.
| CommandCost CmdShowStoryPage | ( | DoCommandFlags | flags, |
| StoryPageID | page_id | ||
| ) |
Display a story page for all clients that are allowed to view the story page.
| flags | type of operation |
| page_id | StoryPageID to show. |
Definition at line 366 of file story.cpp.
References _current_company, _local_company, CMD_ERROR, StoryPage::company, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), OWNER_DEITY, ShowStoryBook(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
| CommandCost CmdStoryPageButton | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| StoryPageElementID | page_element_id, | ||
| VehicleID | reference | ||
| ) |
Clicked/used a button on a story page.
| flags | Type of operation. |
| tile | Tile selected, for tile selection buttons, otherwise unused. |
| page_element_id | story page element id of button. |
| reference | ID of selected item for buttons that select an item (e.g. vehicle), otherwise unused. |
Definition at line 438 of file story.cpp.
References _current_company, CMD_ERROR, StoryPage::company, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_element_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_vehicle_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_element_pool >::IsValidID(), IsValidTile(), Game::NewEvent(), StoryPageElement::page, SPET_BUTTON_PUSH, SPET_BUTTON_TILE, SPET_BUTTON_VEHICLE, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and StoryPageElement::type.
| CommandCost CmdUpdateStoryPageElement | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| StoryPageElementID | page_element_id, | ||
| uint32_t | reference, | ||
| const EncodedString & | text | ||
| ) |
Update a new story page element.
| flags | type of operation |
| tile | Tile location if it is a location page element, otherwise unused. |
| page_element_id | The page element to update. |
| reference | Id of referenced object |
| text | Text content in case it is a text or location page element |
Definition at line 296 of file story.cpp.
References _current_company, CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_element_pool >::Get(), InvalidateWindowClassesData(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_story_page_element_pool >::IsValidID(), OWNER_DEITY, StoryPageElement::page, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), StoryPageElement::type, UpdateElement(), VerifyElementContentParameters(), and WC_STORY_BOOK.