OpenTTD Source 20241224-master-gf74b0cf984
story_cmd.h File Reference

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, StoryPageIDCmdCreateStoryPage (DoCommandFlag flags, CompanyID company, const std::string &text)
 Create a new story page.
 
std::tuple< CommandCost, StoryPageElementIDCmdCreateStoryPageElement (DoCommandFlag flags, TileIndex tile, StoryPageID page_id, StoryPageElementType type, uint32_t reference, const std::string &text)
 Create a new story page element.
 
CommandCost CmdUpdateStoryPageElement (DoCommandFlag flags, TileIndex tile, StoryPageElementID page_element_id, uint32_t reference, const std::string &text)
 Update a new story page element.
 
CommandCost CmdSetStoryPageTitle (DoCommandFlag flags, StoryPageID page_id, const std::string &text)
 Update title of a story page.
 
CommandCost CmdSetStoryPageDate (DoCommandFlag flags, StoryPageID page_id, TimerGameCalendar::Date date)
 Update date of a story page.
 
CommandCost CmdShowStoryPage (DoCommandFlag flags, StoryPageID page_id)
 Display a story page for all clients that are allowed to view the story page.
 
CommandCost CmdRemoveStoryPage (DoCommandFlag flags, StoryPageID page_id)
 Remove a story page and associated story page elements.
 
CommandCost CmdRemoveStoryPageElement (DoCommandFlag flags, StoryPageElementID page_element_id)
 Remove a story page element.
 
CommandCost CmdStoryPageButton (DoCommandFlag flags, TileIndex tile, StoryPageElementID page_element_id, VehicleID reference)
 Clicked/used a button on a story page.
 

Detailed Description

Command definitions related to stories.

Definition in file story_cmd.h.

Function Documentation

◆ CmdCreateStoryPage()

◆ CmdCreateStoryPageElement()

◆ CmdRemoveStoryPage()

◆ CmdRemoveStoryPageElement()

CommandCost CmdRemoveStoryPageElement ( DoCommandFlag  flags,
StoryPageElementID  page_element_id 
)

◆ CmdSetStoryPageDate()

CommandCost CmdSetStoryPageDate ( DoCommandFlag  flags,
StoryPageID  page_id,
TimerGameCalendar::Date  date 
)

◆ CmdSetStoryPageTitle()

CommandCost CmdSetStoryPageTitle ( DoCommandFlag  flags,
StoryPageID  page_id,
const std::string &  text 
)

Update title of a story page.

Parameters
flagstype of operation
page_idStoryPageID to update.
texttitle text of the story page.
Returns
the cost of this operation or an error

Definition at line 320 of file story.cpp.

References _current_company, CMD_ERROR, DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_story_page_pool >::Get(), InvalidateWindowClassesData(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_story_page_pool >::IsValidID(), OWNER_DEITY, StoryPage::title, and WC_STORY_BOOK.

◆ CmdShowStoryPage()

◆ CmdStoryPageButton()

◆ CmdUpdateStoryPageElement()

CommandCost CmdUpdateStoryPageElement ( DoCommandFlag  flags,
TileIndex  tile,
StoryPageElementID  page_element_id,
uint32_t  reference,
const std::string &  text 
)

Update a new story page element.

Parameters
flagstype of operation
tileTile location if it is a location page element, otherwise unused.
page_element_idThe page element to update.
referenceId of referenced object
textText content in case it is a text or location page element
Returns
the cost of this operation or an error

Definition at line 294 of file story.cpp.

References _current_company, CMD_ERROR, DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_story_page_element_pool >::Get(), InvalidateWindowClassesData(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_story_page_element_pool >::IsValidID(), OWNER_DEITY, StoryPageElement::page, StoryPageElement::type, UpdateElement(), VerifyElementContentParameters(), and WC_STORY_BOOK.