(svn r7142) -Fix: disable clone button in vehicle view for not owned vehicles (was already done for trains)

This commit is contained in:
glx
2006-11-14 00:02:02 +00:00
parent ed46b7d380
commit 30bc338f90
3 changed files with 14 additions and 8 deletions

View File

@@ -235,11 +235,13 @@ static void RoadVehViewWndProc(Window *w, WindowEvent *e)
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 */