|
OpenTTD Source 20251116-master-g21329071df
|
Miscellaneous command definitions. More...
Go to the source code of this file.
Enumerations | |
| enum class | LoanCommand : uint8_t { Interval , Max , Amount } |
Functions | |
| CommandCost | CmdMoneyCheat (DoCommandFlags flags, Money amount) |
| Change the financial flow of your company. | |
| CommandCost | CmdChangeBankBalance (DoCommandFlags flags, TileIndex tile, Money delta, CompanyID company, ExpensesType expenses_type) |
| Change the bank bank balance of a company by inserting or removing money without affecting the loan. | |
| CommandCost | CmdIncreaseLoan (DoCommandFlags flags, LoanCommand cmd, Money amount) |
| Increase the loan of your company. | |
| CommandCost | CmdDecreaseLoan (DoCommandFlags flags, LoanCommand cmd, Money amount) |
| Decrease the loan of your company. | |
| CommandCost | CmdSetCompanyMaxLoan (DoCommandFlags flags, CompanyID company, Money amount) |
| Sets the max loan amount of your company. | |
| CommandCost | CmdPause (DoCommandFlags flags, PauseMode mode, bool pause) |
| Pause/Unpause the game (server-only). | |
Miscellaneous command definitions.
Definition in file misc_cmd.h.
|
strong |
Definition at line 17 of file misc_cmd.h.
| CommandCost CmdChangeBankBalance | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| Money | delta, | ||
| CompanyID | company, | ||
| ExpensesType | expenses_type | ||
| ) |
Change the bank bank balance of a company by inserting or removing money without affecting the loan.
| flags | operation to perform |
| tile | tile to show text effect on (if not 0) |
| delta | the amount of money to receive (if positive), or spend (if negative) |
| company | the company ID. |
| expenses_type | the expenses type which should register the cost/income |
Definition at line 234 of file misc_cmd.cpp.
References _current_company, CMD_ERROR, Execute, EXPENSES_END, GetTilePixelZ(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), OWNER_DEITY, Backup< T >::Restore(), ShowCostOrIncomeAnimation(), SubtractMoneyFromCompany(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TILE_SIZE, TileX(), and TileY().
| CommandCost CmdDecreaseLoan | ( | DoCommandFlags | flags, |
| LoanCommand | cmd, | ||
| Money | amount | ||
| ) |
Decrease the loan of your company.
| flags | operation to perform |
| cmd | when LoanCommand::Interval: pays back LOAN_INTERVAL, when LoanCommand::Max: pays back the maximum loan permitting money (press CTRL), when LoanCommand::Amount: pays back the amount specified in amount |
| amount | amount to decrease the loan with, multitude of LOAN_INTERVAL. Only used when cmd == LoanCommand::Amount. |
Definition at line 85 of file misc_cmd.cpp.
References _current_company, CMD_ERROR, CommandCostWithParam(), CompanyProperties::current_loan, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), GetAvailableMoneyForCommand(), InvalidateCompanyWindows(), LOAN_INTERVAL, CompanyProperties::money, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
| CommandCost CmdIncreaseLoan | ( | DoCommandFlags | flags, |
| LoanCommand | cmd, | ||
| Money | amount | ||
| ) |
Increase the loan of your company.
| flags | operation to perform |
| cmd | when LoanCommand::Interval: loans LOAN_INTERVAL, when LoanCommand::Max: loans the maximum loan permitting money (press CTRL), when LoanCommand::Amount: loans the amount specified in amount |
| amount | amount to increase the loan with, multitude of LOAN_INTERVAL. Only used when cmd == LoanCommand::Amount. |
Definition at line 39 of file misc_cmd.cpp.
References _current_company, CMD_ERROR, CommandCostWithParam(), CompanyProperties::current_loan, Execute, EXPENSES_OTHER, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), Company::GetMaxLoan(), InvalidateCompanyWindows(), LOAN_INTERVAL, CompanyProperties::money, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
| CommandCost CmdMoneyCheat | ( | DoCommandFlags | flags, |
| Money | amount | ||
| ) |
Change the financial flow of your company.
| amount | the amount of money to receive (if positive), or spend (if negative) |
Definition at line 220 of file misc_cmd.cpp.
References EXPENSES_OTHER.
| CommandCost CmdPause | ( | DoCommandFlags | flags, |
| PauseMode | mode, | ||
| bool | pause | ||
| ) |
Pause/Unpause the game (server-only).
Set or unset a bit in the pause mode. If pause mode is zero the game is unpaused. A bitset is used instead of a boolean value/counter to have more control over the game when saving/loading, etc.
| flags | operation to perform |
| mode | the pause mode to change |
| pause | true pauses, false unpauses this mode |
Definition at line 167 of file misc_cmd.cpp.
References _networking, _pause_mode, ActiveClients, AskUnsafeUnpauseCallback(), CMD_ERROR, CommandDuringPause, Error, Execute, GameScript, GetEncodedString(), Join, LinkGraph, NetworkHandlePauseChange(), Normal, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), SaveLoad, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), SetWindowDirty(), ShowQuery(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), WC_MAIN_TOOLBAR, and WC_STATUS_BAR.
| CommandCost CmdSetCompanyMaxLoan | ( | DoCommandFlags | flags, |
| CompanyID | company, | ||
| Money | amount | ||
| ) |
Sets the max loan amount of your company.
Does not respect the global loan setting.
| company | the company ID. |
| amount | the new max loan amount, will be rounded down to the multitude of LOAN_INTERVAL. If set to COMPANY_MAX_LOAN_DEFAULT reset the max loan to default(global) value. |
Definition at line 125 of file misc_cmd.cpp.
References _current_company, CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::GetIfValid(), InvalidateCompanyWindows(), LOAN_INTERVAL, CompanyProperties::max_loan, MAX_LOAN_LIMIT, OWNER_DEITY, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().