|
OpenTTD Source
1.10.0-RC1
|
Company related GUIs. More...
#include "stdafx.h"#include "error.h"#include "gui.h"#include "window_gui.h"#include "textbuf_gui.h"#include "viewport_func.h"#include "company_func.h"#include "command_func.h"#include "network/network.h"#include "network/network_gui.h"#include "network/network_func.h"#include "newgrf.h"#include "company_manager_face.h"#include "strings_func.h"#include "date_func.h"#include "widgets/dropdown_type.h"#include "tilehighlight_func.h"#include "company_base.h"#include "core/geometry_func.hpp"#include "object_type.h"#include "rail.h"#include "road.h"#include "engine_base.h"#include "window_func.h"#include "road_func.h"#include "water.h"#include "station_func.h"#include "zoom_func.h"#include "sortlist_type.h"#include "widgets/company_widget.h"#include "safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | ExpensesList |
| Expense list container. More... | |
| struct | CompanyFinancesWindow |
| Window class displaying the company finances. More... | |
| class | DropDownListColourItem |
| struct | SelectCompanyLiveryWindow |
| Company livery colour scheme window. More... | |
| class | SelectCompanyManagerFaceWindow |
| Management class for customizing the face of the company manager. More... | |
| struct | CompanyInfrastructureWindow |
| Window with detailed information about the company's infrastructure. More... | |
| struct | CompanyWindow |
| Window with general information about a company. More... | |
| struct | BuyCompanyWindow |
Typedefs | |
| typedef GUIList< const Group * > | GUIGroupList |
Functions | |
| static void | DoSelectCompanyManagerFace (Window *parent) |
| Open the simple/advanced company manager face selection window. More... | |
| static void | ShowCompanyInfrastructure (CompanyID company) |
| Open the infrastructure window of a company. More... | |
| static void | DrawCategories (const Rect &r) |
| Draw the expenses categories. More... | |
| static void | DrawPrice (Money amount, int left, int right, int top) |
| Draw an amount of money. More... | |
| static void | DrawYearColumn (const Rect &r, int year, const Money(*tbl)[EXPENSES_END]) |
| Draw a column with prices. More... | |
| void | ShowCompanyFinances (CompanyID company) |
| Open the finances window of a company. More... | |
| void | ShowCompanyLiveryWindow (CompanyID company, GroupID group) |
| void | DrawCompanyManagerFace (CompanyManagerFace cmf, int colour, int x, int y) |
| Draws the face of a company manager's face. More... | |
| int | GetAmountOwnedBy (const Company *c, Owner owner) |
| void | ShowCompany (CompanyID company) |
| Show the window with the overview of the company. More... | |
| void | DirtyCompanyInfrastructureWindows (CompanyID company) |
| Redraw all windows with company infrastructure counts. More... | |
| void | ShowBuyCompanyDialog (CompanyID company) |
| Show the query to buy another company. More... | |
Variables | |
| static const uint | EXP_LINESPACE = 2 |
| Company GUI constants. More... | |
| static const uint | EXP_BLOCKSPACE = 10 |
| Amount of vertical space between two blocks of numbers. | |
| static ExpensesType | _expenses_list_1 [] |
| Standard unsorted list of expenses. More... | |
| static ExpensesType | _expenses_list_2 [] |
| Grouped list of expenses. More... | |
| static const ExpensesList | _expenses_list_types [] |
| static const NWidgetPart | _nested_company_finances_widgets [] |
| static WindowDesc | _company_finances_desc (WDP_AUTO, "company_finances", 0, 0, WC_FINANCES, WC_NONE, 0, _nested_company_finances_widgets, lengthof(_nested_company_finances_widgets)) |
| static const StringID | _colour_dropdown [] |
| static const LiveryClass | _livery_class [LS_END] |
| static const int | LEVEL_WIDTH = 10 |
| Indenting width of a sub-group in pixels. | |
| static const NWidgetPart | _nested_select_company_livery_widgets [] |
| static WindowDesc | _select_company_livery_desc (WDP_AUTO, "company_livery", 0, 0, WC_COMPANY_COLOUR, WC_NONE, 0, _nested_select_company_livery_widgets, lengthof(_nested_select_company_livery_widgets)) |
| static const NWidgetPart | _nested_select_company_manager_face_widgets [] |
| Nested widget description for the company manager face selection dialog. | |
| static WindowDesc | _select_company_manager_face_desc (WDP_AUTO, "company_face", 0, 0, WC_COMPANY_MANAGER_FACE, WC_NONE, WDF_CONSTRUCTION, _nested_select_company_manager_face_widgets, lengthof(_nested_select_company_manager_face_widgets)) |
| Company manager face selection window description. | |
| static const NWidgetPart | _nested_company_infrastructure_widgets [] |
| static WindowDesc | _company_infrastructure_desc (WDP_AUTO, "company_infrastructure", 0, 0, WC_COMPANY_INFRASTRUCTURE, WC_NONE, 0, _nested_company_infrastructure_widgets, lengthof(_nested_company_infrastructure_widgets)) |
| static const NWidgetPart | _nested_company_widgets [] |
| static const StringID | _company_view_vehicle_count_strings [] |
| Strings for the company vehicle counts. More... | |
| static WindowDesc | _company_desc (WDP_AUTO, "company", 0, 0, WC_COMPANY, WC_NONE, 0, _nested_company_widgets, lengthof(_nested_company_widgets)) |
| static const NWidgetPart | _nested_buy_company_widgets [] |
| static WindowDesc | _buy_company_desc (WDP_AUTO, nullptr, 0, 0, WC_BUY_COMPANY, WC_NONE, WDF_CONSTRUCTION, _nested_buy_company_widgets, lengthof(_nested_buy_company_widgets)) |
Company related GUIs.
Definition in file company_gui.cpp.
| void DirtyCompanyInfrastructureWindows | ( | CompanyID | company | ) |
Redraw all windows with company infrastructure counts.
| company | The company to redraw the windows of. |
Definition at line 2722 of file company_gui.cpp.
References SetWindowDirty(), WC_COMPANY, and WC_COMPANY_INFRASTRUCTURE.
Referenced by Station::AfterStationTileSetChange(), CmdConvertRail(), RemoveLock(), and UpdateCompanyRoadInfrastructure().
|
static |
Open the simple/advanced company manager face selection window.
| parent | the parent company window |
Definition at line 1757 of file company_gui.cpp.
References BringWindowToFrontById(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), WC_COMPANY_MANAGER_FACE, and Window::window_number.
Referenced by CompanyWindow::OnClick().
|
static |
Draw the expenses categories.
| r | Available space for drawing. |
Definition at line 135 of file company_gui.cpp.
Referenced by CompanyFinancesWindow::DrawWidget().
| void DrawCompanyManagerFace | ( | CompanyManagerFace | cmf, |
| int | colour, | ||
| int | x, | ||
| int | y | ||
| ) |
Draws the face of a company manager's face.
| cmf | the company manager's face |
| colour | the (background) colour of the gradient |
| x | x-position to draw the face |
| y | y-position to draw the face |
Definition at line 1114 of file company_gui.cpp.
Referenced by ErrmsgWindow::DrawWidget(), CompanyWindow::DrawWidget(), and BuyCompanyWindow::DrawWidget().
|
static |
Draw an amount of money.
| amount | Amount of money to draw, |
| left | Left coordinate of the space to draw in. |
| right | Right coordinate of the space to draw in. |
| top | Top coordinate of the space to draw in. |
Definition at line 165 of file company_gui.cpp.
References DrawString(), and SetDParam().
Draw a column with prices.
| r | Available space for drawing. |
| year | Year being drawn. |
| tbl | Pointer to table of amounts for year. |
Definition at line 183 of file company_gui.cpp.
Referenced by CompanyFinancesWindow::DrawWidget().
| void ShowBuyCompanyDialog | ( | CompanyID | company | ) |
Show the query to buy another company.
| company | The company to buy. |
Definition at line 2823 of file company_gui.cpp.
| void ShowCompany | ( | CompanyID | company | ) |
Show the window with the overview of the company.
| company | The company to show the window for. |
Definition at line 2711 of file company_gui.cpp.
| void ShowCompanyFinances | ( | CompanyID | company | ) |
Open the finances window of a company.
| company | Company to show finances of. |
Definition at line 479 of file company_gui.cpp.
References BringWindowToFrontById(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), and WC_FINANCES.
Referenced by CompaniesYearlyLoop(), MenuClickFinances(), and StatusBarWindow::OnClick().
|
static |
Open the infrastructure window of a company.
| company | Company to show infrastructure of. |
Definition at line 2139 of file company_gui.cpp.
Referenced by CompanyFinancesWindow::OnClick().
|
static |
Definition at line 488 of file company_gui.cpp.
|
static |
Strings for the company vehicle counts.
Definition at line 2248 of file company_gui.cpp.
|
static |
Standard unsorted list of expenses.
Definition at line 53 of file company_gui.cpp.
|
static |
|
static |
Definition at line 125 of file company_gui.cpp.
|
static |
Definition at line 508 of file company_gui.cpp.
|
static |
Definition at line 2793 of file company_gui.cpp.
|
static |
Company GUI constants.
Amount of vertical space for a horizontal (sub-)total line.
Definition at line 46 of file company_gui.cpp.