106 _new_goal_id = g->
index;
251 #ifdef ENABLE_NETWORK 257 byte type =
GB(p2, 29, 2);
258 bool is_client =
HasBit(p2, 31);
263 #ifdef ENABLE_NETWORK 276 #ifdef ENABLE_NETWORK static void NewEvent(class ScriptEvent *event)
Queue a new event for a Game Script.
Definition of stuff that is very close to a company, like the company struct itself.
bool _networking
are we in networking mode?
CommandCost CmdCreateGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Create a new goal.
CommandCost CmdGoalQuestion(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Ask a goal related question.
Destination is a story page.
static Titem * Get(size_t index)
Returns Titem with given index.
Destination is a company.
uint16 GoalID
ID of a goal.
Popup with a set of buttons, designed to ask the user a question from a GameScript.
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
Destination is not linked.
Struct about goals, current and completed.
Goals list; Window numbers:
Tindex index
Index of this pool item.
Base core network types and some helper functions to access them.
Common return value for all commands.
CompanyByte _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
GoalTypeID dst
Index of type.
The object is owned by a superuser / goal script.
static bool IsValidTile(TileIndex tile)
Checks if a tile is valid.
void InvalidateWindowClassesData(WindowClass cls, int data, bool gui_scope)
Mark window data of all windows of a given class as invalid (in need of re-computing) Note that by de...
Functions related to low-level strings.
Some methods of Pool are placed here in order to reduce compilation time and binary size...
CommandCost CmdSetGoalProgress(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Update progress text of a goal.
Destination is an industry.
DoCommandFlag
List of flags for a command.
GoalType
Types of goal destinations.
ClientID _network_own_client_id
Our client identifier.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
char * stredup(const char *s, const char *last)
Create a duplicate of the given string.
Basic functions/variables used all over the place.
GoalTypeByte type
Type of the goal.
Base class for all pools.
#define INSTANTIATE_POOL_METHODS(name)
Force instantiation of pool methods so we don't get linker errors.
void DeleteWindowById(WindowClass cls, WindowNumber number, bool force)
Delete a window by its class and window number (if it is open).
execute the given command
Functions related to companies.
CompanyByte company
Goal is for a specific company; INVALID_COMPANY if it is global.
char * progress
Progress text of the goal.
static bool StrEmpty(const char *s)
Check if a string buffer is empty.
CompanyByte _current_company
Company currently doing an action.
uint32 TileIndex
The index/ID of a Tile.
static size_t GetNumItems()
Returns number of valid items in the pool.
ClientID
'Unique' identifier to be given to clients
bool completed
Is the goal completed or not?
void ShowGoalQuestion(uint16 id, byte type, uint32 button_mask, const char *question)
Display a goal question.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
CommandCost CmdRemoveGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Remove a goal.
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function() ...
static uint CountBits(T value)
Counts the number of set bits in a variable.
Base functions for all Games.
Functions related to commands.
Network functions used by other parts of OpenTTD.
bool _network_server
network-server is active
Main toolbar (the long bar at the top); Window numbers:
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-NULL) Titem.
CommandCost CmdSetGoalText(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Update goal text of a goal.
static void free(const void *ptr)
Version of the standard free that accepts const pointers.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
static const uint32 GOAL_QUESTION_BUTTON_COUNT
Amount of buttons available.
CommandCost CmdGoalQuestionAnswer(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Reply to a goal question.
char * text
Text of the goal.
static const byte GOAL_QUESTION_TYPE_COUNT
Amount of question types.
Owner
Enum for all companies/owners.
Window functions not directly related to making/drawing windows.
static NetworkClientInfo * GetByClientID(ClientID client_id)
Return the CI given it's client-identifier.
CommandCost CmdSetGoalCompleted(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Update completed state of a goal.
GUI functions that shouldn't be here.
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data, bool gui_scope)
Mark window data of the window of a given class and specific window number as invalid (in need of re-...