Changeset - r24445:3cdfd9b40e1a
[Not reviewed]
master
0 3 0
stormcone - 4 years ago 2020-09-13 21:24:46
48624099+stormcone@users.noreply.github.com
Feature: Show group name as part of the default vehicle name.

Only if the vehicle is member of a group and does not have a user defined name.
3 files changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/group_cmd.cpp
Show inline comments
 
@@ -456,6 +456,8 @@ CommandCost CmdAlterGroup(TileIndex tile
 
		InvalidateWindowData(WC_REPLACE_VEHICLE, g->vehicle_type, 1);
 
		InvalidateWindowData(GetWindowClassForVehicleType(g->vehicle_type), VehicleListIdentifier(VL_GROUP_LIST, g->vehicle_type, _current_company).Pack());
 
		InvalidateWindowData(WC_COMPANY_COLOUR, g->owner, g->vehicle_type);
 
		InvalidateWindowClassesData(WC_VEHICLE_VIEW);
 
		InvalidateWindowClassesData(WC_VEHICLE_DETAILS);
 
	}
 

	
 
	return CommandCost();
 
@@ -545,6 +547,8 @@ CommandCost CmdAddVehicleGroup(TileIndex
 
		SetWindowDirty(WC_VEHICLE_VIEW, v->index);
 
		SetWindowDirty(WC_VEHICLE_DETAILS, v->index);
 
		InvalidateWindowData(GetWindowClassForVehicleType(v->type), VehicleListIdentifier(VL_GROUP_LIST, v->type, _current_company).Pack());
 
		InvalidateWindowData(WC_VEHICLE_VIEW, v->index);
 
		InvalidateWindowData(WC_VEHICLE_DETAILS, v->index);
 
	}
 

	
 
	return CommandCost();
src/lang/english.txt
Show inline comments
 
@@ -5037,6 +5037,7 @@ STR_FORMAT_BUOY_NAME                    
 
STR_FORMAT_BUOY_NAME_SERIAL                                     :{TOWN} Buoy #{COMMA}
 
STR_FORMAT_COMPANY_NUM                                          :(Company {COMMA})
 
STR_FORMAT_GROUP_NAME                                           :Group {COMMA}
 
STR_FORMAT_GROUP_VEHICLE_NAME                                   :{GROUP} #{COMMA}
 
STR_FORMAT_INDUSTRY_NAME                                        :{TOWN} {STRING}
 
STR_FORMAT_WAYPOINT_NAME                                        :{TOWN} Waypoint
 
STR_FORMAT_WAYPOINT_NAME_SERIAL                                 :{TOWN} Waypoint #{COMMA}
src/strings.cpp
Show inline comments
 
@@ -1467,6 +1467,11 @@ static char *FormatString(char *buff, co
 
					int64 args_array[] = {(int64)(size_t)v->name.c_str()};
 
					StringParameters tmp_params(args_array);
 
					buff = GetStringWithArgs(buff, STR_JUST_RAW_STRING, &tmp_params, last);
 
				} else if (v->group_id != DEFAULT_GROUP) {
 
					/* The vehicle has no name, but is member of a group, so print group name */
 
					int64 args_array[] = {v->group_id, v->unitnumber};
 
					StringParameters tmp_params(args_array);
 
					buff = GetStringWithArgs(buff, STR_FORMAT_GROUP_VEHICLE_NAME, &tmp_params, last);
 
				} else {
 
					int64 args_array[] = {v->unitnumber};
 
					StringParameters tmp_params(args_array);
0 comments (0 inline, 0 general)