Changeset - r17121:3f07957f9a46
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2011-01-20 12:40:40
rubidium@openttd.org
(svn r21868) -Fix (r21866 and some more): the changes to the main toolbar rail types dropdown should happen for the autoreplace dropdown as well
1 file changed with 3 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/autoreplace_gui.cpp
Show inline comments
 
@@ -22,12 +22,13 @@
 
#include "widgets/dropdown_type.h"
 
#include "engine_base.h"
 
#include "window_gui.h"
 
#include "engine_gui.h"
 
#include "settings_func.h"
 
#include "core/geometry_func.hpp"
 
#include "rail_gui.h"
 

	
 
#include "table/strings.h"
 

	
 
uint GetEngineListHeight(VehicleType type);
 
void DrawEngineList(VehicleType type, int x, int r, int y, const GUIEngineList *eng_list, uint16 min, uint16 max, EngineID selected_id, bool show_count, GroupID selected_group);
 

	
 
@@ -417,24 +418,15 @@ public:
 
				this->replace_engines  = !(this->replace_engines);
 
				this->engines[0].ForceRebuild();
 
				this->reset_sel_engine = true;
 
				this->SetDirty();
 
				break;
 

	
 
			case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: { // Railtype selection dropdown menu
 
				const Company *c = Company::Get(_local_company);
 
				DropDownList *list = new DropDownList();
 
				for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
 
					const RailtypeInfo *rti = GetRailTypeInfo(rt);
 
					/* Skip rail type if it has no label */
 
					if (rti->label == 0) continue;
 
					list->push_back(new DropDownListStringItem(rti->strings.replace_text, rt, !HasBit(c->avail_railtypes, rt)));
 
				}
 
				ShowDropDownList(this, list, sel_railtype, RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN);
 
			case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: // Railtype selection dropdown menu
 
				ShowDropDownList(this, GetRailTypeDropDownList(true), sel_railtype, RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN);
 
				break;
 
			}
 

	
 
			case RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE: // toggle renew_keep_length
 
				DoCommandP(0, GetCompanySettingIndex("company.renew_keep_length"), Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, CMD_CHANGE_COMPANY_SETTING);
 
				break;
 

	
 
			case RVW_WIDGET_START_REPLACE: { // Start replacing
0 comments (0 inline, 0 general)