summaryrefslogtreecommitdiff
path: root/src/company_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/company_gui.cpp')
-rw-r--r--src/company_gui.cpp180
1 files changed, 2 insertions, 178 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 4e364f74e..312114fb7 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -39,6 +39,8 @@
#include "water.h"
#include "station_func.h"
+#include "widgets/company_widget.h"
+
#include "table/strings.h"
/** Company GUI constants. */
@@ -126,29 +128,6 @@ static const ExpensesList _expenses_list_types[] = {
ExpensesList(_expenses_list_2, lengthof(_expenses_list_2), 3),
};
-/** Widgets of the company finances windows. */
-enum CompanyFinancesWindowWidgets {
- CFW_CAPTION, ///< Caption of the window
- CFW_TOGGLE_SIZE, ///< Toggle windows size
- CFW_SEL_PANEL, ///< Select panel or nothing
- CFW_EXPS_CATEGORY, ///< Column for expenses category strings
- CFW_EXPS_PRICE1, ///< Column for year Y-2 expenses
- CFW_EXPS_PRICE2, ///< Column for year Y-1 expenses
- CFW_EXPS_PRICE3, ///< Column for year Y expenses
- CFW_TOTAL_PANEL, ///< Panel for totals
- CFW_SEL_MAXLOAN, ///< Selection of maxloan column
- CFW_BALANCE_VALUE, ///< Bank balance value
- CFW_LOAN_VALUE, ///< Loan
- CFW_LOAN_LINE, ///< Line for summing bank balance and loan
- CFW_TOTAL_VALUE, ///< Total
- CFW_MAXLOAN_GAP, ///< Gap above max loan widget
- CFW_MAXLOAN_VALUE, ///< Max loan widget
- CFW_SEL_BUTTONS, ///< Selection of buttons
- CFW_INCREASE_LOAN, ///< Increase loan
- CFW_REPAY_LOAN, ///< Decrease loan
- CFW_INFRASTRUCTURE,///< View company infrastructure
-};
-
/**
* Draw the expenses categories.
* @param r Available space for drawing.
@@ -567,20 +546,6 @@ public:
}
};
-/** Widgets of the select company livery window. */
-enum SelectCompanyLiveryWindowWidgets {
- SCLW_WIDGET_CAPTION,
- SCLW_WIDGET_CLASS_GENERAL,
- SCLW_WIDGET_CLASS_RAIL,
- SCLW_WIDGET_CLASS_ROAD,
- SCLW_WIDGET_CLASS_SHIP,
- SCLW_WIDGET_CLASS_AIRCRAFT,
- SCLW_WIDGET_SPACER_DROPDOWN,
- SCLW_WIDGET_PRI_COL_DROPDOWN,
- SCLW_WIDGET_SEC_COL_DROPDOWN,
- SCLW_WIDGET_MATRIX,
-};
-
/** Company livery colour scheme window. */
struct SelectCompanyLiveryWindow : public Window {
private:
@@ -930,78 +895,6 @@ void DrawCompanyManagerFace(CompanyManagerFace cmf, int colour, int x, int y)
}
}
-/**
- * Names of the widgets. Keep them in the same order as in the widget array.
- * Do not change the order of the widgets from SCMFW_WIDGET_HAS_MOUSTACHE_EARRING to SCMFW_WIDGET_GLASSES_R,
- * this order is needed for the WE_CLICK event of DrawFaceStringLabel().
- */
-enum SelectCompanyManagerFaceWidgets {
- SCMFW_WIDGET_CAPTION,
- SCMFW_WIDGET_TOGGLE_LARGE_SMALL,
- SCMFW_WIDGET_SELECT_FACE,
- SCMFW_WIDGET_CANCEL,
- SCMFW_WIDGET_ACCEPT,
- SCMFW_WIDGET_MALE, ///< Male button in the simple view.
- SCMFW_WIDGET_FEMALE, ///< Female button in the simple view.
- SCMFW_WIDGET_MALE2, ///< Male button in the advanced view.
- SCMFW_WIDGET_FEMALE2, ///< Female button in the advanced view.
- SCMFW_WIDGET_SEL_LOADSAVE, ///< Selection to display the load/save/number buttons in the advanced view.
- SCMFW_WIDGET_SEL_MALEFEMALE, ///< Selection to display the male/female buttons in the simple view.
- SCMFW_WIDGET_SEL_PARTS, ///< Selection to display the buttons for setting each part of the face in the advanced view.
- SCMFW_WIDGET_RANDOM_NEW_FACE,
- SCMFW_WIDGET_TOGGLE_LARGE_SMALL_BUTTON,
- SCMFM_WIDGET_FACE,
- SCMFW_WIDGET_LOAD,
- SCMFW_WIDGET_FACECODE,
- SCMFW_WIDGET_SAVE,
- SCMFW_WIDGET_HAS_MOUSTACHE_EARRING_TEXT,
- SCMFW_WIDGET_TIE_EARRING_TEXT,
- SCMFW_WIDGET_LIPS_MOUSTACHE_TEXT,
- SCMFW_WIDGET_HAS_GLASSES_TEXT,
- SCMFW_WIDGET_HAIR_TEXT,
- SCMFW_WIDGET_EYEBROWS_TEXT,
- SCMFW_WIDGET_EYECOLOUR_TEXT,
- SCMFW_WIDGET_GLASSES_TEXT,
- SCMFW_WIDGET_NOSE_TEXT,
- SCMFW_WIDGET_CHIN_TEXT,
- SCMFW_WIDGET_JACKET_TEXT,
- SCMFW_WIDGET_COLLAR_TEXT,
- SCMFW_WIDGET_ETHNICITY_EUR,
- SCMFW_WIDGET_ETHNICITY_AFR,
- SCMFW_WIDGET_HAS_MOUSTACHE_EARRING,
- SCMFW_WIDGET_HAS_GLASSES,
- SCMFW_WIDGET_EYECOLOUR_L,
- SCMFW_WIDGET_EYECOLOUR,
- SCMFW_WIDGET_EYECOLOUR_R,
- SCMFW_WIDGET_CHIN_L,
- SCMFW_WIDGET_CHIN,
- SCMFW_WIDGET_CHIN_R,
- SCMFW_WIDGET_EYEBROWS_L,
- SCMFW_WIDGET_EYEBROWS,
- SCMFW_WIDGET_EYEBROWS_R,
- SCMFW_WIDGET_LIPS_MOUSTACHE_L,
- SCMFW_WIDGET_LIPS_MOUSTACHE,
- SCMFW_WIDGET_LIPS_MOUSTACHE_R,
- SCMFW_WIDGET_NOSE_L,
- SCMFW_WIDGET_NOSE,
- SCMFW_WIDGET_NOSE_R,
- SCMFW_WIDGET_HAIR_L,
- SCMFW_WIDGET_HAIR,
- SCMFW_WIDGET_HAIR_R,
- SCMFW_WIDGET_JACKET_L,
- SCMFW_WIDGET_JACKET,
- SCMFW_WIDGET_JACKET_R,
- SCMFW_WIDGET_COLLAR_L,
- SCMFW_WIDGET_COLLAR,
- SCMFW_WIDGET_COLLAR_R,
- SCMFW_WIDGET_TIE_EARRING_L,
- SCMFW_WIDGET_TIE_EARRING,
- SCMFW_WIDGET_TIE_EARRING_R,
- SCMFW_WIDGET_GLASSES_L,
- SCMFW_WIDGET_GLASSES,
- SCMFW_WIDGET_GLASSES_R,
-};
-
/** Nested widget description for the company manager face selection dialog */
static const NWidgetPart _nested_select_company_manager_face_widgets[] = {
NWidget(NWID_HORIZONTAL),
@@ -1616,22 +1509,6 @@ static void DoSelectCompanyManagerFace(Window *parent)
new SelectCompanyManagerFaceWindow(&_select_company_manager_face_desc, parent);
}
-
-/** Names of the widgets of the #CompanyInfrastructureWindow. */
-enum CompanyInfrastructureWindowWidgets {
- CIW_WIDGET_CAPTION,
- CIW_WIDGET_RAIL_DESC,
- CIW_WIDGET_RAIL_COUNT,
- CIW_WIDGET_ROAD_DESC,
- CIW_WIDGET_ROAD_COUNT,
- CIW_WIDGET_WATER_DESC,
- CIW_WIDGET_WATER_COUNT,
- CIW_WIDGET_STATION_DESC,
- CIW_WIDGET_STATION_COUNT,
- CIW_WIDGET_TOTAL_DESC,
- CIW_WIDGET_TOTAL,
-};
-
static const NWidgetPart _nested_company_infrastructure_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@@ -1976,49 +1853,6 @@ static void ShowCompanyInfrastructure(CompanyID company)
AllocateWindowDescFront<CompanyInfrastructureWindow>(&_company_infrastructure_desc, company);
}
-
-/** Names of the widgets of the #CompanyWindow. Keep them in the same order as in the widget array */
-enum CompanyWindowWidgets {
- CW_WIDGET_CAPTION,
-
- CW_WIDGET_FACE,
- CW_WIDGET_FACE_TITLE,
-
- CW_WIDGET_DESC_INAUGURATION,
- CW_WIDGET_DESC_COLOUR_SCHEME,
- CW_WIDGET_DESC_COLOUR_SCHEME_EXAMPLE,
- CW_WIDGET_DESC_VEHICLE,
- CW_WIDGET_DESC_VEHICLE_COUNTS,
- CW_WIDGET_DESC_COMPANY_VALUE,
- CW_WIDGET_DESC_INFRASTRUCTURE,
- CW_WIDGET_DESC_INFRASTRUCTURE_COUNTS,
-
- CW_WIDGET_SELECT_DESC_OWNERS,
- CW_WIDGET_DESC_OWNERS,
-
- CW_WIDGET_SELECT_BUTTONS, ///< Selection widget for the button bar.
- CW_WIDGET_NEW_FACE,
- CW_WIDGET_COLOUR_SCHEME,
- CW_WIDGET_PRESIDENT_NAME,
- CW_WIDGET_COMPANY_NAME,
- CW_WIDGET_BUY_SHARE,
- CW_WIDGET_SELL_SHARE,
-
- CW_WIDGET_SELECT_VIEW_BUILD_HQ,
- CW_WIDGET_VIEW_HQ,
- CW_WIDGET_BUILD_HQ,
-
- CW_WIDGET_SELECT_RELOCATE, ///< View/hide the 'Relocate HQ' button.
- CW_WIDGET_RELOCATE_HQ,
-
- CW_WIDGET_VIEW_INFRASTRUCTURE,
-
- CW_WIDGET_HAS_PASSWORD, ///< Draw a lock when the company has a password
- CW_WIDGET_SELECT_MULTIPLAYER, ///< Multiplayer selection panel.
- CW_WIDGET_COMPANY_PASSWORD,
- CW_WIDGET_COMPANY_JOIN,
-};
-
static const NWidgetPart _nested_company_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@@ -2595,16 +2429,6 @@ void DirtyCompanyInfrastructureWindows(CompanyID company)
SetWindowDirty(WC_COMPANY_INFRASTRUCTURE, company);
}
-
-/** widget numbers of the #BuyCompanyWindow. */
-enum BuyCompanyWidgets {
- BCW_CAPTION,
- BCW_FACE,
- BCW_QUESTION,
- BCW_NO,
- BCW_YES,
-};
-
struct BuyCompanyWindow : Window {
BuyCompanyWindow(const WindowDesc *desc, WindowNumber window_number) : Window()
{