Feature: Display icon/text whether vehicle is lost in vehicle (list) window (#9543)

This commit is contained in:
SamuXarick
2021-09-14 21:10:00 +01:00
committed by GitHub
parent 37de878129
commit a57c2b073a
3 changed files with 20 additions and 7 deletions

View File

@@ -778,6 +778,8 @@ void Vehicle::HandlePathfindingResult(bool path_found)
/* Clear the flag as the PF's problem was solved. */
ClrBit(this->vehicle_flags, VF_PATHFINDER_LOST);
SetWindowWidgetDirty(WC_VEHICLE_VIEW, this->index, WID_VV_START_STOP);
InvalidateWindowClassesData(GetWindowClassForVehicleType(this->type));
/* Delete the news item. */
DeleteVehicleNews(this->index, STR_NEWS_VEHICLE_IS_LOST);
return;
@@ -788,6 +790,8 @@ void Vehicle::HandlePathfindingResult(bool path_found)
/* It is first time the problem occurred, set the "lost" flag. */
SetBit(this->vehicle_flags, VF_PATHFINDER_LOST);
SetWindowWidgetDirty(WC_VEHICLE_VIEW, this->index, WID_VV_START_STOP);
InvalidateWindowClassesData(GetWindowClassForVehicleType(this->type));
/* Notify user about the event. */
AI::NewEvent(this->owner, new ScriptEventVehicleLost(this->index));
if (_settings_client.gui.lost_vehicle_warn && this->owner == _local_company) {