diff options
author | michi_cc <michi_cc@openttd.org> | 2012-04-17 19:43:38 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2012-04-17 19:43:38 +0000 |
commit | 32ab630bda765ba6eb7283d06df88d783ce17865 (patch) | |
tree | 562a14f9bb82c9da292b7e2be15ba98e3e2998fc /src/company_gui.cpp | |
parent | f1c59a315961ac8cc4d2e65a33f9322dc32b0941 (diff) | |
download | openttd-32ab630bda765ba6eb7283d06df88d783ce17865.tar.xz |
(svn r24131) -Add [FS#1952]: Ctrl-Clicking to change colour of all colour schemes at once. (Roest)
Diffstat (limited to 'src/company_gui.cpp')
-rw-r--r-- | src/company_gui.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 6804e98d1..654eb94e6 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -781,7 +781,8 @@ public: virtual void OnDropdownSelect(int widget, int index) { for (LiveryScheme scheme = LS_DEFAULT; scheme < LS_END; scheme++) { - if (HasBit(this->sel, 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))) { DoCommandP(0, scheme | (widget == WID_SCL_PRI_COL_DROPDOWN ? 0 : 256), index, CMD_SET_COMPANY_COLOUR); } } |