Changeset - r23366:56d2931f7948
[Not reviewed]
master
0 1 0
peter1138 - 6 years ago 2019-02-26 06:45:14
peter1138@openttd.org
Fix #7281: Unable to select last group in open livery window on group creation.
1 file changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/company_gui.cpp
Show inline comments
 
@@ -1022,15 +1022,21 @@ public:
 
	{
 
		if (!gui_scope) return;
 

	
 
		if (data != -1) {
 
			/* data contains a VehicleType, rebuild list if it displayed */
 
			if (this->livery_class == data + LC_GROUP_RAIL) {
 
				if (!Group::IsValidID(this->sel)) this->sel = INVALID_GROUP;
 
				this->groups.ForceRebuild();
 
				this->BuildGroupList((CompanyID)this->window_number);
 
				this->SetRows();
 

	
 
				if (!Group::IsValidID(this->sel)) {
 
					this->sel = INVALID_GROUP;
 
					if (this->groups.Length() > 0) this->sel = this->groups[0]->index;
 
				}
 

	
 
				this->SetDirty();
 
			}
 
			return;
 
		}
 

	
 
		this->SetWidgetsDisabledState(true, WID_SCL_CLASS_RAIL, WID_SCL_CLASS_ROAD, WID_SCL_CLASS_SHIP, WID_SCL_CLASS_AIRCRAFT, WIDGET_LIST_END);
0 comments (0 inline, 0 general)