24 #include "table/strings.h" 108 if (c->
money < loan) {
165 STR_NEWGRF_UNPAUSE_WARNING_TITLE,
166 STR_NEWGRF_UNPAUSE_WARNING,
214 int32 delta = (int32)p1;
216 ExpensesType expenses_type = Extract<ExpensesType, 8, 8>(p2);
void InvalidateCompanyWindows(const Company *company)
Refresh all windows owned by a company.
Functions related to OTTD's strings.
Owner
Enum for all companies/owners.
CommandCost CmdGiveMoney(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Transfer funds (money) from one company to another.
A game paused for 'min_active_clients'.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Definition of stuff that is very close to a company, like the company struct itself.
bool _networking
are we in networking mode?
void SetWindowDirty(WindowClass cls, WindowNumber number)
Mark window as dirty (in need of repainting)
EconomySettings economy
settings to change the economy
static Titem * Get(size_t index)
Returns Titem with given index.
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
CommandCost CmdMoneyCheat(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Change the financial flow of your company.
static const int LOAN_INTERVAL
The "steps" in loan size, in British Pounds!
bool give_money
allow giving other companies money
static void AskUnsafeUnpauseCallback(Window *w, bool confirmed)
In case of an unsafe unpause, we want the user to confirm that it might crash.
Helper functions to extract data from command parameters.
Money GetCost() const
The costs as made up to this moment.
Stuff related to the text buffer GUI.
Common return value for all commands.
static T max(const T a, const T b)
Returns the maximum of two values.
void NetworkHandlePauseChange(PauseMode prev_mode, PauseMode changed_mode)
Handle the pause mode change so we send the right messages to the chat.
Class to backup a specific variable and restore it later.
Data structure for an opened window.
CommandCost CmdPause(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Pause/Unpause the game (server-only).
CommandCost CmdDecreaseLoan(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Decrease the loan of your company.
void ShowQuery(StringID caption, StringID message, Window *parent, QueryCallbackProc *callback)
Show a modal confirmation window with standard 'yes' and 'no' buttons The window is aligned to the ce...
A game paused for saving/loading.
DoCommandFlag
List of flags for a command.
Money current_loan
Amount of money borrowed from the bank.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
GUI Functions related to companies.
Money money
Money owned by the company.
Basic functions/variables used all over the place.
bool DoCommandP(const CommandContainer *container, bool my_cmd)
Shortcut for the long DoCommandP when having a container with the data.
static T min(const T a, const T b)
Returns the minimum of two values.
PauseMode _pause_mode
The current pause mode.
Money max_loan
NOSAVE: Maximum possible loan.
PauseMode
Modes of pausing we've got.
#define return_cmd_error(errcode)
Returns from a function with a specific StringID as error.
execute the given command
Functions related to companies.
CommandCost CmdChangeBankBalance(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Change the bank bank balance of a company by inserting or removing money without affecting the loan...
uint32 TileIndex
The index/ID of a Tile.
Functions related to the economy.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
void SubtractMoneyFromCompany(CommandCost cost)
Subtract money from the _current_company, if the company is valid.
CommandCost CmdIncreaseLoan(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Increase the loan of your company.
Statusbar (at the bottom of your screen); Window numbers:
Functions related to commands.
Network functions used by other parts of OpenTTD.
Main toolbar (the long bar at the top); Window numbers:
CompanyID _current_company
Company currently doing an action.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
void Restore()
Restore the variable.
A game paused by a game script.
Window functions not directly related to making/drawing windows.
A game paused for 'pause_on_join'.
ExpensesType
Types of expenses.
The object is owned by a superuser / goal script.
Class for backupping variables and making sure they are restored later.
A game paused because a (critical) error.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.