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