Fix viewport order lines/markers for multiplayer clients.

This commit is contained in:
Jonathan G Rennison
2016-12-26 15:25:39 +00:00
parent 0d1e08ed75
commit 509da024cc
6 changed files with 76 additions and 42 deletions

View File

@@ -609,8 +609,11 @@ struct RefitWindow : public Window {
{
if (this->window_number != INVALID_VEHICLE) {
if (!FocusWindowById(WC_VEHICLE_VIEW, this->window_number)) {
if (this->window_number != INVALID_VEHICLE) MarkAllRoutePathsDirty(Vehicle::Get(this->window_number));
MarkAllRouteStepsDirty(this);
if (this->window_number != INVALID_VEHICLE) {
const Vehicle *v = Vehicle::Get(this->window_number);
MarkAllRoutePathsDirty(v);
MarkAllRouteStepsDirty(v);
}
}
}
}
@@ -618,16 +621,22 @@ struct RefitWindow : public Window {
virtual void OnFocus(Window *previously_focused_window)
{
if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) {
if (this->window_number != INVALID_VEHICLE) MarkAllRoutePathsDirty(Vehicle::Get(this->window_number));
MarkAllRouteStepsDirty(this);
if (this->window_number != INVALID_VEHICLE) {
const Vehicle *v = Vehicle::Get(this->window_number);
MarkAllRoutePathsDirty(v);
MarkAllRouteStepsDirty(v);
}
}
}
virtual void OnFocusLost(Window *newly_focused_window)
{
if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) {
if (this->window_number != INVALID_VEHICLE) MarkAllRoutePathsDirty(Vehicle::Get(this->window_number));
MarkAllRouteStepsDirty(this);
if (this->window_number != INVALID_VEHICLE) {
const Vehicle *v = Vehicle::Get(this->window_number);
MarkAllRoutePathsDirty(v);
MarkAllRouteStepsDirty(v);
}
}
}
@@ -1912,8 +1921,11 @@ struct VehicleDetailsWindow : Window {
{
if (this->window_number != INVALID_VEHICLE) {
if (!FocusWindowById(WC_VEHICLE_VIEW, this->window_number)) {
if (this->window_number != INVALID_VEHICLE) MarkAllRoutePathsDirty(Vehicle::Get(this->window_number));
MarkAllRouteStepsDirty(this);
if (this->window_number != INVALID_VEHICLE) {
const Vehicle *v = Vehicle::Get(this->window_number);
MarkAllRoutePathsDirty(v);
MarkAllRouteStepsDirty(v);
}
}
}
}
@@ -2270,16 +2282,22 @@ struct VehicleDetailsWindow : Window {
virtual void OnFocus(Window *previously_focused_window)
{
if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) {
if (this->window_number != INVALID_VEHICLE) MarkAllRoutePathsDirty(Vehicle::Get(this->window_number));
MarkAllRouteStepsDirty(this);
if (this->window_number != INVALID_VEHICLE) {
const Vehicle *v = Vehicle::Get(this->window_number);
MarkAllRoutePathsDirty(v);
MarkAllRouteStepsDirty(v);
}
}
}
virtual void OnFocusLost(Window *newly_focused_window)
{
if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) {
if (this->window_number != INVALID_VEHICLE) MarkAllRoutePathsDirty(Vehicle::Get(this->window_number));
MarkAllRouteStepsDirty(this);
if (this->window_number != INVALID_VEHICLE) {
const Vehicle *v = Vehicle::Get(this->window_number);
MarkAllRoutePathsDirty(v);
MarkAllRouteStepsDirty(v);
}
}
}
};
@@ -2554,8 +2572,11 @@ public:
~VehicleViewWindow()
{
if (this->window_number != INVALID_VEHICLE) MarkAllRoutePathsDirty(Vehicle::Get(this->window_number));
MarkAllRouteStepsDirty(this);
if (this->window_number != INVALID_VEHICLE) {
const Vehicle *v = Vehicle::Get(this->window_number);
MarkAllRoutePathsDirty(v);
MarkAllRouteStepsDirty(v);
}
DeleteWindowById(WC_VEHICLE_ORDERS, this->window_number, false);
DeleteWindowById(WC_VEHICLE_REFIT, this->window_number, false);
DeleteWindowById(WC_VEHICLE_DETAILS, this->window_number, false);
@@ -2565,16 +2586,22 @@ public:
virtual void OnFocus(Window *previously_focused_window)
{
if (HasFocusedVehicleChanged(this->window_number, previously_focused_window)) {
if (this->window_number != INVALID_VEHICLE) MarkAllRoutePathsDirty(Vehicle::Get(this->window_number));
MarkAllRouteStepsDirty(this);
if (this->window_number != INVALID_VEHICLE) {
const Vehicle *v = Vehicle::Get(this->window_number);
MarkAllRoutePathsDirty(v);
MarkAllRouteStepsDirty(v);
}
}
}
virtual void OnFocusLost(Window *newly_focused_window)
{
if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) {
if (this->window_number != INVALID_VEHICLE) MarkAllRoutePathsDirty(Vehicle::Get(this->window_number));
MarkAllRouteStepsDirty(this);
if (this->window_number != INVALID_VEHICLE) {
const Vehicle *v = Vehicle::Get(this->window_number);
MarkAllRoutePathsDirty(v);
MarkAllRouteStepsDirty(v);
}
}
}