author | bjarni |
Sun, 11 Mar 2007 16:31:18 +0000 | |
branch | cpp_gui |
changeset 6298 | c30fe89622df |
parent 6258 | a2f86b8fd99b |
child 6303 | 84c215fc8eb8 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
diff
changeset
|
3 |
#ifndef VEHICLE_GUI_H |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
diff
changeset
|
4 |
#define VEHICLE_GUI_H |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
diff
changeset
|
5 |
|
4442
8d8d0c2df7cb
(svn r6215) -Codechange: [vehicle list windows] unified Player(vehicle)WndProc into PlayerVehWndProc
bjarni
parents:
4434
diff
changeset
|
6 |
#include "window.h" |
4734
20770a208a04
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
bjarni
parents:
4712
diff
changeset
|
7 |
#include "vehicle.h" |
1752
cdbfb2f23e72
(svn r2256) - Fix: Trains cannot find a depot when they are in a tunnel. (glx)
matthijs
parents:
1246
diff
changeset
|
8 |
|
2436
177cb6a8339f
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents:
2186
diff
changeset
|
9 |
void DrawVehicleProfitButton(const Vehicle *v, int x, int y); |
4712
273ec3b182bf
(svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders)
bjarni
parents:
4681
diff
changeset
|
10 |
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order); |
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
6258
diff
changeset
|
11 |
void InitializeVehiclesGuiList(); |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
diff
changeset
|
12 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
diff
changeset
|
13 |
/* sorter stuff */ |
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
6258
diff
changeset
|
14 |
void RebuildVehicleLists(); |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
6258
diff
changeset
|
15 |
void ResortVehicleLists(); |
588 | 16 |
|
168
79f9ed5b23e6
(svn r169) -Fix: move around sort-widgets a bit so it looks more natural
darkvater
parents:
164
diff
changeset
|
17 |
#define PERIODIC_RESORT_DAYS 10 |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
diff
changeset
|
18 |
|
6258
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
6223
diff
changeset
|
19 |
/* Vehicle List BaseWindow type flags */ |
4449
7b1d5a6d15be
(svn r6227) -Codechange: added window type flags to use with PlayerVehWndProc
bjarni
parents:
4442
diff
changeset
|
20 |
enum { |
4546
9345e0569655
(svn r6378) -Codechange: Rename VLW_FLAGS to VLW_MASK as it is a mask
Darkvater
parents:
4545
diff
changeset
|
21 |
VLW_STANDARD = 0 << 8, |
4449
7b1d5a6d15be
(svn r6227) -Codechange: added window type flags to use with PlayerVehWndProc
bjarni
parents:
4442
diff
changeset
|
22 |
VLW_SHARED_ORDERS = 1 << 8, |
7b1d5a6d15be
(svn r6227) -Codechange: added window type flags to use with PlayerVehWndProc
bjarni
parents:
4442
diff
changeset
|
23 |
VLW_STATION_LIST = 2 << 8, |
4681
7d7a89b32dd0
(svn r6586) -Feature: [depot window] added a vehicle list window with all vehicles having a certain depot in their orders
bjarni
parents:
4668
diff
changeset
|
24 |
VLW_DEPOT_LIST = 3 << 8, |
4546
9345e0569655
(svn r6378) -Codechange: Rename VLW_FLAGS to VLW_MASK as it is a mask
Darkvater
parents:
4545
diff
changeset
|
25 |
VLW_MASK = 0x700, |
4449
7b1d5a6d15be
(svn r6227) -Codechange: added window type flags to use with PlayerVehWndProc
bjarni
parents:
4442
diff
changeset
|
26 |
}; |
7b1d5a6d15be
(svn r6227) -Codechange: added window type flags to use with PlayerVehWndProc
bjarni
parents:
4442
diff
changeset
|
27 |
|
4506
0d8fcc0a4e49
(svn r6291) -Feature: Vehicle lists from the station window now also got the goto depot button
bjarni
parents:
4485
diff
changeset
|
28 |
static inline bool ValidVLWFlags(uint16 flags) |
0d8fcc0a4e49
(svn r6291) -Feature: Vehicle lists from the station window now also got the goto depot button
bjarni
parents:
4485
diff
changeset
|
29 |
{ |
4681
7d7a89b32dd0
(svn r6586) -Feature: [depot window] added a vehicle list window with all vehicles having a certain depot in their orders
bjarni
parents:
4668
diff
changeset
|
30 |
return (flags == VLW_STANDARD || flags == VLW_SHARED_ORDERS || flags == VLW_STATION_LIST || flags == VLW_DEPOT_LIST); |
4506
0d8fcc0a4e49
(svn r6291) -Feature: Vehicle lists from the station window now also got the goto depot button
bjarni
parents:
4485
diff
changeset
|
31 |
} |
0d8fcc0a4e49
(svn r6291) -Feature: Vehicle lists from the station window now also got the goto depot button
bjarni
parents:
4485
diff
changeset
|
32 |
|
6258
a2f86b8fd99b
(svn r8801) [cpp_gui] -Codechange: few changes towards OO GUI:
KUDr
parents:
6223
diff
changeset
|
33 |
void PlayerVehWndProc(BaseWindow *w, WindowEvent *e); |
4442
8d8d0c2df7cb
(svn r6215) -Codechange: [vehicle list windows] unified Player(vehicle)WndProc into PlayerVehWndProc
bjarni
parents:
4434
diff
changeset
|
34 |
|
6030
70686dbed756
(svn r8331) -Feature: the train and aircraft build windows are now resizable in horizontal direction as well
bjarni
parents:
5996
diff
changeset
|
35 |
void DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number); |
842 | 36 |
|
4442
8d8d0c2df7cb
(svn r6215) -Codechange: [vehicle list windows] unified Player(vehicle)WndProc into PlayerVehWndProc
bjarni
parents:
4434
diff
changeset
|
37 |
void DrawTrainImage(const Vehicle *v, int x, int y, int count, int skip, VehicleID selection); |
8d8d0c2df7cb
(svn r6215) -Codechange: [vehicle list windows] unified Player(vehicle)WndProc into PlayerVehWndProc
bjarni
parents:
4434
diff
changeset
|
38 |
void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection); |
8d8d0c2df7cb
(svn r6215) -Codechange: [vehicle list windows] unified Player(vehicle)WndProc into PlayerVehWndProc
bjarni
parents:
4434
diff
changeset
|
39 |
void DrawShipImage(const Vehicle *v, int x, int y, VehicleID selection); |
4542
24f60077489a
(svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
Darkvater
parents:
4506
diff
changeset
|
40 |
void DrawAircraftImage(const Vehicle *v, int x, int y, VehicleID selection); |
4442
8d8d0c2df7cb
(svn r6215) -Codechange: [vehicle list windows] unified Player(vehicle)WndProc into PlayerVehWndProc
bjarni
parents:
4434
diff
changeset
|
41 |
|
4800
009e3c6cea8a
(svn r6722) -Codechange: [aircraft build window] moved aircraft build window to a file of it's own
bjarni
parents:
4796
diff
changeset
|
42 |
void ShowBuildVehicleWindow(TileIndex tile, byte type); |
4442
8d8d0c2df7cb
(svn r6215) -Codechange: [vehicle list windows] unified Player(vehicle)WndProc into PlayerVehWndProc
bjarni
parents:
4434
diff
changeset
|
43 |
|
2552
fb174febb0b1
(svn r3081) -Codechange: [autoreplace] complete rewrite of autoreplace
bjarni
parents:
2548
diff
changeset
|
44 |
void ChangeVehicleViewWindow(const Vehicle *from_v, const Vehicle *to_v); |
fb174febb0b1
(svn r3081) -Codechange: [autoreplace] complete rewrite of autoreplace
bjarni
parents:
2548
diff
changeset
|
45 |
|
4932
3567a3ec9d80
(svn r6912) - Feature: Show a list of cargo types that a vehicle is refittable to in the purchase information window. (mart3p)
peter1138
parents:
4930
diff
changeset
|
46 |
uint ShowAdditionalText(int x, int y, uint w, EngineID engine); |
3567a3ec9d80
(svn r6912) - Feature: Show a list of cargo types that a vehicle is refittable to in the purchase information window. (mart3p)
peter1138
parents:
4930
diff
changeset
|
47 |
uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine); |
2552
fb174febb0b1
(svn r3081) -Codechange: [autoreplace] complete rewrite of autoreplace
bjarni
parents:
2548
diff
changeset
|
48 |
|
5996
d4b66530ded4
(svn r8293) -Codechange: overloaded ShowVehicleListWindow() so it can open all types of vehicle lists (depending on arguments)
bjarni
parents:
5726
diff
changeset
|
49 |
void ShowVehicleListWindow(const Vehicle *v); |
d4b66530ded4
(svn r8293) -Codechange: overloaded ShowVehicleListWindow() so it can open all types of vehicle lists (depending on arguments)
bjarni
parents:
5726
diff
changeset
|
50 |
void ShowVehicleListWindow(PlayerID player, byte vehicle_type); |
d4b66530ded4
(svn r8293) -Codechange: overloaded ShowVehicleListWindow() so it can open all types of vehicle lists (depending on arguments)
bjarni
parents:
5726
diff
changeset
|
51 |
void ShowVehicleListWindow(PlayerID player, byte vehicle_type, StationID station); |
d4b66530ded4
(svn r8293) -Codechange: overloaded ShowVehicleListWindow() so it can open all types of vehicle lists (depending on arguments)
bjarni
parents:
5726
diff
changeset
|
52 |
void ShowVehicleListWindow(PlayerID player, byte vehicle_type, TileIndex depot_tile); |
4668
8b6035c51188
(svn r6562) -Codechange: merged the vehicle list window widget arrays
bjarni
parents:
4642
diff
changeset
|
53 |
|
6060
8388a1bcb7c8
(svn r8371) -Codechange: [autoreplace GUI] moved the autoreplace GUI to a file of it's own
bjarni
parents:
6059
diff
changeset
|
54 |
void ShowReplaceVehicleWindow(byte vehicletype); |
4734
20770a208a04
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
bjarni
parents:
4712
diff
changeset
|
55 |
|
20770a208a04
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
bjarni
parents:
4712
diff
changeset
|
56 |
static inline void DrawVehicleImage(const Vehicle *v, int x, int y, int count, int skip, VehicleID selection) |
20770a208a04
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
bjarni
parents:
4712
diff
changeset
|
57 |
{ |
20770a208a04
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
bjarni
parents:
4712
diff
changeset
|
58 |
switch (v->type) { |
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
6258
diff
changeset
|
59 |
case VEH_TRAIN: DrawTrainImage(v, x, y, count, skip, selection); break; |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
6258
diff
changeset
|
60 |
case VEH_ROAD: DrawRoadVehImage(v, x, y, selection); break; |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
6258
diff
changeset
|
61 |
case VEH_SHIP: DrawShipImage(v, x, y, selection); break; |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
6258
diff
changeset
|
62 |
case VEH_AIRCRAFT: DrawAircraftImage(v, x, y, selection); break; |
4734
20770a208a04
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
bjarni
parents:
4712
diff
changeset
|
63 |
default: NOT_REACHED(); |
20770a208a04
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
bjarni
parents:
4712
diff
changeset
|
64 |
} |
20770a208a04
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
bjarni
parents:
4712
diff
changeset
|
65 |
} |
20770a208a04
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
bjarni
parents:
4712
diff
changeset
|
66 |
|
6223
92d2073c3d7e
(svn r8661) -Fix: [depot windows] Enlarge the blocks in the depot window if a sprite is too big to fit (ships and aircraft only)
bjarni
parents:
6060
diff
changeset
|
67 |
static inline uint GetVehicleListHeight(byte type) |
4796
7e40ab01097a
(svn r6718) -Codechange: added function to get the line height for a vehicle type
bjarni
parents:
4734
diff
changeset
|
68 |
{ |
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
6258
diff
changeset
|
69 |
return (type == VEH_TRAIN || type == VEH_ROAD) ? 14 : 24; |
4796
7e40ab01097a
(svn r6718) -Codechange: added function to get the line height for a vehicle type
bjarni
parents:
4734
diff
changeset
|
70 |
} |
7e40ab01097a
(svn r6718) -Codechange: added function to get the line height for a vehicle type
bjarni
parents:
4734
diff
changeset
|
71 |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
diff
changeset
|
72 |
#endif /* VEHICLE_GUI_H */ |