Fix group add/remove/rename not updating template replacement GUI in MP

pull/192/head
Jonathan G Rennison 4 years ago
parent 2ea3a7d6f4
commit a36e77c269

@ -342,6 +342,7 @@ CommandCost CmdCreateGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
InvalidateWindowData(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_GROUP_LIST, vt, _current_company).Pack());
InvalidateWindowData(WC_COMPANY_COLOUR, g->owner, g->vehicle_type);
InvalidateWindowData(WC_TEMPLATEGUI_MAIN, 0, 0, 0);
}
return CommandCost();
@ -401,6 +402,7 @@ CommandCost CmdDeleteGroup(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
InvalidateWindowData(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_GROUP_LIST, vt, _current_company).Pack());
InvalidateWindowData(WC_COMPANY_COLOUR, _current_company, vt);
InvalidateWindowData(WC_TEMPLATEGUI_MAIN, 0, 0, 0);
}
return CommandCost();
@ -471,6 +473,7 @@ 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);
InvalidateWindowData(WC_TEMPLATEGUI_MAIN, 0, 0, 0);
}
return CommandCost();

@ -946,7 +946,6 @@ public:
void OnQueryTextFinished(char *str) override
{
if (str != nullptr) DoCommandP(0, this->group_rename, 0, CMD_ALTER_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_RENAME), nullptr, str);
InvalidateWindowData(WC_TEMPLATEGUI_MAIN, 0, 0, 0);
this->group_rename = INVALID_GROUP;
}

Loading…
Cancel
Save