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