Mercurial > hg > openttd
changeset 5078:7984f2cbf0b4 draft
(svn r7142) -Fix: disable clone button in vehicle view for not owned vehicles (was already done for trains)
author | glx <glx@openttd.org> |
---|---|
date | Tue, 14 Nov 2006 00:02:02 +0000 |
parents | 81981a625502 |
children | 095095ff3e0e |
files | aircraft_gui.c roadveh_gui.c ship_gui.c |
diffstat | 3 files changed, 14 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/aircraft_gui.c +++ b/aircraft_gui.c @@ -215,9 +215,11 @@ case WE_PAINT: { const Vehicle *v = GetVehicle(w->window_number); StringID str; + bool is_localplayer = v->owner == _local_player; - SetWindowWidgetDisabledState(w, 7, v->owner != _local_player); - SetWindowWidgetDisabledState(w, 8, !IsAircraftInHangarStopped(v) || v->owner != _local_player); + SetWindowWidgetDisabledState(w, 7, !is_localplayer); + SetWindowWidgetDisabledState(w, 8, !IsAircraftInHangarStopped(v) || !is_localplayer); + SetWindowWidgetDisabledState(w, 11, !is_localplayer); /* draw widgets & caption */
--- a/roadveh_gui.c +++ b/roadveh_gui.c @@ -235,11 +235,13 @@ case WE_PAINT: { Vehicle *v = GetVehicle(w->window_number); StringID str; + bool is_localplayer = v->owner == _local_player; - SetWindowWidgetDisabledState(w, 7, v->owner != _local_player); - SetWindowWidgetDisabledState(w, 8, v->owner != _local_player); + SetWindowWidgetDisabledState(w, 7, !is_localplayer); + SetWindowWidgetDisabledState(w, 8, !is_localplayer); + SetWindowWidgetDisabledState(w, 11, !is_localplayer); /* Disable refit button if vehicle not refittable */ - SetWindowWidgetDisabledState(w, 12, v->owner != _local_player || + SetWindowWidgetDisabledState(w, 12, !is_localplayer || _engine_info[v->engine_type].refit_mask == 0); /* draw widgets & caption */
--- a/ship_gui.c +++ b/ship_gui.c @@ -380,11 +380,13 @@ Vehicle *v = GetVehicle(w->window_number); StringID str; bool refitable_and_stopped_in_depot = ShipVehInfo(v->engine_type)->refittable && IsShipInDepotStopped(v); + bool is_localplayer = v->owner == _local_player; - SetWindowWidgetDisabledState(w, 7, v->owner != _local_player); - SetWindowWidgetDisabledState(w, 8, - v->owner != _local_player || // Disable if owner is not local player + SetWindowWidgetDisabledState(w, 7, !is_localplayer); + SetWindowWidgetDisabledState(w, 8, + !is_localplayer || // Disable if owner is not local player !refitable_and_stopped_in_depot); // Disable if the ship is not refitable or stopped in a depot + SetWindowWidgetDisabledState(w, 11, !is_localplayer); /* draw widgets & caption */ SetDParam(0, v->string_id);