Avoid unnecessary redrawing of vehicle list windows
Redraw info section every tick if values have changed
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "window_func.h"
|
||||
#include "date_func.h"
|
||||
#include "vehicle_func.h"
|
||||
#include "vehicle_gui.h"
|
||||
#include "sound_func.h"
|
||||
#include "ai/ai.hpp"
|
||||
#include "game/game.hpp"
|
||||
@@ -254,7 +255,7 @@ void Ship::OnNewDay()
|
||||
|
||||
SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
|
||||
/* we need this for the profit */
|
||||
SetWindowClassesDirty(WC_SHIPS_LIST);
|
||||
DirtyVehicleListWindowForVehicle(this);
|
||||
}
|
||||
|
||||
Trackdir Ship::GetVehicleTrackdir() const
|
||||
@@ -414,7 +415,7 @@ static bool CheckShipLeaveDepot(Ship *v)
|
||||
PlayShipSound(v);
|
||||
VehicleServiceInDepot(v);
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||
SetWindowClassesDirty(WC_SHIPS_LIST);
|
||||
DirtyVehicleListWindowForVehicle(v);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user