author | truelight |
Sat, 04 Dec 2004 17:54:56 +0000 | |
changeset 543 | e3b43338096b |
parent 536 | aef4753985d3 |
child 545 | 6e8767542192 |
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:
502
diff
changeset
|
3 |
#include "table/strings.h" |
0 | 4 |
#include "window.h" |
5 |
#include "gui.h" |
|
6 |
#include "gfx.h" |
|
7 |
#include "command.h" |
|
8 |
#include "engine.h" |
|
430 | 9 |
#include "screenshot.h" |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
10 |
#include "newgrf.h" |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
11 |
#include "network.h" |
0 | 12 |
|
13 |
static uint32 _difficulty_click_a; |
|
14 |
static uint32 _difficulty_click_b; |
|
15 |
static byte _difficulty_timeout; |
|
16 |
||
17 |
extern const StringID _currency_string_list[]; |
|
18 |
extern uint GetMaskOfAllowedCurrencies(); |
|
19 |
||
20 |
static const StringID _distances_dropdown[] = { |
|
21 |
STR_0139_IMPERIAL_MILES, |
|
22 |
STR_013A_METRIC_KILOMETERS, |
|
23 |
INVALID_STRING_ID |
|
24 |
}; |
|
25 |
||
26 |
static const StringID _driveside_dropdown[] = { |
|
27 |
STR_02E9_DRIVE_ON_LEFT, |
|
28 |
STR_02EA_DRIVE_ON_RIGHT, |
|
29 |
INVALID_STRING_ID |
|
30 |
}; |
|
31 |
||
32 |
static const StringID _autosave_dropdown[] = { |
|
33 |
STR_02F7_OFF, |
|
34 |
STR_AUTOSAVE_1_MONTH, |
|
35 |
STR_02F8_EVERY_3_MONTHS, |
|
36 |
STR_02F9_EVERY_6_MONTHS, |
|
37 |
STR_02FA_EVERY_12_MONTHS, |
|
38 |
INVALID_STRING_ID, |
|
39 |
}; |
|
40 |
||
41 |
static const StringID _designnames_dropdown[] = { |
|
42 |
STR_02BE_DEFAULT, |
|
43 |
STR_02BF_CUSTOM, |
|
44 |
INVALID_STRING_ID |
|
45 |
}; |
|
46 |
||
47 |
static StringID *BuildDynamicDropdown(StringID base, int num) |
|
48 |
{ |
|
49 |
static StringID buf[32 + 1]; |
|
50 |
StringID *p = buf; |
|
51 |
while (--num>=0) *p++ = base++; |
|
52 |
*p = INVALID_STRING_ID; |
|
53 |
return buf; |
|
54 |
} |
|
55 |
||
56 |
static int GetCurRes() |
|
57 |
{ |
|
58 |
int i; |
|
306
c44133836566
(svn r312) -Fix: [926105] ctrl + d bug. Longest outstanding bug has been fixed \o/ 2004-03-30 (Tron)
darkvater
parents:
298
diff
changeset
|
59 |
for(i = 0; i != _num_resolutions; i++) |
c44133836566
(svn r312) -Fix: [926105] ctrl + d bug. Longest outstanding bug has been fixed \o/ 2004-03-30 (Tron)
darkvater
parents:
298
diff
changeset
|
60 |
if (_resolutions[i][0] == _screen.width && |
c44133836566
(svn r312) -Fix: [926105] ctrl + d bug. Longest outstanding bug has been fixed \o/ 2004-03-30 (Tron)
darkvater
parents:
298
diff
changeset
|
61 |
_resolutions[i][1] == _screen.height) |
0 | 62 |
break; |
63 |
return i; |
|
64 |
} |
|
65 |
||
66 |
static void GameOptionsWndProc(Window *w, WindowEvent *e) |
|
67 |
{ |
|
68 |
int i; |
|
69 |
||
70 |
switch(e->event) { |
|
71 |
case WE_PAINT: { |
|
72 |
StringID str = STR_02BE_DEFAULT; |
|
73 |
w->disabled_state = (_vehicle_design_names & 1) ? (++str, 0) : (1 << 21); |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
74 |
SetDParam(0, str); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
75 |
SetDParam(1, _currency_string_list[_opt_mod_ptr->currency]); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
76 |
SetDParam(2, _opt_mod_ptr->kilometers + STR_0139_IMPERIAL_MILES); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
77 |
SetDParam(3, STR_02E9_DRIVE_ON_LEFT + _opt_mod_ptr->road_side); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
78 |
SetDParam(4, STR_TOWNNAME_ENGLISH + _opt_mod_ptr->town_name); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
79 |
SetDParam(5, _autosave_dropdown[_opt_mod_ptr->autosave]); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
80 |
SetDParam(6, SPECSTR_LANGUAGE_START + _dynlang.curr); |
0 | 81 |
i = GetCurRes(); |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
82 |
SetDParam(7, i == _num_resolutions ? STR_RES_OTHER : SPECSTR_RESOLUTION_START + i); |
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
83 |
SetDParam(8, SPECSTR_SCREENSHOT_START + _cur_screenshot_format); |
298
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
84 |
(_fullscreen) ? SETBIT(w->click_state, 28) : CLRBIT(w->click_state, 28); // fullscreen button |
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
85 |
|
0 | 86 |
DrawWindowWidgets(w); |
298
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
87 |
DrawString(20, 175, STR_OPTIONS_FULLSCREEN, 0); // fullscreen |
0 | 88 |
} break; |
89 |
||
90 |
case WE_CLICK: |
|
91 |
switch(e->click.widget) { |
|
92 |
case 5: |
|
93 |
ShowDropDownMenu(w, _currency_string_list, _opt_mod_ptr->currency, e->click.widget, _game_mode == GM_MENU ? 0 : ~GetMaskOfAllowedCurrencies()); |
|
94 |
return; |
|
95 |
case 8: |
|
96 |
ShowDropDownMenu(w, _distances_dropdown, _opt_mod_ptr->kilometers, e->click.widget, 0); |
|
97 |
return; |
|
98 |
case 11: { |
|
99 |
int i = _opt_mod_ptr->road_side; |
|
100 |
ShowDropDownMenu(w, _driveside_dropdown, i, e->click.widget, (_game_mode == GM_MENU) ? 0 : (-1) ^ (1 << i)); |
|
101 |
return; |
|
102 |
} |
|
103 |
case 14: { |
|
104 |
int i = _opt_mod_ptr->town_name; |
|
105 |
ShowDropDownMenu(w, BuildDynamicDropdown(STR_TOWNNAME_ENGLISH, SPECSTR_TOWNNAME_LAST - SPECSTR_TOWNNAME_START + 1), i, e->click.widget, (_game_mode == GM_MENU) ? 0 : (-1) ^ (1 << i)); |
|
106 |
return; |
|
107 |
} |
|
108 |
case 17: |
|
109 |
ShowDropDownMenu(w, _autosave_dropdown, _opt_mod_ptr->autosave, e->click.widget, 0); |
|
110 |
return; |
|
111 |
case 20: |
|
112 |
ShowDropDownMenu(w, _designnames_dropdown, (_vehicle_design_names&1)?1:0, e->click.widget, (_vehicle_design_names&2)?0:2); |
|
113 |
return; |
|
114 |
case 21: |
|
115 |
return; |
|
116 |
case 24: |
|
117 |
ShowDropDownMenu(w, _dynlang.dropdown, _dynlang.curr, e->click.widget, 0); |
|
118 |
return; |
|
119 |
case 27: |
|
120 |
// setup resolution dropdown |
|
121 |
ShowDropDownMenu(w, BuildDynamicDropdown(SPECSTR_RESOLUTION_START, _num_resolutions), GetCurRes(), e->click.widget, 0); |
|
122 |
return; |
|
298
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
123 |
case 28: /* Click fullscreen on/off */ |
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
124 |
(_fullscreen) ? CLRBIT(w->click_state, 28) : SETBIT(w->click_state, 28); |
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
125 |
ToggleFullScreen(!_fullscreen); // toggle full-screen on/off |
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
126 |
SetWindowDirty(w); |
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
127 |
return; |
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
128 |
case 31: /* Setup screenshot format dropdown */ |
0 | 129 |
ShowDropDownMenu(w, BuildDynamicDropdown(SPECSTR_SCREENSHOT_START, _num_screenshot_formats), _cur_screenshot_format, e->click.widget, 0); |
130 |
return; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
131 |
|
0 | 132 |
} |
133 |
break; |
|
134 |
||
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
135 |
case WE_DROPDOWN_SELECT: |
0 | 136 |
switch(e->dropdown.button) { |
137 |
case 20: |
|
138 |
if (e->dropdown.index == 0) { |
|
139 |
DeleteCustomEngineNames(); |
|
140 |
MarkWholeScreenDirty(); |
|
141 |
} else if (!(_vehicle_design_names&1)) { |
|
142 |
LoadCustomEngineNames(); |
|
143 |
MarkWholeScreenDirty(); |
|
144 |
} |
|
145 |
break; |
|
146 |
case 5: |
|
147 |
_opt_mod_ptr->currency = _opt.currency = e->dropdown.index; |
|
148 |
MarkWholeScreenDirty(); |
|
149 |
break; |
|
150 |
case 8: |
|
151 |
_opt_mod_ptr->kilometers = e->dropdown.index; |
|
152 |
MarkWholeScreenDirty(); |
|
153 |
break; |
|
154 |
case 11: |
|
155 |
if (_game_mode == GM_MENU) |
|
156 |
DoCommandP(0, e->dropdown.index, 0, NULL, CMD_SET_ROAD_DRIVE_SIDE | CMD_MSG(STR_EMPTY)); |
|
157 |
break; |
|
158 |
case 14: |
|
159 |
if (_game_mode == GM_MENU) |
|
160 |
DoCommandP(0, e->dropdown.index, 0, NULL, CMD_SET_TOWN_NAME_TYPE | CMD_MSG(STR_EMPTY)); |
|
161 |
break; |
|
162 |
case 17: |
|
163 |
_opt_mod_ptr->autosave = e->dropdown.index; |
|
164 |
SetWindowDirty(w); |
|
165 |
break; |
|
166 |
||
167 |
// change interface language |
|
168 |
case 24: |
|
169 |
ReadLanguagePack(e->dropdown.index); |
|
170 |
MarkWholeScreenDirty(); |
|
171 |
break; |
|
172 |
||
173 |
// change resolution |
|
174 |
case 27: |
|
175 |
if (e->dropdown.index < _num_resolutions && ChangeResInGame(_resolutions[e->dropdown.index][0],_resolutions[e->dropdown.index][1])) |
|
176 |
SetWindowDirty(w); |
|
177 |
break; |
|
178 |
||
179 |
// change screenshot format |
|
315
e008762a8689
(svn r321) -Fix: crash when making png screenshot with odd resolution (Tron)
truelight
parents:
306
diff
changeset
|
180 |
case 31: |
0 | 181 |
SetScreenshotFormat(e->dropdown.index); |
182 |
SetWindowDirty(w); |
|
183 |
break; |
|
184 |
} |
|
185 |
break; |
|
186 |
} |
|
187 |
} |
|
188 |
||
189 |
int32 CmdSetRoadDriveSide(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
|
190 |
{ |
|
191 |
if (flags & DC_EXEC) { |
|
192 |
_opt_mod_ptr->road_side = p1; |
|
193 |
InvalidateWindow(WC_GAME_OPTIONS,0); |
|
194 |
} |
|
195 |
return 0; |
|
196 |
} |
|
197 |
||
198 |
int32 CmdSetTownNameType(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
|
199 |
{ |
|
200 |
if (flags & DC_EXEC) { |
|
201 |
_opt_mod_ptr->town_name = p1; |
|
202 |
InvalidateWindow(WC_GAME_OPTIONS,0); |
|
203 |
} |
|
204 |
return 0; |
|
205 |
} |
|
206 |
||
207 |
||
208 |
static const Widget _game_options_widgets[] = { |
|
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
209 |
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
210 |
{ WWT_CAPTION, 14, 11, 369, 0, 13, STR_00B1_GAME_OPTIONS, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
298
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
211 |
{ WWT_PANEL, 14, 0, 369, 14, 238, 0x0, STR_NULL}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
212 |
{ WWT_FRAME, 14, 10, 179, 20, 55, STR_02E0_CURRENCY_UNITS, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
213 |
{ WWT_6, 14, 20, 169, 34, 45, STR_02E1, STR_02E2_CURRENCY_UNITS_SELECTION}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
214 |
{ WWT_CLOSEBOX, 14, 158, 168, 35, 44, STR_0225, STR_02E2_CURRENCY_UNITS_SELECTION}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
215 |
{ WWT_FRAME, 14, 190, 359, 20, 55, STR_02E3_DISTANCE_UNITS, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
216 |
{ WWT_6, 14, 200, 349, 34, 45, STR_02E4, STR_02E5_DISTANCE_UNITS_SELECTION}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
217 |
{ WWT_CLOSEBOX, 14, 338, 348, 35, 44, STR_0225, STR_02E5_DISTANCE_UNITS_SELECTION}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
218 |
{ WWT_FRAME, 14, 10, 179, 62, 97, STR_02E6_ROAD_VEHICLES, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
219 |
{ WWT_6, 14, 20, 169, 76, 87, STR_02E7, STR_02E8_SELECT_SIDE_OF_ROAD_FOR}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
220 |
{ WWT_CLOSEBOX, 14, 158, 168, 77, 86, STR_0225, STR_02E8_SELECT_SIDE_OF_ROAD_FOR}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
221 |
{ WWT_FRAME, 14, 190, 359, 62, 97, STR_02EB_TOWN_NAMES, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
222 |
{ WWT_6, 14, 200, 349, 76, 87, STR_02EC, STR_02ED_SELECT_STYLE_OF_TOWN_NAMES}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
223 |
{ WWT_CLOSEBOX, 14, 338, 348, 77, 86, STR_0225, STR_02ED_SELECT_STYLE_OF_TOWN_NAMES}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
224 |
{ WWT_FRAME, 14, 10, 179, 104, 139, STR_02F4_AUTOSAVE, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
225 |
{ WWT_6, 14, 20, 169, 118, 129, STR_02F5, STR_02F6_SELECT_INTERVAL_BETWEEN}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
226 |
{ WWT_CLOSEBOX, 14, 158, 168, 119, 128, STR_0225, STR_02F6_SELECT_INTERVAL_BETWEEN}, |
0 | 227 |
|
298
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
228 |
{ WWT_FRAME, 14, 10, 359, 194, 228, STR_02BC_VEHICLE_DESIGN_NAMES, STR_NULL}, |
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
229 |
{ WWT_6, 14, 20, 119, 207, 218, STR_02BD, STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION}, |
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
230 |
{ WWT_CLOSEBOX, 14, 108, 118, 208, 217, STR_0225, STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION}, |
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
231 |
{ WWT_CLOSEBOX, 14, 130, 349, 207, 218, STR_02C0_SAVE_CUSTOM_NAMES_TO_DISK, STR_02C2_SAVE_CUSTOMIZED_VEHICLE}, |
0 | 232 |
|
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
233 |
{ WWT_FRAME, 14, 190, 359, 104, 139, STR_OPTIONS_LANG, STR_NULL}, |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
234 |
{ WWT_6, 14, 200, 349, 118, 129, STR_OPTIONS_LANG_CBO, STR_OPTIONS_LANG_TIP}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
235 |
{ WWT_CLOSEBOX, 14, 338, 348, 119, 128, STR_0225, STR_OPTIONS_LANG_TIP}, |
298
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
236 |
|
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
237 |
{ WWT_FRAME, 14, 10, 179, 146, 190, STR_OPTIONS_RES, STR_NULL}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
238 |
{ WWT_6, 14, 20, 169, 160, 171, STR_OPTIONS_RES_CBO, STR_OPTIONS_RES_TIP}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
239 |
{ WWT_CLOSEBOX, 14, 158, 168, 161, 170, STR_0225, STR_OPTIONS_RES_TIP}, |
298
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
240 |
{ WWT_TEXTBTN, 14, 149, 169, 176, 184, STR_EMPTY, STR_OPTIONS_FULLSCREEN_TIP}, |
0 | 241 |
|
298
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
242 |
{ WWT_FRAME, 14, 190, 359, 146, 190, STR_OPTIONS_SCREENSHOT_FORMAT, STR_NULL}, |
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
243 |
{ WWT_6, 14, 200, 349, 160, 171, STR_OPTIONS_SCREENSHOT_FORMAT_CBO, STR_OPTIONS_SCREENSHOT_FORMAT_TIP}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
244 |
{ WWT_CLOSEBOX, 14, 338, 348, 161, 170, STR_0225, STR_OPTIONS_SCREENSHOT_FORMAT_TIP}, |
0 | 245 |
|
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
246 |
{ WIDGETS_END}, |
0 | 247 |
}; |
248 |
||
249 |
static const WindowDesc _game_options_desc = { |
|
298
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
250 |
WDP_CENTER, WDP_CENTER, 370, 239, |
0 | 251 |
WC_GAME_OPTIONS,0, |
252 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESTORE_DPARAM | WDF_UNCLICK_BUTTONS, |
|
253 |
_game_options_widgets, |
|
254 |
GameOptionsWndProc |
|
255 |
}; |
|
256 |
||
257 |
||
258 |
void ShowGameOptions() |
|
259 |
{ |
|
260 |
DeleteWindowById(WC_GAME_OPTIONS, 0); |
|
261 |
AllocateWindowDesc(&_game_options_desc); |
|
262 |
} |
|
263 |
||
264 |
typedef struct { |
|
265 |
int16 min; |
|
266 |
int16 max; |
|
267 |
int16 step; |
|
268 |
StringID str; |
|
269 |
} GameSettingData; |
|
270 |
||
271 |
static const GameSettingData _game_setting_info[] = { |
|
272 |
{0,7,1,0}, |
|
273 |
{0,3,1,STR_6830_IMMEDIATE}, |
|
274 |
{0,2,1,STR_6816_LOW}, |
|
61
cd2827156f2a
(svn r62) - Added "None" as option for number of industries in difficulty settings
orudge
parents:
58
diff
changeset
|
275 |
{0,3,1,STR_26816_NONE}, |
0 | 276 |
{100,500,50,0}, |
277 |
{2,4,1,0}, |
|
278 |
{0,2,1,STR_6820_LOW}, |
|
279 |
{0,4,1,STR_681B_VERY_SLOW}, |
|
280 |
{0,2,1,STR_6820_LOW}, |
|
281 |
{0,2,1,STR_6823_NONE}, |
|
282 |
{0,3,1,STR_6826_X1_5}, |
|
283 |
{0,2,1,STR_6820_LOW}, |
|
284 |
{0,3,1,STR_682A_VERY_FLAT}, |
|
285 |
{0,3,1,STR_VERY_LOW}, |
|
286 |
{0,1,1,STR_682E_STEADY}, |
|
287 |
{0,1,1,STR_6834_AT_END_OF_LINE_AND_AT_STATIONS}, |
|
288 |
{0,1,1,STR_6836_OFF}, |
|
289 |
{0,2,1,STR_6839_PERMISSIVE}, |
|
290 |
}; |
|
291 |
||
536 | 292 |
static inline bool GetBitAndShift(uint32 *b) |
0 | 293 |
{ |
294 |
uint32 x = *b; |
|
295 |
*b >>= 1; |
|
296 |
return (x&1) != 0; |
|
297 |
} |
|
298 |
||
299 |
static const int16 _default_game_diff[3][GAME_DIFFICULTY_NUM] = { |
|
61
cd2827156f2a
(svn r62) - Added "None" as option for number of industries in difficulty settings
orudge
parents:
58
diff
changeset
|
300 |
{2, 2, 1, 3, 300, 2, 0, 2, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0}, |
cd2827156f2a
(svn r62) - Added "None" as option for number of industries in difficulty settings
orudge
parents:
58
diff
changeset
|
301 |
{4, 1, 1, 2, 150, 3, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1}, |
cd2827156f2a
(svn r62) - Added "None" as option for number of industries in difficulty settings
orudge
parents:
58
diff
changeset
|
302 |
{7, 0, 2, 2, 100, 4, 1, 3, 2, 2, 0, 2, 3, 2, 1, 1, 1, 2}, |
0 | 303 |
}; |
304 |
||
305 |
void SetDifficultyLevel(int mode, GameOptions *gm_opt) |
|
306 |
{ |
|
307 |
int i; |
|
308 |
assert(mode <= 3); |
|
309 |
||
310 |
gm_opt->diff_level = mode; |
|
311 |
if (mode != 3) { // not custom |
|
312 |
for(i = 0; i != GAME_DIFFICULTY_NUM; i++) |
|
313 |
((int*)&gm_opt->diff)[i] = _default_game_diff[mode][i]; |
|
314 |
} |
|
315 |
} |
|
316 |
||
46
c9bdf1d58df6
(svn r47) -Fix StartupEconomy warning in settings_gui.c
darkvater
parents:
42
diff
changeset
|
317 |
extern void StartupEconomy(); |
c9bdf1d58df6
(svn r47) -Fix StartupEconomy warning in settings_gui.c
darkvater
parents:
42
diff
changeset
|
318 |
|
0 | 319 |
static void GameDifficultyWndProc(Window *w, WindowEvent *e) |
320 |
{ |
|
321 |
switch(e->event) { |
|
322 |
case WE_PAINT: { |
|
323 |
uint32 click_a, click_b, disabled; |
|
324 |
int i; |
|
325 |
int x,y,value; |
|
326 |
||
327 |
w->click_state = (1 << 4) << _opt_mod_temp.diff_level; |
|
328 |
w->disabled_state = (_game_mode != GM_NORMAL) ? 0 : (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7); |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
329 |
// Disable save-button in multiplayer (and if client) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
330 |
if (_networking && !_network_server) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
331 |
w->disabled_state |= (1 << 10); |
0 | 332 |
DrawWindowWidgets(w); |
333 |
||
334 |
click_a = _difficulty_click_a; |
|
335 |
click_b = _difficulty_click_b; |
|
336 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
337 |
/* XXX - This is most likely the worst way I have ever seen |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
338 |
to disable some buttons and to enable others. |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
339 |
What the value means, is this: |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
340 |
if bit1 is enabled, setting 1 is disabled |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
341 |
then it is shifted to the left, and the story |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
342 |
repeats.... |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
343 |
-- TrueLight */ |
0 | 344 |
disabled = _game_mode == GM_NORMAL ? 0x383E : 0; |
345 |
||
346 |
x = 0; |
|
347 |
y = 32; |
|
348 |
for (i = 0; i != GAME_DIFFICULTY_NUM; i++) { |
|
349 |
DrawFrameRect(x+5, y+1, x+5+9, y+9, 3, GetBitAndShift(&click_a)?0x20:0); |
|
350 |
DrawFrameRect(x+15, y+1, x+15+9, y+9, 3, GetBitAndShift(&click_b)?0x20:0); |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
351 |
if (GetBitAndShift(&disabled) || (_networking && !_network_server)) { |
0 | 352 |
int color = 0x8000 | _color_list[3].unk2; |
353 |
GfxFillRect(x+6, y+2, x+6+8, y+9, color); |
|
354 |
GfxFillRect(x+16, y+2, x+16+8, y+9, color); |
|
355 |
} |
|
356 |
||
357 |
DrawStringCentered(x+10, y+1, STR_6819, 0); |
|
358 |
DrawStringCentered(x+20, y+1, STR_681A, 0); |
|
359 |
||
360 |
||
361 |
value = _game_setting_info[i].str + ((int*)&_opt_mod_temp.diff)[i]; |
|
362 |
if (i == 4) value *= 1000; // handle currency option |
|
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
363 |
SetDParam(0, value); |
0 | 364 |
DrawString(x+30, y+1, STR_6805_MAXIMUM_NO_COMPETITORS + i, 0); |
365 |
||
366 |
y += 11; |
|
367 |
} |
|
368 |
} break; |
|
369 |
||
370 |
case WE_CLICK: |
|
371 |
switch(e->click.widget) { |
|
372 |
case 3: { |
|
373 |
int x,y; |
|
374 |
uint btn, dis; |
|
375 |
int val; |
|
376 |
const GameSettingData *info; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
377 |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
378 |
// Don't allow clients to make any changes |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
379 |
if (_networking && !_network_server) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
380 |
return; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
381 |
|
0 | 382 |
x = e->click.pt.x - 5; |
383 |
if (!IS_INT_INSIDE(x, 0, 21)) |
|
384 |
return; |
|
385 |
||
386 |
y = e->click.pt.y - 33; |
|
387 |
if (y < 0) |
|
388 |
return; |
|
389 |
||
390 |
// Get button from Y coord. |
|
391 |
btn = y / 11; |
|
392 |
if (btn >= GAME_DIFFICULTY_NUM || y % 11 > 9) |
|
393 |
return; |
|
394 |
||
395 |
// Clicked disabled button? |
|
396 |
dis = 0; |
|
397 |
if (_game_mode == GM_NORMAL) |
|
398 |
dis |= 0x383E; |
|
399 |
if (HASBIT(dis, btn)) |
|
400 |
return; |
|
401 |
||
402 |
_difficulty_timeout = 5; |
|
403 |
||
404 |
val = ((int*)&_opt_mod_temp.diff)[btn]; |
|
405 |
||
406 |
info = &_game_setting_info[btn]; |
|
407 |
if (x >= 10) { |
|
408 |
// Increase button clicked |
|
409 |
val = min(val + info->step, info->max); |
|
410 |
SETBIT(_difficulty_click_b, btn); |
|
411 |
} else { |
|
412 |
// Decrease button clicked |
|
413 |
val = max(val - info->step, info->min); |
|
414 |
SETBIT(_difficulty_click_a, btn); |
|
415 |
} |
|
416 |
||
417 |
// save value in temporary variable |
|
418 |
((int*)&_opt_mod_temp.diff)[btn] = val; |
|
419 |
SetDifficultyLevel(3, &_opt_mod_temp); // set difficulty level to custom |
|
420 |
SetWindowDirty(w); |
|
421 |
break; |
|
422 |
} |
|
423 |
case 4: case 5: case 6: case 7: // easy/medium/hard/custom |
|
424 |
// temporarily change difficulty level |
|
425 |
SetDifficultyLevel(e->click.widget - 4, &_opt_mod_temp); |
|
426 |
SetWindowDirty(w); |
|
427 |
break; |
|
428 |
case 8: |
|
429 |
ShowHighscoreTable(_opt_mod_ptr->diff_level); |
|
430 |
break; |
|
431 |
case 10: { // Save button - save changes |
|
432 |
int btn, val; |
|
433 |
for (btn = 0; btn != GAME_DIFFICULTY_NUM; btn++) { |
|
434 |
val = ((int*)&_opt_mod_temp.diff)[btn]; |
|
435 |
// if setting has changed, change it |
|
436 |
if (val != ((int*)&_opt_mod_ptr->diff)[btn]) |
|
437 |
DoCommandP(0, btn, val, NULL, CMD_CHANGE_DIFFICULTY_LEVEL); |
|
438 |
} |
|
439 |
DoCommandP(0, -1, _opt_mod_temp.diff_level, NULL, CMD_CHANGE_DIFFICULTY_LEVEL); |
|
440 |
DeleteWindow(w); |
|
42
567add3568d6
(svn r43) Fix: [ 982666 ] max_loan in editor bug (truelight)
dominik
parents:
26
diff
changeset
|
441 |
// If we are in the editor, we should reload the economy. |
567add3568d6
(svn r43) Fix: [ 982666 ] max_loan in editor bug (truelight)
dominik
parents:
26
diff
changeset
|
442 |
// This way when you load a game, the max loan and interest rate |
567add3568d6
(svn r43) Fix: [ 982666 ] max_loan in editor bug (truelight)
dominik
parents:
26
diff
changeset
|
443 |
// are loaded correctly. |
567add3568d6
(svn r43) Fix: [ 982666 ] max_loan in editor bug (truelight)
dominik
parents:
26
diff
changeset
|
444 |
if (_game_mode == GM_EDITOR) |
567add3568d6
(svn r43) Fix: [ 982666 ] max_loan in editor bug (truelight)
dominik
parents:
26
diff
changeset
|
445 |
StartupEconomy(); |
0 | 446 |
break; |
447 |
} |
|
448 |
case 11: // Cancel button - close window |
|
449 |
DeleteWindow(w); |
|
450 |
break; |
|
451 |
} |
|
452 |
break; |
|
453 |
||
454 |
case WE_MOUSELOOP: |
|
455 |
if (_difficulty_timeout != 0 && !--_difficulty_timeout) { |
|
456 |
_difficulty_click_a = 0; |
|
457 |
_difficulty_click_b = 0; |
|
458 |
SetWindowDirty(w); |
|
459 |
} |
|
460 |
break; |
|
461 |
} |
|
462 |
} |
|
463 |
||
464 |
static const Widget _game_difficulty_widgets[] = { |
|
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
465 |
{ WWT_CLOSEBOX, 10, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
466 |
{ WWT_CAPTION, 10, 11, 369, 0, 13, STR_6800_DIFFICULTY_LEVEL, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
467 |
{ WWT_PANEL, 10, 0, 369, 14, 29, 0x0, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
468 |
{ WWT_PANEL, 10, 0, 369, 30, 276, 0x0, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
469 |
{ WWT_PUSHTXTBTN, 3, 10, 96, 16, 27, STR_6801_EASY, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
470 |
{ WWT_PUSHTXTBTN, 3, 97, 183, 16, 27, STR_6802_MEDIUM, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
471 |
{ WWT_PUSHTXTBTN, 3, 184, 270, 16, 27, STR_6803_HARD, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
472 |
{ WWT_PUSHTXTBTN, 3, 271, 357, 16, 27, STR_6804_CUSTOM, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
473 |
{ WWT_EMPTY, 10, 0, 369, 251, 262, 0x0, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
474 |
//{ WWT_CLOSEBOX, 10, 0, 369, 251, 262, STR_6838_SHOW_HI_SCORE_CHART,STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
475 |
{ WWT_PANEL, 10, 0, 369, 263, 278, 0x0, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
476 |
{ WWT_PUSHTXTBTN, 3, 105, 185, 265, 276, STR_OPTIONS_SAVE_CHANGES, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
477 |
{ WWT_PUSHTXTBTN, 3, 186, 266, 265, 276, STR_012E_CANCEL, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
478 |
{ WIDGETS_END}, |
0 | 479 |
}; |
480 |
||
481 |
static const WindowDesc _game_difficulty_desc = { |
|
482 |
WDP_CENTER, WDP_CENTER, 370, 279, |
|
483 |
WC_GAME_OPTIONS,0, |
|
484 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
|
485 |
_game_difficulty_widgets, |
|
486 |
GameDifficultyWndProc |
|
487 |
}; |
|
488 |
||
489 |
void ShowGameDifficulty() |
|
490 |
{ |
|
491 |
DeleteWindowById(WC_GAME_OPTIONS, 0); |
|
492 |
/* copy current settings to temporary holding place |
|
493 |
* change that when setting stuff, copy back on clicking 'OK' |
|
494 |
*/ |
|
495 |
memcpy(&_opt_mod_temp, _opt_mod_ptr, sizeof(GameOptions)); |
|
496 |
AllocateWindowDesc(&_game_difficulty_desc); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
497 |
} |
0 | 498 |
|
499 |
void ShowHighscoreTable(int tbl) |
|
500 |
{ |
|
501 |
ShowInfoF("ShowHighscoreTable(%d) not implemented", tbl); |
|
502 |
} |
|
503 |
||
68
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
504 |
// virtual PositionMainToolbar function, calls the right one. |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
505 |
int32 v_PositionMainToolbar(int32 p1) |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
506 |
{ |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
507 |
if (_game_mode != GM_MENU) |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
508 |
PositionMainToolbar(NULL); |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
509 |
|
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
510 |
return 0; |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
511 |
} |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
512 |
|
84
1e0721c29bad
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
truelight
parents:
68
diff
changeset
|
513 |
int32 AiNew_PatchActive_Warning(int32 p1) |
1e0721c29bad
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
truelight
parents:
68
diff
changeset
|
514 |
{ |
155
81e9878f3678
(svn r156) -Codechange: remove obsolete callback arrays
darkvater
parents:
91
diff
changeset
|
515 |
if (p1 == 1) |
81e9878f3678
(svn r156) -Codechange: remove obsolete callback arrays
darkvater
parents:
91
diff
changeset
|
516 |
ShowErrorMessage(-1, TEMP_AI_ACTIVATED, 0, 0); |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
517 |
|
155
81e9878f3678
(svn r156) -Codechange: remove obsolete callback arrays
darkvater
parents:
91
diff
changeset
|
518 |
return 0; |
84
1e0721c29bad
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
truelight
parents:
68
diff
changeset
|
519 |
} |
1e0721c29bad
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
truelight
parents:
68
diff
changeset
|
520 |
|
91
6477ea0c240d
(svn r92) Feature: invisible trees when in transparent mode (patch entry)
dominik
parents:
84
diff
changeset
|
521 |
int32 InvisibleTreesActive(int32 p1) |
6477ea0c240d
(svn r92) Feature: invisible trees when in transparent mode (patch entry)
dominik
parents:
84
diff
changeset
|
522 |
{ |
6477ea0c240d
(svn r92) Feature: invisible trees when in transparent mode (patch entry)
dominik
parents:
84
diff
changeset
|
523 |
MarkWholeScreenDirty(); |
6477ea0c240d
(svn r92) Feature: invisible trees when in transparent mode (patch entry)
dominik
parents:
84
diff
changeset
|
524 |
return 0; |
6477ea0c240d
(svn r92) Feature: invisible trees when in transparent mode (patch entry)
dominik
parents:
84
diff
changeset
|
525 |
} |
6477ea0c240d
(svn r92) Feature: invisible trees when in transparent mode (patch entry)
dominik
parents:
84
diff
changeset
|
526 |
|
156
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
527 |
int32 InValidateDetailsWindow(int32 p1) |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
528 |
{ |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
529 |
InvalidateWindowClasses(WC_VEHICLE_DETAILS); |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
530 |
return 0; |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
531 |
} |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
532 |
|
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
533 |
/* Check service intervals of vehicles, p1 is value of % or day based servicing */ |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
534 |
int32 CheckInterval(int32 p1) |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
535 |
{ |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
536 |
bool warning; |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
537 |
if (p1) { |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
538 |
warning = ( (IS_INT_INSIDE(_patches.servint_trains, 5, 90+1) || _patches.servint_trains == 0) && |
156
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
539 |
(IS_INT_INSIDE(_patches.servint_roadveh, 5, 90+1) || _patches.servint_roadveh == 0) && |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
540 |
(IS_INT_INSIDE(_patches.servint_aircraft, 5, 90+1) || _patches.servint_aircraft == 0) && |
156
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
541 |
(IS_INT_INSIDE(_patches.servint_ships, 5, 90+1) || _patches.servint_ships == 0) ); |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
542 |
} else { |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
543 |
warning = ( (IS_INT_INSIDE(_patches.servint_trains, 30, 800+1) || _patches.servint_trains == 0) && |
156
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
544 |
(IS_INT_INSIDE(_patches.servint_roadveh, 30, 800+1) || _patches.servint_roadveh == 0) && |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
545 |
(IS_INT_INSIDE(_patches.servint_aircraft, 30, 800+1) || _patches.servint_aircraft == 0) && |
156
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
546 |
(IS_INT_INSIDE(_patches.servint_ships, 30, 800+1) || _patches.servint_ships == 0) ); |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
547 |
} |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
548 |
|
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
549 |
if (!warning) |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
550 |
ShowErrorMessage(-1, STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE, 0, 0); |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
551 |
|
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
552 |
return InValidateDetailsWindow(0); |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
553 |
} |
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
155
diff
changeset
|
554 |
|
68
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
555 |
typedef int32 PatchButtonClick(int32); |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
556 |
|
0 | 557 |
typedef struct PatchEntry { |
68
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
558 |
byte type; // type of selector |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
559 |
byte flags; // selector flags |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
560 |
StringID str; // string with descriptive text |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
561 |
void *variable; // pointer to the variable |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
562 |
int32 min,max; // range for spinbox setting |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
563 |
uint32 step; // step for spinbox |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
564 |
PatchButtonClick *click_proc; // callback procedure |
0 | 565 |
} PatchEntry; |
566 |
||
567 |
enum { |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
568 |
PE_BOOL = 0, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
569 |
PE_UINT8 = 1, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
570 |
PE_INT16 = 2, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
571 |
PE_UINT16 = 3, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
572 |
PE_INT32 = 4, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
573 |
PE_CURRENCY = 5, |
0 | 574 |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
575 |
PF_0ISDIS = 1, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
576 |
PF_NOCOMMA = 2, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
577 |
PF_MULTISTRING = 4, |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
578 |
PF_PLAYERBASED = 8, // This has to match the entries that are in settings.c, patch_player_settings |
0 | 579 |
}; |
580 |
||
581 |
static const PatchEntry _patches_ui[] = { |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
582 |
{PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_VEHICLESPEED, &_patches.vehicle_speed, 0, 0, 0, NULL}, |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
583 |
{PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_LONGDATE, &_patches.status_long_date, 0, 0, 0, NULL}, |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
584 |
{PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_SHOWFINANCES, &_patches.show_finances, 0, 0, 0, NULL}, |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
585 |
{PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTOSCROLL, &_patches.autoscroll, 0, 0, 0, NULL}, |
0 | 586 |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
587 |
{PE_UINT8, PF_PLAYERBASED, STR_CONFIG_PATCHES_ERRMSG_DURATION, &_patches.errmsg_duration, 0, 20, 1, NULL}, |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
588 |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
589 |
{PE_UINT8, PF_MULTISTRING, STR_CONFIG_PATCHES_TOOLBAR_POS, &_patches.toolbar_pos, 0, 2, 1, &v_PositionMainToolbar}, |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
590 |
{PE_UINT8, PF_MULTISTRING | PF_PLAYERBASED, STR_CONFIG_PATCHES_TOOLBAR_POS, &_patches.toolbar_pos, 0, 2, 1, &v_PositionMainToolbar}, |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
591 |
{PE_UINT8, PF_0ISDIS, STR_CONFIG_PATCHES_SNAP_RADIUS, &_patches.window_snap_radius, 1, 32, 1, NULL}, |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
592 |
{PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_INVISIBLE_TREES, &_patches.invisible_trees, 0, 1, 1, &InvisibleTreesActive}, |
0 | 593 |
}; |
594 |
||
595 |
static const PatchEntry _patches_construction[] = { |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
596 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_BUILDONSLOPES, &_patches.build_on_slopes, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
597 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_EXTRADYNAMITE, &_patches.extra_dynamite, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
598 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_LONGBRIDGES, &_patches.longbridges, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
599 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_SIGNALSIDE, &_patches.signal_side, 0, 0, 0, NULL}, |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
600 |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
601 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_SMALL_AIRPORTS, &_patches.always_small_airport, 0, 0, 0, NULL}, |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
602 |
{PE_UINT8, PF_PLAYERBASED, STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY, &_patches.drag_signals_density, 1, 20, 1, NULL}, |
0 | 603 |
|
604 |
}; |
|
605 |
||
606 |
static const PatchEntry _patches_vehicles[] = { |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
607 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_REALISTICACCEL, &_patches.realistic_acceleration, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
608 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_MAMMOTHTRAINS, &_patches.mammoth_trains, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
609 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_GOTODEPOT, &_patches.gotodepot, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
610 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_ROADVEH_QUEUE, &_patches.roadveh_queue, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
611 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_NEW_DEPOT_FINDING,&_patches.new_depot_finding, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
612 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_NEW_TRAIN_PATHFIND, &_patches.new_pathfinding, 0, 0, 0, NULL}, |
0 | 613 |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
614 |
{PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_WARN_INCOME_LESS, &_patches.train_income_warn, 0, 0, 0, NULL}, |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
615 |
{PE_UINT8, PF_MULTISTRING | PF_PLAYERBASED, STR_CONFIG_PATCHES_ORDER_REVIEW,&_patches.order_review_system,0,2, 1, NULL}, |
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
616 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES, &_patches.never_expire_vehicles,0,0,0, NULL}, |
0 | 617 |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
618 |
{PE_UINT16, PF_0ISDIS | PF_PLAYERBASED, STR_CONFIG_PATCHES_LOST_TRAIN_DAYS, &_patches.lost_train_days, 180,720, 60, NULL}, |
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
619 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_AUTORENEW_VEHICLE,&_patches.autorenew, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
620 |
{PE_INT16, 0, STR_CONFIG_PATCHES_AUTORENEW_MONTHS, &_patches.autorenew_months, -12, 12, 1, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
621 |
{PE_CURRENCY, 0, STR_CONFIG_PATCHES_AUTORENEW_MONEY,&_patches.autorenew_money, 0, 2000000, 100000, NULL}, |
0 | 622 |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
623 |
{PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_TRAINS, &_patches.max_trains, 0,240, 10, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
624 |
{PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_ROADVEH, &_patches.max_roadveh, 0,240, 10, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
625 |
{PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_AIRCRAFT, &_patches.max_aircraft, 0,240, 10, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
626 |
{PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_SHIPS, &_patches.max_ships, 0,240, 10, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
627 |
|
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
628 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_SERVINT_ISPERCENT,&_patches.servint_ispercent, 0, 0, 0, &CheckInterval}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
629 |
{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_TRAINS, &_patches.servint_trains, 5,800, 5, &InValidateDetailsWindow}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
630 |
{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_ROADVEH, &_patches.servint_roadveh, 5,800, 5, &InValidateDetailsWindow}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
631 |
{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_AIRCRAFT, &_patches.servint_aircraft, 5,800, 5, &InValidateDetailsWindow}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
632 |
{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_SHIPS, &_patches.servint_ships, 5,800, 5, &InValidateDetailsWindow}, |
0 | 633 |
}; |
634 |
||
635 |
static const PatchEntry _patches_stations[] = { |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
636 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_JOINSTATIONS, &_patches.join_stations, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
637 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_FULLLOADANY, &_patches.full_load_any, 0, 0, 0, NULL}, |
523
1184a22723ad
(svn r853) -Feature: Implement improved vehicle loading algorithm
tron
parents:
507
diff
changeset
|
638 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_IMPROVEDLOAD, &_patches.improved_load, 0, 0, 0, NULL}, |
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
639 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_SELECTGOODS, &_patches.selectgoods, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
640 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_NEW_NONSTOP, &_patches.new_nonstop, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
641 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_NONUNIFORM_STATIONS, &_patches.nonuniform_stations, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
642 |
{PE_UINT8, 0, STR_CONFIG_PATCHES_STATION_SPREAD, &_patches.station_spread, 4, 64, 1, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
643 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_SERVICEATHELIPAD, &_patches.serviceathelipad, 0, 0, 0, NULL}, |
0 | 644 |
}; |
645 |
||
646 |
static const PatchEntry _patches_economy[] = { |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
647 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_INFLATION, &_patches.inflation, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
648 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_BUILDXTRAIND, &_patches.build_rawmaterial_ind, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
649 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_MULTIPINDTOWN, &_patches.multiple_industry_per_town,0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
650 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_SAMEINDCLOSE, &_patches.same_industry_close, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
651 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_BRIBE, &_patches.bribe, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
652 |
{PE_UINT8, 0, STR_CONFIG_PATCHES_SNOWLINE_HEIGHT, &_patches.snow_line_height, 2, 13, 1, NULL}, |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
653 |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
654 |
{PE_INT32, PF_NOCOMMA, STR_CONFIG_PATCHES_COLORED_NEWS_DATE, &_patches.colored_news_date, 1900, 2200, 5, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
655 |
{PE_INT32, PF_NOCOMMA, STR_CONFIG_PATCHES_STARTING_DATE, &_patches.starting_date, 1920,2100, 1, NULL}, |
0 | 656 |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
657 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_SMOOTH_ECONOMY, &_patches.smooth_economy, 0, 0, 0, NULL}, |
0 | 658 |
}; |
659 |
||
21 | 660 |
static const PatchEntry _patches_ai[] = { |
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
661 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_AINEW_ACTIVE, &_patches.ainew_active, 0, 1, 1, &AiNew_PatchActive_Warning}, |
84
1e0721c29bad
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
truelight
parents:
68
diff
changeset
|
662 |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
663 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_TRAINS, &_patches.ai_disable_veh_train, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
664 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH,&_patches.ai_disable_veh_roadveh, 0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
665 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT, &_patches.ai_disable_veh_aircraft,0, 0, 0, NULL}, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
666 |
{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_SHIPS, &_patches.ai_disable_veh_ship, 0, 0, 0, NULL}, |
21 | 667 |
}; |
668 |
||
0 | 669 |
typedef struct PatchPage { |
670 |
const PatchEntry *entries; |
|
671 |
uint num; |
|
672 |
} PatchPage; |
|
673 |
||
674 |
static const PatchPage _patches_page[] = { |
|
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
675 |
{_patches_ui, lengthof(_patches_ui) }, |
0 | 676 |
{_patches_construction, lengthof(_patches_construction) }, |
179
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
677 |
{_patches_vehicles, lengthof(_patches_vehicles) }, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
678 |
{_patches_stations, lengthof(_patches_stations) }, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
679 |
{_patches_economy, lengthof(_patches_economy) }, |
003096efeb9d
(svn r180) -Fix: some more warning fixes for C99 (Tron)
darkvater
parents:
176
diff
changeset
|
680 |
{_patches_ai, lengthof(_patches_ai) }, |
0 | 681 |
}; |
682 |
||
26 | 683 |
extern uint GetCurrentCurrencyRate(); |
684 |
||
0 | 685 |
static int32 ReadPE(const PatchEntry*pe) |
686 |
{ |
|
687 |
switch(pe->type) { |
|
688 |
case PE_BOOL: return *(bool*)pe->variable; |
|
689 |
case PE_UINT8: return *(uint8*)pe->variable; |
|
690 |
case PE_INT16: return *(int16*)pe->variable; |
|
691 |
case PE_UINT16: return *(uint16*)pe->variable; |
|
692 |
case PE_INT32: return *(int32*)pe->variable; |
|
26 | 693 |
case PE_CURRENCY: return (*(int64*)pe->variable) * GetCurrentCurrencyRate(); |
0 | 694 |
default: |
695 |
NOT_REACHED(); |
|
696 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
697 |
|
0 | 698 |
/* useless, but avoids compiler warning this way */ |
699 |
return 0; |
|
700 |
} |
|
701 |
||
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
702 |
static void WritePE(const PatchEntry *pe, int32 val) |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
703 |
{ |
48
20d80c99ef02
(svn r49) -'Disabled' in patch settings universal for all pe->variable types (dominik81).
darkvater
parents:
47
diff
changeset
|
704 |
|
20d80c99ef02
(svn r49) -'Disabled' in patch settings universal for all pe->variable types (dominik81).
darkvater
parents:
47
diff
changeset
|
705 |
if ((pe->flags & PF_0ISDIS) && val <= 0) { |
20d80c99ef02
(svn r49) -'Disabled' in patch settings universal for all pe->variable types (dominik81).
darkvater
parents:
47
diff
changeset
|
706 |
*(bool*)pe->variable = 0; // "clamp" 'disabled' value to smallest type, PE_BOOL |
20d80c99ef02
(svn r49) -'Disabled' in patch settings universal for all pe->variable types (dominik81).
darkvater
parents:
47
diff
changeset
|
707 |
return; |
20d80c99ef02
(svn r49) -'Disabled' in patch settings universal for all pe->variable types (dominik81).
darkvater
parents:
47
diff
changeset
|
708 |
} |
20d80c99ef02
(svn r49) -'Disabled' in patch settings universal for all pe->variable types (dominik81).
darkvater
parents:
47
diff
changeset
|
709 |
|
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
710 |
switch(pe->type) { |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
711 |
case PE_BOOL: *(bool*)pe->variable = (bool)val; break; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
712 |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
713 |
case PE_UINT8: if ((uint8)val > (uint8)pe->max) |
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
714 |
*(uint8*)pe->variable = (uint8)pe->max; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
715 |
else if ((uint8)val < (uint8)pe->min) |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
716 |
*(uint8*)pe->variable = (uint8)pe->min; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
717 |
else |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
718 |
*(uint8*)pe->variable = (uint8)val; |
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
719 |
break; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
720 |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
721 |
case PE_INT16: if ((int16)val > (int16)pe->max) |
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
722 |
*(int16*)pe->variable = (int16)pe->max; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
723 |
else if ((int16)val < (int16)pe->min) |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
724 |
*(int16*)pe->variable = (int16)pe->min; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
725 |
else |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
726 |
*(int16*)pe->variable = (int16)val; |
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
727 |
break; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
728 |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
729 |
case PE_UINT16: if ((uint16)val > (uint16)pe->max) |
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
730 |
*(uint16*)pe->variable = (uint16)pe->max; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
731 |
else if ((uint16)val < (uint16)pe->min) |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
732 |
*(uint16*)pe->variable = (uint16)pe->min; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
733 |
else |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
734 |
*(uint16*)pe->variable = (uint16)val; |
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
735 |
break; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
736 |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
737 |
case PE_INT32: if ((int32)val > (int32)pe->max) |
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
738 |
*(int32*)pe->variable = (int32)pe->max; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
739 |
else if ((int32)val < (int32)pe->min) |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
740 |
*(int32*)pe->variable = (int32)pe->min; |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
741 |
else |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
742 |
*(int32*)pe->variable = val; |
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
743 |
break; |
26 | 744 |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
745 |
case PE_CURRENCY: if ((int64)val > (int64)pe->max) |
26 | 746 |
*(int64*)pe->variable = (int64)pe->max; |
747 |
else if ((int64)val < (int64)pe->min) |
|
748 |
*(int64*)pe->variable = (int64)pe->min; |
|
749 |
else |
|
750 |
*(int64*)pe->variable = val; |
|
751 |
break; |
|
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
752 |
default: |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
753 |
NOT_REACHED(); |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
17
diff
changeset
|
754 |
} |
0 | 755 |
} |
756 |
||
757 |
static void PatchesSelectionWndProc(Window *w, WindowEvent *e) |
|
758 |
{ |
|
759 |
uint i; |
|
760 |
switch(e->event) { |
|
761 |
case WE_PAINT: { |
|
762 |
int x,y; |
|
763 |
const PatchEntry *pe; |
|
764 |
const PatchPage *page; |
|
765 |
uint clk; |
|
766 |
int32 val; |
|
767 |
||
768 |
w->click_state = 1 << (WP(w,def_d).data_1 + 4); |
|
769 |
||
770 |
DrawWindowWidgets(w); |
|
771 |
||
772 |
x = 0; |
|
773 |
y = 46; |
|
774 |
clk = WP(w,def_d).data_2; |
|
775 |
page = &_patches_page[WP(w,def_d).data_1]; |
|
776 |
for(i=0,pe=page->entries; i!=page->num; i++,pe++) { |
|
11
836bc4b37b5b
(svn r12) Change: removed patch no_train_service. Instead you can set the default service interval for any vehicle type to 'disabled'.
dominik
parents:
0
diff
changeset
|
777 |
bool disabled = false; |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
778 |
bool editable = true; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
779 |
// We do not allow changes of some items when we are a client in a networkgame |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
780 |
if (!(pe->flags & PF_PLAYERBASED) && _networking && !_network_server) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
781 |
editable = false; |
0 | 782 |
if (pe->type == PE_BOOL) { |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
783 |
if (editable) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
784 |
DrawFrameRect(x+5, y+1, x+15+9, y+9, (*(bool*)pe->variable)?6:4, (*(bool*)pe->variable)?0x20:0); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
785 |
else |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
786 |
DrawFrameRect(x+5, y+1, x+15+9, y+9, (*(bool*)pe->variable)?7:9, (*(bool*)pe->variable)?0x20:0); |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
787 |
SetDParam(0, *(bool*)pe->variable ? STR_CONFIG_PATCHES_ON : STR_CONFIG_PATCHES_OFF); |
0 | 788 |
} else { |
789 |
DrawFrameRect(x+5, y+1, x+5+9, y+9, 3, clk == i*2+1 ? 0x20 : 0); |
|
790 |
DrawFrameRect(x+15, y+1, x+15+9, y+9, 3, clk == i*2+2 ? 0x20 : 0); |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
791 |
if (!editable) { |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
792 |
int color = 0x8000 | _color_list[3].unk2; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
793 |
GfxFillRect(x+6, y+2, x+6+8, y+9, color); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
794 |
GfxFillRect(x+16, y+2, x+16+8, y+9, color); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
795 |
} |
0 | 796 |
DrawStringCentered(x+10, y+1, STR_6819, 0); |
797 |
DrawStringCentered(x+20, y+1, STR_681A, 0); |
|
798 |
||
799 |
val = ReadPE(pe); |
|
26 | 800 |
if (pe->type == PE_CURRENCY) |
801 |
val /= GetCurrentCurrencyRate(); |
|
11
836bc4b37b5b
(svn r12) Change: removed patch no_train_service. Instead you can set the default service interval for any vehicle type to 'disabled'.
dominik
parents:
0
diff
changeset
|
802 |
disabled = ((val == 0) && (pe->flags & PF_0ISDIS)); |
836bc4b37b5b
(svn r12) Change: removed patch no_train_service. Instead you can set the default service interval for any vehicle type to 'disabled'.
dominik
parents:
0
diff
changeset
|
803 |
if (disabled) { |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
804 |
SetDParam(0, STR_CONFIG_PATCHES_DISABLED); |
0 | 805 |
} else { |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
806 |
SetDParam(1, val); |
26 | 807 |
if (pe->type == PE_CURRENCY) |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
808 |
SetDParam(0, STR_CONFIG_PATCHES_CURRENCY); |
53
1e32a44e2e52
(svn r54) -Add: PF_MULTISTRING in Patch menu to select between things instead of numbers (Celestar)
truelight
parents:
48
diff
changeset
|
809 |
else { |
1e32a44e2e52
(svn r54) -Add: PF_MULTISTRING in Patch menu to select between things instead of numbers (Celestar)
truelight
parents:
48
diff
changeset
|
810 |
if (pe->flags & PF_MULTISTRING) |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
811 |
SetDParam(0, pe->str + val + 1); |
53
1e32a44e2e52
(svn r54) -Add: PF_MULTISTRING in Patch menu to select between things instead of numbers (Celestar)
truelight
parents:
48
diff
changeset
|
812 |
else |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
813 |
SetDParam(0, pe->flags & PF_NOCOMMA ? STR_CONFIG_PATCHES_INT32 : STR_7024); |
53
1e32a44e2e52
(svn r54) -Add: PF_MULTISTRING in Patch menu to select between things instead of numbers (Celestar)
truelight
parents:
48
diff
changeset
|
814 |
} |
0 | 815 |
} |
816 |
} |
|
11
836bc4b37b5b
(svn r12) Change: removed patch no_train_service. Instead you can set the default service interval for any vehicle type to 'disabled'.
dominik
parents:
0
diff
changeset
|
817 |
DrawString(30, y+1, (pe->str)+disabled, 0); |
0 | 818 |
y += 11; |
819 |
} |
|
820 |
break; |
|
821 |
} |
|
822 |
||
823 |
case WE_CLICK: |
|
824 |
switch(e->click.widget) { |
|
825 |
case 3: { |
|
826 |
int x,y; |
|
827 |
uint btn; |
|
828 |
const PatchPage *page; |
|
829 |
const PatchEntry *pe; |
|
830 |
||
831 |
y = e->click.pt.y - 46 - 1; |
|
832 |
if (y < 0) return; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
833 |
|
0 | 834 |
btn = y / 11; |
835 |
if (y % 11 > 9) return; |
|
836 |
||
837 |
page = &_patches_page[WP(w,def_d).data_1]; |
|
838 |
if (btn >= page->num) return; |
|
839 |
pe = &page->entries[btn]; |
|
840 |
||
841 |
x = e->click.pt.x - 5; |
|
842 |
if (x < 0) return; |
|
843 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
844 |
if (!(pe->flags & PF_PLAYERBASED) && _networking && !_network_server) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
845 |
return; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
846 |
|
68
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
847 |
if (x < 21) { // clicked on the icon on the left side. Either scroller or bool on/off |
0 | 848 |
int32 val = ReadPE(pe), oval = val; |
849 |
||
850 |
switch(pe->type) { |
|
851 |
case PE_BOOL: |
|
852 |
val ^= 1; |
|
853 |
break; |
|
854 |
case PE_UINT8: |
|
855 |
case PE_INT16: |
|
856 |
case PE_UINT16: |
|
857 |
case PE_INT32: |
|
26 | 858 |
case PE_CURRENCY: |
0 | 859 |
// don't allow too fast scrolling |
860 |
if ((w->flags4 & WF_TIMEOUT_MASK) > 2 << WF_TIMEOUT_SHL) { |
|
861 |
_left_button_clicked = false; |
|
862 |
return; |
|
863 |
} |
|
864 |
||
865 |
if (x >= 10) { |
|
866 |
//increase |
|
867 |
if (pe->flags & PF_0ISDIS && val == 0) |
|
868 |
val = pe->min; |
|
869 |
else |
|
870 |
val += pe->step; |
|
871 |
if (val > pe->max) val = pe->max; |
|
872 |
} else { |
|
47
8368e4d4ef07
(svn r48) Fix: Possible to disable some patches (e.g. default service interval) again by setting them to 0
dominik
parents:
46
diff
changeset
|
873 |
// decrease |
0 | 874 |
if (val <= pe->min && pe->flags & PF_0ISDIS) { |
875 |
val = 0; |
|
876 |
} else { |
|
877 |
val -= pe->step; |
|
878 |
if (val < pe->min) val = pe->min; |
|
879 |
} |
|
880 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
881 |
|
0 | 882 |
if (val != oval) { |
883 |
WP(w,def_d).data_2 = btn * 2 + 1 + ((x>=10) ? 1 : 0); |
|
884 |
w->flags4 |= 5 << WF_TIMEOUT_SHL; |
|
885 |
_left_button_clicked = false; |
|
886 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
887 |
break; |
0 | 888 |
} |
889 |
if (val != oval) { |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
890 |
// To make patch-changes network-safe |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
891 |
if (pe->type == PE_CURRENCY) { |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
892 |
val /= GetCurrentCurrencyRate(); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
893 |
} |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
894 |
// If an item is playerbased, we do not send it over the network (if any) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
895 |
if (pe->flags & PF_PLAYERBASED) { |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
896 |
WritePE(pe, val); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
897 |
} else { |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
898 |
// Else we do |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
899 |
DoCommandP(0, (byte)WP(w,def_d).data_1 + ((byte)btn << 8), val, NULL, CMD_CHANGE_PATCH_SETTING); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
900 |
} |
0 | 901 |
SetWindowDirty(w); |
68
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
902 |
|
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
903 |
if (pe->click_proc != NULL) // call callback function |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
904 |
pe->click_proc(val); |
0 | 905 |
} |
906 |
} else { |
|
68
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
907 |
if (pe->type != PE_BOOL && !(pe->flags & PF_MULTISTRING)) { // do not open editbox |
0 | 908 |
WP(w,def_d).data_3 = btn; |
534
17ab2f22ff74
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
909 |
SetDParam(0, ReadPE(pe)); |
0 | 910 |
ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_PATCHES_QUERY_CAPT, 10, 100, WC_GAME_OPTIONS, 0); |
911 |
} |
|
912 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
179
diff
changeset
|
913 |
|
0 | 914 |
break; |
915 |
} |
|
21 | 916 |
case 4: case 5: case 6: case 7: case 8: case 9: |
0 | 917 |
WP(w,def_d).data_1 = e->click.widget - 4; |
918 |
DeleteWindowById(WC_QUERY_STRING, 0); |
|
919 |
SetWindowDirty(w); |
|
920 |
break; |
|
921 |
} |
|
922 |
break; |
|
923 |
||
924 |
case WE_TIMEOUT: |
|
925 |
WP(w,def_d).data_2 = 0; |
|
926 |
SetWindowDirty(w); |
|
927 |
break; |
|
928 |
||
929 |
case WE_ON_EDIT_TEXT: { |
|
930 |
if (*e->edittext.str) { |
|
931 |
const PatchPage *page = &_patches_page[WP(w,def_d).data_1]; |
|
68
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
932 |
const PatchEntry *pe = &page->entries[WP(w,def_d).data_3]; |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
933 |
int32 val; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
934 |
val = atoi(e->edittext.str); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
935 |
if (pe->type == PE_CURRENCY) { |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
936 |
val /= GetCurrentCurrencyRate(); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
937 |
} |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
938 |
// If an item is playerbased, we do not send it over the network (if any) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
939 |
if (pe->flags & PF_PLAYERBASED) { |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
940 |
WritePE(pe, val); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
941 |
} else { |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
942 |
// Else we do |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
943 |
DoCommandP(0, (byte)WP(w,def_d).data_1 + ((byte)WP(w,def_d).data_3 << 8), val, NULL, CMD_CHANGE_PATCH_SETTING); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
944 |
} |
0 | 945 |
SetWindowDirty(w); |
68
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
946 |
|
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
947 |
if (pe->click_proc != NULL) // call callback function |
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
948 |
pe->click_proc(*(int32*)pe->variable); |
0 | 949 |
} |
950 |
break; |
|
951 |
} |
|
952 |
||
953 |
case WE_DESTROY: |
|
954 |
DeleteWindowById(WC_QUERY_STRING, 0); |
|
955 |
break; |
|
956 |
} |
|
957 |
} |
|
958 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
959 |
int32 CmdChangePatchSetting(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
960 |
{ |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
961 |
const PatchPage *page; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
962 |
const PatchEntry *pe; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
963 |
|
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
964 |
if (flags & DC_EXEC) { |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
965 |
page = &_patches_page[(byte)p1]; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
966 |
if (page == NULL) return 0; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
967 |
pe = &page->entries[(byte)(p1 >> 8)]; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
968 |
if (pe == NULL) return 0; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
969 |
|
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
970 |
WritePE(pe, (int32)p2); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
971 |
|
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
972 |
InvalidateWindow(WC_GAME_OPTIONS, 0); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
973 |
} |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
974 |
|
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
975 |
return 0; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
976 |
} |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
977 |
|
0 | 978 |
static const Widget _patches_selection_widgets[] = { |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
979 |
{ WWT_CLOSEBOX, 10, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
980 |
{ WWT_CAPTION, 10, 11, 369, 0, 13, STR_CONFIG_PATCHES_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
981 |
{ WWT_PANEL, 10, 0, 369, 14, 41, 0x0, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
982 |
{ WWT_PANEL, 10, 0, 369, 42, 320, 0x0, STR_NULL}, |
0 | 983 |
|
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
984 |
{ WWT_CLOSEBOX, 3, 10, 96, 16, 27, STR_CONFIG_PATCHES_GUI, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
985 |
{ WWT_CLOSEBOX, 3, 97, 183, 16, 27, STR_CONFIG_PATCHES_CONSTRUCTION, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
986 |
{ WWT_CLOSEBOX, 3, 184, 270, 16, 27, STR_CONFIG_PATCHES_VEHICLES, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
987 |
{ WWT_CLOSEBOX, 3, 271, 357, 16, 27, STR_CONFIG_PATCHES_STATIONS, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
988 |
{ WWT_CLOSEBOX, 3, 10, 96, 28, 39, STR_CONFIG_PATCHES_ECONOMY, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
989 |
{ WWT_CLOSEBOX, 3, 97, 183, 28, 39, STR_CONFIG_PATCHES_AI, STR_NULL}, |
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
990 |
{ WIDGETS_END}, |
0 | 991 |
}; |
992 |
||
993 |
static const WindowDesc _patches_selection_desc = { |
|
994 |
WDP_CENTER, WDP_CENTER, 370, 321, |
|
995 |
WC_GAME_OPTIONS,0, |
|
996 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
|
997 |
_patches_selection_widgets, |
|
998 |
PatchesSelectionWndProc, |
|
999 |
}; |
|
1000 |
||
1001 |
void ShowPatchesSelection() |
|
1002 |
{ |
|
1003 |
DeleteWindowById(WC_GAME_OPTIONS, 0); |
|
1004 |
AllocateWindowDesc(&_patches_selection_desc); |
|
1005 |
} |
|
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1006 |
|
484 | 1007 |
struct GRFFile *_sel_grffile; |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1008 |
|
484 | 1009 |
enum { |
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1010 |
NEWGRF_WND_PROC_OFFSET_TOP_WIDGET = 14, |
484 | 1011 |
NEWGRF_WND_PROC_ROWSIZE = 14 |
1012 |
}; |
|
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1013 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1014 |
static void NewgrfWndProc(Window *w, WindowEvent *e) |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1015 |
{ |
484 | 1016 |
switch (e->event) { |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1017 |
case WE_PAINT: { |
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1018 |
int x, y = NEWGRF_WND_PROC_OFFSET_TOP_WIDGET; |
484 | 1019 |
uint16 i = 0; |
1020 |
struct GRFFile *c = _first_grffile; |
|
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1021 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1022 |
DrawWindowWidgets(w); |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
1023 |
|
484 | 1024 |
if (_first_grffile == NULL) { // no grf sets installed |
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1025 |
DrawStringMultiCenter(140, 210, STR_NEWGRF_NO_FILES_INSTALLED, 250); |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1026 |
break; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1027 |
} |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1028 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1029 |
// draw list of all grf files |
484 | 1030 |
while (c != NULL) { |
1031 |
if (i >= w->vscroll.pos) { // draw files according to scrollbar position |
|
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1032 |
bool h = (_sel_grffile==c); |
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1033 |
// show highlighted item with a different background and highlighted text |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
1034 |
if(h) GfxFillRect(1, y + 1, 267, y + 12, 156); |
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1035 |
// XXX - will be grf name later |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
1036 |
DoDrawString(c->filename, 25, y + 2, h ? 0xC : 0x10); |
484 | 1037 |
DrawSprite(SPRITE_PALETTE(0x2EB | 0x30b8000), 5, y + 3); |
1038 |
y += NEWGRF_WND_PROC_ROWSIZE; |
|
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1039 |
} |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
1040 |
|
484 | 1041 |
c = c->next; |
1042 |
if (++i == w->vscroll.cap + w->vscroll.pos) break; // stop after displaying 12 items |
|
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1043 |
} |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1044 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1045 |
// DoDrawString(_sel_grffile->setname, 120, 200, 0x01); // draw grf name |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1046 |
|
484 | 1047 |
if (_sel_grffile == NULL) { // no grf file selected yet |
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1048 |
DrawStringMultiCenter(140, 210, STR_NEWGRF_TIP, 250); |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1049 |
} else { |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1050 |
// draw filename |
484 | 1051 |
x = DrawString(5, 199, STR_NEWGRF_FILENAME, 0); |
1052 |
DoDrawString(_sel_grffile->filename, x + 2, 199, 0x01); |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
1053 |
|
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1054 |
// draw grf id |
484 | 1055 |
x = DrawString(5, 209, STR_NEWGRF_GRF_ID, 0); |
486
dadcb8d5a6bd
(svn r768) In the NewGRF manager, show GRF ids as 8-digit hex numbers (that's how they are supposed to look).
pasky
parents:
484
diff
changeset
|
1056 |
snprintf(_userstring, USERSTRING_LEN, "%08X", _sel_grffile->grfid); |
dadcb8d5a6bd
(svn r768) In the NewGRF manager, show GRF ids as 8-digit hex numbers (that's how they are supposed to look).
pasky
parents:
484
diff
changeset
|
1057 |
DrawString(x + 2, 209, STR_SPEC_USERSTRING, 0x01); |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1058 |
} |
484 | 1059 |
} break; |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1060 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1061 |
case WE_CLICK: |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1062 |
switch(e->click.widget) { |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1063 |
case 2: { // select a grf file |
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1064 |
int y = (e->click.pt.y - NEWGRF_WND_PROC_OFFSET_TOP_WIDGET) / NEWGRF_WND_PROC_ROWSIZE; |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1065 |
|
484 | 1066 |
if (y >= w->vscroll.cap) { return;} // click out of bounds |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1067 |
|
484 | 1068 |
y += w->vscroll.pos; |
1069 |
||
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1070 |
if (y >= _grffile_count) return; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1071 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1072 |
_sel_grffile = _first_grffile; |
484 | 1073 |
// get selected grf-file |
1074 |
while (y-- != 0) _sel_grffile = _sel_grffile->next; |
|
1075 |
||
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1076 |
SetWindowDirty(w); |
484 | 1077 |
} break; |
1078 |
case 9: /* Cancel button */ |
|
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1079 |
DeleteWindowById(WC_GAME_OPTIONS, 0); |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1080 |
break; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1081 |
} break; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1082 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1083 |
/* Parameter edit box not used yet |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1084 |
case WE_TIMEOUT: |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1085 |
WP(w,def_d).data_2 = 0; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1086 |
SetWindowDirty(w); |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1087 |
break; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1088 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1089 |
case WE_ON_EDIT_TEXT: { |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1090 |
if (*e->edittext.str) { |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1091 |
SetWindowDirty(w); |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1092 |
} |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1093 |
break; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1094 |
} |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1095 |
*/ |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1096 |
case WE_DESTROY: |
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1097 |
_sel_grffile = NULL; |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1098 |
DeleteWindowById(WC_QUERY_STRING, 0); |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1099 |
break; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1100 |
} |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1101 |
} |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1102 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1103 |
static const Widget _newgrf_widgets[] = { |
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1104 |
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1105 |
{ WWT_CAPTION, 14, 11, 279, 0, 13, STR_NEWGRF_SETTINGS_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1106 |
{ WWT_MATRIX, 14, 0, 268, 14, 182, 0xC01,/*small rows*/ STR_NEWGRF_TIP}, |
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1107 |
{ WWT_PANEL, 14, 0, 279, 183, 276, 0x0, STR_NULL}, |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1108 |
|
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1109 |
{ WWT_SCROLLBAR, 14, 269, 279, 14, 182, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1110 |
|
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1111 |
{ WWT_CLOSEBOX, 14, 147, 158, 244, 255, STR_0188, STR_NULL}, |
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1112 |
{ WWT_CLOSEBOX, 14, 159, 170, 244, 255, STR_0189, STR_NULL}, |
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1113 |
{ WWT_CLOSEBOX, 14, 175, 274, 244, 255, STR_NEWGRF_SET_PARAMETERS, STR_NULL}, |
484 | 1114 |
|
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1115 |
{ WWT_CLOSEBOX, 3, 5, 138, 261, 272, STR_NEWGRF_APPLY_CHANGES, STR_NULL}, |
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1116 |
{ WWT_CLOSEBOX, 3, 142, 274, 261, 272, STR_012E_CANCEL, STR_NULL}, |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1117 |
{ WIDGETS_END}, |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1118 |
}; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1119 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1120 |
static const WindowDesc _newgrf_desc = { |
502
c2db77551c24
(svn r801) - re-enabled background highlighting in Newgrf GUI
dominik
parents:
486
diff
changeset
|
1121 |
WDP_CENTER, WDP_CENTER, 280, 277, |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1122 |
WC_GAME_OPTIONS,0, |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1123 |
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1124 |
_newgrf_widgets, |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1125 |
NewgrfWndProc, |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1126 |
}; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1127 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1128 |
void ShowNewgrf() |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1129 |
{ |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1130 |
Window *w; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1131 |
DeleteWindowById(WC_GAME_OPTIONS, 0); |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1132 |
w = AllocateWindowDesc(&_newgrf_desc); |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1133 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1134 |
{ // little helper function to calculate _grffile_count |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1135 |
// should be REMOVED once _grffile_count is calculated at loading |
484 | 1136 |
struct GRFFile *c = _first_grffile; |
1137 |
_grffile_count = 0; |
|
1138 |
while (c != NULL) { |
|
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1139 |
_grffile_count++; |
484 | 1140 |
c = c->next; |
478
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1141 |
} |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1142 |
} |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1143 |
|
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1144 |
w->vscroll.cap = 12; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1145 |
w->vscroll.count = _grffile_count; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1146 |
w->vscroll.pos = 0; |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1147 |
w->disabled_state = (1 << 5) | (1 << 6) | (1 << 7); |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1148 |
} |
19987403ee5d
(svn r745) Added newgrf GUI (in options menu)\nThe interface currently only displays the installed grf sets, you can't (de)activate them through the gui yet
dominik
parents:
430
diff
changeset
|
1149 |