Merge branch 'master' into jgrpp

# Conflicts:
#	src/airport_gui.cpp
#	src/build_vehicle_gui.cpp
#	src/direction_type.h
#	src/gfx_type.h
#	src/group_gui.cpp
#	src/misc_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/signs_gui.cpp
#	src/slope_func.h
#	src/smallmap_gui.cpp
#	src/terraform_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_gui.cpp
#	src/town_type.h
#	src/vehicle_type.h
#	src/widget_type.h
This commit is contained in:
Jonathan G Rennison
2024-01-21 22:24:49 +00:00
105 changed files with 1193 additions and 1227 deletions

View File

@@ -278,7 +278,7 @@ static void DrawYearColumn(const Rect &r, int year, const Expenses &tbl)
DrawPrice(sum, r.left, r.right, y, TC_WHITE);
}
static const NWidgetPart _nested_company_finances_widgets[] = {
static constexpr NWidgetPart _nested_company_finances_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_CF_CAPTION), SetDataTip(STR_FINANCES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -771,7 +771,7 @@ public:
void SetSelectedGroup(CompanyID company, GroupID group)
{
this->RaiseWidget(this->livery_class + WID_SCL_CLASS_GENERAL);
this->RaiseWidget(WID_SCL_CLASS_GENERAL + this->livery_class);
const Group *g = Group::Get(group);
switch (g->vehicle_type) {
case VEH_TRAIN: this->livery_class = LC_GROUP_RAIL; break;
@@ -781,7 +781,7 @@ public:
default: NOT_REACHED();
}
this->sel = group;
this->LowerWidget(this->livery_class + WID_SCL_CLASS_GENERAL);
this->LowerWidget(WID_SCL_CLASS_GENERAL + this->livery_class);
this->groups.ForceRebuild();
this->BuildGroupList(company);
@@ -987,9 +987,9 @@ public:
case WID_SCL_GROUPS_ROAD:
case WID_SCL_GROUPS_SHIP:
case WID_SCL_GROUPS_AIRCRAFT:
this->RaiseWidget(this->livery_class + WID_SCL_CLASS_GENERAL);
this->RaiseWidget(WID_SCL_CLASS_GENERAL + this->livery_class);
this->livery_class = (LiveryClass)(widget - WID_SCL_CLASS_GENERAL);
this->LowerWidget(this->livery_class + WID_SCL_CLASS_GENERAL);
this->LowerWidget(WID_SCL_CLASS_GENERAL + this->livery_class);
/* Select the first item in the list */
if (this->livery_class < LC_GROUP_RAIL) {
@@ -1121,7 +1121,7 @@ public:
}
};
static const NWidgetPart _nested_select_company_livery_widgets[] = {
static constexpr NWidgetPart _nested_select_company_livery_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SCL_CAPTION), SetDataTip(STR_LIVERY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -1216,7 +1216,7 @@ void DrawCompanyManagerFace(CompanyManagerFace cmf, int colour, const Rect &r)
}
/** Nested widget description for the company manager face selection dialog */
static const NWidgetPart _nested_select_company_manager_face_widgets[] = {
static constexpr NWidgetPart _nested_select_company_manager_face_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SCMF_CAPTION), SetDataTip(STR_FACE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -1795,7 +1795,7 @@ static void DoSelectCompanyManagerFace(Window *parent)
new SelectCompanyManagerFaceWindow(&_select_company_manager_face_desc, parent);
}
static const NWidgetPart _nested_company_infrastructure_widgets[] = {
static constexpr NWidgetPart _nested_company_infrastructure_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_CI_CAPTION), SetDataTip(STR_COMPANY_INFRASTRUCTURE_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -2196,7 +2196,7 @@ static void ShowCompanyInfrastructure(CompanyID company)
AllocateWindowDescFront<CompanyInfrastructureWindow>(&_company_infrastructure_desc, company);
}
static const NWidgetPart _nested_company_widgets[] = {
static constexpr NWidgetPart _nested_company_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_C_CAPTION), SetDataTip(STR_COMPANY_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -2902,7 +2902,7 @@ private:
Money company_value; ///< The value of the company for which the user can buy it.
};
static const NWidgetPart _nested_buy_company_widgets[] = {
static constexpr NWidgetPart _nested_buy_company_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE, WID_BC_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION_OTHER_COMPANY, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),