Merge branch 'tracerestrict-sx' into jgrpp
# Conflicts: # src/command.cpp # src/group_gui.cpp # src/lang/english.txt # src/saveload/extended_ver_sl.cpp # src/settings_gui.cpp # src/tracerestrict.cpp # src/tracerestrict.h # src/tracerestrict_gui.cpp # src/vehicle_gui.cpp # src/vehicle_gui_base.h # src/vehiclelist.cpp # src/window_type.h
This commit is contained in:
@@ -531,16 +531,16 @@ public:
|
||||
this->vscroll->SetCount(this->vehicles.Length());
|
||||
|
||||
/* The drop down menu is out, *but* it may not be used, retract it. */
|
||||
if (this->vehicles.Length() == 0 && this->IsWidgetLowered(WID_GL_MANAGE_VEHICLES_DROPDOWN)) {
|
||||
if (!this->ShouldShowActionDropdownList() && this->IsWidgetLowered(WID_GL_MANAGE_VEHICLES_DROPDOWN)) {
|
||||
this->RaiseWidget(WID_GL_MANAGE_VEHICLES_DROPDOWN);
|
||||
HideDropDownMenu(this);
|
||||
}
|
||||
|
||||
/* Disable all lists management button when the list is empty */
|
||||
this->SetWidgetDisabledState(WID_GL_MANAGE_VEHICLES_DROPDOWN, !this->ShouldShowActionDropdownList() || _local_company != this->vli.company);
|
||||
this->SetWidgetsDisabledState(this->vehicles.Length() == 0 || _local_company != this->vli.company,
|
||||
WID_GL_STOP_ALL,
|
||||
WID_GL_START_ALL,
|
||||
WID_GL_MANAGE_VEHICLES_DROPDOWN,
|
||||
WIDGET_LIST_END);
|
||||
|
||||
/* Disable the group specific function when we select the default group or all vehicles */
|
||||
@@ -802,7 +802,7 @@ public:
|
||||
|
||||
case WID_GL_MANAGE_VEHICLES_DROPDOWN: {
|
||||
DropDownList *list = this->BuildActionDropdownList(true, Group::IsValidID(this->vli.index), this->vli.vtype == VEH_TRAIN);
|
||||
ShowDropDownList(this, list, 0, WID_GL_MANAGE_VEHICLES_DROPDOWN);
|
||||
ShowDropDownList(this, list, -1, WID_GL_MANAGE_VEHICLES_DROPDOWN);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -928,7 +928,7 @@ public:
|
||||
break;
|
||||
|
||||
case WID_GL_MANAGE_VEHICLES_DROPDOWN:
|
||||
assert(this->vehicles.Length() != 0);
|
||||
assert(this->ShouldShowActionDropdownList());
|
||||
|
||||
switch (index) {
|
||||
case ADI_TEMPLATE_REPLACE: // TemplateReplace Window
|
||||
@@ -955,6 +955,13 @@ public:
|
||||
|
||||
DoCommandP(0, this->vli.index, 0, CMD_REMOVE_ALL_VEHICLES_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES));
|
||||
break;
|
||||
|
||||
case ADI_TRACERESTRICT_SLOT_MGMT: {
|
||||
extern void ShowTraceRestrictSlotWindow(CompanyID company);
|
||||
ShowTraceRestrictSlotWindow(this->owner);
|
||||
break;
|
||||
}
|
||||
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user