src/aircraft_gui.cpp
branchcpp_gui
changeset 6250 5135b200b376
parent 6246 2a4c2c4d66f0
child 6258 a2f86b8fd99b
equal deleted inserted replaced
6249:abafebc2fbce 6250:5135b200b376
   344 		bool plane_stopped = IsAircraftInHangarStopped(v);
   344 		bool plane_stopped = IsAircraftInHangarStopped(v);
   345 
   345 
   346 		/* Widget 7 (send to hangar) must be hidden if the plane is already stopped in hangar.
   346 		/* Widget 7 (send to hangar) must be hidden if the plane is already stopped in hangar.
   347 		 * Widget 11 (clone) should then be shown, since cloning is allowed only while in hangar and stopped.
   347 		 * Widget 11 (clone) should then be shown, since cloning is allowed only while in hangar and stopped.
   348 		 * This sytem allows to have two buttons, on top of each other*/
   348 		 * This sytem allows to have two buttons, on top of each other*/
   349 		if (plane_stopped != IsWindowWidgetHidden(w, 7) || plane_stopped == IsWindowWidgetHidden(w, 11)) {
   349 		if (plane_stopped != w->IsWidgetHidden(7) || plane_stopped == w->IsWidgetHidden(11)) {
   350 			SetWindowWidgetHiddenState(w,  7, plane_stopped);  // send to hangar
   350 			w->SetWidgetHiddenState( 7, plane_stopped);  // send to hangar
   351 			SetWindowWidgetHiddenState(w, 11, !plane_stopped); // clone
   351 			w->SetWidgetHiddenState(11, !plane_stopped); // clone
   352 			w->SetDirty();
   352 			w->SetDirty();
   353 		}
   353 		}
   354 	} break;
   354 	} break;
   355 	}
   355 	}
   356 }
   356 }