summaryrefslogtreecommitdiff
path: root/aircraft_gui.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-09-28 23:05:03 +0000
committerbjarni <bjarni@openttd.org>2006-09-28 23:05:03 +0000
commit4ccdb0686f3b401199efc975e8ce9f75bbcde0d7 (patch)
treeb9c5f2fcf23245015608eafaccdf02f62b94eda6 /aircraft_gui.c
parent1ae8aa4b809c3ddff032e2f3de7317490efa5235 (diff)
downloadopenttd-4ccdb0686f3b401199efc975e8ce9f75bbcde0d7.tar.xz
(svn r6562) -Codechange: merged the vehicle list window widget arrays
It made no sense to maintain 8 nearly identically arrays when a single one can do the job Also made the two buttons always use half of the bottom width each, even when resizing
Diffstat (limited to 'aircraft_gui.c')
-rw-r--r--aircraft_gui.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c
index cc1894f27..8b503bd3c 100644
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -602,79 +602,3 @@ void DrawSmallOrderListAircraft(const Vehicle *v, int x, int y)
}
}
}
-
-
-static const Widget _player_aircraft_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW },
-{ WWT_CAPTION, RESIZE_RIGHT, 14, 11, 247, 0, 13, STR_A009_AIRCRAFT, STR_018C_WINDOW_TITLE_DRAG_THIS },
-{ WWT_STICKYBOX, RESIZE_LR, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON },
-{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, STR_SORT_BY, STR_SORT_ORDER_TIP },
-{ WWT_PANEL, RESIZE_NONE, 14, 81, 235, 14, 25, 0x0, STR_SORT_CRITERIA_TIP },
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 236, 247, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP },
-{ WWT_PANEL, RESIZE_RIGHT, 14, 248, 259, 14, 25, 0x0, STR_NULL },
-{ WWT_MATRIX, RESIZE_RB, 14, 0, 247, 26, 169, 0x401, STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT },
-{ WWT_SCROLLBAR, RESIZE_LRB, 14, 248, 259, 26, 169, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST },
-{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 124, 170, 181, STR_SEND_TO_HANGARS, STR_SEND_TO_HANGARS_TIP },
-{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 125, 247, 170, 181, STR_REPLACE_VEHICLES, STR_REPLACE_HELP },
-{ WWT_PANEL, RESIZE_RTB, 14, 248, 247, 170, 181, 0x0, STR_NULL },
-{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 248, 259, 170, 181, 0x0, STR_RESIZE_BUTTON },
-{ WIDGETS_END},
-};
-
-static const Widget _other_player_aircraft_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW },
-{ WWT_CAPTION, RESIZE_RIGHT, 14, 11, 247, 0, 13, STR_A009_AIRCRAFT, STR_018C_WINDOW_TITLE_DRAG_THIS },
-{ WWT_STICKYBOX, RESIZE_LR, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON },
-{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, STR_SORT_BY, STR_SORT_ORDER_TIP },
-{ WWT_PANEL, RESIZE_NONE, 14, 81, 235, 14, 25, 0x0, STR_SORT_CRITERIA_TIP },
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 236, 247, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP },
-{ WWT_PANEL, RESIZE_RIGHT, 14, 248, 259, 14, 25, 0x0, STR_NULL },
-{ WWT_MATRIX, RESIZE_RB, 14, 0, 247, 26, 169, 0x401, STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT },
-{ WWT_SCROLLBAR, RESIZE_LRB, 14, 248, 259, 26, 169, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST },
-{ WWT_PANEL, RESIZE_RTB, 14, 0, 247, 170, 181, 0x0, STR_NULL },
-{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 248, 259, 170, 181, 0x0, STR_RESIZE_BUTTON },
-{ WIDGETS_END},
-};
-
-static const WindowDesc _player_aircraft_desc = {
- -1, -1, 260, 182,
- WC_AIRCRAFT_LIST,0,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
- _player_aircraft_widgets,
- PlayerVehWndProc
-};
-
-static const WindowDesc _other_player_aircraft_desc = {
- -1, -1, 260, 182,
- WC_AIRCRAFT_LIST,0,
- WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
- _other_player_aircraft_widgets,
- PlayerVehWndProc
-};
-
-void ShowPlayerAircraftLocal(PlayerID player, StationID station, OrderID order, bool show_shared)
-{
- Window *w;
-
- if (show_shared) {
- w = AllocateWindowDescFront(&_player_aircraft_desc, (order << 16) | (VEH_Aircraft << 11) | VLW_SHARED_ORDERS | player);
- } else {
- uint16 VLW_flag = (station == INVALID_STATION) ? VLW_STANDARD : VLW_STATION_LIST;
- if (player == _local_player) {
- w = AllocateWindowDescFront(&_player_aircraft_desc, (station << 16) | (VEH_Aircraft << 11) | VLW_flag | player);
- } else {
- w = AllocateWindowDescFront(&_other_player_aircraft_desc, (station << 16) | (VEH_Aircraft << 11) | VLW_flag | player);
- }
- }
-}
-
-void ShowPlayerAircraft(PlayerID player, StationID station)
-{
- ShowPlayerAircraftLocal(player, station, INVALID_ORDER, false);
-}
-
-void ShowVehWithSharedOrdersAircraft(Vehicle *v)
-{
- if (v->orders == NULL) return; // no shared list to show
- ShowPlayerAircraftLocal(v->owner, INVALID_STATION, v->orders->index, true);
-}