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