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