summaryrefslogtreecommitdiff
path: root/src/group_cmd.cpp
diff options
context:
space:
mode:
authorstormcone <48624099+stormcone@users.noreply.github.com>2020-09-13 23:24:46 +0200
committerPatric Stout <github@truebrain.nl>2020-12-15 21:18:03 +0100
commitca65f19b03f28bd6a2283d740ca6ae449bdc01e7 (patch)
treeef81217d01e6b4c6ba870891405b62104ecbf852 /src/group_cmd.cpp
parent1a67954ff9e6d2ebd50b1ec60dd481df195da9dc (diff)
downloadopenttd-ca65f19b03f28bd6a2283d740ca6ae449bdc01e7.tar.xz
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.
Diffstat (limited to 'src/group_cmd.cpp')
-rw-r--r--src/group_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp
index fd63bd153..bf25dae86 100644
--- a/src/group_cmd.cpp
+++ b/src/group_cmd.cpp
@@ -456,6 +456,8 @@ CommandCost CmdAlterGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
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 tile, DoCommandFlag flags, uint32 p1, u
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();