Merge branch 'master' into jgrpp
# Conflicts: # bin/baseset/no_sound.obs # bin/baseset/orig_dos.obg # bin/baseset/orig_dos.obs # bin/baseset/orig_dos_de.obg # bin/baseset/orig_win.obg # bin/baseset/orig_win.obm # bin/baseset/orig_win.obs # src/aircraft_cmd.cpp # src/blitter/32bpp_anim.cpp # src/blitter/32bpp_anim.hpp # src/blitter/32bpp_base.cpp # src/blitter/32bpp_base.hpp # src/blitter/8bpp_base.cpp # src/blitter/8bpp_base.hpp # src/blitter/common.hpp # src/group_gui.cpp # src/lang/korean.txt # src/linkgraph/linkgraph_gui.cpp # src/saveload/saveload.cpp # src/town_cmd.cpp # src/viewport.cpp # src/viewport_func.h
This commit is contained in:
@@ -652,9 +652,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();
|
||||
}
|
||||
@@ -662,6 +664,10 @@ public:
|
||||
virtual void SetStringParameters(int widget) const
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_SCL_CAPTION:
|
||||
SetDParam(0, (CompanyID)this->window_number);
|
||||
break;
|
||||
|
||||
case WID_SCL_PRI_COL_DROPDOWN:
|
||||
case WID_SCL_SEC_COL_DROPDOWN: {
|
||||
const Company *c = Company::Get((CompanyID)this->window_number);
|
||||
@@ -793,6 +799,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))) {
|
||||
|
Reference in New Issue
Block a user