depot_gui.c
changeset 4702 c79e9d9f27b3
parent 4699 525b5057397d
child 4709 a81ab800c25b
equal deleted inserted replaced
4701:9e83e5ae6de7 4702:c79e9d9f27b3
    69 	WIDGET_MOVE_DOWN_RIGHT,         // DEPOT_WIDGET_RESIZE
    69 	WIDGET_MOVE_DOWN_RIGHT,         // DEPOT_WIDGET_RESIZE
    70 };
    70 };
    71 
    71 
    72 /* Widget array for all depot windows.
    72 /* Widget array for all depot windows.
    73  * If a widget is needed in some windows only (like train specific), add it for all windows
    73  * If a widget is needed in some windows only (like train specific), add it for all windows
    74  * and use w->hidden_state in ShowDepotWindow() to remove it in the windows where it should not be
    74  * and use HideWindowWidget in ShowDepotWindow() to remove it in the windows where it should not be
    75  * Keep the widget numbers in sync with the enum or really bad stuff will happen!!! */
    75  * Keep the widget numbers in sync with the enum or really bad stuff will happen!!! */
    76 
    76 
    77 /* When adding widgets, place them as you would place them for the ship depot and define how you want it to move in widget_moves[]
    77 /* When adding widgets, place them as you would place them for the ship depot and define how you want it to move in widget_moves[]
    78  * If you want a widget for one window only, set it to be hidden in ShowDepotWindow() for the windows where you don't want it
    78  * If you want a widget for one window only, set it to be hidden in ShowDepotWindow() for the windows where you don't want it
    79  * NOTE: the train only widgets are moved/resized in ShowDepotWindow() so they follow certain other widgets if they are moved to ensure that they stick together.
    79  * NOTE: the train only widgets are moved/resized in ShowDepotWindow() so they follow certain other widgets if they are moved to ensure that they stick together.
   966 		w->widget[DEPOT_WIDGET_MATRIX].data =
   966 		w->widget[DEPOT_WIDGET_MATRIX].data =
   967 			(w->vscroll.cap * 0x100) // number of rows to draw on the background
   967 			(w->vscroll.cap * 0x100) // number of rows to draw on the background
   968 			+ (type == VEH_Train ? 1 : w->hscroll.cap); // number of boxes in each row. Trains always have just one
   968 			+ (type == VEH_Train ? 1 : w->hscroll.cap); // number of boxes in each row. Trains always have just one
   969 
   969 
   970 		if (type != VEH_Train) {
   970 		if (type != VEH_Train) {
   971 			SETBIT(w->hidden_state, DEPOT_WIDGET_H_SCROLL);
   971 			HideWindowWidget(w, DEPOT_WIDGET_H_SCROLL);
   972 			SETBIT(w->hidden_state, DEPOT_WIDGET_SELL_CHAIN);
   972 			HideWindowWidget(w, DEPOT_WIDGET_SELL_CHAIN);
   973 		}
   973 		}
   974 
   974 
   975 		/* Move the widgets to their right locations */
   975 		/* Move the widgets to their right locations */
   976 		ResizeWindowWidgets(w, widget_moves, lengthof(widget_moves), horizontal, vertical);
   976 		ResizeWindowWidgets(w, widget_moves, lengthof(widget_moves), horizontal, vertical);
   977 
   977