OpenTTD Source 20250531-master-g621c031307
|
GUI Functions related to companies. More...
Go to the source code of this file.
Functions | |
TextColour | GetDrawStringCompanyColour (CompanyID company) |
Get the colour for DrawString-subroutines which matches the colour of the company. | |
void | DrawCompanyIcon (CompanyID c, int x, int y) |
Draw the icon of a company. | |
void | ShowCompanyLiveryWindow (CompanyID company, GroupID group) |
void | ShowCompanyStations (CompanyID company) |
Opens window with list of company's stations. | |
void | ShowCompanyFinances (CompanyID company) |
Open the finances window of a company. | |
void | ShowCompany (CompanyID company) |
Show the window with the overview of the company. | |
void | InvalidateCompanyWindows (const Company *c) |
Mark all finance windows owned by a company as needing a refresh. | |
void | CloseCompanyWindows (CompanyID company) |
Close all windows of a company. | |
void | DirtyCompanyInfrastructureWindows (CompanyID company) |
Redraw all windows with company infrastructure counts. | |
GUI Functions related to companies.
Definition in file company_gui.h.
void CloseCompanyWindows | ( | CompanyID | id | ) |
Close all windows of a company.
We identify windows of a company by looking at the caption colour. If it is equal to the company ID then we say the window belongs to the company and should be closed
id | company identifier |
Definition at line 1210 of file window.cpp.
References CloseWindowById(), and WC_BUY_COMPANY.
Referenced by Company::~Company().
void DirtyCompanyInfrastructureWindows | ( | CompanyID | company | ) |
Redraw all windows with company infrastructure counts.
company | The company to redraw the windows of. |
Definition at line 2502 of file company_gui.cpp.
References SetWindowDirty(), WC_COMPANY, and WC_COMPANY_INFRASTRUCTURE.
Referenced by Station::AfterStationTileSetChange(), BuildObject(), CmdBuildBridge(), CmdBuildCanal(), CmdBuildRailWaypoint(), CmdBuildRoad(), CmdBuildRoadWaypoint(), CmdBuildShipDepot(), CmdBuildSingleRail(), CmdBuildSingleSignal(), CmdBuildTrainDepot(), CmdBuildTunnel(), CmdConvertRail(), CmdLandscapeClear(), CmdRemoveSingleRail(), CmdRemoveSingleSignal(), ConvertRoadTypeOwner(), DoBuildLock(), DoClearBridge(), DoClearTunnel(), RemoveFromRailBaseStation(), RemoveLock(), RemoveRoad(), RemoveRoadStop(), RemoveRoadWaypointStop(), and UpdateCompanyRoadInfrastructure().
void DrawCompanyIcon | ( | CompanyID | c, |
int | x, | ||
int | y | ||
) |
Draw the icon of a company.
c | Company that needs its icon drawn. |
x | Horizontal coordinate of the icon. |
y | Vertical coordinate of the icon. |
Definition at line 171 of file company_cmd.cpp.
TextColour GetDrawStringCompanyColour | ( | CompanyID | company | ) |
Get the colour for DrawString-subroutines which matches the colour of the company.
company | Company to get the colour of. |
Definition at line 149 of file company_cmd.cpp.
References _company_colours, GetColourGradient(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), and TC_IS_PALETTE_COLOUR.
Referenced by CmdGiveMoney(), NetworkServerSendChat(), and ClientNetworkGameSocketHandler::Receive_SERVER_CHAT().
void InvalidateCompanyWindows | ( | const Company * | company | ) |
Mark all finance windows owned by a company as needing a refresh.
The actual refresh is deferred until the end of the gameloop to reduce duplicated work.
company | Company that changed, and needs its windows refreshed. |
Definition at line 214 of file company_cmd.cpp.
References _dirty_company_finances, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().
Referenced by CmdDecreaseLoan(), CmdIncreaseLoan(), CmdSetCompanyMaxLoan(), and SubtractMoneyFromAnyCompany().
void ShowCompany | ( | CompanyID | company | ) |
Show the window with the overview of the company.
company | The company to show the window for. |
Definition at line 2491 of file company_gui.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID().
Referenced by GoalListWindow::HandleClick(), MenuClickCompany(), and MainToolbarWindow::OnHotkey().
void ShowCompanyFinances | ( | CompanyID | company | ) |
Open the finances window of a company.
company | Company to show finances of. |
Definition at line 568 of file company_gui.cpp.
References BringWindowToFrontById(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), and WC_FINANCES.
Referenced by MenuClickFinances(), StatusBarWindow::OnClick(), and MainToolbarWindow::OnHotkey().
Definition at line 1103 of file company_gui.cpp.
void ShowCompanyStations | ( | CompanyID | company | ) |
Opens window with list of company's stations.
company | whose stations' list show |
Definition at line 807 of file station_gui.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID().
Referenced by MenuClickStations(), and MainToolbarWindow::OnHotkey().