Changeset - r13583:13ede4e35c38
[Not reviewed]
master
0 2 0
rubidium - 15 years ago 2009-11-16 15:11:54
rubidium@openttd.org
(svn r18117) -Codechange: don't pass the location of the vehicle count but whether to show the vehicle count
2 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/autoreplace_gui.cpp
Show inline comments
 
@@ -28,7 +28,7 @@
 

	
 
#include "table/strings.h"
 

	
 
void DrawEngineList(VehicleType type, int x, int r, int y, const GUIEngineList *eng_list, uint16 min, uint16 max, EngineID selected_id, int count_location, GroupID selected_group);
 
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);
 

	
 
/** Widget numbers of the autoreplace GUI. */
 
enum ReplaceVehicleWindowWidgets {
 
@@ -334,7 +334,7 @@ public:
 

	
 
				/* Do the actual drawing */
 
				DrawEngineList((VehicleType)this->window_number, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP,
 
						&this->engines[side], start, end, this->sel_engine[side], side == 0 ? r.right - WD_FRAMERECT_RIGHT : 0, this->sel_group);
 
						&this->engines[side], start, end, this->sel_engine[side], side == 0, this->sel_group);
 
				break;
 
			}
 
		}
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -685,10 +685,10 @@ int DrawVehiclePurchaseInfo(int left, in
 
 * @param min where to start in the list
 
 * @param max where in the list to end
 
 * @param selected_id what engine to highlight as selected, if any
 
 * @param count_location Offset to print the engine count (used by autoreplace). 0 means it's off
 
 * @param show_count Whether to show the amount of engines or not
 
 * @param selected_group the group to list the engines of
 
 */
 
void DrawEngineList(VehicleType type, int x, int r, int y, const GUIEngineList *eng_list, uint16 min, uint16 max, EngineID selected_id, int count_location, GroupID selected_group)
 
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)
 
{
 
	byte step_size = GetVehicleListHeight(type);
 
	byte x_offset = 0;
 
@@ -728,10 +728,10 @@ void DrawEngineList(VehicleType type, in
 

	
 
		SetDParam(0, engine);
 
		DrawString(x + x_offset, r, y, STR_ENGINE_NAME, engine == selected_id ? TC_WHITE : TC_BLACK);
 
		DrawVehicleEngine(x, y + y_offset, engine, (count_location != 0 && num_engines == 0) ? PALETTE_CRASH : GetEnginePalette(engine, _local_company));
 
		if (count_location != 0) {
 
		DrawVehicleEngine(x, y + y_offset, engine, (show_count && num_engines == 0) ? PALETTE_CRASH : GetEnginePalette(engine, _local_company));
 
		if (show_count) {
 
			SetDParam(0, num_engines);
 
			DrawString(x, count_location, y + (GetVehicleListHeight(type) == 14 ? 3 : 8), STR_TINY_BLACK_COMA, TC_FROMSTRING, SA_RIGHT);
 
			DrawString(x, r, y + (GetVehicleListHeight(type) == 14 ? 3 : 8), STR_TINY_BLACK_COMA, TC_FROMSTRING, SA_RIGHT);
 
		}
 
	}
 
}
 
@@ -1104,7 +1104,7 @@ struct BuildVehicleWindow : Window {
 
	{
 
		switch (widget) {
 
			case BUILD_VEHICLE_WIDGET_LIST:
 
				DrawEngineList(this->vehicle_type, r.left + WD_FRAMERECT_LEFT, r.right + WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, &this->eng_list, this->vscroll.GetPosition(), min(this->vscroll.GetPosition() + this->vscroll.GetCapacity(), this->eng_list.Length()), this->sel_engine, 0, DEFAULT_GROUP);
 
				DrawEngineList(this->vehicle_type, r.left + WD_FRAMERECT_LEFT, r.right + WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, &this->eng_list, this->vscroll.GetPosition(), min(this->vscroll.GetPosition() + this->vscroll.GetCapacity(), this->eng_list.Length()), this->sel_engine, false, DEFAULT_GROUP);
 
				break;
 

	
 
			case BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING:
0 comments (0 inline, 0 general)