OpenTTD Source 20260206-master-g4d4e37dbf1
story_cmd.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
9
10#ifndef STORY_CMD_H
11#define STORY_CMD_H
12
13#include "command_type.h"
14#include "company_type.h"
15#include "story_type.h"
16#include "vehicle_type.h"
17
18std::tuple<CommandCost, StoryPageID> CmdCreateStoryPage(DoCommandFlags flags, CompanyID company, const EncodedString &text);
19std::tuple<CommandCost, StoryPageElementID> CmdCreateStoryPageElement(DoCommandFlags flags, TileIndex tile, StoryPageID page_id, StoryPageElementType type, uint32_t reference, const EncodedString &text);
20CommandCost CmdUpdateStoryPageElement(DoCommandFlags flags, TileIndex tile, StoryPageElementID page_element_id, uint32_t reference, const EncodedString &text);
21CommandCost CmdSetStoryPageTitle(DoCommandFlags flags, StoryPageID page_id, const EncodedString &text);
22CommandCost CmdSetStoryPageDate(DoCommandFlags flags, StoryPageID page_id, TimerGameCalendar::Date date);
23CommandCost CmdShowStoryPage(DoCommandFlags flags, StoryPageID page_id);
24CommandCost CmdRemoveStoryPage(DoCommandFlags flags, StoryPageID page_id);
25CommandCost CmdRemoveStoryPageElement(DoCommandFlags flags, StoryPageElementID page_element_id);
26CommandCost CmdStoryPageButton(DoCommandFlags flags, TileIndex tile, StoryPageElementID page_element_id, VehicleID reference);
27
37
38#endif /* STORY_CMD_H */
Common return value for all commands.
Container for an encoded string, created by GetEncodedString.
Types related to commands.
@ OtherManagement
Renaming stuff, changing company colours, placing signs, etc.
@ Deity
the command may be executed by COMPANY_DEITY
@ StrCtrl
the command's string may contain control strings
@ SetStoryPageTitle
update title of a story page
@ ShowStoryPage
show a story page
@ SetStoryPageDate
update date of a story page
@ UpdateStoryPageElement
update a story page element
@ StoryPageButton
selection via story page button
@ RemoveStoryPage
remove a story page
@ CreateStoryPageElement
create a new story page element
@ CreateStoryPage
create a new story page
@ RemoveStoryPageElement
remove a story page element
Types related to companies.
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.
Definition story.cpp:293
std::tuple< CommandCost, StoryPageID > CmdCreateStoryPage(DoCommandFlags flags, CompanyID company, const EncodedString &text)
Create a new story page.
Definition story.cpp:258
CommandCost CmdUpdateStoryPageElement(DoCommandFlags flags, TileIndex tile, StoryPageElementID page_element_id, uint32_t reference, const EncodedString &text)
Update a new story page element.
Definition story.cpp:336
CommandCost CmdRemoveStoryPageElement(DoCommandFlags flags, StoryPageElementID page_element_id)
Remove a story page element.
Definition story.cpp:453
CommandCost CmdRemoveStoryPage(DoCommandFlags flags, StoryPageID page_id)
Remove a story page and associated story page elements.
Definition story.cpp:424
CommandCost CmdStoryPageButton(DoCommandFlags flags, TileIndex tile, StoryPageElementID page_element_id, VehicleID reference)
Clicked/used a button on a story page.
Definition story.cpp:478
CommandCost CmdSetStoryPageTitle(DoCommandFlags flags, StoryPageID page_id, const EncodedString &text)
Update title of a story page.
Definition story.cpp:362
CommandCost CmdSetStoryPageDate(DoCommandFlags flags, StoryPageID page_id, TimerGameCalendar::Date date)
Update date of a story page.
Definition story.cpp:384
CommandCost CmdShowStoryPage(DoCommandFlags flags, StoryPageID page_id)
Display a story page for all clients that are allowed to view the story page.
Definition story.cpp:406
StoryPageElementType
Definition story_base.h:31
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.
Definition story.cpp:293
std::tuple< CommandCost, StoryPageID > CmdCreateStoryPage(DoCommandFlags flags, CompanyID company, const EncodedString &text)
Create a new story page.
Definition story.cpp:258
CommandCost CmdUpdateStoryPageElement(DoCommandFlags flags, TileIndex tile, StoryPageElementID page_element_id, uint32_t reference, const EncodedString &text)
Update a new story page element.
Definition story.cpp:336
CommandCost CmdRemoveStoryPageElement(DoCommandFlags flags, StoryPageElementID page_element_id)
Remove a story page element.
Definition story.cpp:453
CommandCost CmdRemoveStoryPage(DoCommandFlags flags, StoryPageID page_id)
Remove a story page and associated story page elements.
Definition story.cpp:424
CommandCost CmdStoryPageButton(DoCommandFlags flags, TileIndex tile, StoryPageElementID page_element_id, VehicleID reference)
Clicked/used a button on a story page.
Definition story.cpp:478
CommandCost CmdSetStoryPageTitle(DoCommandFlags flags, StoryPageID page_id, const EncodedString &text)
Update title of a story page.
Definition story.cpp:362
CommandCost CmdSetStoryPageDate(DoCommandFlags flags, StoryPageID page_id, TimerGameCalendar::Date date)
Update date of a story page.
Definition story.cpp:384
CommandCost CmdShowStoryPage(DoCommandFlags flags, StoryPageID page_id)
Display a story page for all clients that are allowed to view the story page.
Definition story.cpp:406
Basic types related to story pages.
PoolID< uint16_t, struct StoryPageIDTag, 64000, 0xFFFF > StoryPageID
ID of a story page.
Definition story_type.h:16
PoolID< uint16_t, struct StoryPageElementIDTag, 64000, 0xFFFF > StoryPageElementID
ID of a story page element.
Definition story_type.h:15
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > > TileIndex
The index/ID of a Tile.
Definition tile_type.h:92
Types related to vehicles.
PoolID< uint32_t, struct VehicleIDTag, 0xFF000, 0xFFFFF > VehicleID
The type all our vehicle IDs have.