Go to the documentation of this file.
26 #include "table/strings.h"
64 loan = ((uint64)p1 << 32) | (p2 & 0xFFFFFFFC);
110 loan = ((uint64)p1 << 32) | (p2 & 0xFFFFFFFC);
115 if (c->
money < loan) {
173 STR_NEWGRF_UNPAUSE_WARNING_TITLE,
174 STR_NEWGRF_UNPAUSE_WARNING,
222 int32 delta = (int32)p1;
224 ExpensesType expenses_type = Extract<ExpensesType, 8, 8>(p2);
uint32 TileIndex
The index/ID of a Tile.
CommandCost CmdIncreaseLoan(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Increase the loan of your company.
static Titem * Get(size_t index)
Returns Titem with given index.
@ EXPENSES_END
Number of expense types.
void SetWindowDirty(WindowClass cls, WindowNumber number)
Mark window as dirty (in need of repainting)
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
Class to backup a specific variable and restore it later.
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.
@ EXPENSES_OTHER
Other expenses.
static const int LOAN_INTERVAL
The "steps" in loan size, in British Pounds!
static const uint TILE_SIZE
Tile size in world coordinates.
void NetworkHandlePauseChange(PauseMode prev_mode, PauseMode changed_mode)
Handle the pause mode change so we send the right messages to the chat.
Money max_loan
NOSAVE: Maximum possible loan.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
Owner
Enum for all companies/owners.
@ DC_EXEC
execute the given command
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.
DoCommandFlag
List of flags for a command.
Money current_loan
Amount of money borrowed from the bank.
static uint TileX(TileIndex tile)
Get the X component of a tile.
#define return_cmd_error(errcode)
Returns from a function with a specific StringID as error.
Common return value for all commands.
@ PM_PAUSED_SAVELOAD
A game paused for saving/loading.
bool DoCommandP(const CommandContainer *container, bool my_cmd)
Shortcut for the long DoCommandP when having a container with the data.
@ CMD_PAUSE
pause the game
static void AskUnsafeUnpauseCallback(Window *w, bool confirmed)
In case of an unsafe unpause, we want the user to confirm that it might crash.
Money money
Money owned by the company.
void InvalidateCompanyWindows(const Company *company)
Refresh all windows owned by a company.
PauseMode _pause_mode
The current pause mode.
bool _networking
are we in networking mode?
PauseMode
Modes of pausing we've got.
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
Display animated income or costs on the map.
@ PM_PAUSED_GAME_SCRIPT
A game paused by a game script.
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.
@ PM_PAUSED_ACTIVE_CLIENTS
A game paused for 'min_active_clients'.
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...
CompanyID _current_company
Company currently doing an action.
static int GetTilePixelZ(TileIndex tile)
Get bottom height of the tile.
void Restore()
Restore the variable.
@ PM_PAUSED_NORMAL
A game normally paused.
@ OWNER_DEITY
The object is owned by a superuser / goal script.
@ PM_PAUSED_LINK_GRAPH
A game paused due to the link graph schedule lagging.
@ PM_PAUSED_JOIN
A game paused for 'pause_on_join'.
CommandCost CmdMoneyCheat(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Change the financial flow of your company.
Data structure for an opened window.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
@ WC_STATUS_BAR
Statusbar (at the bottom of your screen); Window numbers:
void SubtractMoneyFromCompany(const CommandCost &cost)
Subtract money from the _current_company, if the company is valid.
ExpensesType
Types of expenses.
@ PM_PAUSED_ERROR
A game paused because a (critical) error.
@ WC_MAIN_TOOLBAR
Main toolbar (the long bar at the top); Window numbers: