author | truelight |
Mon, 03 Jan 2005 19:45:18 +0000 | |
changeset 867 | 581154a08a78 |
parent 790 | e19caa5f0ddf |
child 888 | 127b65c07558 |
permissions | -rw-r--r-- |
0 | 1 |
#include "stdafx.h" |
2 |
#include "ttd.h" |
|
507
8aa8100b0b22
(svn r815) Include strings.h only in the files which need it.
tron
parents:
200
diff
changeset
|
3 |
#include "table/strings.h" |
0 | 4 |
#include "window.h" |
5 |
#include "gui.h" |
|
6 |
#include "viewport.h" |
|
7 |
#include "gfx.h" |
|
8 |
#include "player.h" |
|
9 |
#include "command.h" |
|
10 |
#include "vehicle.h" |
|
186
d6fde0ea62f0
(svn r187) -Feature: [1024044] Show max loan in finances window. (ledow)
darkvater
parents:
176
diff
changeset
|
11 |
#include "economy.h" |
773
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
12 |
#include "network.h" |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
13 |
|
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
14 |
#ifdef ENABLE_NETWORK |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
15 |
#include "network_data.h" |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
16 |
#include "network_client.h" |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
17 |
#endif |
0 | 18 |
|
790
e19caa5f0ddf
(svn r1260) -Fix: [1090357] Patch for braindead MinGW compiler (luzi82)
darkvater
parents:
773
diff
changeset
|
19 |
static void DoShowPlayerFinances(int player, bool show_small); |
0 | 20 |
|
21 |
||
22 |
static void DrawPlayerEconomyStats(Player *p, byte mode) |
|
23 |
{ |
|
24 |
int x,y,i,j,year; |
|
25 |
int64 (*tbl)[13], sum,cost; |
|
26 |
StringID str; |
|
27 |
||
186
d6fde0ea62f0
(svn r187) -Feature: [1024044] Show max loan in finances window. (ledow)
darkvater
parents:
176
diff
changeset
|
28 |
if (!(mode & 1)) { // normal sized economics window (mode&1) is minimized status |
0 | 29 |
/* draw categories */ |
30 |
DrawStringCenterUnderline(61, 15, STR_700F_EXPENDITURE_INCOME, 0); |
|
31 |
for(i=0; i!=13; i++) |
|
32 |
DrawString(2, 27 + i*10, STR_7011_CONSTRUCTION + i, 0); |
|
33 |
DrawStringRightAligned(111, 27 + 10*13 + 2, STR_7020_TOTAL, 0); |
|
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
34 |
|
0 | 35 |
/* draw the price columns */ |
36 |
year = _cur_year - 2; |
|
37 |
j = 3; |
|
38 |
x = 215; |
|
39 |
tbl = p->yearly_expenses + 2; |
|
40 |
do { |
|
41 |
if (year >= p->inaugurated_year) { |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
42 |
SetDParam(0, year + 1920); |
0 | 43 |
DrawStringCenterUnderline(x-17, 15, STR_7010, 0); |
44 |
sum = 0; |
|
45 |
for(i=0; i!=13; i++) { |
|
46 |
/* draw one row in the price column */ |
|
47 |
cost = (*tbl)[i]; |
|
48 |
if (cost != 0) { |
|
49 |
sum += cost; |
|
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
50 |
|
0 | 51 |
str = STR_701E; |
52 |
if (cost < 0) { cost = -cost; str++; } |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
53 |
SetDParam64(0, cost); |
0 | 54 |
DrawStringRightAligned(x, 27+i*10, str, 0); |
55 |
} |
|
56 |
} |
|
57 |
||
58 |
str = STR_701E; |
|
59 |
if (sum < 0) { sum = -sum; str++; } |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
60 |
SetDParam64(0, sum); |
0 | 61 |
DrawStringRightAligned(x, 27 + 13*10 + 2, str, 0); |
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
62 |
|
0 | 63 |
GfxFillRect(x - 75, 27 + 10*13, x, 27 + 10*13, 215); |
64 |
x += 95; |
|
65 |
} |
|
66 |
year++; |
|
67 |
tbl--; |
|
68 |
} while (--j != 0); |
|
69 |
||
70 |
y = 171; |
|
186
d6fde0ea62f0
(svn r187) -Feature: [1024044] Show max loan in finances window. (ledow)
darkvater
parents:
176
diff
changeset
|
71 |
|
d6fde0ea62f0
(svn r187) -Feature: [1024044] Show max loan in finances window. (ledow)
darkvater
parents:
176
diff
changeset
|
72 |
// draw max loan aligned to loan below (y += 10) |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
73 |
SetDParam64(0, (uint64)_economy.max_loan); |
186
d6fde0ea62f0
(svn r187) -Feature: [1024044] Show max loan in finances window. (ledow)
darkvater
parents:
176
diff
changeset
|
74 |
DrawString(202, y+10, STR_MAX_LOAN, 0); |
d6fde0ea62f0
(svn r187) -Feature: [1024044] Show max loan in finances window. (ledow)
darkvater
parents:
176
diff
changeset
|
75 |
|
d6fde0ea62f0
(svn r187) -Feature: [1024044] Show max loan in finances window. (ledow)
darkvater
parents:
176
diff
changeset
|
76 |
} else |
0 | 77 |
y = 15; |
78 |
||
79 |
DrawString(2, y, STR_7026_BANK_BALANCE, 0); |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
80 |
SetDParam64(0, p->money64); |
0 | 81 |
DrawStringRightAligned(182, y, STR_7028, 0); |
82 |
||
83 |
y += 10; |
|
84 |
||
85 |
DrawString(2, y, STR_7027_LOAN, 0); |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
86 |
SetDParam64(0, p->current_loan); |
0 | 87 |
DrawStringRightAligned(182, y, STR_7028, 0); |
88 |
||
89 |
y += 12; |
|
90 |
||
91 |
GfxFillRect(182 - 75, y-2, 182, y-2, 215); |
|
92 |
||
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
93 |
SetDParam64(0, p->money64 - p->current_loan); |
0 | 94 |
DrawStringRightAligned(182, y, STR_7028, 0); |
95 |
} |
|
96 |
||
97 |
static const Widget _player_finances_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
98 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
99 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 392, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
100 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 393, 406, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
101 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 406, 14, 169, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
102 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 406, 170, 203, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
103 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 202, 204, 215, STR_7029_BORROW, STR_7035_INCREASE_SIZE_OF_LOAN}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
104 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 203, 406, 204, 215, STR_702A_REPAY, STR_7036_REPAY_PART_OF_LOAN}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
150
diff
changeset
|
105 |
{ WIDGETS_END}, |
0 | 106 |
}; |
107 |
||
108 |
static const Widget _other_player_finances_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
109 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
110 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 392, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
111 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 393, 406, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
112 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 406, 14, 169, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
113 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 406, 170, 203, 0x0, STR_NULL}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
150
diff
changeset
|
114 |
{ WIDGETS_END}, |
0 | 115 |
}; |
116 |
||
117 |
static const Widget _other_player_finances_small_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
118 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
119 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 265, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
120 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 266, 279, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
121 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
122 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 279, 14, 47, 0x0, STR_NULL}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
150
diff
changeset
|
123 |
{ WIDGETS_END}, |
0 | 124 |
}; |
125 |
||
126 |
static const Widget _player_finances_small_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
127 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
128 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 265, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
129 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 266, 279, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
130 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
131 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 279, 14, 47, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
132 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 139, 48, 59, STR_7029_BORROW, STR_7035_INCREASE_SIZE_OF_LOAN}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
133 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 140, 279, 48, 59, STR_702A_REPAY, STR_7036_REPAY_PART_OF_LOAN}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
150
diff
changeset
|
134 |
{ WIDGETS_END}, |
0 | 135 |
}; |
136 |
||
137 |
||
138 |
static void PlayerFinancesWndProc(Window *w, WindowEvent *e) |
|
139 |
{ |
|
140 |
switch(e->event) { |
|
141 |
case WE_PAINT: { |
|
142 |
Player *p = DEREF_PLAYER(w->window_number); |
|
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
143 |
|
0 | 144 |
w->disabled_state = p->current_loan != 0 ? 0 : (1 << 6); |
145 |
||
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
146 |
SetDParam(0, p->name_1); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
147 |
SetDParam(1, p->name_2); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
148 |
SetDParam(2, GetPlayerNameString((byte)w->window_number, 3)); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
149 |
SetDParam(4, 10000); |
0 | 150 |
DrawWindowWidgets(w); |
151 |
||
152 |
DrawPlayerEconomyStats(p, (byte)WP(w,def_d).data_1); |
|
153 |
} break; |
|
154 |
||
155 |
case WE_CLICK: |
|
156 |
switch(e->click.widget) { |
|
157 |
case 2: {/* toggle size */ |
|
158 |
byte mode = (byte)WP(w,def_d).data_1; |
|
159 |
int player = w->window_number; |
|
160 |
DeleteWindow(w); |
|
161 |
DoShowPlayerFinances(player, (mode & 1) == 0); |
|
162 |
} break; |
|
163 |
||
164 |
case 5: /* increase loan */ |
|
165 |
DoCommandP(0, w->window_number, _ctrl_pressed, NULL, CMD_INCREASE_LOAN | CMD_MSG(STR_702C_CAN_T_BORROW_ANY_MORE_MONEY)); |
|
166 |
break; |
|
167 |
||
168 |
case 6: /* repay loan */ |
|
169 |
DoCommandP(0, w->window_number, _ctrl_pressed, NULL, CMD_DECREASE_LOAN | CMD_MSG(STR_702F_CAN_T_REPAY_LOAN)); |
|
170 |
break; |
|
171 |
} |
|
172 |
break; |
|
173 |
} |
|
174 |
} |
|
175 |
||
176 |
static const WindowDesc _player_finances_desc = { |
|
177 |
-1,-1, 407, 216, |
|
178 |
WC_FINANCES,0, |
|
179 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESTORE_DPARAM | WDF_UNCLICK_BUTTONS, |
|
180 |
_player_finances_widgets, |
|
181 |
PlayerFinancesWndProc |
|
182 |
}; |
|
183 |
||
184 |
static const WindowDesc _player_finances_small_desc = { |
|
185 |
-1,-1, 280, 60, |
|
186 |
WC_FINANCES,0, |
|
187 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESTORE_DPARAM | WDF_UNCLICK_BUTTONS, |
|
188 |
_player_finances_small_widgets, |
|
189 |
PlayerFinancesWndProc |
|
190 |
}; |
|
191 |
||
192 |
static const WindowDesc _other_player_finances_desc = { |
|
193 |
-1,-1, 407, 204, |
|
194 |
WC_FINANCES,0, |
|
195 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESTORE_DPARAM | WDF_UNCLICK_BUTTONS, |
|
196 |
_other_player_finances_widgets, |
|
197 |
PlayerFinancesWndProc |
|
198 |
}; |
|
199 |
||
200 |
static const WindowDesc _other_player_finances_small_desc = { |
|
201 |
-1,-1, 280, 48, |
|
202 |
WC_FINANCES,0, |
|
203 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESTORE_DPARAM | WDF_UNCLICK_BUTTONS, |
|
204 |
_other_player_finances_small_widgets, |
|
205 |
PlayerFinancesWndProc |
|
206 |
}; |
|
207 |
||
208 |
static const WindowDesc * const desc_table[2*2] = { |
|
209 |
&_player_finances_desc,&_player_finances_small_desc, |
|
210 |
&_other_player_finances_desc,&_other_player_finances_small_desc, |
|
211 |
}; |
|
212 |
||
790
e19caa5f0ddf
(svn r1260) -Fix: [1090357] Patch for braindead MinGW compiler (luzi82)
darkvater
parents:
773
diff
changeset
|
213 |
static void DoShowPlayerFinances(int player, bool show_small) |
0 | 214 |
{ |
215 |
Window *w; |
|
216 |
int mode; |
|
217 |
||
790
e19caa5f0ddf
(svn r1260) -Fix: [1090357] Patch for braindead MinGW compiler (luzi82)
darkvater
parents:
773
diff
changeset
|
218 |
mode = ((byte)player != _local_player)*2 + show_small; |
0 | 219 |
w = AllocateWindowDescFront( desc_table[mode], player); |
220 |
if (w) { |
|
221 |
w->caption_color = w->window_number; |
|
222 |
WP(w,def_d).data_1 = mode; |
|
223 |
} |
|
224 |
} |
|
225 |
||
226 |
void ShowPlayerFinances(int player) |
|
227 |
{ |
|
228 |
DoShowPlayerFinances(player, false); |
|
229 |
} |
|
230 |
||
231 |
static void SelectPlayerColorWndProc(Window *w, WindowEvent *e) |
|
232 |
{ |
|
233 |
switch(e->event) { |
|
234 |
case WE_PAINT: { |
|
235 |
Player *p; |
|
236 |
uint used_colors = 0; |
|
237 |
int num_free = 16; |
|
238 |
int x,y,pos; |
|
239 |
int i; |
|
240 |
||
241 |
FOR_ALL_PLAYERS(p) { |
|
242 |
if (p->is_active) { |
|
243 |
SETBIT(used_colors, p->player_color); |
|
244 |
num_free--; |
|
245 |
} |
|
246 |
} |
|
247 |
WP(w,def_d).data_1 = used_colors; |
|
248 |
SetVScrollCount(w, num_free); |
|
249 |
DrawWindowWidgets(w); |
|
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
250 |
|
0 | 251 |
x = 2; |
252 |
y = 17; |
|
253 |
pos = w->vscroll.pos; |
|
254 |
||
255 |
for(i=0; i!=16; i++) { |
|
256 |
if (!(used_colors & 1) && --pos < 0 && pos >= -8) { |
|
257 |
DrawString(x + 30, y, STR_00D1_DARK_BLUE + i, 2); |
|
258 |
DrawSprite((i << 16) + 0x3078C1A, x + 14, y + 4); |
|
259 |
y += 14; |
|
260 |
} |
|
261 |
used_colors >>= 1; |
|
262 |
} |
|
263 |
} break; |
|
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
264 |
|
0 | 265 |
case WE_CLICK: |
266 |
if (e->click.widget == 2) { |
|
267 |
int item = (e->click.pt.y - 13) / 14; |
|
268 |
uint used_colors; |
|
269 |
int i; |
|
270 |
||
271 |
if ((uint)item >= 8) |
|
272 |
return; |
|
273 |
item += w->vscroll.pos; |
|
274 |
used_colors = WP(w,def_d).data_1; |
|
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
275 |
|
0 | 276 |
for(i=0; i!=16; i++) { |
277 |
if (!(used_colors & 1) && --item < 0) { |
|
278 |
DoCommandP(0, w->window_number, i, NULL, CMD_SET_PLAYER_COLOR); |
|
279 |
DeleteWindow(w); |
|
280 |
break; |
|
281 |
} |
|
282 |
used_colors >>= 1; |
|
283 |
} |
|
284 |
} |
|
285 |
break; |
|
286 |
} |
|
287 |
} |
|
288 |
||
289 |
static const Widget _select_player_color_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
290 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
291 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 149, 0, 13, STR_7007_NEW_COLOR_SCHEME, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
292 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 138, 14, 127, 0x0, STR_7034_CLICK_ON_SELECTED_NEW_COLOR}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
293 |
{ WWT_SCROLLBAR, RESIZE_NONE, 14, 139, 149, 14, 127, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
150
diff
changeset
|
294 |
{ WIDGETS_END}, |
0 | 295 |
}; |
296 |
||
297 |
static const WindowDesc _select_player_color_desc = { |
|
298 |
-1,-1, 150, 128, |
|
299 |
WC_PLAYER_COLOR,0, |
|
300 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
|
301 |
_select_player_color_widgets, |
|
302 |
SelectPlayerColorWndProc |
|
303 |
}; |
|
304 |
||
305 |
static void SelectPlayerFaceWndProc(Window *w, WindowEvent *e) |
|
306 |
{ |
|
307 |
switch(e->event) { |
|
308 |
case WE_PAINT: { |
|
309 |
Player *p; |
|
310 |
w->click_state = (w->click_state & ~(1<<5|1<<6)) | ((1<<5) << WP(w,facesel_d).gender); |
|
311 |
DrawWindowWidgets(w); |
|
312 |
p = DEREF_PLAYER(w->window_number); |
|
313 |
DrawPlayerFace(WP(w,facesel_d).face, p->player_color, 2, 16); |
|
314 |
} break; |
|
315 |
||
316 |
case WE_CLICK: |
|
317 |
switch(e->click.widget) { |
|
318 |
case 3: DeleteWindow(w); break; |
|
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
319 |
case 4: /* ok click */ |
0 | 320 |
DoCommandP(0, w->window_number, WP(w,facesel_d).face, NULL, CMD_SET_PLAYER_FACE); |
321 |
DeleteWindow(w); |
|
322 |
break; |
|
323 |
case 5: /* male click */ |
|
324 |
case 6: /* female click */ |
|
325 |
WP(w,facesel_d).gender = e->click.widget - 5; |
|
326 |
SetWindowDirty(w); |
|
327 |
break; |
|
328 |
case 7: |
|
329 |
WP(w,facesel_d).face = (InteractiveRandom() & 0x7FFFFFFF) + (WP(w,facesel_d).gender << 31); |
|
330 |
SetWindowDirty(w); |
|
331 |
break; |
|
332 |
} |
|
333 |
break; |
|
334 |
} |
|
335 |
} |
|
336 |
||
337 |
static const Widget _select_player_face_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
338 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
339 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 189, 0, 13, STR_7043_FACE_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
340 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 189, 14, 136, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
341 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 94, 137, 148, STR_012E_CANCEL, STR_7047_CANCEL_NEW_FACE_SELECTION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
342 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 189, 137, 148, STR_012F_OK, STR_7048_ACCEPT_NEW_FACE_SELECTION}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
343 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 95, 187, 25, 36, STR_7044_MALE, STR_7049_SELECT_MALE_FACES}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
344 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 95, 187, 37, 48, STR_7045_FEMALE, STR_704A_SELECT_FEMALE_FACES}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
345 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 79, 90, STR_7046_NEW_FACE, STR_704B_GENERATE_RANDOM_NEW_FACE}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
150
diff
changeset
|
346 |
{ WIDGETS_END}, |
0 | 347 |
}; |
348 |
||
349 |
static const WindowDesc _select_player_face_desc = { |
|
350 |
-1,-1, 190, 149, |
|
351 |
WC_PLAYER_FACE,0, |
|
352 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, |
|
353 |
_select_player_face_widgets, |
|
354 |
SelectPlayerFaceWndProc |
|
355 |
}; |
|
356 |
||
357 |
static const Widget _my_player_company_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
358 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
359 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 359, 0, 13, STR_7001, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
360 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 359, 14, 157, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
361 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 89, 158, 169, STR_7004_NEW_FACE, STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
362 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 90, 179, 158, 169, STR_7005_COLOR_SCHEME, STR_7031_CHANGE_THE_COMPANY_VEHICLE}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
363 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 180, 269, 158, 169, STR_7009_PRESIDENT_NAME, STR_7032_CHANGE_THE_PRESIDENT_S}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
364 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 270, 359, 158, 169, STR_7008_COMPANY_NAME, STR_7033_CHANGE_THE_COMPANY_NAME}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
365 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 18, 29, STR_706F_BUILD_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
366 |
{ WWT_EMPTY, RESIZE_NONE, 14, 266, 355, 32, 43, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
367 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 138, 149, STR_COMPANY_PASSWORD, STR_COMPANY_PASSWORD_TOOLTIP}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
150
diff
changeset
|
368 |
{ WIDGETS_END}, |
0 | 369 |
}; |
370 |
||
371 |
static const Widget _other_player_company_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
372 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
373 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 359, 0, 13, STR_7001, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
374 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 359, 14, 157, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
375 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
376 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
377 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
378 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
379 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 18, 29, STR_7072_VIEW_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
380 |
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
381 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 179, 158, 169, STR_7077_BUY_25_SHARE_IN_COMPANY, STR_7079_BUY_25_SHARE_IN_THIS_COMPANY}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
382 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 180, 359, 158, 169, STR_7078_SELL_25_SHARE_IN_COMPANY, STR_707A_SELL_25_SHARE_IN_THIS_COMPANY}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
150
diff
changeset
|
383 |
{ WIDGETS_END}, |
0 | 384 |
}; |
385 |
||
386 |
static const Widget _my_player_company_bh_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
387 |
{ WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
388 |
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 359, 0, 13, STR_7001, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
389 |
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 359, 14, 157, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
390 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 89, 158, 169, STR_7004_NEW_FACE, STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
391 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 90, 179, 158, 169, STR_7005_COLOR_SCHEME, STR_7031_CHANGE_THE_COMPANY_VEHICLE}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
392 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 180, 269, 158, 169, STR_7009_PRESIDENT_NAME, STR_7032_CHANGE_THE_PRESIDENT_S}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
393 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 270, 359, 158, 169, STR_7008_COMPANY_NAME, STR_7033_CHANGE_THE_COMPANY_NAME}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
394 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 18, 29, STR_7072_VIEW_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
395 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 32, 43, STR_RELOCATE_HQ, STR_RELOCATE_COMPANY_HEADQUARTERS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
396 |
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 138, 149, STR_COMPANY_PASSWORD, STR_COMPANY_PASSWORD_TOOLTIP}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
150
diff
changeset
|
397 |
{ WIDGETS_END}, |
0 | 398 |
}; |
399 |
||
400 |
static void DrawPlayerVehiclesAmount(int player) |
|
401 |
{ |
|
402 |
const int x = 110; |
|
403 |
int y = 72; |
|
404 |
Vehicle *v; |
|
405 |
uint train,road,air,ship; |
|
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
406 |
|
0 | 407 |
DrawString(x, y, STR_7039_VEHICLES, 0); |
408 |
||
409 |
train = road = air = ship = 0; |
|
410 |
||
411 |
FOR_ALL_VEHICLES(v) { |
|
412 |
if (v->owner == player) { |
|
413 |
if (v->type == VEH_Train) { |
|
414 |
if (v->subtype == 0) |
|
415 |
train++; |
|
416 |
} else if (v->type == VEH_Road) { |
|
417 |
road++; |
|
418 |
} else if (v->type == VEH_Aircraft) { |
|
419 |
if (v->subtype <= 2) |
|
420 |
air++; |
|
421 |
} else if (v->type == VEH_Ship) { |
|
422 |
ship++; |
|
423 |
} |
|
424 |
} |
|
425 |
} |
|
426 |
||
427 |
if (train+road+air+ship == 0) { |
|
428 |
DrawString(x+70, y, STR_7042_NONE, 0); |
|
429 |
} else { |
|
430 |
if (train != 0) { |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
431 |
SetDParam(0, train); |
0 | 432 |
DrawString(x + 70, y, train==1 ? STR_703A_TRAIN : STR_703B_TRAINS, 0); |
433 |
y += 10; |
|
434 |
} |
|
435 |
||
436 |
if (road != 0) { |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
437 |
SetDParam(0, road); |
0 | 438 |
DrawString(x + 70, y, road==1 ? STR_703C_ROAD_VEHICLE : STR_703D_ROAD_VEHICLES, 0); |
439 |
y += 10; |
|
440 |
} |
|
441 |
||
442 |
if (air != 0) { |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
443 |
SetDParam(0, air); |
0 | 444 |
DrawString(x + 70, y, air==1 ? STR_703E_AIRCRAFT : STR_703F_AIRCRAFT, 0); |
445 |
y += 10; |
|
446 |
} |
|
447 |
||
448 |
if (ship != 0) { |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
449 |
SetDParam(0, ship); |
0 | 450 |
DrawString(x + 70, y, ship==1 ? STR_7040_SHIP : STR_7041_SHIPS, 0); |
451 |
} |
|
452 |
} |
|
453 |
} |
|
454 |
||
599
80e49e323483
(svn r1023) -Fix: [Network] [ 1083692 ] You can no longer buy out a company in MP
truelight
parents:
543
diff
changeset
|
455 |
int GetAmountOwnedBy(Player *p, byte owner) |
0 | 456 |
{ |
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
457 |
return (p->share_owners[0] == owner) + |
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
458 |
(p->share_owners[1] == owner) + |
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
459 |
(p->share_owners[2] == owner) + |
0 | 460 |
(p->share_owners[3] == owner); |
461 |
} |
|
462 |
||
463 |
static void DrawCompanyOwnerText(Player *p) |
|
464 |
{ |
|
465 |
int num = -1; |
|
466 |
Player *p2; |
|
467 |
int amt; |
|
468 |
||
469 |
FOR_ALL_PLAYERS(p2) { |
|
470 |
if ((amt=GetAmountOwnedBy(p, p2->index)) != 0) { |
|
471 |
num++; |
|
472 |
||
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
473 |
SetDParam(num*3+0, amt*25); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
474 |
SetDParam(num*3+1, p2->name_1); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
475 |
SetDParam(num*3+2, p2->name_2); |
0 | 476 |
|
477 |
if (num != 0) |
|
478 |
break; |
|
479 |
} |
|
480 |
} |
|
481 |
||
482 |
if (num >= 0) |
|
483 |
DrawString(120, 124, STR_707D_OWNED_BY+num, 0); |
|
484 |
} |
|
485 |
||
486 |
static void PlayerCompanyWndProc(Window *w, WindowEvent *e) |
|
487 |
{ |
|
488 |
switch(e->event) { |
|
489 |
case WE_PAINT: { |
|
490 |
Player *p = DEREF_PLAYER(w->window_number); |
|
491 |
uint32 dis; |
|
492 |
||
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
493 |
if (!IsWindowOfPrototype(w, _other_player_company_widgets)) { |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
494 |
AssignWidgetToWindow(w, (p->location_of_house != 0) ? _my_player_company_bh_widgets : _my_player_company_widgets); |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
495 |
|
773
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
496 |
if (!_networking) w->hidden_state |= (1 << 9); // hide company-password widget |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
497 |
} |
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
498 |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
499 |
SetDParam(0, p->name_1); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
500 |
SetDParam(1, p->name_2); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
501 |
SetDParam(2, GetPlayerNameString((byte)w->window_number, 3)); |
0 | 502 |
|
503 |
dis = 0; |
|
599
80e49e323483
(svn r1023) -Fix: [Network] [ 1083692 ] You can no longer buy out a company in MP
truelight
parents:
543
diff
changeset
|
504 |
if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 0) dis |= 1 << 9; |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
505 |
// Also disable the buy button if 25% is not-owned by someone |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
506 |
// and the player is not an AI |
599
80e49e323483
(svn r1023) -Fix: [Network] [ 1083692 ] You can no longer buy out a company in MP
truelight
parents:
543
diff
changeset
|
507 |
if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 1 && !p->is_ai) dis |= 1 << 9; |
150
636c31df729f
(svn r151) -Fix: [1021566] Buy/Sell 25% share button is broke
darkvater
parents:
147
diff
changeset
|
508 |
if (GetAmountOwnedBy(p, _local_player) == 0) dis |= 1 << 10; |
669
75646b8921be
(svn r1107) -Fix: [Network] A spectator can no longer buy/sell shares of companies
truelight
parents:
599
diff
changeset
|
509 |
if (_local_player == OWNER_SPECTATOR) dis |= (1 << 9) | (1 << 10); |
0 | 510 |
|
511 |
w->disabled_state = dis; |
|
512 |
DrawWindowWidgets(w); |
|
513 |
||
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
514 |
SetDParam(0, p->inaugurated_year + 1920); |
0 | 515 |
DrawString(110, 25, STR_7038_INAUGURATED, 0); |
516 |
||
517 |
DrawPlayerVehiclesAmount(w->window_number); |
|
518 |
||
519 |
DrawString(110,48, STR_7006_COLOR_SCHEME, 0); |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
520 |
// Draw company-colour bus (0xC19) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
521 |
DrawSprite(PLAYER_SPRITE_COLOR(p->index) + 0x8C19, 215, 49); |
0 | 522 |
|
523 |
DrawPlayerFace(p->face, p->player_color, 2, 16); |
|
524 |
||
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
525 |
SetDParam(0, p->president_name_1); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
526 |
SetDParam(1, p->president_name_2); |
0 | 527 |
DrawStringMultiCenter(48, 141, STR_7037_PRESIDENT, 94); |
528 |
||
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
529 |
SetDParam64(0, CalculateCompanyValue(p)); |
0 | 530 |
DrawString(110, 114, STR_7076_COMPANY_VALUE, 0); |
531 |
||
532 |
DrawCompanyOwnerText(p); |
|
533 |
} break; |
|
534 |
||
535 |
case WE_CLICK: |
|
536 |
switch(e->click.widget) { |
|
537 |
case 3: { /* select face */ |
|
538 |
w = AllocateWindowDescFront(&_select_player_face_desc, w->window_number); |
|
539 |
if (w) { |
|
540 |
w->caption_color = w->window_number; |
|
541 |
WP(w,facesel_d).face = DEREF_PLAYER(w->window_number)->face; |
|
542 |
WP(w,facesel_d).gender = 0; |
|
543 |
} |
|
544 |
} break; |
|
545 |
||
546 |
case 4: {/* change color */ |
|
547 |
w = AllocateWindowDescFront(&_select_player_color_desc,w->window_number); |
|
548 |
if (w) { |
|
549 |
w->caption_color = w->window_number; |
|
550 |
w->vscroll.cap = 8; |
|
551 |
} |
|
552 |
} break; |
|
553 |
||
554 |
case 5: {/* change president name */ |
|
555 |
Player *p = DEREF_PLAYER(w->window_number); |
|
556 |
WP(w,def_d).byte_1 = 0; |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
557 |
SetDParam(0, p->president_name_2); |
0 | 558 |
ShowQueryString(p->president_name_1, STR_700B_PRESIDENT_S_NAME, 31, 94, w->window_class, w->window_number); |
559 |
} break; |
|
560 |
||
561 |
case 6: {/* change company name */ |
|
562 |
Player *p = DEREF_PLAYER(w->window_number); |
|
563 |
WP(w,def_d).byte_1 = 1; |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
564 |
SetDParam(0, p->name_2); |
0 | 565 |
ShowQueryString(p->name_1, STR_700A_COMPANY_NAME, 31, 150, w->window_class, w->window_number); |
566 |
} break; |
|
567 |
||
568 |
case 7: {/* build hq */ |
|
569 |
TileIndex tile = DEREF_PLAYER(w->window_number)->location_of_house; |
|
570 |
if (tile == 0) { |
|
571 |
if ((byte)w->window_number != _local_player) |
|
572 |
return; |
|
573 |
SetObjectToPlaceWnd(0x2D0, 1, w); |
|
574 |
SetTileSelectSize(2, 2); |
|
575 |
} else { |
|
576 |
ScrollMainWindowToTile(tile); |
|
200
03b8104d1479
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
truelight
parents:
186
diff
changeset
|
577 |
} |
0 | 578 |
} break; |
579 |
||
147
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
580 |
case 8: /* relocate HQ */ |
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
581 |
SetObjectToPlaceWnd(0x2D0, 1, w); |
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
582 |
SetTileSelectSize(2, 2); |
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
583 |
break; |
773
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
584 |
case 9: {/* buy 25% or password protect your company */ |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
585 |
#ifdef ENABLE_NETWORK |
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
586 |
if (!IsWindowOfPrototype(w, _other_player_company_widgets)) { |
773
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
587 |
StringID str; |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
588 |
WP(w,def_d).byte_1 = 2; |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
589 |
str = AllocateName(_network_player_info[_local_player].password, 0); |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
590 |
ShowQueryString(str, STR_SET_COMPANY_PASSWORD, sizeof(_network_player_info[_local_player].password), 250, w->window_class, w->window_number); |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
591 |
DeleteName(str); |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
592 |
} else |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
593 |
#endif |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
594 |
DoCommandP(0, w->window_number, 0, NULL, CMD_BUY_SHARE_IN_COMPANY | CMD_MSG(STR_707B_CAN_T_BUY_25_SHARE_IN_THIS)); |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
595 |
|
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
596 |
} break; |
0 | 597 |
|
147
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
598 |
case 10: /* sell 25% */ |
0 | 599 |
DoCommandP(0, w->window_number, 0, NULL, CMD_SELL_SHARE_IN_COMPANY | CMD_MSG(STR_707C_CAN_T_SELL_25_SHARE_IN)); |
600 |
break; |
|
601 |
} |
|
602 |
break; |
|
603 |
||
604 |
case WE_MOUSELOOP: |
|
605 |
/* redraw the window every now and then */ |
|
606 |
if ((++w->vscroll.pos & 0x1F) == 0) |
|
607 |
SetWindowDirty(w); |
|
608 |
break; |
|
609 |
||
147
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
610 |
case WE_PLACE_OBJ: { |
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
611 |
// you cannot destroy a HQ, only relocate it. So build_HQ is called, just with different flags |
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
612 |
TileIndex tile = DEREF_PLAYER(w->window_number)->location_of_house; |
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
613 |
if (DoCommandP(e->place.tile, (tile == 0) ? 0 : (1 << 16) | w->window_number, 0, NULL, CMD_BUILD_COMPANY_HQ | CMD_AUTO | CMD_NO_WATER | CMD_MSG(STR_7071_CAN_T_BUILD_COMPANY_HEADQUARTERS))) |
0 | 614 |
ResetObjectToPlace(); |
615 |
break; |
|
147
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
616 |
} |
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
16
diff
changeset
|
617 |
|
0 | 618 |
|
619 |
case WE_DESTROY: |
|
620 |
DeleteWindowById(WC_PLAYER_COLOR, w->window_number); |
|
621 |
DeleteWindowById(WC_PLAYER_FACE, w->window_number); |
|
622 |
break; |
|
623 |
||
624 |
case WE_ON_EDIT_TEXT: { |
|
773
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
625 |
char *b = (char*)e->edittext.str; |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
626 |
|
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
627 |
if (*b == 0 && WP(w,def_d).byte_1 != 2) // empty string is allowed for password |
0 | 628 |
return; |
773
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
629 |
|
0 | 630 |
memcpy(_decode_parameters, b, 32); |
773
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
631 |
switch (WP(w,def_d).byte_1) { |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
632 |
case 0: /* Change president name */ |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
633 |
DoCommandP(0, w->window_number, 0, NULL, CMD_CHANGE_PRESIDENT_NAME | CMD_MSG(STR_700D_CAN_T_CHANGE_PRESIDENT)); |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
634 |
break; |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
635 |
case 1: /* Change company name */ |
0 | 636 |
DoCommandP(0, w->window_number, 0, NULL, CMD_CHANGE_COMPANY_NAME | CMD_MSG(STR_700C_CAN_T_CHANGE_COMPANY_NAME)); |
773
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
637 |
break; |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
638 |
#ifdef ENABLE_NETWORK |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
639 |
case 2: /* Change company password */ |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
640 |
if (*b == 0) *b = '*'; // empty password is a '*' because of console argument |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
641 |
NetworkChangeCompanyPassword(b); |
0c5d7a4bac3d
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
darkvater
parents:
669
diff
changeset
|
642 |
#endif |
0 | 643 |
} |
644 |
} break; |
|
645 |
||
646 |
} |
|
647 |
} |
|
648 |
||
649 |
||
650 |
static const WindowDesc _my_player_company_desc = { |
|
651 |
-1,-1, 360, 170, |
|
652 |
WC_COMPANY,0, |
|
653 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, |
|
654 |
_my_player_company_widgets, |
|
655 |
PlayerCompanyWndProc |
|
656 |
}; |
|
657 |
||
658 |
static const WindowDesc _other_player_company_desc = { |
|
659 |
-1,-1, 360, 170, |
|
660 |
WC_COMPANY,0, |
|
661 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, |
|
662 |
_other_player_company_widgets, |
|
663 |
PlayerCompanyWndProc |
|
664 |
}; |
|
665 |
||
666 |
void ShowPlayerCompany(int player) |
|
667 |
{ |
|
668 |
Window *w; |
|
669 |
w = AllocateWindowDescFront((byte)player == _local_player ? &_my_player_company_desc : &_other_player_company_desc, player); |
|
670 |
if (w) |
|
671 |
w->caption_color = w->window_number; |
|
672 |
} |
|
673 |
||
674 |
||
675 |
||
676 |
static void BuyCompanyWndProc(Window *w, WindowEvent *e) |
|
677 |
{ |
|
678 |
switch(e->event) { |
|
679 |
case WE_PAINT: { |
|
680 |
Player *p = DEREF_PLAYER(w->window_number); |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
681 |
SetDParam(0, p->name_1); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
682 |
SetDParam(1, p->name_2); |
0 | 683 |
DrawWindowWidgets(w); |
684 |
||
685 |
DrawPlayerFace(p->face, p->player_color, 2, 16); |
|
686 |
||
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
687 |
SetDParam(0, p->name_1); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
688 |
SetDParam(1, p->name_2); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
689 |
SetDParam(2, p->bankrupt_value); |
0 | 690 |
DrawStringMultiCenter(214, 65, STR_705B_WE_ARE_LOOKING_FOR_A_TRANSPORT, 238); |
691 |
break; |
|
692 |
} |
|
693 |
||
694 |
case WE_CLICK: |
|
695 |
switch(e->click.widget) { |
|
696 |
case 3: |
|
697 |
DeleteWindow(w); |
|
698 |
break; |
|
699 |
case 4: { |
|
700 |
DoCommandP(0, w->window_number, 0, NULL, CMD_BUY_COMPANY | CMD_MSG(STR_7060_CAN_T_BUY_COMPANY)); |
|
701 |
break; |
|
702 |
} |
|
703 |
} |
|
704 |
break; |
|
705 |
} |
|
706 |
} |
|
707 |
||
708 |
static const Widget _buy_company_widgets[] = { |
|
867
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
709 |
{ WWT_TEXTBTN, RESIZE_NONE, 5, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
710 |
{ WWT_CAPTION, RESIZE_NONE, 5, 11, 333, 0, 13, STR_00B3_MESSAGE_FROM, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
711 |
{ WWT_IMGBTN, RESIZE_NONE, 5, 0, 333, 14, 136, 0x0, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
712 |
{ WWT_TEXTBTN, RESIZE_NONE, 5, 148, 207, 117, 128, STR_00C9_NO, STR_NULL}, |
581154a08a78
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
790
diff
changeset
|
713 |
{ WWT_TEXTBTN, RESIZE_NONE, 5, 218, 277, 117, 128, STR_00C8_YES, STR_NULL}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
150
diff
changeset
|
714 |
{ WIDGETS_END}, |
0 | 715 |
}; |
716 |
||
717 |
static const WindowDesc _buy_company_desc = { |
|
718 |
153,171, 334, 137, |
|
719 |
WC_BUY_COMPANY,0, |
|
720 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
|
721 |
_buy_company_widgets, |
|
722 |
BuyCompanyWndProc |
|
723 |
}; |
|
724 |
||
725 |
||
726 |
void ShowBuyCompanyDialog(uint player) |
|
727 |
{ |
|
728 |
AllocateWindowDescFront(&_buy_company_desc, player); |
|
729 |
} |