summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/company_gui.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index c62c6d61c..208b798a7 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -648,9 +648,11 @@ public:
virtual void OnPaint()
{
+ bool local = (CompanyID)this->window_number == _local_company;
+
/* Disable dropdown controls if no scheme is selected */
- this->SetWidgetDisabledState(WID_SCL_PRI_COL_DROPDOWN, this->sel == 0);
- this->SetWidgetDisabledState(WID_SCL_SEC_COL_DROPDOWN, this->sel == 0);
+ this->SetWidgetDisabledState(WID_SCL_PRI_COL_DROPDOWN, !local || this->sel == 0);
+ this->SetWidgetDisabledState(WID_SCL_SEC_COL_DROPDOWN, !local || this->sel == 0);
this->DrawWidgets();
}
@@ -789,6 +791,9 @@ public:
virtual void OnDropdownSelect(int widget, int index)
{
+ bool local = (CompanyID)this->window_number == _local_company;
+ if (!local) return;
+
for (LiveryScheme scheme = LS_DEFAULT; scheme < LS_END; scheme++) {
/* Changed colour for the selected scheme, or all visible schemes if CTRL is pressed. */
if (HasBit(this->sel, scheme) || (_ctrl_pressed && _livery_class[scheme] == this->livery_class && HasBit(_loaded_newgrf_features.used_liveries, scheme))) {