summaryrefslogtreecommitdiff
path: root/src/group_gui.cpp
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2019-01-31 13:57:44 +0000
committerIngo von Borstel <github@planetmaker.de>2019-01-31 14:57:44 +0100
commit23960d0f2c82a634e0ca1be720c229ac22f14962 (patch)
tree7a7c75a5e7ae19943377756d49c477d759873d3b /src/group_gui.cpp
parentba38a7ca652c00a1d0851f4d97f0b7d360df853c (diff)
downloadopenttd-23960d0f2c82a634e0ca1be720c229ac22f14962.tar.xz
Feature: Group liveries, and livery window usability enhancements. (#7108)
* Change: Replace checkbox in livery selection window with Default option in drop down selection. This reduces clutter in the UI and allows for primary/secondary colours to independently follow the default scheme if desired. * Feature: Add vehicle group liveries.
Diffstat (limited to 'src/group_gui.cpp')
-rw-r--r--src/group_gui.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index a88492084..ce607c326 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -25,6 +25,7 @@
#include "vehicle_gui_base.h"
#include "core/geometry_func.hpp"
#include "company_base.h"
+#include "company_gui.h"
#include "widgets/group_widget.h"
@@ -63,6 +64,8 @@ static const NWidgetPart _nested_group_widgets[] = {
SetDataTip(SPR_GROUP_DELETE_TRAIN, STR_GROUP_DELETE_TOOLTIP),
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_RENAME_GROUP), SetFill(0, 1),
SetDataTip(SPR_GROUP_RENAME_TRAIN, STR_GROUP_RENAME_TOOLTIP),
+ NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_LIVERY_GROUP), SetFill(0, 1),
+ SetDataTip(SPR_GROUP_LIVERY_TRAIN, STR_GROUP_LIVERY_TOOLTIP),
NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), EndContainer(),
NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_REPLACE_PROTECTION), SetFill(0, 1),
SetDataTip(SPR_GROUP_REPLACE_OFF_TRAIN, STR_GROUP_REPLACE_PROTECTION_TOOLTIP),
@@ -344,6 +347,7 @@ public:
this->GetWidget<NWidgetCore>(WID_GL_CREATE_GROUP)->widget_data += this->vli.vtype;
this->GetWidget<NWidgetCore>(WID_GL_RENAME_GROUP)->widget_data += this->vli.vtype;
this->GetWidget<NWidgetCore>(WID_GL_DELETE_GROUP)->widget_data += this->vli.vtype;
+ this->GetWidget<NWidgetCore>(WID_GL_LIVERY_GROUP)->widget_data += this->vli.vtype;
this->GetWidget<NWidgetCore>(WID_GL_REPLACE_PROTECTION)->widget_data += this->vli.vtype;
this->FinishInitNested(window_number);
@@ -499,6 +503,7 @@ public:
this->SetWidgetsDisabledState(IsDefaultGroupID(this->vli.index) || IsAllGroupID(this->vli.index) || _local_company != this->vli.company,
WID_GL_DELETE_GROUP,
WID_GL_RENAME_GROUP,
+ WID_GL_LIVERY_GROUP,
WID_GL_REPLACE_PROTECTION,
WIDGET_LIST_END);
@@ -696,6 +701,10 @@ public:
this->ShowRenameGroupWindow(this->vli.index, false);
break;
+ case WID_GL_LIVERY_GROUP: // Set group livery
+ ShowCompanyLiveryWindow(this->owner, this->vli.index);
+ break;
+
case WID_GL_AVAILABLE_VEHICLES:
ShowBuildVehicleWindow(INVALID_TILE, this->vli.vtype);
break;