Changeset - r27906:b8b6671834b9
[Not reviewed]
master
0 1 0
Daniel Robinson - 9 months ago 2023-09-13 15:19:44
62957152+carlossss111@users.noreply.github.com
Fix #10600: 'Replace Vehicles' didn't show numbers >999 (#10680)
1 file changed with 9 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -1026,7 +1026,15 @@ void DrawEngineList(VehicleType type, co
 
	int count_width = 0;
 
	if (show_count) {
 
		replace_icon = GetSpriteSize(SPR_GROUP_REPLACE_ACTIVE);
 
		SetDParamMaxDigits(0, 3, FS_SMALL);
 

	
 
		uint biggest_num_engines = 0;
 
		for (auto i = min; i < max; i++) {
 
			const auto &item = eng_list[i];
 
			const uint num_engines = GetGroupNumEngines(_local_company, selected_group, item.engine_id);
 
			biggest_num_engines = std::max(biggest_num_engines, num_engines);
 
		}
 

	
 
		SetDParam(0, biggest_num_engines);
 
		count_width = GetStringBoundingBox(STR_JUST_COMMA, FS_SMALL).width;
 
	}
 

	
0 comments (0 inline, 0 general)