annotate OSWindow.cpp @ 2326:c889e521af1f

some EventCastSpell cleanups - removing labels, changing some numbers to enums
author Grumpy7
date Tue, 01 Apr 2014 22:19:57 +0200
parents 847aba0b7f82
children d6887ee81068
rev   line source
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2223
diff changeset
1 #define _CRT_SECURE_NO_WARNINGS
1804
Nomad
parents:
diff changeset
2 #include "OSWindow.h"
Nomad
parents:
diff changeset
3 #include "mm7_data.h"
Nomad
parents:
diff changeset
4 #include "Arcomage.h"
Nomad
parents:
diff changeset
5 #include "AudioPlayer.h"
Nomad
parents:
diff changeset
6 #include "VideoPlayer.h"
Nomad
parents:
diff changeset
7 #include "Mouse.h"
2044
28cb79ae2f6f Time.h rename
Ritor1
parents: 1995
diff changeset
8 #include "Timer.h"
1804
Nomad
parents:
diff changeset
9 #include "GUIWindow.h"
Nomad
parents:
diff changeset
10 #include "Party.h"
Nomad
parents:
diff changeset
11 #include "Game.h"
Nomad
parents:
diff changeset
12 #include "IndoorCameraD3D.h"
Nomad
parents:
diff changeset
13 #include "Keyboard.h"
Nomad
parents:
diff changeset
14 #include "Render.h"
Nomad
parents:
diff changeset
15 #include "Viewport.h"
Nomad
parents:
diff changeset
16 #include "Vis.h"
Nomad
parents:
diff changeset
17 #include "Texts.h"
Nomad
parents:
diff changeset
18 #include "AIL.h"
Nomad
parents:
diff changeset
19 #include "Bink_Smacker.h"
Nomad
parents:
diff changeset
20 #include "ErrorHandling.h"
2052
71a814f4482a Moved implementation to cpp
Nomad
parents: 2044
diff changeset
21 #include "Log.h"
2223
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
22 #include "LOD.h"
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
23 #include "Outdoor_stuff.h"
1804
Nomad
parents:
diff changeset
24
Nomad
parents:
diff changeset
25
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
26 bool wizard_eye = false; //включить на постоянно око чародея
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
27 bool change_seasons = false; //смена времён года
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
28 bool all_magic = false; //включить всю магию
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
29 bool debug_information = false; //информация fps, положение группы, уровень пола и т.п.
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
30 bool show_picked_face = false; //выделить активный фейс
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
31 bool draw_portals_loops = false; //видны рамки порталов
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
32 bool new_speed = false;
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
33 bool bSnow = false;
2320
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
34 bool draw_terrain_dist_mist = false;//новая дальность отрисовки тайлов
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
35
1804
Nomad
parents:
diff changeset
36 bool OSWindow::OnMouseLeftClick(int x, int y)
Nomad
parents:
diff changeset
37 {
1815
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
38 if (UIControl::OnMouseLeftClick(x, y))
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
39 return true;
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
40
1804
Nomad
parents:
diff changeset
41 if (pVideoPlayer->pVideoFrame.pPixels)
Nomad
parents:
diff changeset
42 pVideoPlayer->bStopBeforeSchedule = true;
Nomad
parents:
diff changeset
43
Nomad
parents:
diff changeset
44 pMouse->SetMouseClick(x, y);
Nomad
parents:
diff changeset
45
Nomad
parents:
diff changeset
46 if (GetCurrentMenuID() == MENU_CREATEPARTY)
Nomad
parents:
diff changeset
47 UI_OnKeyDown(VK_SELECT);
Nomad
parents:
diff changeset
48
Nomad
parents:
diff changeset
49 if (pGame)
Nomad
parents:
diff changeset
50 pGame->PickMouse(512.0, x, y, false, &vis_sprite_filter_3, &vis_door_filter);
Nomad
parents:
diff changeset
51
Nomad
parents:
diff changeset
52 UI_OnMouseLeftClick(0);
Nomad
parents:
diff changeset
53 return true;
Nomad
parents:
diff changeset
54 }
Nomad
parents:
diff changeset
55
Nomad
parents:
diff changeset
56 bool OSWindow::OnMouseRightClick(int x, int y)
Nomad
parents:
diff changeset
57 {
1815
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
58 if (UIControl::OnMouseRightClick(x, y))
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
59 return true;
bd899dfd976c MainMenuWindow
Nomad
parents: 1806
diff changeset
60
1804
Nomad
parents:
diff changeset
61 if (pVideoPlayer->pVideoFrame.pPixels)
Nomad
parents:
diff changeset
62 pVideoPlayer->bStopBeforeSchedule = true;
Nomad
parents:
diff changeset
63
Nomad
parents:
diff changeset
64 pMouse->SetMouseClick(x, y);
Nomad
parents:
diff changeset
65
Nomad
parents:
diff changeset
66 if (pGame)
Nomad
parents:
diff changeset
67 pGame->PickMouse(pGame->pIndoorCameraD3D->GetPickDepth(), x, y, 0, &vis_sprite_filter_2, &vis_door_filter);
Nomad
parents:
diff changeset
68
Nomad
parents:
diff changeset
69 UI_OnMouseRightClick(0);
Nomad
parents:
diff changeset
70 return true;
Nomad
parents:
diff changeset
71 }
Nomad
parents:
diff changeset
72
Nomad
parents:
diff changeset
73
1830
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
74 bool _507B98_ctrl_pressed = false;
1804
Nomad
parents:
diff changeset
75 bool OSWindow::WinApiMessageProc(UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *result)
Nomad
parents:
diff changeset
76 {
Nomad
parents:
diff changeset
77 switch (msg)
Nomad
parents:
diff changeset
78 {
Nomad
parents:
diff changeset
79 case WM_KEYUP:
Nomad
parents:
diff changeset
80 {
1830
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
81 if (wparam == VK_CONTROL)
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
82 _507B98_ctrl_pressed = false;
2132
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2104
diff changeset
83 if (wparam == VK_SNAPSHOT)
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2104
diff changeset
84 pRenderer->SavePCXScreenshot();
1830
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
85
1804
Nomad
parents:
diff changeset
86 OnKey(wparam);
Nomad
parents:
diff changeset
87 return *result = 0, true;
Nomad
parents:
diff changeset
88 }
Nomad
parents:
diff changeset
89
Nomad
parents:
diff changeset
90 case WM_SIZING: return *result = 1, true;
Nomad
parents:
diff changeset
91 case WM_WINDOWPOSCHANGED:
2142
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2132
diff changeset
92 //if (pVideoPlayer && pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer)
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2132
diff changeset
93 //BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0);
1804
Nomad
parents:
diff changeset
94 return false;
Nomad
parents:
diff changeset
95
Nomad
parents:
diff changeset
96 case WM_CHAR:
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2187
diff changeset
97 if (!pKeyActionMap->ProcessTextInput(wparam) && !viewparams->field_4C)
1804
Nomad
parents:
diff changeset
98 GUI_HandleHotkey(wparam);
Nomad
parents:
diff changeset
99 return false;
Nomad
parents:
diff changeset
100
Nomad
parents:
diff changeset
101 case WM_DESTROY:
Nomad
parents:
diff changeset
102 ExitProcess(GetLastError());
Nomad
parents:
diff changeset
103 // SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
Nomad
parents:
diff changeset
104 // PostQuitMessage(0);
Nomad
parents:
diff changeset
105 // return 0;
Nomad
parents:
diff changeset
106
Nomad
parents:
diff changeset
107 //case WM_DEVICECHANGE:
Nomad
parents:
diff changeset
108 //{
Nomad
parents:
diff changeset
109 // if (wParam == 0x8000) // CD or some device has been inserted - notify InsertCD dialog
Nomad
parents:
diff changeset
110 // PostMessageW(hInsertCDWindow, WM_USER + 1, 0, 0);
Nomad
parents:
diff changeset
111 // return 0;
Nomad
parents:
diff changeset
112 //}
Nomad
parents:
diff changeset
113
Nomad
parents:
diff changeset
114 case WM_COMMAND:
Nomad
parents:
diff changeset
115 if (OnOSMenu(wparam))
Nomad
parents:
diff changeset
116 return *result = 0, true;
Nomad
parents:
diff changeset
117 return false;
Nomad
parents:
diff changeset
118
Nomad
parents:
diff changeset
119 case WM_LBUTTONDOWN:
Nomad
parents:
diff changeset
120 {
Nomad
parents:
diff changeset
121 if (pArcomageGame->bGameInProgress)
Nomad
parents:
diff changeset
122 {
Nomad
parents:
diff changeset
123 pArcomageGame->stru1.field_0 = 7;
Nomad
parents:
diff changeset
124 ArcomageGame::OnMouseClick(0, true);
Nomad
parents:
diff changeset
125 return false;
Nomad
parents:
diff changeset
126 }
Nomad
parents:
diff changeset
127
Nomad
parents:
diff changeset
128 OnMouseLeftClick(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
129 }
Nomad
parents:
diff changeset
130 return false;
Nomad
parents:
diff changeset
131
Nomad
parents:
diff changeset
132
Nomad
parents:
diff changeset
133 case WM_RBUTTONDOWN:
Nomad
parents:
diff changeset
134 {
Nomad
parents:
diff changeset
135 if (pArcomageGame->bGameInProgress)
Nomad
parents:
diff changeset
136 {
Nomad
parents:
diff changeset
137 pArcomageGame->stru1.field_0 = 8;
Nomad
parents:
diff changeset
138 ArcomageGame::OnMouseClick(1, true);
Nomad
parents:
diff changeset
139 return false;
Nomad
parents:
diff changeset
140 }
Nomad
parents:
diff changeset
141
Nomad
parents:
diff changeset
142 OnMouseRightClick(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
143 }
Nomad
parents:
diff changeset
144 return false;
Nomad
parents:
diff changeset
145
Nomad
parents:
diff changeset
146
Nomad
parents:
diff changeset
147 case WM_LBUTTONUP:
Nomad
parents:
diff changeset
148 if ( !pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
149 {
Nomad
parents:
diff changeset
150 back_to_game();
Nomad
parents:
diff changeset
151 return false;
Nomad
parents:
diff changeset
152 }
Nomad
parents:
diff changeset
153 pArcomageGame->stru1.field_0 = 3;
Nomad
parents:
diff changeset
154 ArcomageGame::OnMouseClick(0, 0);
Nomad
parents:
diff changeset
155 return false;
Nomad
parents:
diff changeset
156
Nomad
parents:
diff changeset
157 case WM_RBUTTONUP:
Nomad
parents:
diff changeset
158 if ( !pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
159 {
Nomad
parents:
diff changeset
160 back_to_game();
Nomad
parents:
diff changeset
161 return false;
Nomad
parents:
diff changeset
162 }
Nomad
parents:
diff changeset
163 pArcomageGame->stru1.field_0 = 4;
Nomad
parents:
diff changeset
164 ArcomageGame::OnMouseClick(1, false);
Nomad
parents:
diff changeset
165 return false;
Nomad
parents:
diff changeset
166
Nomad
parents:
diff changeset
167 case WM_LBUTTONDBLCLK:
Nomad
parents:
diff changeset
168 {
Nomad
parents:
diff changeset
169 if ( pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
170 {
Nomad
parents:
diff changeset
171 pArcomageGame->stru1.field_0 = 7;
Nomad
parents:
diff changeset
172 return false;
Nomad
parents:
diff changeset
173 }
Nomad
parents:
diff changeset
174
Nomad
parents:
diff changeset
175 OnMouseLeftClick(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
176 }
Nomad
parents:
diff changeset
177 return false;
Nomad
parents:
diff changeset
178
Nomad
parents:
diff changeset
179 case WM_RBUTTONDBLCLK:
Nomad
parents:
diff changeset
180 {
Nomad
parents:
diff changeset
181 if (pArcomageGame->bGameInProgress)
Nomad
parents:
diff changeset
182 {
Nomad
parents:
diff changeset
183 pArcomageGame->stru1.field_0 = 8;
Nomad
parents:
diff changeset
184 return false;
Nomad
parents:
diff changeset
185 }
Nomad
parents:
diff changeset
186
Nomad
parents:
diff changeset
187 OnMouseRightClick(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
188 }
Nomad
parents:
diff changeset
189 return false;
Nomad
parents:
diff changeset
190
Nomad
parents:
diff changeset
191 /*case WM_MBUTTONDOWN:
Nomad
parents:
diff changeset
192 if (pRenderer->pRenderD3D && pGame)
Nomad
parents:
diff changeset
193 {
Nomad
parents:
diff changeset
194 pGame->PickMouse(pGame->pIndoorCameraD3D->GetPickDepth(), LOWORD(lParam), HIWORD(lParam), 1, &vis_sprite_filter_3, &vis_face_filter);
Nomad
parents:
diff changeset
195 }
Nomad
parents:
diff changeset
196 return false;*/
Nomad
parents:
diff changeset
197
Nomad
parents:
diff changeset
198 case WM_MOUSEMOVE:
Nomad
parents:
diff changeset
199 if ( pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
200 {
Nomad
parents:
diff changeset
201 ArcomageGame::OnMouseMove(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
202 ArcomageGame::OnMouseClick(0, wparam == MK_LBUTTON);
Nomad
parents:
diff changeset
203 ArcomageGame::OnMouseClick(1, wparam == MK_RBUTTON);
Nomad
parents:
diff changeset
204 }
Nomad
parents:
diff changeset
205 else if (pMouse)
Nomad
parents:
diff changeset
206 pMouse->SetMouseClick(LOWORD(lparam), HIWORD(lparam));
Nomad
parents:
diff changeset
207 return false;
Nomad
parents:
diff changeset
208
Nomad
parents:
diff changeset
209 case WM_SYSCOMMAND:
Nomad
parents:
diff changeset
210 if ( wparam == SC_SCREENSAVE || wparam == SC_MONITORPOWER )
Nomad
parents:
diff changeset
211 return *result = 0, true;
Nomad
parents:
diff changeset
212 return false;
Nomad
parents:
diff changeset
213
Nomad
parents:
diff changeset
214 case WM_KEYDOWN:
Nomad
parents:
diff changeset
215 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 )
Nomad
parents:
diff changeset
216 {
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2187
diff changeset
217 pKeyActionMap->ProcessTextInput(wparam);
1804
Nomad
parents:
diff changeset
218 return false;
Nomad
parents:
diff changeset
219 }
Nomad
parents:
diff changeset
220 if ( !pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
221 {
Nomad
parents:
diff changeset
222 if ( pVideoPlayer->pVideoFrame.pPixels )
Nomad
parents:
diff changeset
223 pVideoPlayer->bStopBeforeSchedule = 1;
Nomad
parents:
diff changeset
224 if ( wparam == VK_RETURN )
Nomad
parents:
diff changeset
225 {
Nomad
parents:
diff changeset
226 if ( !viewparams->field_4C )
Nomad
parents:
diff changeset
227 UI_OnKeyDown(wparam);
Nomad
parents:
diff changeset
228 return 0;
Nomad
parents:
diff changeset
229 }
1830
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
230 if (wparam == VK_CONTROL)
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
231 {
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
232 _507B98_ctrl_pressed = true;
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
233 return false;
5ea627a263dd Clicking works again
Nomad
parents: 1827
diff changeset
234 }
1804
Nomad
parents:
diff changeset
235 if ( wparam == VK_ESCAPE )
Nomad
parents:
diff changeset
236 {
Nomad
parents:
diff changeset
237 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, window_SpeakInHouse != 0, 0);
Nomad
parents:
diff changeset
238 return 0;
Nomad
parents:
diff changeset
239 }
Nomad
parents:
diff changeset
240 if ( wparam <= VK_HOME )
Nomad
parents:
diff changeset
241 return 0;
Nomad
parents:
diff changeset
242 if ( wparam > VK_DOWN )
Nomad
parents:
diff changeset
243 {
Nomad
parents:
diff changeset
244 if ( wparam != VK_F4 || pVideoPlayer->AnyMovieLoaded() )
Nomad
parents:
diff changeset
245 return 0;
Nomad
parents:
diff changeset
246
Nomad
parents:
diff changeset
247 // F4 - toggle fullscreen
Nomad
parents:
diff changeset
248 SendMessageW(api_handle, WM_COMMAND, 104, 0);
Nomad
parents:
diff changeset
249 return 0;
Nomad
parents:
diff changeset
250 }
Nomad
parents:
diff changeset
251 if ( wparam >= VK_LEFT && wparam <= VK_DOWN )
Nomad
parents:
diff changeset
252 {
Nomad
parents:
diff changeset
253 if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_MODAL_WINDOW )
Nomad
parents:
diff changeset
254 {
Nomad
parents:
diff changeset
255 if ( !viewparams->field_4C )
Nomad
parents:
diff changeset
256 UI_OnKeyDown(wparam);
Nomad
parents:
diff changeset
257 return 0;
Nomad
parents:
diff changeset
258 }
Nomad
parents:
diff changeset
259 }
Nomad
parents:
diff changeset
260 if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_MODAL_WINDOW )
Nomad
parents:
diff changeset
261 return 0;
Nomad
parents:
diff changeset
262 }
Nomad
parents:
diff changeset
263
Nomad
parents:
diff changeset
264 pArcomageGame->stru1.field_0 = 1;
Nomad
parents:
diff changeset
265
Nomad
parents:
diff changeset
266 set_stru1_field_8_InArcomage(MapVirtualKey(wparam, MAPVK_VK_TO_CHAR));
Nomad
parents:
diff changeset
267 if ( wparam == 27 )
Nomad
parents:
diff changeset
268 {
Nomad
parents:
diff changeset
269 pArcomageGame->GameOver = 1;
Nomad
parents:
diff changeset
270 pArcomageGame->field_F4 = 1;
2214
20995bb8895a GameResultsApply() full refactored
Ritor1
parents: 2201
diff changeset
271 pArcomageGame->uGameWinner = 2;
20995bb8895a GameResultsApply() full refactored
Ritor1
parents: 2201
diff changeset
272 pArcomageGame->Victory_type = -2;
1804
Nomad
parents:
diff changeset
273 return false;
Nomad
parents:
diff changeset
274 }
Nomad
parents:
diff changeset
275 if ( wparam != 114 )
Nomad
parents:
diff changeset
276 {
Nomad
parents:
diff changeset
277 if ( wparam == 115 && !pVideoPlayer->AnyMovieLoaded() )
Nomad
parents:
diff changeset
278 SendMessage(api_handle, WM_COMMAND, 104, 0);
Nomad
parents:
diff changeset
279 return false;
Nomad
parents:
diff changeset
280 }
Nomad
parents:
diff changeset
281 SendMessageW(api_handle, WM_COMMAND, 103, 0);
Nomad
parents:
diff changeset
282 return *result = 0, true;
Nomad
parents:
diff changeset
283
Nomad
parents:
diff changeset
284 case WM_ACTIVATEAPP:
Nomad
parents:
diff changeset
285 if ( wparam && (GetForegroundWindow() == api_handle || GetForegroundWindow() == hInsertCDWindow) )
Nomad
parents:
diff changeset
286 {
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
287 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
1804
Nomad
parents:
diff changeset
288 {
Nomad
parents:
diff changeset
289 dword_4E98BC_bApplicationActive = 1;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
290 /*if ( pRenderer->bWindowMode )
1804
Nomad
parents:
diff changeset
291 {
Nomad
parents:
diff changeset
292 HDC hDC = GetDC(api_handle);
Nomad
parents:
diff changeset
293 int bitsPerPixel = GetDeviceCaps(hDC, BITSPIXEL);
Nomad
parents:
diff changeset
294 int planes = GetDeviceCaps(hDC, PLANES);
Nomad
parents:
diff changeset
295 ReleaseDC(api_handle, hDC);
Nomad
parents:
diff changeset
296 if (bitsPerPixel != 16 || planes != 1)
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
297 Error(L"%S", pGlobalTXT_LocalizationStrings[62]);
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
298 }*/
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
299 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_APP_INACTIVE;
1804
Nomad
parents:
diff changeset
300
Nomad
parents:
diff changeset
301 if ( pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
302 {
Nomad
parents:
diff changeset
303 pArcomageGame->field_F9 = 1;
Nomad
parents:
diff changeset
304 }
Nomad
parents:
diff changeset
305 else
Nomad
parents:
diff changeset
306 {
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
307 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0200_EVENT_TIMER)
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
308 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0200_EVENT_TIMER;
1804
Nomad
parents:
diff changeset
309 else
Nomad
parents:
diff changeset
310 pEventTimer->Resume();
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
311 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0400_MISC_TIMER)
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
312 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0400_MISC_TIMER;
1804
Nomad
parents:
diff changeset
313 else
Nomad
parents:
diff changeset
314 pMiscTimer->Resume();
Nomad
parents:
diff changeset
315
Nomad
parents:
diff changeset
316 viewparams->bRedrawGameUI = true;
2142
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2132
diff changeset
317 if ( pVideoPlayer->pMovie)//pVideoPlayer->pSmackerMovie )
1804
Nomad
parents:
diff changeset
318 {
Nomad
parents:
diff changeset
319 pRenderer->RestoreFrontBuffer();
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2142
diff changeset
320 pRenderer->RestoreBackBuffer();
2142
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2132
diff changeset
321 //pVideoPlayer->_4BF5B2();
1804
Nomad
parents:
diff changeset
322 }
Nomad
parents:
diff changeset
323 }
2142
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2132
diff changeset
324 if ( pAudioPlayer->hAILRedbook && !bGameoverLoop && !pVideoPlayer->pMovie)//!pVideoPlayer->pSmackerMovie )
1804
Nomad
parents:
diff changeset
325 AIL_redbook_resume(pAudioPlayer->hAILRedbook);
Nomad
parents:
diff changeset
326 }
Nomad
parents:
diff changeset
327 }
Nomad
parents:
diff changeset
328 else
Nomad
parents:
diff changeset
329 {
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
330 if (!(dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE))
1804
Nomad
parents:
diff changeset
331 {
Nomad
parents:
diff changeset
332 dword_4E98BC_bApplicationActive = 0;
2142
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2132
diff changeset
333 if ( pVideoPlayer->pMovie//(pVideoPlayer->pSmackerMovie || pVideoPlayer->pBinkMovie)
ca548138d6aa some code cleaning in video playing, loops play but there is a memory leak
zipi
parents: 2132
diff changeset
334 && pVideoPlayer->bPlayingMovie )
1804
Nomad
parents:
diff changeset
335 pVideoPlayer->bStopBeforeSchedule = 1;
Nomad
parents:
diff changeset
336
Nomad
parents:
diff changeset
337 ClipCursor(0);
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
338 dword_6BE364_game_settings_1 |= GAME_SETTINGS_APP_INACTIVE;
1804
Nomad
parents:
diff changeset
339 if ( pEventTimer->bPaused )
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
340 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0200_EVENT_TIMER;
1804
Nomad
parents:
diff changeset
341 else
Nomad
parents:
diff changeset
342 pEventTimer->Pause();
Nomad
parents:
diff changeset
343 if ( pMiscTimer->bPaused )
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
344 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0400_MISC_TIMER;
1804
Nomad
parents:
diff changeset
345 else
Nomad
parents:
diff changeset
346 pMiscTimer->Pause();
Nomad
parents:
diff changeset
347
2104
9574c5bfb96f UpdateSounds()
Ritor1
parents: 2069
diff changeset
348 pAudioPlayer->StopChannels(-1, -1);//приостановка воспроизведения звуков при неактивном окне игры
1804
Nomad
parents:
diff changeset
349 if ( pAudioPlayer->hAILRedbook )
Nomad
parents:
diff changeset
350 AIL_redbook_pause(pAudioPlayer->hAILRedbook);
Nomad
parents:
diff changeset
351 }
Nomad
parents:
diff changeset
352 }
Nomad
parents:
diff changeset
353 return *result = 0, true;
Nomad
parents:
diff changeset
354
Nomad
parents:
diff changeset
355 case WM_SETFOCUS:
Nomad
parents:
diff changeset
356 dword_4E98BC_bApplicationActive = 0;
Nomad
parents:
diff changeset
357 ClipCursor(0);
Nomad
parents:
diff changeset
358 return false;
Nomad
parents:
diff changeset
359
Nomad
parents:
diff changeset
360 case WM_KILLFOCUS:
Nomad
parents:
diff changeset
361 dword_4E98BC_bApplicationActive = 1;
Nomad
parents:
diff changeset
362 return false;
Nomad
parents:
diff changeset
363
Nomad
parents:
diff changeset
364 case WM_PAINT:
1806
Nomad
parents: 1805
diff changeset
365 if (!api_handle || !pRenderer)
1805
830f196a69ea WinXP fix
Nomad
parents: 1804
diff changeset
366 return false;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
367
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
368 if ( !GetUpdateRect(api_handle, 0, 0))// || !dword_4E98BC_bApplicationActive && !pRenderer->bWindowMode )
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
369 return *result = 0, true;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
370
1804
Nomad
parents:
diff changeset
371 PAINTSTRUCT Paint;
Nomad
parents:
diff changeset
372 BeginPaint(api_handle, &Paint);
Nomad
parents:
diff changeset
373 if ( pArcomageGame->bGameInProgress )
Nomad
parents:
diff changeset
374 {
Nomad
parents:
diff changeset
375 pArcomageGame->field_F9 = 1;
Nomad
parents:
diff changeset
376 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
377 if (pRenderer->AreRenderSurfacesOk())
1804
Nomad
parents:
diff changeset
378 {
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
379 pRenderer->Present();
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
380 //EndPaint(api_handle, &Paint);
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
381 //return *result = 0, true;
1804
Nomad
parents:
diff changeset
382 }
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2152
diff changeset
383
1804
Nomad
parents:
diff changeset
384 EndPaint(api_handle, &Paint);
Nomad
parents:
diff changeset
385 return *result = 0, true;
Nomad
parents:
diff changeset
386
Nomad
parents:
diff changeset
387 }
Nomad
parents:
diff changeset
388 return false;
Nomad
parents:
diff changeset
389 }
Nomad
parents:
diff changeset
390
Nomad
parents:
diff changeset
391
Nomad
parents:
diff changeset
392
Nomad
parents:
diff changeset
393 bool OSWindow::Initialize(const wchar_t *title, int window_width, int window_height)
Nomad
parents:
diff changeset
394 {
Nomad
parents:
diff changeset
395 WNDCLASSEXW wcxw;
Nomad
parents:
diff changeset
396 wcxw.cbClsExtra = 0;
Nomad
parents:
diff changeset
397 wcxw.cbSize = sizeof(wcxw);
Nomad
parents:
diff changeset
398 wcxw.cbWndExtra = 0;
Nomad
parents:
diff changeset
399 wcxw.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1);
Nomad
parents:
diff changeset
400 wcxw.hCursor = nullptr;
Nomad
parents:
diff changeset
401 wcxw.hIcon = wcxw.hIconSm = nullptr;
Nomad
parents:
diff changeset
402 wcxw.hInstance = GetModuleHandleW(nullptr);
Nomad
parents:
diff changeset
403 wcxw.lpfnWndProc = WinApiMsgRouter;
Nomad
parents:
diff changeset
404 wcxw.lpszClassName = L"M&MTrilogy";
Nomad
parents:
diff changeset
405 wcxw.lpszMenuName = nullptr;
Nomad
parents:
diff changeset
406 wcxw.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
Nomad
parents:
diff changeset
407 if (!RegisterClassExW(&wcxw))
Nomad
parents:
diff changeset
408 return false;
Nomad
parents:
diff changeset
409
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
410 api_handle = CreateWindowExW(0, wcxw.lpszClassName, title, 0,
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
411 ReadWindowsRegistryInt("window X", (GetSystemMetrics(SM_CXSCREEN) - window_width) / 2),
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
412 ReadWindowsRegistryInt("window Y", (GetSystemMetrics(SM_CYSCREEN) - window_height) / 2),
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
413 window_width, window_height, nullptr,
1804
Nomad
parents:
diff changeset
414 nullptr, wcxw.hInstance, this);
Nomad
parents:
diff changeset
415 if (!api_handle)
Nomad
parents:
diff changeset
416 {
Nomad
parents:
diff changeset
417 UnregisterClassW(wcxw.lpszClassName, wcxw.hInstance);
Nomad
parents:
diff changeset
418 return false;
Nomad
parents:
diff changeset
419 }
Nomad
parents:
diff changeset
420
Nomad
parents:
diff changeset
421 SetWindowedMode(window_width, window_height);
Nomad
parents:
diff changeset
422 Show();
Nomad
parents:
diff changeset
423
Nomad
parents:
diff changeset
424 SetActiveWindow(api_handle);
Nomad
parents:
diff changeset
425
Nomad
parents:
diff changeset
426 MSG msg;
Nomad
parents:
diff changeset
427 while (PeekMessageW(&msg, api_handle, 0, 0, PM_REMOVE))
Nomad
parents:
diff changeset
428 {
Nomad
parents:
diff changeset
429 TranslateMessage(&msg);
Nomad
parents:
diff changeset
430 DispatchMessageW(&msg);
Nomad
parents:
diff changeset
431 }
Nomad
parents:
diff changeset
432
Nomad
parents:
diff changeset
433 return true;
Nomad
parents:
diff changeset
434 }
Nomad
parents:
diff changeset
435
Nomad
parents:
diff changeset
436
Nomad
parents:
diff changeset
437
Nomad
parents:
diff changeset
438
Nomad
parents:
diff changeset
439 OSWindow *OSWindow::Create(const wchar_t *title, int window_width, int window_height)
Nomad
parents:
diff changeset
440 {
2061
b2a434d65344 GAME_SETTINGS_* defines introduced
Nomad
parents: 2052
diff changeset
441 auto window = new OSWindow;
1804
Nomad
parents:
diff changeset
442 if (window)
Nomad
parents:
diff changeset
443 if (!window->Initialize(title, window_width, window_height))
Nomad
parents:
diff changeset
444 {
Nomad
parents:
diff changeset
445 delete window;
Nomad
parents:
diff changeset
446 window = nullptr;
Nomad
parents:
diff changeset
447 }
Nomad
parents:
diff changeset
448
Nomad
parents:
diff changeset
449 return window;
Nomad
parents:
diff changeset
450 }
Nomad
parents:
diff changeset
451
Nomad
parents:
diff changeset
452
Nomad
parents:
diff changeset
453
Nomad
parents:
diff changeset
454 LRESULT __stdcall OSWindow::WinApiMsgRouter(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Nomad
parents:
diff changeset
455 {
Nomad
parents:
diff changeset
456 if (msg == WM_NCCREATE)
Nomad
parents:
diff changeset
457 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1924
diff changeset
458 CREATESTRUCTA* cs = (CREATESTRUCTA *)(lparam);
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1924
diff changeset
459 OSWindow* window = (OSWindow *)cs->lpCreateParams;
1804
Nomad
parents:
diff changeset
460
Nomad
parents:
diff changeset
461 SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)window);
Nomad
parents:
diff changeset
462 return DefWindowProcW(hwnd, msg, wparam, lparam);
Nomad
parents:
diff changeset
463 }
Nomad
parents:
diff changeset
464
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1924
diff changeset
465 OSWindow* window = (OSWindow *)GetWindowLongPtrW(hwnd, GWLP_USERDATA);
1804
Nomad
parents:
diff changeset
466 if (window && window->api_handle == hwnd)
Nomad
parents:
diff changeset
467 {
Nomad
parents:
diff changeset
468 LPARAM result;
Nomad
parents:
diff changeset
469 if (window->WinApiMessageProc(msg, wparam, lparam, &result))
Nomad
parents:
diff changeset
470 return result;
Nomad
parents:
diff changeset
471 }
Nomad
parents:
diff changeset
472 return DefWindowProcW(hwnd, msg, (WPARAM)wparam, (LPARAM)lparam);
Nomad
parents:
diff changeset
473 }
Nomad
parents:
diff changeset
474
Nomad
parents:
diff changeset
475
Nomad
parents:
diff changeset
476 void OSWindow::Show()
Nomad
parents:
diff changeset
477 {
Nomad
parents:
diff changeset
478 ShowWindow(api_handle, SW_SHOWNORMAL);
Nomad
parents:
diff changeset
479 UpdateWindow(api_handle);
Nomad
parents:
diff changeset
480 }
Nomad
parents:
diff changeset
481
Nomad
parents:
diff changeset
482
Nomad
parents:
diff changeset
483 void OSWindow::SetCursor(const char *cursor_name)
Nomad
parents:
diff changeset
484 {
Nomad
parents:
diff changeset
485 POINT cursor_pos;
Nomad
parents:
diff changeset
486 GetCursorPos(&cursor_pos);
Nomad
parents:
diff changeset
487
Nomad
parents:
diff changeset
488 if (!strcmp(cursor_name, "MICON1") )
2223
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
489 //SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(GetModuleHandleW(nullptr), IDC_ARROW));
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
490 SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(NULL, IDC_ARROW));
1804
Nomad
parents:
diff changeset
491 else if (!strcmp(cursor_name, "MICON2") )
2219
e6771956e74a for mouse
Ritor1
parents: 2217
diff changeset
492 {
2223
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
493 //HCURSOR hCurs1; // дескриптор курсора
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
494
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
495 // Создаем курсор в виде мишени.
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
496
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
497 //pMouse->uCursorTextureID = pIcons_LOD->LoadTexture(cursor_name, TEXTURE_16BIT_PALETTE);//есть альфа маска
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
498 //hCurs1 = LoadCursor(NULL, L"Target");//неверно, наверно нужно загрузить/создать курсор
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
499 SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(NULL, IDC_CROSS));
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
500
2219
e6771956e74a for mouse
Ritor1
parents: 2217
diff changeset
501 }
1804
Nomad
parents:
diff changeset
502 else if (!strcmp(cursor_name, "MICON3") )
2223
17bc3a1eb037 LoadCursor fix
Ritor1
parents: 2219
diff changeset
503 SetClassLongPtrW(api_handle, GCLP_HCURSOR, (LONG)LoadCursorW(NULL, IDC_WAIT));
1804
Nomad
parents:
diff changeset
504
2217
744ed51880ed expand button
Ritor1
parents: 2214
diff changeset
505 //ClientToScreen(api_handle, &cursor_pos); //кидает курсор в другую часть экрана
1804
Nomad
parents:
diff changeset
506 SetCursorPos(cursor_pos.x, cursor_pos.y);
Nomad
parents:
diff changeset
507 }
Nomad
parents:
diff changeset
508
Nomad
parents:
diff changeset
509 void OSWindow::SetFullscreenMode()
Nomad
parents:
diff changeset
510 {
Nomad
parents:
diff changeset
511 SetMenu(api_handle, nullptr);
Nomad
parents:
diff changeset
512 SetWindowLongW(api_handle, GWL_EXSTYLE, WS_EX_TOPMOST);
Nomad
parents:
diff changeset
513 SetWindowLongW(api_handle, GWL_STYLE, WS_VISIBLE | WS_POPUP);
Nomad
parents:
diff changeset
514
Nomad
parents:
diff changeset
515 SetWindowPos(api_handle, HWND_TOP, 0, 0, -1, -1, SWP_NOSIZE | SWP_SHOWWINDOW);
Nomad
parents:
diff changeset
516 }
Nomad
parents:
diff changeset
517
Nomad
parents:
diff changeset
518 void OSWindow::SetWindowedMode(int new_window_width, int new_window_height)
Nomad
parents:
diff changeset
519 {
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
520 RECT rcWindowPos;
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
521 GetWindowRect(api_handle, &rcWindowPos);
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
522
1804
Nomad
parents:
diff changeset
523 SetWindowLongW(api_handle, GWL_EXSTYLE, 0);
Nomad
parents:
diff changeset
524 SetWindowLongW(api_handle, GWL_STYLE, WS_VISIBLE | WS_OVERLAPPEDWINDOW);
1995
25e3772e3650 window style fix
zipi
parents: 1994
diff changeset
525 SetWindowPos(api_handle, HWND_TOP, 0, 0, -1, -1, 0);
25e3772e3650 window style fix
zipi
parents: 1994
diff changeset
526
1804
Nomad
parents:
diff changeset
527 RECT rcWindow;
Nomad
parents:
diff changeset
528 GetWindowRect(api_handle, &rcWindow);
Nomad
parents:
diff changeset
529
Nomad
parents:
diff changeset
530 RECT rcClient;
Nomad
parents:
diff changeset
531 GetClientRect(api_handle, &rcClient);
Nomad
parents:
diff changeset
532
Nomad
parents:
diff changeset
533 int window_borders_width = (rcWindow.right - rcWindow.left) - (rcClient.right - rcClient.left),
Nomad
parents:
diff changeset
534 window_borders_height = (rcWindow.bottom - rcWindow.top) - (rcClient.bottom - rcClient.top);
Nomad
parents:
diff changeset
535 int window_total_width = new_window_width + window_borders_width,
Nomad
parents:
diff changeset
536 window_total_height = new_window_height + window_borders_height;
Nomad
parents:
diff changeset
537
Nomad
parents:
diff changeset
538 #ifdef _DEBUG
Nomad
parents:
diff changeset
539 if (!GetMenu(api_handle))
Nomad
parents:
diff changeset
540 window_total_height += GetSystemMetrics(SM_CYMENU);
Nomad
parents:
diff changeset
541 #endif
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
542 MoveWindow(api_handle, rcWindowPos.left,
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
543 rcWindowPos.top,
1804
Nomad
parents:
diff changeset
544 window_total_width,
Nomad
parents:
diff changeset
545 window_total_height, 0);
Nomad
parents:
diff changeset
546 #ifdef _DEBUG
Nomad
parents:
diff changeset
547 static HMENU debug_menu = CreateDebugMenuPanel();
Nomad
parents:
diff changeset
548 SetMenu(api_handle, debug_menu);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
549
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
550 GetWindowRect(api_handle, &rcWindow);
259df09dfb50 32bits almost there
Nomad
parents: 2061
diff changeset
551 GetClientRect(api_handle, &rcClient);
1804
Nomad
parents:
diff changeset
552 #endif
Nomad
parents:
diff changeset
553 }
Nomad
parents:
diff changeset
554
Nomad
parents:
diff changeset
555
Nomad
parents:
diff changeset
556
Nomad
parents:
diff changeset
557
Nomad
parents:
diff changeset
558 HMENU OSWindow::CreateDebugMenuPanel()
Nomad
parents:
diff changeset
559 {
Nomad
parents:
diff changeset
560 HMENU menu = CreateMenu();
Nomad
parents:
diff changeset
561 {
Nomad
parents:
diff changeset
562 HMENU file = CreatePopupMenu();
Nomad
parents:
diff changeset
563 AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)file, L"&File");
Nomad
parents:
diff changeset
564 {
Nomad
parents:
diff changeset
565 AppendMenuW(file, MF_ENABLED | MF_STRING, 40001, L"Exit");
Nomad
parents:
diff changeset
566 }
Nomad
parents:
diff changeset
567
Nomad
parents:
diff changeset
568 HMENU debug = CreatePopupMenu();
Nomad
parents:
diff changeset
569 AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug, L"&Debug");
Nomad
parents:
diff changeset
570 {
Nomad
parents:
diff changeset
571 HMENU debug_party = CreatePopupMenu();
Nomad
parents:
diff changeset
572 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_party, L"&Party");
Nomad
parents:
diff changeset
573 {
Nomad
parents:
diff changeset
574 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40007, L"Give Gold (10 000)");
Nomad
parents:
diff changeset
575 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40008, L"Give Exp (20 000)");
Nomad
parents:
diff changeset
576 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40059, L"Give Skills (50 each)");
Nomad
parents:
diff changeset
577 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40013, L"Remove Gold");
Nomad
parents:
diff changeset
578
Nomad
parents:
diff changeset
579 HMENU debug_party_setconditions = CreatePopupMenu();
Nomad
parents:
diff changeset
580 AppendMenuW(debug_party, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_party_setconditions, L"Set Condition");
Nomad
parents:
diff changeset
581 {
Nomad
parents:
diff changeset
582 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40044, L"Afraid");
Nomad
parents:
diff changeset
583 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40043, L"Asleep");
Nomad
parents:
diff changeset
584 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40037, L"Curse");
2187
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
585 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40036, L"Disease Weak");
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
586 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40035, L"Disease Medium");
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
587 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40034, L"Disease Severe");
1804
Nomad
parents:
diff changeset
588 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40041, L"Dead");
Nomad
parents:
diff changeset
589 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40039, L"Drunk");
Nomad
parents:
diff changeset
590 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40042, L"Eradicated");
Nomad
parents:
diff changeset
591 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40038, L"Insane");
Nomad
parents:
diff changeset
592 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40045, L"Paralyzed");
2187
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
593 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40033, L"Poison Weak");
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
594 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40032, L"Poison Medium");
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
595 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40031, L"Poison Severe");
1804
Nomad
parents:
diff changeset
596 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40029, L"&Stone");
Nomad
parents:
diff changeset
597 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40040, L"Unconscious");
Nomad
parents:
diff changeset
598 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40030, L"Weak");
Nomad
parents:
diff changeset
599 AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40073, L"Zombie");
Nomad
parents:
diff changeset
600 }
Nomad
parents:
diff changeset
601
Nomad
parents:
diff changeset
602 AppendMenuW(debug_party, MF_ENABLED | MF_STRING, 40006, L"Set Food (20)");
Nomad
parents:
diff changeset
603
Nomad
parents:
diff changeset
604 HMENU debug_party_alignment = CreatePopupMenu();
Nomad
parents:
diff changeset
605 AppendMenuW(debug_party, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_party_alignment, L"Alignment");
Nomad
parents:
diff changeset
606 {
Nomad
parents:
diff changeset
607 AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING, 40062, L"Good");
Nomad
parents:
diff changeset
608 AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING | MF_CHECKED, 40063, L"Neutral");
Nomad
parents:
diff changeset
609 AppendMenuW(debug_party_alignment, MF_ENABLED | MF_STRING, 40064, L"Evil");
Nomad
parents:
diff changeset
610 }
Nomad
parents:
diff changeset
611 }
Nomad
parents:
diff changeset
612
Nomad
parents:
diff changeset
613 HMENU debug_time = CreatePopupMenu();
Nomad
parents:
diff changeset
614 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_time, L"&Time");
Nomad
parents:
diff changeset
615 {
Nomad
parents:
diff changeset
616 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40009, L"Add 1 Day");
Nomad
parents:
diff changeset
617 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40010, L"Add 1 Week");
Nomad
parents:
diff changeset
618 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40011, L"Add 1 Month");
Nomad
parents:
diff changeset
619 AppendMenuW(debug_time, MF_ENABLED | MF_STRING, 40012, L"Add 1 Year");
Nomad
parents:
diff changeset
620 }
Nomad
parents:
diff changeset
621
Nomad
parents:
diff changeset
622 HMENU debug_items = CreatePopupMenu();
Nomad
parents:
diff changeset
623 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_items, L"&Items");
Nomad
parents:
diff changeset
624 {
Nomad
parents:
diff changeset
625 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40015, L"Generate level &1 item");
Nomad
parents:
diff changeset
626 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40016, L"Generate level &2 item");
Nomad
parents:
diff changeset
627 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40017, L"Generate level &3 item");
Nomad
parents:
diff changeset
628 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40018, L"Generate level &4 item");
Nomad
parents:
diff changeset
629 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40019, L"Generate level &5 item");
Nomad
parents:
diff changeset
630 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40020, L"Generate level &6 item");
Nomad
parents:
diff changeset
631 AppendMenuW(debug_items, MF_ENABLED | MF_STRING, 40061, L"Generate special item");
Nomad
parents:
diff changeset
632 }
Nomad
parents:
diff changeset
633
Nomad
parents:
diff changeset
634 HMENU debug_graphics = CreatePopupMenu();
Nomad
parents:
diff changeset
635 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_graphics, L"&Graphics");
Nomad
parents:
diff changeset
636 {
Nomad
parents:
diff changeset
637 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40023, L"Lighting Mode");
Nomad
parents:
diff changeset
638 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40024, L"Lighting Geometry");
Nomad
parents:
diff changeset
639 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING | MF_GRAYED, 40104, L"Lights Off");
Nomad
parents:
diff changeset
640 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40105, L"Colored Lights");
Nomad
parents:
diff changeset
641 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40025, L"Debug Lights");
Nomad
parents:
diff changeset
642 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40101, L"Debug Decals");
Nomad
parents:
diff changeset
643 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40027, L"HWID Portals");
Nomad
parents:
diff changeset
644 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40047, L"SWID Portals");
Nomad
parents:
diff changeset
645 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40051, L"OD Frustum");
Nomad
parents:
diff changeset
646 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40054, L"SWOD Constant Redraw");
Nomad
parents:
diff changeset
647 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40055, L"SWOD Lit Rasterizer");
Nomad
parents:
diff changeset
648 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40056, L"Party Light off");
Nomad
parents:
diff changeset
649 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40060, L"SWOD Nice Lighting off");
Nomad
parents:
diff changeset
650 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40067, L"HWOD Additive Fog Lights");
Nomad
parents:
diff changeset
651 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40072, L"HWID Nice Lighting");
Nomad
parents:
diff changeset
652 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40048, L"Wireframe");
Nomad
parents:
diff changeset
653 AppendMenuW(debug_graphics, MF_ENABLED | MF_STRING, 40049, L"Fog");
Nomad
parents:
diff changeset
654 }
Nomad
parents:
diff changeset
655
Nomad
parents:
diff changeset
656 HMENU debug_misc = CreatePopupMenu();
Nomad
parents:
diff changeset
657 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_misc, L"&Misc");
Nomad
parents:
diff changeset
658 {
Nomad
parents:
diff changeset
659 AppendMenuW(debug_misc, MF_ENABLED | MF_STRING, 40066, L"Object Viewcone Culling");
Nomad
parents:
diff changeset
660 AppendMenuW(debug_misc, MF_ENABLED | MF_STRING, 40068, L"Red Tint");
Nomad
parents:
diff changeset
661 AppendMenuW(debug_misc, MF_ENABLED | MF_STRING, 40071, L"Display Secrets");
Nomad
parents:
diff changeset
662 AppendMenuW(debug_misc, MF_ENABLED | MF_STRING, 40102, L"Massive Bloodsplat");
Nomad
parents:
diff changeset
663 AppendMenuW(debug_misc, MF_ENABLED | MF_STRING, 40103, L"Underwater Gravity");
Nomad
parents:
diff changeset
664 }
Nomad
parents:
diff changeset
665
Nomad
parents:
diff changeset
666 HMENU debug_eax = CreatePopupMenu();
Nomad
parents:
diff changeset
667 AppendMenuW(debug, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)debug_eax, L"EAX Environs");
Nomad
parents:
diff changeset
668 {
Nomad
parents:
diff changeset
669 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40074, L"NONE");
Nomad
parents:
diff changeset
670 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40075, L"GENERIC");
Nomad
parents:
diff changeset
671 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40076, L"PADDEDCELL");
Nomad
parents:
diff changeset
672 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40077, L"ROOM");
Nomad
parents:
diff changeset
673 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40078, L"BATHROOM");
Nomad
parents:
diff changeset
674 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40079, L"LIVINGROOM");
Nomad
parents:
diff changeset
675 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40080, L"STONEROOM");
Nomad
parents:
diff changeset
676 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40081, L"AUDITORIUM");
Nomad
parents:
diff changeset
677 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40082, L"CONCERTHALL");
Nomad
parents:
diff changeset
678 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40083, L"CAVE");
Nomad
parents:
diff changeset
679 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40084, L"ARENA");
Nomad
parents:
diff changeset
680 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40085, L"HANGAR");
Nomad
parents:
diff changeset
681 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40086, L"CARPETEDHALLWAY");
Nomad
parents:
diff changeset
682 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40087, L"HALLWAY");
Nomad
parents:
diff changeset
683 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40088, L"STONECORRIDOR");
Nomad
parents:
diff changeset
684 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40089, L"ALLEY");
Nomad
parents:
diff changeset
685 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40090, L"FOREST");
Nomad
parents:
diff changeset
686 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40091, L"CITY");
Nomad
parents:
diff changeset
687 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40092, L"MOUNTAINS");
Nomad
parents:
diff changeset
688 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40093, L"QUARRY");
Nomad
parents:
diff changeset
689 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40094, L"PLAIN");
Nomad
parents:
diff changeset
690 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40095, L"PARKINGLOT");
Nomad
parents:
diff changeset
691 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40096, L"SEWERPIPE");
Nomad
parents:
diff changeset
692 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40097, L"UNDERWATER");
Nomad
parents:
diff changeset
693 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40098, L"DRUGGED");
Nomad
parents:
diff changeset
694 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40099, L"DIZZY");
Nomad
parents:
diff changeset
695 AppendMenuW(debug_eax, MF_ENABLED | MF_STRING, 40100, L"PSICHOTIC");
Nomad
parents:
diff changeset
696 }
Nomad
parents:
diff changeset
697 }
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
698 HMENU other = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
699 AppendMenuW(menu, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other, L"&Other");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
700 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
701 HMENU other_wizard_eye = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
702 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_wizard_eye, L"Wizard eye");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
703 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
704 AppendMenuW(other_wizard_eye, MF_ENABLED | MF_STRING, 40101, L"Wizard eye on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
705 AppendMenuW(other_wizard_eye, MF_ENABLED | MF_STRING, 40102, L"Wizard eye off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
706 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
707 HMENU other_new_draw_object_dist = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
708 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_new_draw_object_dist, L"New draw object distance");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
709 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
710 AppendMenuW(other_new_draw_object_dist, MF_ENABLED | MF_STRING, 40103, L"New draw object dist on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
711 AppendMenuW(other_new_draw_object_dist, MF_ENABLED | MF_STRING, 40104, L"New draw object dist off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
712 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
713 HMENU other_change_seasons = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
714 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_change_seasons, L"Change seasons");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
715 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
716 AppendMenuW(other_change_seasons, MF_ENABLED | MF_STRING, 40105, L"Change seasons on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
717 AppendMenuW(other_change_seasons, MF_ENABLED | MF_STRING, 40106, L"Change seasons off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
718 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
719 HMENU other_all_magic = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
720 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_all_magic, L"All magic");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
721 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
722 AppendMenuW(other_all_magic, MF_ENABLED | MF_STRING, 40107, L"All magic on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
723 AppendMenuW(other_all_magic, MF_ENABLED | MF_STRING, 40108, L"All magic off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
724 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
725 HMENU other_debug_information = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
726 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_debug_information, L"Debug information");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
727 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
728 AppendMenuW(other_debug_information, MF_ENABLED | MF_STRING, 40109, L"Debug information on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
729 AppendMenuW(other_debug_information, MF_ENABLED | MF_STRING, 40110, L"Debug information off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
730 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
731 HMENU other_show_picked_face = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
732 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_show_picked_face, L"Show picked face");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
733 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
734 AppendMenuW(other_show_picked_face, MF_ENABLED | MF_STRING, 40111, L"Show picked face on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
735 AppendMenuW(other_show_picked_face, MF_ENABLED | MF_STRING, 40112, L"Show picked face off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
736 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
737 HMENU other_draw_portals_loops = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
738 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_draw_portals_loops, L"Draw portals loops");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
739 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
740 AppendMenuW(other_draw_portals_loops, MF_ENABLED | MF_STRING, 40113, L"Draw portals loops on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
741 AppendMenuW(other_draw_portals_loops, MF_ENABLED | MF_STRING, 40114, L"Draw portals loops off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
742 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
743 HMENU other_new_speed = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
744 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_new_speed, L"New_speed");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
745 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
746 AppendMenuW(other_new_speed, MF_ENABLED | MF_STRING, 40115, L"New_speed on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
747 AppendMenuW(other_new_speed, MF_ENABLED | MF_STRING, 40116, L"New_speed off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
748 }
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
749 HMENU other_snow = CreatePopupMenu();
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
750 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_snow, L"Snow");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
751 {
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
752 AppendMenuW(other_snow, MF_ENABLED | MF_STRING, 40117, L"Snowfall on");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
753 AppendMenuW(other_snow, MF_ENABLED | MF_STRING, 40118, L"Snowfall off");
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
754 }
2320
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
755 HMENU other_draw_terrain_dist_mist = CreatePopupMenu();
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
756 AppendMenuW(other, MF_ENABLED | MF_STRING | MF_POPUP, (UINT_PTR)other_draw_terrain_dist_mist, L"New draw terrain distance");
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
757 {
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
758 AppendMenuW(other_draw_terrain_dist_mist, MF_ENABLED | MF_STRING, 40119, L"New draw terrain distance on");
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
759 AppendMenuW(other_draw_terrain_dist_mist, MF_ENABLED | MF_STRING, 40120, L"New draw terrain distance off");
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
760 }
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
761
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
762 }
1804
Nomad
parents:
diff changeset
763 }
Nomad
parents:
diff changeset
764 return menu;
Nomad
parents:
diff changeset
765 }
Nomad
parents:
diff changeset
766
Nomad
parents:
diff changeset
767
Nomad
parents:
diff changeset
768
Nomad
parents:
diff changeset
769
Nomad
parents:
diff changeset
770 bool OSWindow::OnOSMenu(int item_id)
Nomad
parents:
diff changeset
771 {
Nomad
parents:
diff changeset
772 switch (item_id)
Nomad
parents:
diff changeset
773 {
Nomad
parents:
diff changeset
774 default: return false;
Nomad
parents:
diff changeset
775
Nomad
parents:
diff changeset
776
2132
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2104
diff changeset
777 //case 103: pRenderer->SavePCXScreenshot(); break;
1804
Nomad
parents:
diff changeset
778 case 101: // Quit game
2132
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2104
diff changeset
779 case 40001: // Menu "File"-> "Exit"
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2104
diff changeset
780 pGame->Deinitialize();
1804
Nomad
parents:
diff changeset
781 SendMessageW(api_handle, WM_DESTROY, 0, 0);
Nomad
parents:
diff changeset
782 break;
Nomad
parents:
diff changeset
783
2132
49de109bbab5 SavePCXScreenshot() continue
Ritor1
parents: 2104
diff changeset
784 case 104: //F4 button
1804
Nomad
parents:
diff changeset
785 pRenderer->ChangeBetweenWinFullscreenModes();
Nomad
parents:
diff changeset
786 if (pArcomageGame->bGameInProgress)
Nomad
parents:
diff changeset
787 pArcomageGame->field_F6 = 1;
Nomad
parents:
diff changeset
788 break;
Nomad
parents:
diff changeset
789
Nomad
parents:
diff changeset
790 //SubMenu "Party"
Nomad
parents:
diff changeset
791 case 40006: pParty->SetFood(pParty->uNumFoodRations + 20); break;
Nomad
parents:
diff changeset
792 case 40007: pParty->SetGold(pParty->uNumGold + 10000); break;
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1815
diff changeset
793 case 40008: pParty->GivePartyExp(20000); break;
1804
Nomad
parents:
diff changeset
794 case 40013: pParty->SetGold(0); break;
Nomad
parents:
diff changeset
795
Nomad
parents:
diff changeset
796 case 40059:
Nomad
parents:
diff changeset
797 for (uint i = 0; i < 4; ++i)
Nomad
parents:
diff changeset
798 pParty->pPlayers[i].uSkillPoints = 50;
Nomad
parents:
diff changeset
799 break;
Nomad
parents:
diff changeset
800
2185
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
801 case 40029: pPlayers[uActiveCharacter]->SetPertified(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
802 case 40030: pPlayers[uActiveCharacter]->SetWeak(pParty->uTimePlayed); break;
2187
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
803 case 40031: pPlayers[uActiveCharacter]->SetPoisonSevere(pParty->uTimePlayed); break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
804 case 40032: pPlayers[uActiveCharacter]->SetPoisonMedium(pParty->uTimePlayed); break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
805 case 40033: pPlayers[uActiveCharacter]->SetPoisonWeak(pParty->uTimePlayed); break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
806 case 40034: pPlayers[uActiveCharacter]->SetDiseaseSevere(pParty->uTimePlayed); break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
807 case 40035: pPlayers[uActiveCharacter]->SetDiseaseMedium(pParty->uTimePlayed); break;
9856c2f8f918 CastSpell continue
Ritor1
parents: 2185
diff changeset
808 case 40036: pPlayers[uActiveCharacter]->SetDiseaseWeak(pParty->uTimePlayed); break;
2185
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
809 case 40037: pPlayers[uActiveCharacter]->SetCursed(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
810 case 40038: pPlayers[uActiveCharacter]->SetInsane(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
811 case 40039: pPlayers[uActiveCharacter]->SetDrunk(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
812 case 40040: pPlayers[uActiveCharacter]->SetUnconcious(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
813 case 40041: pPlayers[uActiveCharacter]->SetDead(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
814 case 40042: pPlayers[uActiveCharacter]->SetEradicated(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
815 case 40043: pPlayers[uActiveCharacter]->SetAsleep(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
816 case 40044: pPlayers[uActiveCharacter]->SetAfraid(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
817 case 40045: pPlayers[uActiveCharacter]->SetParalyzed(pParty->uTimePlayed); break;
385040580292 CastSpell continue
Ritor1
parents: 2155
diff changeset
818 case 40073: pPlayers[uActiveCharacter]->SetZombie(pParty->uTimePlayed); break;
1804
Nomad
parents:
diff changeset
819
Nomad
parents:
diff changeset
820 case 40062:
Nomad
parents:
diff changeset
821 pParty->alignment = PartyAlignment_Good;
Nomad
parents:
diff changeset
822 SetUserInterface(pParty->alignment, true);
Nomad
parents:
diff changeset
823 break;
Nomad
parents:
diff changeset
824 case 40063:
Nomad
parents:
diff changeset
825 pParty->alignment = PartyAlignment_Neutral;
Nomad
parents:
diff changeset
826 SetUserInterface(pParty->alignment, true);
Nomad
parents:
diff changeset
827 break;
Nomad
parents:
diff changeset
828 case 40064:
Nomad
parents:
diff changeset
829 pParty->alignment = PartyAlignment_Evil;
Nomad
parents:
diff changeset
830 SetUserInterface(pParty->alignment, true);
Nomad
parents:
diff changeset
831 break;
Nomad
parents:
diff changeset
832
Nomad
parents:
diff changeset
833
Nomad
parents:
diff changeset
834
Nomad
parents:
diff changeset
835 //SubMenu "Time"
Nomad
parents:
diff changeset
836 case 40009: pParty->uTimePlayed += Timer::Day; break;
Nomad
parents:
diff changeset
837 case 40010: pParty->uTimePlayed += Timer::Week; break;
Nomad
parents:
diff changeset
838 case 40011: pParty->uTimePlayed += Timer::Month; break;
Nomad
parents:
diff changeset
839 case 40012: pParty->uTimePlayed += Timer::Year; break;
Nomad
parents:
diff changeset
840
Nomad
parents:
diff changeset
841 //SubMenu "Items"
Nomad
parents:
diff changeset
842 case 40015: // uItemID_Rep_St == 1
Nomad
parents:
diff changeset
843 case 40016: // uItemID_Rep_St == 2
Nomad
parents:
diff changeset
844 case 40017: // uItemID_Rep_St == 3
Nomad
parents:
diff changeset
845 case 40018: // uItemID_Rep_St == 4
Nomad
parents:
diff changeset
846 case 40019: // uItemID_Rep_St == 5
Nomad
parents:
diff changeset
847 case 40020: // uItemID_Rep_St == 6
Nomad
parents:
diff changeset
848 {
Nomad
parents:
diff changeset
849 int pItemID = rand() % 500;
Nomad
parents:
diff changeset
850 for (uint i = 0; i < 500; ++i)
Nomad
parents:
diff changeset
851 {
Nomad
parents:
diff changeset
852 if (pItemID + i > 499)
Nomad
parents:
diff changeset
853 pItemID = 0;
Nomad
parents:
diff changeset
854 if (pItemsTable->pItems[pItemID + i].uItemID_Rep_St == (item_id - 40015 + 1))
Nomad
parents:
diff changeset
855 {
Nomad
parents:
diff changeset
856 pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
Nomad
parents:
diff changeset
857 break;
Nomad
parents:
diff changeset
858 }
Nomad
parents:
diff changeset
859 }
Nomad
parents:
diff changeset
860 }
Nomad
parents:
diff changeset
861 break;
Nomad
parents:
diff changeset
862
Nomad
parents:
diff changeset
863 case 40061:
Nomad
parents:
diff changeset
864 {
Nomad
parents:
diff changeset
865 int pItemID = rand() % 500;
Nomad
parents:
diff changeset
866 for (uint i = 0; i < 500; ++i)
Nomad
parents:
diff changeset
867 {
Nomad
parents:
diff changeset
868 if (pItemID + i > 499)
Nomad
parents:
diff changeset
869 pItemID = 0;
Nomad
parents:
diff changeset
870 if (pItemsTable->pItems[pItemID + i].uItemID_Rep_St > 6)
Nomad
parents:
diff changeset
871 {
Nomad
parents:
diff changeset
872 pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
Nomad
parents:
diff changeset
873 break;
Nomad
parents:
diff changeset
874 }
Nomad
parents:
diff changeset
875 }
Nomad
parents:
diff changeset
876 }
Nomad
parents:
diff changeset
877 break;
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
878 //SubMenu "Other"
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
879 case 40101: wizard_eye = true; break; //включить око чародея
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
880 case 40102: wizard_eye = false; break; //выключить око чародея
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
881 case 40103: pODMRenderParams->shading_dist_mist = 0x6000; break;//новая дальность отрисовки объектов
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
882 case 40104: pODMRenderParams->shading_dist_mist = 0x2000; break;////обычная дальность отрисовки объектов
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
883 case 40105: change_seasons = true; break; //включить смену времён года
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
884 case 40106: change_seasons = false; break; //выключить смену времён года
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
885 case 40107: all_magic = true; break; //включить все заклы(нажимать в окне создания группы)
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
886 case 40108: all_magic = false; break; //выключить все заклы
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
887 case 40109: debug_information = true; break; //включить информацию fps, положение группы, уровень пола и т.п.
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
888 case 40110: debug_information = false; break; //выключить информацию fps, положение группы, уровень пола и т.п.
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
889 case 40111: show_picked_face = true; break; //включить выделение активного фейса
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
890 case 40112: show_picked_face = false; break; //выключить выделение активного фейса
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
891 case 40113: draw_portals_loops = true; break; //включить отрисовку рамок порталов
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
892 case 40114: draw_portals_loops = false; break; //включить отрисовку рамок порталов
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
893 case 40115: new_speed = true; break; //включить двойную скорость
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
894 case 40116: new_speed = false; break; //включить двойную скорость
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
895 case 40117: bSnow = true; break; //включить снег
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
896 case 40118: bSnow = false; break; //включить снег
2320
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
897 case 40119: draw_terrain_dist_mist = true; break; //новая дальность отрисовки тайлов
847aba0b7f82 draw terrain distance
Ritor1
parents: 2277
diff changeset
898 case 40120: draw_terrain_dist_mist = false; break; //обычная дальность отрисовки тайлов
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
899
1804
Nomad
parents:
diff changeset
900 }
Nomad
parents:
diff changeset
901
Nomad
parents:
diff changeset
902 return true;
1924
8cd321994943 MSVS 2012 project file & some compilation warning fixes
Nomad
parents: 1830
diff changeset
903 }
2277
b9adf4f414f6 submenu Other
Ritor1
parents: 2253
diff changeset
904