Mercurial > mm7
annotate Game.cpp @ 2210:7d5c05264a0d
m
author | Ritor1 |
---|---|
date | Wed, 12 Feb 2014 20:51:31 +0600 |
parents | db94443ea4e7 |
children | e18200fcfb50 |
rev | line source |
---|---|
1016 | 1 #include "Vis.h" |
2121 | 2 #include "Weather.h" |
1016 | 3 #include "LightmapBuilder.h" |
4 #include "DecalBuilder.h" | |
5 #include "ParticleEngine.h" | |
6 #include "Mouse.h" | |
7 #include "Keyboard.h" | |
8 #include "CShow.h" | |
9 #include "GammaControl.h" | |
10 #include "stru6.h" | |
11 #include "stru9.h" | |
12 #include "stru10.h" | |
13 | |
0 | 14 #include "Game.h" |
15 #include "Party.h" | |
16 #include "Viewport.h" | |
2044 | 17 #include "Timer.h" |
0 | 18 #include "Outdoor.h" |
1277 | 19 #include "Outdoor_stuff.h" |
0 | 20 #include "Overlays.h" |
21 #include "AudioPlayer.h" | |
22 #include "LOD.h" | |
23 #include "GUIWindow.h" | |
24 #include "TurnEngine.h" | |
25 #include "VideoPlayer.h" | |
26 #include "Bink_Smacker.h" | |
27 #include "Events.h" | |
28 #include "Arcomage.h" | |
189 | 29 #include "texts.h" |
791 | 30 #include "GUIFont.h" |
194 | 31 #include "Log.h" |
1262 | 32 #include "Lights.h" |
33 #include "mm7_data.h" | |
1915 | 34 #include "MapInfo.h" |
35 #include "CastSpellInfo.h" | |
36 #include "FrameTableInc.h" | |
37 #include "Actor.h" | |
38 #include "Events2D.h" | |
39 #include "GUIProgressBar.h" | |
40 #include "ObjectList.h" | |
41 #include "Level/Decoration.h" | |
42 #include "PaletteManager.h" | |
43 #include "UI\UIHouses.h" | |
44 #include "SaveLoad.h" | |
45 #include "SpriteObject.h" | |
46 #include "mm7.h" | |
47 #include "Sprites.h" | |
0 | 48 |
49 | |
50 | |
51 | |
52 | |
53 Game *pGame; | |
54 | |
55 | |
56 | |
57 | |
58 | |
59 //----- (00435694) -------------------------------------------------------- | |
60 void Game::ToggleFlags2(unsigned int uFlag) | |
61 { | |
62 unsigned int v2; // eax@1 | |
63 | |
64 v2 = this->uFlags2; | |
65 if ( v2 & uFlag ) | |
66 this->uFlags2 = v2 & ~uFlag; | |
67 else | |
68 this->uFlags2 = uFlag | v2; | |
69 } | |
70 | |
71 //----- (0044103C) -------------------------------------------------------- | |
72 void Game::Draw() | |
73 { | |
142 | 74 //float v2; // ST24_4@11 |
0 | 75 //double v3; // ST28_8@11 |
76 int v4; // edi@26 | |
142 | 77 //int v5; // eax@35 |
0 | 78 |
1556 | 79 uFlags2 &= ~0x02; |
0 | 80 if ( pParty->_497FC5_check_party_perception_against_level() ) |
81 uFlags2 |= 2u; | |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1556
diff
changeset
|
82 |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
83 pGame->pIndoorCameraD3D->sRotationX = pParty->sRotationX; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
84 pGame->pIndoorCameraD3D->sRotationY = pParty->sRotationY; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
85 pGame->pIndoorCameraD3D->vPartyPos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * 3.141592653589 * pParty->sRotationY / 2048.0); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
86 pGame->pIndoorCameraD3D->vPartyPos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * 3.141592653589 * pParty->sRotationY / 2048.0); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
87 pGame->pIndoorCameraD3D->vPartyPos.z = pParty->vPosition.z + pParty->sEyelevel;//193, but real 353 |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1556
diff
changeset
|
88 |
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1556
diff
changeset
|
89 //pIndoorCamera->Initialize2(); |
1642 | 90 pIndoorCameraD3D->CalculateRotations(pParty->sRotationX, pParty->sRotationY); |
0 | 91 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff(); |
92 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum(); | |
93 | |
94 if ( pVideoPlayer->AnyMovieLoaded() ) | |
95 { | |
2154 | 96 /*if ( !pRenderer->pRenderD3D ) |
1421 | 97 { |
98 pRenderer->BeginSceneD3D(); | |
99 pMouse->DrawCursorToTarget(); | |
100 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); | |
2154 | 101 }*/ |
0 | 102 } |
103 else | |
104 { | |
1110 | 105 if ( pParty->vPosition.x != pParty->vPrevPosition.x || pParty->sRotationY != pParty->sPrevRotationY || pParty->vPosition.y != pParty->vPrevPosition.y |
106 || pParty->sRotationX != pParty->sPrevRotationX || pParty->vPosition.z != pParty->vPrevPosition.z || pParty->sEyelevel != pParty->sPrevEyelevel ) | |
0 | 107 pParty->uFlags |= 2u; |
847 | 108 pParty->vPrevPosition.x = pParty->vPosition.x; |
78 | 109 pParty->vPrevPosition.y = pParty->vPosition.y; |
847 | 110 pParty->vPrevPosition.z = pParty->vPosition.z; |
0 | 111 //v0 = &pRenderer; |
112 pParty->sPrevRotationY = pParty->sRotationY; | |
113 pParty->sPrevRotationX = pParty->sRotationX; | |
847 | 114 |
0 | 115 pParty->sPrevEyelevel = pParty->sEyelevel; |
116 pRenderer->BeginSceneD3D(); | |
117 | |
2154 | 118 //if ( !pRenderer->pRenderD3D ) |
119 //pMouse->DrawCursorToTarget(); | |
265 | 120 if ( !PauseGameDrawing() || viewparams->field_48 == 1 ) |
0 | 121 { |
2154 | 122 //if ( pRenderer->pRenderD3D ) |
0 | 123 { |
142 | 124 float v2 = (double)(((signed int)pMiscTimer->uTotalGameTimeElapsed >> 2) & 0x1F) * 0.032258064 * 6.0; |
0 | 125 //v3 = v2 + 6.7553994e15; |
126 //pRenderer->field_1036A8_bitmapid = LODWORD(v3); | |
265 | 127 pRenderer->hd_water_current_frame = floorf(v2 + 0.5f); |
0 | 128 } |
129 | |
130 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
131 pIndoor->Draw(); | |
132 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
133 pOutdoor->Draw(); | |
1545 | 134 else Error("Invalid level type: %u", uCurrentlyLoadedLevelType); |
0 | 135 |
2154 | 136 //if (pRenderer->pRenderD3D) |
0 | 137 { |
138 pDecalBuilder->DrawBloodsplats(); | |
1394 | 139 pGame->pLightmapBuilder->DrawLightmapsType(2); |
0 | 140 } |
141 } | |
1421 | 142 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); |
0 | 143 } |
791 | 144 |
145 //DEBUG: force redraw gui | |
146 viewparams->bRedrawGameUI = true; | |
147 | |
148 | |
0 | 149 pRenderer->BeginScene(); |
2154 | 150 //if (pRenderer->pRenderD3D) |
0 | 151 pMouse->DrawCursorToTarget(); |
142 | 152 if (pOtherOverlayList->bRedraw) |
153 viewparams->bRedrawGameUI = true; | |
0 | 154 v4 = viewparams->bRedrawGameUI; |
783 | 155 GameUI_Footer(); |
0 | 156 if (!viewparams->bRedrawGameUI) |
157 GameUI_DrawRightPanelItems(); | |
158 else | |
159 { | |
160 GameUI_DrawRightPanelFrames(); | |
783 | 161 GameUI_Footer_2(); |
0 | 162 viewparams->bRedrawGameUI = false; |
163 } | |
2142
ca548138d6aa
some code cleaning in video playing, loops play but there is a memory leak
zipi
parents:
2137
diff
changeset
|
164 if (!pVideoPlayer->pMovie)//!pVideoPlayer->pSmackerMovie) |
0 | 165 { |
2070 | 166 GameUI_DrawMinimap(488, 16, 625, 133, viewparams->uMinimapZoom, true);//redraw = pParty->uFlags & 2); |
0 | 167 if (v4) |
168 { | |
2154 | 169 if ( !PauseGameDrawing() /*&& pRenderer->pRenderD3D*/) // clear game viewport with transparent color |
693 | 170 pRenderer->FillRectFast(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pViewport->uViewportBR_X - pViewport->uViewportTL_X, |
171 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1, | |
2155 | 172 0x7FF); |
0 | 173 viewparams->field_48 = 0; |
174 } | |
175 } | |
142 | 176 |
177 viewparams->bRedrawGameUI = pOtherOverlayList->bRedraw; | |
178 pOtherOverlayList->bRedraw = 0; | |
179 | |
0 | 180 GameUI_DrawPartySpells(); |
291 | 181 if (v4 || pParty->pHirelings[0].evt_C || pParty->pHirelings[1].evt_C ) |
994 | 182 GameUI_DrawHiredNPCs(); |
0 | 183 GameUI_DrawPortraits(v4); |
184 GameUI_DrawLifeManaBars(); | |
185 GameUI_DrawCharacterSelectionFrame(); | |
2205 | 186 if ( _44100D_should_alter_right_panel() ) |
994 | 187 GameUI_DrawRightPanel(); |
0 | 188 if ( !pVideoPlayer->AnyMovieLoaded() ) |
189 { | |
190 pStru6Instance->DrawPlayerBuffAnims(); | |
569 | 191 pOtherOverlayList->DrawTurnBasedIcon(v4); |
0 | 192 GameUI_DrawTorchlightAndWizardEye(); |
193 } | |
791 | 194 |
794 | 195 |
196 static bool render_framerate = false; | |
197 static float framerate = 0.0f; | |
198 static uint frames_this_second = 0; | |
199 static uint last_frame_time = GetTickCount(); | |
200 static uint framerate_time_elapsed = 0; | |
2123 | 201 if ( pCurrentScreen == SCREEN_GAME && uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
2122 | 202 pWeather->Draw();//Ritor1: my include |
794 | 203 |
1980 | 204 uint frame_dt = GetTickCount() - last_frame_time; |
794 | 205 last_frame_time = GetTickCount(); |
206 | |
207 framerate_time_elapsed += frame_dt; | |
208 if (framerate_time_elapsed >= 1000) | |
209 { | |
210 framerate = frames_this_second * (1000.0f / framerate_time_elapsed); | |
211 | |
212 framerate_time_elapsed = 0; | |
213 frames_this_second = 0; | |
214 render_framerate = true; | |
215 } | |
216 | |
217 ++frames_this_second; | |
218 | |
1507 | 219 extern bool debug_information; |
220 if ( debug_information ) | |
794 | 221 { |
1507 | 222 if (render_framerate) |
223 { | |
224 sprintf(pTmpBuf.data(), "FPS: % .4f", framerate); | |
2069 | 225 pPrimaryWindow->DrawText(pFontArrus, 494, 0, Color16(0, 0, 0), pTmpBuf.data(), 0, 0, 0); |
1507 | 226 } |
794 | 227 |
1507 | 228 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
229 { | |
1980 | 230 int sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); |
1507 | 231 sprintf(pTmpBuf.data(), "Party Sector ID: %u/%u\n", sector_id, pIndoor->uNumSectors); |
2069 | 232 pPrimaryWindow->DrawText(pFontArrus, 16, 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, -1); |
1507 | 233 } |
234 sprintf(pTmpBuf.data(), "Party Position: % d % d % d", pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); | |
2069 | 235 pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, -1); |
1507 | 236 |
237 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
238 { | |
239 uint uFaceID; | |
1980 | 240 int sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); |
241 int floor_level = BLV_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + 40, sector_id, &uFaceID); | |
1507 | 242 sprintf(pTmpBuf.data(), "BLV_GetFloorLevel: %d face_id %d\n", floor_level, uFaceID); |
243 } | |
244 else | |
245 { | |
246 int on_water, _a6; | |
1980 | 247 int floor_level = ODM_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z, 0, &on_water, &_a6, false); |
1507 | 248 sprintf(pTmpBuf.data(), "ODM_GetFloorLevel: %d on_water: %s a6 = %d\n", floor_level, on_water ? "true" : "false", _a6); |
249 } | |
2069 | 250 pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16 + 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, -1); |
791 | 251 } |
252 | |
0 | 253 GUI_UpdateWindows(); |
130 | 254 pParty->UpdatePlayersAndHirelingsEmotions(); |
937 | 255 |
434 | 256 _unused_5B5924_is_travel_ui_drawn = false; |
0 | 257 if (v4) |
791 | 258 pMouse->bRedraw = true; |
0 | 259 pMouse->_469EA4(); |
260 pMouse->DrawCursor(); | |
261 pMouse->_469E1C(); | |
262 pRenderer->EndScene(); | |
263 pRenderer->Present(); | |
569 | 264 pParty->uFlags &= ~2; |
0 | 265 } |
266 | |
267 //----- (0047A815) -------------------------------------------------------- | |
268 void Game::DrawParticles() | |
269 { | |
270 pParticleEngine->Draw(); | |
271 } | |
272 | |
273 //----- (00463149) -------------------------------------------------------- | |
274 void Game::Loop() | |
275 { | |
276 const char *pLocationName; // [sp-4h] [bp-68h]@74 | |
277 bool bLoading; // [sp+10h] [bp-54h]@1 | |
278 signed int v16; // [sp+14h] [bp-50h]@8 | |
279 MSG Msg; // [sp+28h] [bp-3Ch]@20 | |
280 char Source[64]; // [sp+44h] [bp-20h]@76 | |
281 | |
2006 | 282 bLoading = sCurrentMenuID == MENU_LoadingProcInMainMenu; |
0 | 283 SetCurrentMenuID((MENU_STATE)-1); |
2126 | 284 if (bLoading) |
0 | 285 { |
286 pParty->Reset(); | |
982 | 287 uGameState = GAME_STATE_PLAYING; |
0 | 288 LoadGame(uLoadGameUI_SelectedSlot); |
289 } | |
290 | |
291 for (uint i = 1; i < 5; ++i) | |
292 for (uint j = 1; j < 6; ++j) | |
293 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1165
diff
changeset
|
294 sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1165
diff
changeset
|
295 remove(pTmpBuf.data()); |
0 | 296 } |
297 | |
298 LoadPlayerPortraintsAndVoices(); | |
783 | 299 pIcons_LOD->_inlined_sub1(); |
328 | 300 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); |
0 | 301 |
302 while ( 2 ) | |
303 { | |
304 v16 = 1; | |
783 | 305 pMessageQueue_50CBD0->Flush(); |
0 | 306 |
307 pPartyActionQueue->uNumActions = 0; | |
308 if (pParty->bTurnBasedModeOn) | |
309 { | |
310 pTurnEngine->End(false); | |
311 pParty->bTurnBasedModeOn = false; | |
312 } | |
313 DoPrepareWorld(bLoading, 1); | |
314 pEventTimer->Resume(); | |
2061 | 315 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME; |
0 | 316 // uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0; |
151 | 317 pCurrentScreen = SCREEN_GAME; |
1038 | 318 |
2154 | 319 //if ( pRenderer->pRenderD3D ) |
0 | 320 pGame->pVisInstance->_4C1A02(); |
982 | 321 |
322 bool game_finished = false; | |
0 | 323 do |
324 { | |
325 while ( PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE) ) | |
326 { | |
327 if ( Msg.message == WM_QUIT ) | |
328 Game_DeinitializeAndTerminate(0); | |
329 TranslateMessage(&Msg); | |
330 DispatchMessageA(&Msg); | |
331 } | |
2061 | 332 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE) |
0 | 333 { |
334 WaitMessage(); | |
335 continue; | |
336 } | |
337 pGame->_44EEA7(); | |
338 GameUI_WritePointedObjectStatusString(); | |
339 ProcessInputActions(); | |
340 GameUI_MsgProc(); | |
341 if ( pArcomageGame->bGameInProgress ) | |
342 { | |
343 ArcomageGame::Loop(); | |
344 pRenderer->Present(); | |
345 continue; | |
346 } | |
1802 | 347 |
348 pVideoPlayer->_inlined_in_463149(); | |
983 | 349 |
350 pEventTimer->Update(); | |
351 pMiscTimer->Update(); | |
352 | |
0 | 353 OnTimer(0); |
354 GameUI_StatusBar_UpdateTimedString(0); | |
355 if ( pMiscTimer->bPaused && !pEventTimer->bPaused ) | |
356 pMiscTimer->Resume(); | |
357 if ( pEventTimer->bTackGameTime && !pParty->bTurnBasedModeOn ) | |
358 pEventTimer->bTackGameTime = 0; | |
982 | 359 if ( !pEventTimer->bPaused && uGameState == GAME_STATE_PLAYING) |
0 | 360 { |
361 if ( !pEventTimer->bTackGameTime ) | |
362 _494035_timed_effects__water_walking_damage__etc(); | |
2061 | 363 |
364 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0001) | |
365 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0001; | |
0 | 366 else |
367 { | |
783 | 368 UpdateActorAI(); |
369 UpdateUserInput_and_MapSpecificStuff(); | |
0 | 370 } |
371 } | |
372 if ( v16 ) | |
373 { | |
374 v16 = 0; | |
375 viewparams->bRedrawGameUI = true; | |
376 } | |
378 | 377 pAudioPlayer->UpdateSounds(); |
2124 | 378 if ( (signed int)uGameState == GAME_STATE_PLAYING ) |
379 { | |
380 pGame->Draw(); | |
381 continue; | |
382 } | |
978 | 383 if (uGameState == GAME_FINISHED) |
4 | 384 { |
982 | 385 game_finished = true; |
0 | 386 continue; |
4 | 387 } |
2124 | 388 if (uGameState == GAME_STATE_CHANGE_LOCATION)// ñìåíà ëîêàöèè |
0 | 389 { |
390 pAudioPlayer->StopChannels(-1, -1); | |
391 PrepareWorld(0); | |
982 | 392 uGameState = GAME_STATE_PLAYING; |
0 | 393 continue; |
394 } | |
2132 | 395 if ( (signed int)uGameState <= GAME_STATE_5 || uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU )//GAME_STATE_NEWGAME_OUT_GAMEMENU, GAME_STATE_LOADING_GAME |
4 | 396 { |
2124 | 397 game_finished = true; |
0 | 398 continue; |
4 | 399 } |
2124 | 400 if ( uGameState == GAME_STATE_FINAL_WINDOW ) |
0 | 401 { |
2124 | 402 pRenderer->BeginScene(); |
403 GUI_UpdateWindows(); | |
404 pRenderer->EndScene(); | |
405 pRenderer->Present(); | |
0 | 406 continue; |
407 } | |
981 | 408 if ( uGameState != GAME_STATE_PARTY_DIED ) |
0 | 409 { |
2124 | 410 pGame->Draw(); |
411 continue; | |
412 } | |
413 if ( uGameState == GAME_STATE_PARTY_DIED ) | |
414 { | |
415 pAudioPlayer->StopChannels(-1, -1); | |
416 memset(&pParty->pHirelings[0], 0, 0x4Cu); | |
417 memset(&pParty->pHirelings[1], 0, 0x4Cu); | |
418 for ( int i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i ) | |
0 | 419 { |
2124 | 420 if ( pNPCStats->pNewNPCData[i].field_24 ) |
421 pNPCStats->pNewNPCData[i].uFlags &= 0xFFFFFF7Fu; | |
422 } | |
423 pVideoPlayer->PlayDeathMovie(); | |
424 if ( pVideoPlayer->AnyMovieLoaded() ) | |
425 pVideoPlayer->Unload(); | |
426 SaveGame(0, 0); | |
427 ++pParty->uNumDeaths; | |
428 for ( uint i = 0; i < 4; ++i ) | |
429 pParty->pPlayers[i].SetVariable(VAR_Award, 85); | |
430 pParty->days_played_without_rest = 0; | |
431 pParty->uTimePlayed += 0x276000ui64; | |
432 LOWORD(pParty->uFlags) &= ~0x204; | |
433 pParty->SetGold(0); | |
434 pOtherOverlayList->Reset(); | |
435 memset(pParty->pPartyBuffs.data(), 0, 0x140u); | |
436 | |
437 if ( pParty->bTurnBasedModeOn == 1 ) | |
438 { | |
439 pTurnEngine->End(true); | |
440 pParty->bTurnBasedModeOn = 0; | |
441 } | |
442 for( int i = 0; i < 4; ++i) | |
443 { | |
444 memset(pParty->pPlayers[i].pConditions.data(), 0, 0xA0u);//(pConditions, 0, 160) | |
445 memset(pParty->pPlayers[i].pPlayerBuffs.data(), 0, 0x180u);//(pPlayerBuffs[0], 0, 384) | |
446 pParty->pPlayers[i].sHealth = 1; | |
447 uActiveCharacter = 1; | |
448 } | |
449 if (_449B57_test_bit(pParty->_quest_bits, PARTY_QUEST_FINISHED_EMERALD_ISLE)) | |
450 { | |
451 pParty->vPosition.x = -17331; // respawn in harmondale | |
452 pParty->vPosition.y = 12547; | |
453 pParty->vPosition.z = 465; | |
454 pParty->sRotationY = 0; | |
455 pLocationName = "out02.odm"; | |
0 | 456 } |
981 | 457 else |
458 { | |
2124 | 459 pParty->vPosition.x = 12552; // respawn on emerald isle |
460 pParty->vPosition.y = 1816; | |
461 pParty->vPosition.z = 0; | |
462 pParty->sRotationY = 512; | |
463 pLocationName = "out01.odm"; | |
0 | 464 } |
2124 | 465 strcpy(Source, pLocationName); |
466 pParty->uFallStartY = pParty->vPosition.z; | |
467 pParty->sRotationX = 0; | |
468 pParty->uFallSpeed = 0; | |
469 pParty->field_6E4 = 0; | |
470 pParty->field_6E0 = 0; | |
471 if ( _stricmp(Source, pCurrentMapName) ) | |
472 { | |
473 strcpy(pCurrentMapName, Source); | |
474 _5B65A8_npcdata_uflags_or_other = pParty->vPosition.x; | |
475 _5B65AC_npcdata_fame_or_other = pParty->vPosition.y; | |
476 _5B65B0_npcdata_rep_or_other = pParty->vPosition.z; | |
477 _5B65B4_npcdata_loword_house_or_other = pParty->sRotationY; | |
478 _5B65B8_npcdata_hiword_house_or_other = pParty->sRotationX; | |
479 dword_5B65C0 = 1; | |
480 PrepareWorld(1); | |
481 } | |
482 InitializeActors(); | |
981 | 483 |
2124 | 484 int num_conscious_players = 0; |
485 int conscious_players_ids[4] = {-1, -1, -1, -1}; | |
486 for (int i = 0; i < 4; ++i) | |
487 { | |
488 if (pParty->pPlayers[i].CanAct()) | |
489 conscious_players_ids[num_conscious_players++] = i; | |
490 } | |
491 if (num_conscious_players) | |
492 { | |
493 int idx = conscious_players_ids[rand() % num_conscious_players]; | |
494 Assert(idx >= 0); | |
495 pParty->pPlayers[idx].PlaySound(SPEECH_99, 0); | |
496 } | |
497 | |
498 ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2);// "Once again you've cheated death!.." "Âû ñíîâà îáõèòðèëè ñìåðòü! …" | |
499 uGameState = GAME_STATE_PLAYING; | |
0 | 500 } |
501 } | |
982 | 502 while (!game_finished); |
503 | |
0 | 504 pEventTimer->Pause(); |
505 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); | |
1214
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
506 if ( uGameState == GAME_STATE_LOADING_GAME ) |
0 | 507 { |
508 sub_491E3A(); | |
509 LoadPlayerPortraintsAndVoices(); | |
982 | 510 uGameState = GAME_STATE_PLAYING; |
0 | 511 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles; |
512 bLoading = true; | |
513 continue; | |
514 } | |
515 break; | |
516 } | |
151 | 517 pCurrentScreen = SCREEN_VIDEO; |
0 | 518 sub_491E3A(); |
519 } | |
520 | |
521 | |
522 //----- (0044F192) -------------------------------------------------------- | |
523 void Game::PrepareBloodsplats() | |
524 { | |
525 for (uint i = 0; i < uNumBloodsplats; ++i) | |
526 { | |
2210 | 527 pBloodsplatContainer->AddBloodsplat(pBloodsplats[i].x, pBloodsplats[i].y, pBloodsplats[i].z, |
528 pBloodsplats[i].radius, pBloodsplats[i].r, pBloodsplats[i].g, pBloodsplats[i].b); | |
0 | 529 } |
530 } | |
531 | |
532 | |
533 //----- (0044F120) -------------------------------------------------------- | |
534 void Game::PushStationaryLights(int a2) | |
535 { | |
1094 | 536 Game__StationaryLight* pLight; |
537 | |
538 for( int i=0; i<uNumStationaryLights; ++i ) | |
539 { | |
540 pLight=&pStationaryLights[i]; | |
2210 | 541 pStationaryLightsStack->AddLight(pLight->vPosition.x, pLight->vPosition.y, pLight->vPosition.z, |
542 pLight->flt_18, pLight->vRGBColor.x, pLight->vRGBColor.y, pLight->vRGBColor.z, _4E94D0_light_type); | |
1094 | 543 } |
0 | 544 } |
2154 | 545 // 4E94D0: using guessed type char _4E94D0_light_type; |
0 | 546 |
547 //----- (0044F0FD) -------------------------------------------------------- | |
548 void Game::_44F0FD() | |
549 { | |
550 ToggleFlags(0x40u); | |
551 | |
552 if ( !(uFlags & 0x40) ) | |
553 { | |
554 uNumBloodsplats = 0; | |
555 field_E0C = 0; | |
556 } | |
557 } | |
558 | |
559 //----- (0044F0D8) -------------------------------------------------------- | |
560 void Game::ToggleFlags(uint uMask) | |
561 { | |
562 if (uFlags & uMask) | |
563 uFlags &= ~uMask; | |
564 else | |
565 uFlags |= uMask; | |
566 } | |
567 | |
568 | |
569 //----- (0044F07B) -------------------------------------------------------- | |
570 bool Game::_44F07B() | |
571 { | |
2210 | 572 if (!pKeyboardInstance->IsKeyBeingHeld(VK_SHIFT) && !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) && |
573 !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) || (pKeyboardInstance->WasKeyPressed(VK_F11) == 0 && | |
0 | 574 pKeyboardInstance->WasKeyPressed(VK_F11))) |
575 return true; | |
576 return false; | |
577 } | |
578 | |
579 //----- (0044EEA7) -------------------------------------------------------- | |
580 bool Game::_44EEA7() | |
581 { | |
582 //Game *v1; // esi@1 | |
194 | 583 //double v2; // st7@2 |
0 | 584 float depth; // ST00_4@9 |
194 | 585 //bool result; // eax@9 |
0 | 586 unsigned int v5; // eax@14 |
587 __int64 v6; // kr00_8@21 | |
588 unsigned int y; // [sp+4h] [bp-24h]@2 | |
589 unsigned int x; // [sp+8h] [bp-20h]@2 | |
194 | 590 Vis_SelectionFilter *v10; // [sp+10h] [bp-18h]@2 |
591 Vis_SelectionFilter *v11; // [sp+14h] [bp-14h]@2 | |
0 | 592 POINT a2; // [sp+20h] [bp-8h]@1 |
593 | |
594 //v1 = this; | |
595 ++qword_5C6DF0; | |
596 pParticleEngine->UpdateParticles(); | |
597 pMouseInstance->GetCursorPos(&a2); | |
194 | 598 |
599 x = a2.y; | |
600 y = a2.x; | |
0 | 601 if ( sub_4637E0_is_there_popup_onscreen() ) |
602 { | |
194 | 603 v11 = &vis_face_filter; |
604 v10 = &vis_sprite_filter_2; | |
871 | 605 depth = pGame->pIndoorCameraD3D->GetPickDepth(); |
0 | 606 } |
607 else | |
608 { | |
592 | 609 if ( uFlags2 & GAME_FLAGS_2_TARGETING_MODE ) |
0 | 610 { |
194 | 611 v11 = &vis_face_filter; |
612 v10 = &vis_sprite_filter_1; | |
0 | 613 } |
614 else | |
615 { | |
194 | 616 v11 = &vis_face_filter; |
617 v10 = &vis_sprite_filter_4; | |
0 | 618 } |
194 | 619 depth = 5120.0; |
0 | 620 } |
194 | 621 //depth = v2; |
0 | 622 |
323 | 623 PickMouse(depth, y, x, false, v10, v11); |
0 | 624 pLightmapBuilder->std__vector_000004_size = 0; |
625 pLightmapBuilder->std__vector_183808_size = 0; | |
626 pDecalBuilder->std__vector_pDecals_size = 0; | |
627 pDecalBuilder->field_308008 = 0; | |
194 | 628 if (!_44F07B()) |
629 return false; | |
630 | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
631 if ( uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS) |
794 | 632 pStru10Instance->bDoNotDrawPortalFrustum = false; |
2154 | 633 if ( /*pRenderer->pRenderD3D &&*/ uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
0 | 634 { |
635 v5 = GetLevelFogColor(); | |
636 pRenderer->uFogColor = v5 & 0xFFFFFF; | |
637 } | |
638 if (uFlags & 0x0400) | |
639 uFlags2 |= 0x01; | |
2154 | 640 /*if ( !pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor && pMobileLightsStack->uNumLightsActive ) |
0 | 641 { |
642 uFlags2 |= 0x01; | |
643 field_E10 = qword_5C6DF0; | |
2154 | 644 }*/ |
0 | 645 v6 = qword_5C6DF0 - field_E10; |
646 if ( qword_5C6DF0 - field_E10 == 1 ) | |
647 uFlags2 |= v6; | |
648 if (uNumStationaryLights_in_pStationaryLightsStack != pStationaryLightsStack->uNumLightsActive ) | |
649 { | |
2210 | 650 uFlags2 |= 1; |
0 | 651 uNumStationaryLights_in_pStationaryLightsStack = pStationaryLightsStack->uNumLightsActive; |
652 } | |
653 _44E904(); | |
194 | 654 return true; |
0 | 655 } |
656 | |
657 | |
658 //----- (0044EDE4) -------------------------------------------------------- | |
2006 | 659 bool Game::AlterGamma_BLV(BLVFace *pFace, signed int *pColor) |
0 | 660 { |
638 | 661 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS && |
662 pFace->uAttributes & FACE_CAN_SATURATE_COLOR) | |
0 | 663 { |
664 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0); | |
665 return true; | |
666 } | |
667 else | |
668 return false; | |
669 } | |
670 | |
671 //----- (0044EE30) -------------------------------------------------------- | |
2006 | 672 bool Game::AlterGamma_ODM(ODMFace *pFace, signed int *pColor) |
0 | 673 { |
638 | 674 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS && |
675 pFace->uAttributes & FACE_CAN_SATURATE_COLOR) | |
0 | 676 { |
638 | 677 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0); |
0 | 678 return true; |
679 } | |
680 else | |
681 return false; | |
682 } | |
683 | |
684 | |
685 //----- (004645FA) -------------------------------------------------------- | |
686 void Game::Deinitialize() | |
687 { | |
2155 | 688 WriteWindowsRegistryInt("startinwindow", 1);//pRenderer->bWindowMode); |
689 //if (pRenderer->bWindowMode) | |
0 | 690 { |
2052 | 691 WriteWindowsRegistryInt("window X", window->GetX()); |
692 WriteWindowsRegistryInt("window Y", window->GetY()); | |
1984 | 693 } |
0 | 694 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); |
695 pItemsTable->Release(); | |
696 pNPCStats->Release(); | |
1038 | 697 |
0 | 698 if (pMouse) |
699 pMouse->Deactivate(); | |
700 | |
1093 | 701 delete pRenderer; |
0 | 702 pAudioPlayer->Release();//error |
703 pNew_LOD->FreeSubIndexAndIO(); | |
704 pGames_LOD->FreeSubIndexAndIO(); | |
705 ClipCursor(0); | |
706 Game::Destroy(); | |
707 } | |
708 | |
709 //----- (0044EE7C) -------------------------------------------------------- | |
710 bool Game::draw_debug_outlines() | |
711 { | |
712 if (uFlags & 0x04) | |
713 { | |
714 pLightmapBuilder->DrawDebugOutlines(-1); | |
715 pDecalBuilder->DrawDecalDebugOutlines(); | |
716 } | |
717 return true; | |
718 } | |
719 | |
720 //----- (0044EC23) -------------------------------------------------------- | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1277
diff
changeset
|
721 int Game::_44EC23(struct Polygon *a2, int *a3, signed int a4) |
0 | 722 { |
723 double v4; // st7@4 | |
724 //double v5; // ST00_8@4 | |
725 signed int v6; // eax@5 | |
726 //double v7; // ST00_8@6 | |
727 signed int result; // eax@8 | |
728 //double v9; // ST00_8@9 | |
729 //double v10; // ST00_8@11 | |
730 float a2a; // [sp+14h] [bp+8h]@4 | |
731 float a3a; // [sp+18h] [bp+Ch]@4 | |
732 float a3b; // [sp+18h] [bp+Ch]@6 | |
733 float a4a; // [sp+1Ch] [bp+10h]@9 | |
734 float a4b; // [sp+1Ch] [bp+10h]@11 | |
735 | |
736 if ( this->uFlags2 & 2 && a2->field_59 == 5 && a2->pODMFace->uAttributes & 2 ) | |
737 { | |
738 v4 = (double)a4; | |
739 a2a = v4; | |
740 *a3 |= 2u; | |
741 a3a = (1.0 - this->fSaturation) * v4; | |
742 //v5 = a3a + 6.7553994e15; | |
743 //if ( SLODWORD(v5) >= 0 ) | |
744 if (floorf(a3a + 0.5f) >= 0 ) | |
745 { | |
746 a3b = (1.0 - this->fSaturation) * a2a; | |
747 //v7 = a3b + 6.7553994e15; | |
748 //v6 = LODWORD(v7); | |
749 v6 = floorf(a3b + 0.5f); | |
750 } | |
751 else | |
752 v6 = 0; | |
753 if ( a4 >= v6 ) | |
754 { | |
755 a4a = (1.0 - fSaturation) * a2a; | |
756 //v9 = a4a + 6.7553994e15; | |
757 //if ( SLODWORD(v9) >= 0 ) | |
758 if (floorf(a4a + 0.5f) >= 0) | |
759 { | |
760 a4b = (1.0 - fSaturation) * a2a; | |
761 //v10 = a4b + 6.7553994e15; | |
762 //result = LODWORD(v10); | |
763 result = floorf(a4b + 0.5f); | |
764 } | |
765 else | |
766 result = 0; | |
767 } | |
768 else | |
769 result = a4; | |
770 } | |
771 else | |
772 result = -1; | |
773 return result; | |
774 } | |
775 | |
776 | |
777 | |
778 //----- (00465C8B) -------------------------------------------------------- | |
779 Game *Game::Create() | |
780 { | |
781 return new Game; | |
782 } | |
783 | |
784 //----- (00465CF3) -------------------------------------------------------- | |
785 void Game::Destroy() | |
786 { | |
787 if (pGame) | |
788 delete pGame; | |
789 pGame = nullptr; | |
790 } | |
791 | |
792 //----- (0044ED0A) -------------------------------------------------------- | |
793 signed int Game::_44ED0A(BLVFace *a2, int *a3, signed int a4) | |
794 { | |
795 double v4; // st7@3 | |
796 //double v5; // ST00_8@3 | |
797 signed int v6; // eax@4 | |
798 //double v7; // ST00_8@5 | |
799 signed int result; // eax@7 | |
800 //double v9; // ST00_8@8 | |
801 //double v10; // ST00_8@10 | |
802 float v11; // [sp+14h] [bp+8h]@3 | |
803 float v12; // [sp+18h] [bp+Ch]@3 | |
804 float v13; // [sp+18h] [bp+Ch]@5 | |
805 float v14; // [sp+1Ch] [bp+10h]@8 | |
806 float v15; // [sp+1Ch] [bp+10h]@10 | |
807 | |
808 if ( this->uFlags2 & 2 && a2->uAttributes & 2 ) | |
809 { | |
810 v4 = (double)a4; | |
811 v11 = v4; | |
812 *a3 |= 2u; | |
813 v12 = (1.0 - this->fSaturation) * v4; | |
814 //v5 = v12 + 6.7553994e15; | |
815 if (floorf(v12 + 0.5f)/* SLODWORD(v5)*/ >= 0 ) | |
816 { | |
817 v13 = (1.0 - this->fSaturation) * v11; | |
818 //v7 = v13 + 6.7553994e15; | |
819 //v6 = LODWORD(v7); | |
820 v6 = floorf(v13 + 0.5f); | |
821 } | |
822 else | |
823 v6 = 0; | |
824 if ( a4 >= v6 ) | |
825 { | |
826 v14 = (1.0 - fSaturation) * v11; | |
827 //v9 = v14 + 6.7553994e15; | |
828 if (floorf(v14 + 0.5f)/* SLODWORD(v9)*/ >= 0 ) | |
829 { | |
830 v15 = (1.0 - fSaturation) * v11; | |
831 //v10 = v15 + 6.7553994e15; | |
832 //result = LODWORD(v10); | |
833 result = floorf(v15 + 0.5f); | |
834 } | |
835 else | |
836 result = 0; | |
837 } | |
838 else | |
839 result = a4; | |
840 } | |
841 else | |
842 result = -1; | |
843 return result; | |
844 } | |
845 | |
846 | |
847 //----- (0044E4B7) -------------------------------------------------------- | |
848 Game::Game() | |
849 { | |
850 uNumStationaryLights = 0; | |
851 uNumBloodsplats = 0; | |
852 field_E0C = 0; | |
853 field_E10 = 0; | |
854 uNumStationaryLights_in_pStationaryLightsStack = 0; | |
855 bGammaControlInitialized = false; | |
856 uFlags = 0; | |
857 uFlags2 = 0; | |
858 uSomeGammaStartTime = 0; | |
859 uSomeGammaDeltaTime = 0; | |
860 | |
1397 | 861 //pThreadWardInstance = new ThreadWard; |
862 pThreadWardInstance = nullptr; | |
0 | 863 pParticleEngine = new ParticleEngine; |
1802 | 864 pMouse = pMouseInstance = new Mouse; |
0 | 865 pLightmapBuilder = new LightmapBuilder; |
866 pVisInstance = new Vis; | |
867 pStru6Instance = new stru6; | |
868 pIndoorCameraD3D = new IndoorCameraD3D; | |
869 pStru9Instance = new stru9; | |
870 pStru10Instance = new stru10; | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1277
diff
changeset
|
871 //pStru11Instance = new stru11; |
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1277
diff
changeset
|
872 pStru11Instance = nullptr; |
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1277
diff
changeset
|
873 //pStru12Instance = new stru12(pStru11Instance); |
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1277
diff
changeset
|
874 pStru12Instance = nullptr; |
1397 | 875 //pCShow = new CShow; |
876 pCShow = nullptr; | |
0 | 877 pKeyboardInstance = new Keyboard; |
878 pGammaController = new GammaController; | |
879 | |
880 uFlags |= 0x0800; | |
881 uFlags2 |= 0x24; | |
882 | |
883 _44F0FD(); | |
884 } | |
885 | |
886 //----- (0044E7F3) -------------------------------------------------------- | |
887 Game::~Game() | |
888 { | |
889 if (pGammaController) | |
890 delete pGammaController; | |
891 if (pKeyboardInstance) | |
892 delete pKeyboardInstance; | |
1397 | 893 /*if (pCShow) |
0 | 894 delete pCShow; |
895 if (pStru12Instance) | |
896 delete pStru12Instance; | |
897 if (pStru11Instance) | |
1397 | 898 delete pStru11Instance;*/ |
0 | 899 if (pStru10Instance) |
900 delete pStru10Instance; | |
901 if (pStru9Instance) | |
902 delete pStru9Instance; | |
903 if (pIndoorCameraD3D) | |
904 delete pIndoorCameraD3D; | |
905 if (pStru6Instance) | |
906 delete pStru6Instance; | |
907 if (pVisInstance) | |
908 delete pVisInstance; | |
909 if (pLightmapBuilder) | |
910 delete pLightmapBuilder; | |
911 if (pMouseInstance) | |
912 delete pMouseInstance; | |
913 if (pParticleEngine) | |
914 delete pParticleEngine; | |
1397 | 915 //if (pThreadWardInstance) |
916 // delete pThreadWardInstance; | |
0 | 917 } |
918 | |
919 //----- (0044E904) -------------------------------------------------------- | |
920 void Game::_44E904() | |
921 { | |
922 //Game *v1; // esi@1 | |
923 unsigned __int64 v2; // qax@1 | |
924 unsigned int v3; // ecx@1 | |
925 int v4; // edi@1 | |
926 unsigned __int8 v5; // cf@7 | |
927 double v6; // st7@13 | |
928 double v7; // st7@15 | |
929 signed __int64 v8; // [sp+Ch] [bp-8h]@1 | |
930 | |
931 //v1 = this; | |
932 v2 = pEventTimer->Time(); | |
933 v4 = (v2 - uSomeGammaStartTime) >> 32; | |
934 v3 = v2 - LODWORD(uSomeGammaStartTime); | |
935 v8 = v2 - uSomeGammaStartTime; | |
936 if ( v4 < 0 | |
937 || SHIDWORD(v2) < ((unsigned int)v2 < LODWORD(uSomeGammaStartTime)) + HIDWORD(uSomeGammaStartTime) | v4 == 0 | |
938 && v3 <= 0x80 ) | |
939 { | |
1421 | 940 if ( v4 < 0 ) |
941 { | |
942 v3 = 0; | |
943 v4 = 0; | |
944 uSomeGammaStartTime = v2; | |
945 v8 = __PAIR__(v4, v3); | |
946 } | |
0 | 947 } |
948 else | |
949 { | |
950 if ( uSomeGammaDeltaTime ) | |
951 { | |
952 LODWORD(uSomeGammaDeltaTime) = 0; | |
953 HIDWORD(uSomeGammaDeltaTime) = 0; | |
954 } | |
955 else | |
956 { | |
957 LODWORD(uSomeGammaDeltaTime) = v3; | |
958 HIDWORD(uSomeGammaDeltaTime) = v4; | |
959 } | |
960 v5 = __CFADD__(v3, -128); | |
961 v3 -= 128; | |
962 v4 = v5 + v4 - 1; | |
1421 | 963 uSomeGammaStartTime = v2; |
964 v8 = __PAIR__(v4, v3); | |
0 | 965 } |
966 if ( uSomeGammaDeltaTime ) | |
967 v6 = (double)(signed __int64)(uSomeGammaDeltaTime - __PAIR__(v4, v3)); | |
968 else | |
969 v6 = (double)v8; | |
970 v7 = v6 * 0.0078125; | |
971 if ( v7 < 0.0 || v7 <= 1.0 ) | |
972 { | |
973 if ( v7 < 0.0 ) | |
974 v7 = 0.0; | |
975 } | |
976 else | |
977 v7 = 1.0; | |
2155 | 978 //if ( pRenderer->pRenderD3D ) |
0 | 979 fSaturation = v7; |
2155 | 980 //else |
981 // fSaturation = (1.0 - 0.5) * v7 + 0.5; | |
0 | 982 } |
983 | |
984 //----- (0044EA17) -------------------------------------------------------- | |
985 bool Game::InitializeGammaController() | |
986 { | |
2152 | 987 //if (pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || |
988 //pVersion->pVersionInfo.dwMajorVersion != 4 ) | |
0 | 989 pGammaController->InitializeFromSurface(pRenderer->pFrontBuffer4); |
990 | |
991 bGammaControlInitialized = true; | |
992 uSomeGammaStartTime = pEventTimer->Time(); | |
993 return true; | |
994 } | |
995 | |
996 //----- (0044EA5E) -------------------------------------------------------- | |
194 | 997 bool Game::PickMouse(float fPickDepth, unsigned int uMouseX, unsigned int uMouseY, bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter) |
0 | 998 { |
2154 | 999 /*if (pCurrentScreen != SCREEN_GAME|| !pRenderer->pRenderD3D) |
1000 return false;*/ | |
0 | 1001 |
194 | 1002 if (!pVisInstance) |
0 | 1003 { |
194 | 1004 MessageBoxW(nullptr, L"The 'Vis' object pointer has not been instatiated, but CGame::Pick() is trying to call through it.", nullptr, 0); |
1005 return false; | |
1006 } | |
0 | 1007 |
692 | 1008 if (uMouseX >= (signed int)pViewport->uScreen_TL_X && |
1009 uMouseX <= (signed int)pViewport->uScreen_BR_X && | |
1010 uMouseY >= (signed int)pViewport->uScreen_TL_Y && | |
1011 uMouseY <= (signed int)pViewport->uScreen_BR_Y) | |
194 | 1012 { |
1013 pVisInstance->PickMouse(fPickDepth, uMouseX, uMouseY, sprite_filter, face_filter); | |
0 | 1014 |
194 | 1015 if (bOutline) |
1016 OutlineSelection(); | |
0 | 1017 } |
194 | 1018 |
1019 return true; | |
0 | 1020 } |
1021 // 4E28F8: using guessed type int pCurrentScreen; | |
1022 | |
1023 //----- (0044EB12) -------------------------------------------------------- | |
194 | 1024 bool Game::PickKeyboard(bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter) |
0 | 1025 { |
2154 | 1026 if (pCurrentScreen == SCREEN_GAME && pVisInstance /*&& pRenderer->pRenderD3D*/) |
0 | 1027 { |
194 | 1028 bool r = pVisInstance->PickKeyboard(&pVisInstance->default_list, sprite_filter, face_filter); |
0 | 1029 |
1030 if (bOutline) | |
1031 OutlineSelection(); | |
1032 return r; | |
1033 } | |
1034 return false; | |
1035 } | |
123 | 1036 /* |
1037 Result::Code Game::PickKeyboard(bool bOutline, struct unnamed_F93E6C *a3, struct unnamed_F93E6C *a4) | |
1038 { | |
1039 if (dword_4E28F8_PartyCantJumpIfTrue) | |
1040 return Result::Generic; | |
1041 | |
1042 pVis->PickKeyboard(a3, a4); | |
1043 if (bOutline) | |
1044 Game_outline_selection((int)this); | |
1045 return Result::Success; | |
1046 } | |
1047 */ | |
0 | 1048 // 4E28F8: using guessed type int pCurrentScreen; |
1049 | |
1050 //----- (0044EB5A) -------------------------------------------------------- | |
1051 void Game::OutlineSelection() | |
1052 { | |
194 | 1053 if (!pVisInstance) |
1054 return; | |
1055 | |
1056 if (!pVisInstance->default_list.uNumPointers) | |
1057 return; | |
0 | 1058 |
1980 | 1059 Vis_ObjectInfo* object_info = pVisInstance->default_list.object_pointers[0]; |
194 | 1060 if (object_info) |
1061 switch (object_info->object_type) | |
0 | 1062 { |
194 | 1063 case VisObjectType_Sprite: |
0 | 1064 { |
194 | 1065 Log::Warning(L"Sprite outline currently unsupported"); |
1066 return; | |
0 | 1067 } |
1068 | |
194 | 1069 case VisObjectType_Face: |
1070 { | |
1071 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
0 | 1072 { |
1980 | 1073 ODMFace* face = (ODMFace *)object_info->object; |
194 | 1074 if (face->uAttributes & FACE_OUTLINED) |
1075 face->uAttributes &= ~FACE_OUTLINED; | |
0 | 1076 else |
194 | 1077 face->uAttributes |= FACE_OUTLINED; |
1078 } | |
1079 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
1080 { | |
1980 | 1081 BLVFace* face = (BLVFace *)object_info->object; |
194 | 1082 if (face->uAttributes & FACE_OUTLINED) |
1083 face->uAttributes &= ~FACE_OUTLINED; | |
1084 else | |
1085 face->uAttributes |= FACE_OUTLINED; | |
0 | 1086 } |
1545 | 1087 else Error("Invalid level type", uCurrentlyLoadedLevelType); |
194 | 1088 } |
323 | 1089 break; |
194 | 1090 |
1091 default: | |
1092 { | |
1093 MessageBoxW(nullptr, L"Undefined CObjectInfo type requested in CGame::outline_selection()", nullptr, 0); | |
1094 ExitProcess(0); | |
1095 } | |
0 | 1096 } |
1915 | 1097 } |
1098 //----- (004304E7) -------------------------------------------------------- | |
1099 void GameUI_MsgProc() | |
1100 { | |
1101 //signed int v0; // edi@6 | |
1102 //char *v1; // esi@6 | |
1103 unsigned int v2; // edx@7 | |
1104 Actor *pActor; // ecx@13 | |
1105 int v4; // ecx@18 | |
1106 //NPCData *pNPCData0; // eax@18 | |
1107 //int v6; // edx@20 | |
1108 //int v7; // ecx@29 | |
1109 //unsigned int v8; // edx@59 | |
1110 //unsigned int v9; // ecx@60 | |
1111 unsigned int v10; // ecx@73 | |
1112 //unsigned int v11; // eax@75 | |
1113 unsigned __int8 v12; // sf@75 | |
1114 unsigned __int8 v13; // of@75 | |
1115 int v14; // eax@98 | |
1116 unsigned int v15; // eax@102 | |
1117 unsigned __int8 v16; // al@104 | |
1118 unsigned __int8 v17; // al@105 | |
1119 int v18; // eax@106 | |
1120 float v19; // ST64_4@121 | |
1121 unsigned int v20; // ecx@121 | |
1122 float v21; // ST64_4@126 | |
1123 float v22; // ST64_4@127 | |
1124 unsigned int v23; // ecx@135 | |
1125 unsigned int v24; // ecx@149 | |
1126 unsigned int v25; // ecx@165 | |
1127 GUIWindow *pWindow; // eax@204 | |
1128 unsigned int v27; // edx@204 | |
1129 unsigned int v28; // ecx@204 | |
1130 GUIWindow *pWindow2; // ecx@248 | |
1131 //int v30; // edx@258 | |
1132 //const char *v31; // ecx@262 | |
1133 signed int v32; // eax@269 | |
1134 unsigned int v33; // eax@277 | |
1135 unsigned __int8 v34; // al@279 | |
1136 unsigned __int8 v35; // al@280 | |
1137 //GUIWindow *pWindow3; // ecx@332 | |
1138 int v37; // eax@341 | |
1139 int v38; // eax@358 | |
1140 SHORT v39; // ax@365 | |
1141 //signed int v40; // eax@365 | |
1142 char *v41; // eax@380 | |
1143 int v42; // eax@396 | |
1144 POINT *pPoint; // eax@397 | |
1145 signed int v44; // eax@398 | |
1146 int v45; // edx@398 | |
1147 signed int v46; // ecx@398 | |
1148 char v47; // zf@399 | |
1149 char v48; // zf@405 | |
1150 BLVFace *pBLVFace; // ecx@410 | |
1151 ODMFace *pODMFace; // ecx@412 | |
1152 CastSpellInfo *pSpellInfo; // ecx@415 | |
1153 void *v52; // eax@424 | |
1154 __int16 v53; // ax@431 | |
1155 int v54; // eax@432 | |
1156 int v55; // ecx@432 | |
1157 int v56; // edx@432 | |
1158 int v57; // eax@432 | |
1159 Player *pPlayer; // edx@442 | |
1160 unsigned int pMapNum; // eax@445 | |
1161 signed int v60; // ST64_4@459 | |
1162 //NPCData *pNPCData2; // eax@467 | |
1163 //unsigned __int64 v62; // kr00_8@467 | |
1164 __int16 v63; // dx@479 | |
1165 unsigned int v64; // eax@486 | |
1166 int v65; // ecx@486 | |
1167 int v66; // eax@488 | |
1168 char *v67; // eax@489 | |
1169 __int16 v68; // dx@498 | |
1170 char *v69; // eax@512 | |
1171 int v70; // eax@525 | |
1172 int v71; // edi@527 | |
1173 NPCData *pNPCData3; // esi@527 | |
1174 char *v73; // ecx@533 | |
1175 signed int v74; // edi@535 | |
1176 int v75; // eax@535 | |
1177 int v76; // esi@535 | |
1178 int v77; // eax@537 | |
1179 Player *pPlayer2; // ecx@549 | |
1180 //int v79; // ecx@550 | |
1181 //unsigned int v80; // edx@550 | |
1182 signed int v81; // eax@552 | |
1183 POINT *pPoint2; // eax@553 | |
1184 signed int v83; // ecx@554 | |
1185 signed int v84; // ecx@554 | |
1186 GUIButton *pButton; // eax@578 | |
1187 unsigned int v86; // eax@583 | |
1188 const char *v87; // ecx@595 | |
1189 const char *v88; // ecx@596 | |
1190 //unsigned int v89; // eax@598 | |
1191 unsigned int v90; // eax@602 | |
1192 int v91; // edx@605 | |
1193 int v92; // eax@605 | |
1194 int v93; // edx@605 | |
1195 int pPlayerNum; // edx@611 | |
1196 int v95; // eax@611 | |
1197 //const char *v96; // ecx@621 | |
1198 unsigned int v97; // eax@624 | |
1199 int v98; // eax@636 | |
1200 unsigned __int8 v99; // al@643 | |
1201 Player *pPlayer3; // eax@648 | |
1202 int v101; // ecx@648 | |
1203 int v102; // edx@652 | |
1204 int v103; // eax@671 | |
1205 Player *pPlayer4; // ecx@718 | |
1206 int v105; // eax@718 | |
1207 Player *pPlayer5; // ST78_4@758 | |
1208 unsigned int v107; // eax@758 | |
1209 unsigned int v108; // eax@758 | |
1210 unsigned int v115; // eax@764 | |
1211 int v116; // eax@776 | |
1212 POINT *pPoint3; // eax@777 | |
1213 unsigned int v118; // eax@785 | |
1214 unsigned int v119; // ecx@786 | |
1215 unsigned int v120; // [sp-28h] [bp-624h]@86 | |
1216 unsigned int v121; // [sp-28h] [bp-624h]@711 | |
1217 unsigned int v122; // [sp-24h] [bp-620h]@86 | |
1218 unsigned int v123; // [sp-24h] [bp-620h]@711 | |
1219 unsigned int v124; // [sp-20h] [bp-61Ch]@86 | |
1220 unsigned int v125; // [sp-20h] [bp-61Ch]@711 | |
1221 unsigned int v126; // [sp-1Ch] [bp-618h]@86 | |
1222 int v127; // [sp-1Ch] [bp-618h]@107 | |
1223 unsigned int v128; // [sp-1Ch] [bp-618h]@711 | |
1224 int v129; // [sp-18h] [bp-614h]@86 | |
1225 //signed int v130; // [sp-18h] [bp-614h]@107 | |
1226 int v131; // [sp-14h] [bp-610h]@86 | |
1227 //unsigned int v132; // [sp-14h] [bp-610h]@107 | |
1228 //unsigned int v133; // [sp-10h] [bp-60Ch]@60 | |
1229 unsigned int v134; // [sp-10h] [bp-60Ch]@86 | |
1230 //signed int v135; // [sp-10h] [bp-60Ch]@107 | |
1231 unsigned int v136; // [sp-10h] [bp-60Ch]@121 | |
1232 //unsigned int v137; // [sp-Ch] [bp-608h]@60 | |
1233 unsigned int v138; // [sp-Ch] [bp-608h]@86 | |
1234 //signed int v139; // [sp-Ch] [bp-608h]@107 | |
1235 unsigned int v140; // [sp-Ch] [bp-608h]@121 | |
1236 enum WindowType pWindowType; // [sp-8h] [bp-604h]@56 | |
1237 //enum WindowType pWindowType1; // [sp-8h] [bp-604h]@60 | |
1238 unsigned __int8 v143; // [sp-8h] [bp-604h]@86 | |
1239 //int v144; // [sp-8h] [bp-604h]@107 | |
1240 enum WindowType pWindowType2; // [sp-8h] [bp-604h]@121 | |
1241 //const char *v146; // [sp-8h] [bp-604h]@449 | |
1242 //unsigned int v147; // [sp-8h] [bp-604h]@550 | |
1243 //int v148; // [sp-4h] [bp-600h]@56 | |
1244 GUIButton *pButton2; // [sp-4h] [bp-600h]@59 | |
1245 const char *v150; // [sp-4h] [bp-600h]@86 | |
1246 //unsigned int v151; // [sp-4h] [bp-600h]@107 | |
1247 int v152; // [sp-4h] [bp-600h]@121 | |
1248 int v153; // [sp-4h] [bp-600h]@135 | |
1249 //int v154; // [sp-4h] [bp-600h]@149 | |
1250 int v155; // [sp-4h] [bp-600h]@165 | |
1251 int v156; // [sp-4h] [bp-600h]@204 | |
1252 //const char *v157; // [sp-4h] [bp-600h]@444 | |
1253 //unsigned int v158; // [sp-4h] [bp-600h]@449 | |
1254 //__int16 v159; // [sp-4h] [bp-600h]@550 | |
1255 int v160; // [sp-4h] [bp-600h]@599 | |
1256 const char *v161; // [sp-4h] [bp-600h]@637 | |
1257 //int v162; // [sp+0h] [bp-5FCh]@56 | |
1258 //int v163; // [sp+0h] [bp-5FCh]@59 | |
1259 Texture *pTexture; // [sp+0h] [bp-5FCh]@86 | |
1260 //int v165; // [sp+0h] [bp-5FCh]@107 | |
1261 int v166; // [sp+0h] [bp-5FCh]@121 | |
1262 int v167; // [sp+0h] [bp-5FCh]@135 | |
1263 //int v168; // [sp+0h] [bp-5FCh]@149 | |
1264 int v169; // [sp+0h] [bp-5FCh]@165 | |
1265 int v170; // [sp+0h] [bp-5FCh]@204 | |
1266 //signed int v171; // [sp+0h] [bp-5FCh]@259 | |
1267 KeyToggleType pKeyToggleType; // [sp+0h] [bp-5FCh]@287 | |
1268 char *v173; // [sp+0h] [bp-5FCh]@444 | |
1269 char *v174; // [sp+0h] [bp-5FCh]@449 | |
1270 //int v175; // [sp+0h] [bp-5FCh]@550 | |
1271 int v176; // [sp+0h] [bp-5FCh]@599 | |
1272 const char *v177; // [sp+0h] [bp-5FCh]@629 | |
1273 char *v178; // [sp+0h] [bp-5FCh]@637 | |
1274 int v179; // [sp+4h] [bp-5F8h]@0 | |
1275 //signed int _this; // [sp+14h] [bp-5E8h]@22 | |
1276 signed int thisa; // [sp+14h] [bp-5E8h]@251 | |
1277 signed int thisb; // [sp+14h] [bp-5E8h]@272 | |
1278 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373 | |
1279 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377 | |
1280 char *pMapName; // [sp+14h] [bp-5E8h]@445 | |
1281 Player *pPlayer9; // [sp+14h] [bp-5E8h]@455 | |
1282 int thisg; // [sp+14h] [bp-5E8h]@467 | |
1283 int thish; // [sp+14h] [bp-5E8h]@528 | |
1284 signed int thisi; // [sp+14h] [bp-5E8h]@535 | |
1285 MapInfo *pMapInfo; // [sp+14h] [bp-5E8h]@604 | |
1286 Player *pPlayer10; // [sp+14h] [bp-5E8h]@641 | |
1287 int thisl; // [sp+14h] [bp-5E8h]@648 | |
1288 int uMessageParam; // [sp+18h] [bp-5E4h]@7 | |
1289 int uAction; // [sp+1Ch] [bp-5E0h]@18 | |
1290 NPCData *pNPCData4; // [sp+20h] [bp-5DCh]@23 | |
1291 unsigned int uNumSeconds; // [sp+24h] [bp-5D8h]@18 | |
1292 char v197; // [sp+2Bh] [bp-5D1h]@101 | |
1293 enum UIMessageType uMessage; // [sp+2Ch] [bp-5D0h]@7 | |
1294 unsigned int v199; // [sp+30h] [bp-5CCh]@7 | |
1295 char *v200; // [sp+34h] [bp-5C8h]@518 | |
1296 POINT v201; // [sp+38h] [bp-5C4h]@553 | |
1297 POINT v202; // [sp+40h] [bp-5BCh]@141 | |
1298 POINT a2; // [sp+48h] [bp-5B4h]@127 | |
1299 POINT v204; // [sp+50h] [bp-5ACh]@777 | |
1300 POINT v205; // [sp+58h] [bp-5A4h]@171 | |
1301 POINT v206; // [sp+60h] [bp-59Ch]@553 | |
1302 POINT v207; // [sp+68h] [bp-594h]@155 | |
1303 POINT v208; // [sp+70h] [bp-58Ch]@397 | |
1304 POINT v209; // [sp+78h] [bp-584h]@777 | |
1305 POINT v210; // [sp+80h] [bp-57Ch]@397 | |
1306 POINT v211; // [sp+88h] [bp-574h]@704 | |
1307 //__int64 v212; // [sp+90h] [bp-56Ch]@467 | |
1308 int v213; // [sp+98h] [bp-564h]@385 | |
1309 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380 | |
1310 char pOut[32]; // [sp+BCh] [bp-540h]@370 | |
1311 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524 | |
1312 int v217[9]; // [sp+158h] [bp-4A4h]@652 | |
1313 FrameTableTxtLine v218; // [sp+17Ch] [bp-480h]@524 | |
1314 char a1[64]; // [sp+1F8h] [bp-404h]@467 | |
1315 char Str2[128]; // [sp+238h] [bp-3C4h]@527 | |
1316 Actor actor; // [sp+2B8h] [bp-344h]@4 | |
2154 | 1317 //unsigned short* screenshot; |
1915 | 1318 |
1319 dword_50CDC8 = 0; | |
1320 if ( !pEventTimer->bPaused ) | |
1321 { | |
1322 pParty->sEyelevel = pParty->uDefaultEyelevel; | |
1323 pParty->uPartyHeight = pParty->uDefaultPartyHeight; | |
1324 } | |
1325 if ( bDialogueUI_InitializeActor_NPC_ID ) | |
1326 { | |
1327 //Actor::Actor(&actor); | |
1328 memset(&actor, 0, 0x344u); | |
1329 dword_5B65D0_dialogue_actor_npc_id = bDialogueUI_InitializeActor_NPC_ID; | |
1330 actor.sNPC_ID = bDialogueUI_InitializeActor_NPC_ID; | |
1331 GameUI_InitializeDialogue(&actor, false); | |
1332 bDialogueUI_InitializeActor_NPC_ID = 0; | |
1333 } | |
1334 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1335 { | |
1336 //v1 = ""; | |
1337 while ( 2 ) | |
1338 { | |
1339 if ( !pMessageQueue_50CBD0->uNumMessages ) | |
1340 break; | |
1341 | |
1342 pMessageQueue_50CBD0->PopMessage(&uMessage, &uMessageParam, (int *)&v199); | |
1343 switch ( uMessage ) | |
1344 { | |
1345 case UIMSG_ChangeGameState: | |
1346 uGameState = GAME_FINISHED; | |
1347 continue; | |
1348 case UIMSG_PlayArcomage: | |
1349 pVideoPlayer->_4BF5B2(); | |
1350 pArcomageGame->bGameInProgress = 1; | |
1351 PrepareArcomage(); | |
1352 continue; | |
1353 case UIMSG_StartNPCDialogue: | |
1354 if ( !uActiveCharacter ) | |
1355 continue; | |
1356 viewparams->field_48 = 1; | |
1357 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1358 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1359 dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].sNPC_ID; | |
1360 pActor = &pActors[uMessageParam]; | |
1361 //goto _actor_init_dlg; | |
1362 GameUI_InitializeDialogue(pActor, true); | |
1363 continue; | |
1364 case UIMSG_StartHireling1Dialogue: | |
1365 case UIMSG_StartHireling2Dialogue: | |
1366 { | |
1367 if (bNoNPCHiring || pCurrentScreen) | |
1368 continue; | |
1369 | |
1370 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1371 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1372 uAction = 0; | |
1373 int hireling_idx = uMessage - UIMSG_StartHireling1Dialogue; | |
1374 v4 = 0; | |
1375 | |
1376 for (uint i = 0; i < 2; ++i) | |
1377 //pNPCData0 = pParty->pHirelings; | |
1378 //do | |
1379 { | |
1380 if (pParty->pHirelings[i].pName) | |
1381 //{ | |
1382 //v6 = uAction++; | |
1383 pTmpBuf[uAction++] = i; | |
1384 //} | |
1385 //++pNPCData0; | |
1386 //++v4; | |
1387 } | |
1388 //while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem ); | |
1389 | |
1390 //_this = 0; | |
1391 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
1392 { | |
1980 | 1393 NPCData* npc = &pNPCStats->pNewNPCData[i]; |
1915 | 1394 //do |
1395 //{ | |
1396 if (npc->Hired() && | |
1397 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)) && | |
1398 (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) ) | |
1399 { | |
1400 //v7 =; | |
1401 pTmpBuf[uAction++] = i + 2; | |
1402 } | |
1403 //++_this; | |
1404 //++pNPCData4; | |
1405 //} | |
1406 //while ( _this < (signed int)pNPCStats->uNumNewNPCs ); | |
1407 } | |
1408 | |
1409 if ( (signed int)(hireling_idx + pParty->hirelingScrollPosition) < uAction ) | |
1410 { | |
1411 //Actor::Actor(&actor); | |
1412 memset(&actor, 0, 0x344u); | |
1413 actor.sNPC_ID += -1 - pParty->hirelingScrollPosition - hireling_idx; | |
1414 pActor = &actor; | |
1415 GameUI_InitializeDialogue(&actor, true); | |
1416 } | |
1417 } | |
1418 continue; | |
1419 | |
1420 case UIMSG_BuyInShop_Identify_Repair: | |
1421 UIShop_Buy_Identify_Repair(); | |
1422 continue; | |
1423 case UIMSG_ClickNPCTopic: | |
1424 ClickNPCTopic(uMessageParam); | |
1425 continue; | |
1426 case UIMSG_SelectShopDialogueOption: | |
1427 OnSelectShopDialogueOption(uMessageParam); | |
1428 continue; | |
1429 case UIMSG_SelectNPCDialogueOption: | |
1430 OnSelectNPCDialogueOption((DIALOGUE_TYPE)uMessageParam); | |
1431 continue; | |
1432 case UIMSG_ClickHouseNPCPortrait: | |
1433 _4B4224_UpdateNPCTopics(uMessageParam); | |
1434 continue; | |
1435 case UIMSG_StartNewGame: | |
1436 if ( dword_6BE138 == 124 || uMessageParam ) | |
1437 { | |
1438 pIcons_LOD->SyncLoadedFilesCount(); | |
1439 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
1440 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1441 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1442 pGUIWindow_CurrentMenu->Release(); | |
1443 uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU; | |
1444 pCurrentScreen = SCREEN_GAME; | |
1445 viewparams->bRedrawGameUI = 1; | |
1446 } | |
1447 else | |
1448 { | |
1449 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2u);// "Are you sure? Click again to start a New Game" | |
1450 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0); | |
1451 dword_6BE138 = 124; | |
1452 } | |
1453 stru_506E40.Release(); | |
1454 continue; | |
1455 case UIMSG_Game_OpenLoadGameDialog: | |
1456 pIcons_LOD->SyncLoadedFilesCount(); | |
1457 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
1458 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1459 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1460 pGUIWindow_CurrentMenu->Release(); | |
1461 pCurrentScreen = SCREEN_LOADGAME; | |
1462 LoadUI_Load(1); | |
1463 continue; | |
1464 case UIMSG_Quit: | |
1465 if ( dword_6BE138 == 132 || uMessageParam ) | |
1466 { | |
1467 pIcons_LOD->SyncLoadedFilesCount(); | |
1468 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
1469 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1470 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1471 pGUIWindow_CurrentMenu->Release(); | |
1472 pCurrentScreen = SCREEN_GAME; | |
1473 viewparams->bRedrawGameUI = 1; | |
1474 if ( !uMessageParam ) | |
1475 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0); | |
1476 uGameState = GAME_STATE_GAME_QUITTING_TO_MAIN_MENU; | |
1477 } | |
1478 else | |
1479 { | |
1480 ShowStatusBarString(pGlobalTXT_LocalizationStrings[82], 2);// "Are you sure? Click again to quit" | |
1481 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0); | |
1482 dword_6BE138 = 132; | |
1483 } | |
1484 stru_506E40.Release(); | |
1485 continue; | |
1486 case UIMSG_80: | |
1487 __debugbreak(); | |
1488 pIcons_LOD->SyncLoadedFilesCount(); | |
1489 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
1490 pGUIWindow_CurrentMenu->Release(); | |
1491 pCurrentScreen = SCREEN_OPTIONS; | |
1492 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_8, 0, 0); | |
1493 continue; | |
1494 case UIMSG_ArrowUp: | |
1495 --pSaveListPosition; | |
1496 if ( pSaveListPosition < 0 ) | |
1497 pSaveListPosition = 0; | |
1498 GUIWindow::Create(215, 199, 17, 17, WINDOW_PressedButton2, (int)pBtnArrowUp, 0); | |
1499 continue; | |
1500 case UIMSG_DownArrow: | |
1501 ++pSaveListPosition; | |
1502 if ( pSaveListPosition >= uMessageParam ) | |
1503 pSaveListPosition = uMessageParam - 1; | |
1504 GUIWindow::Create(215, 323, 17, 17, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); | |
1505 continue; | |
1506 case UIMSG_Cancel: | |
1507 GUIWindow::Create(350, 302, 106, 42, WINDOW_CloseRestWindowBtn, (int)pBtnCancel, 0); | |
1508 continue; | |
1509 case UIMSG_SaveLoadBtn: | |
1510 GUIWindow::Create(241, 302, 106, 42, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); | |
1511 continue; | |
1512 case UIMSG_SelectLoadSlot: | |
1513 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
1514 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
1515 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam ) | |
1516 { | |
1517 v10 = pSaveListPosition + uMessageParam; | |
1518 if ( dword_6BE138 == pSaveListPosition + uMessageParam ) | |
1519 { | |
1520 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0); | |
1521 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); | |
1522 } | |
1523 uLoadGameUI_SelectedSlot = v10; | |
1524 dword_6BE138 = v10; | |
1525 } | |
1526 else | |
1527 { | |
1528 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); | |
1529 if ( strcmp((const char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], pGlobalTXT_LocalizationStrings[72]) )// "Empty" | |
1530 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, (const char *)&pSavegameHeader[uLoadGameUI_SelectedSlot]); | |
1531 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); | |
1532 } | |
1533 continue; | |
1534 case UIMSG_LoadGame: | |
1535 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] ) | |
1536 { | |
1537 LoadGame(uLoadGameUI_SelectedSlot); | |
1538 uGameState = GAME_STATE_LOADING_GAME; | |
1539 } | |
1540 stru_506E40.Release(); | |
1541 continue; | |
1542 case UIMSG_SaveGame: | |
1543 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
1544 { | |
1545 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
1546 strcpy((char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], (const char *)pKeyActionMap->pPressedKeysBuffer); | |
1547 } | |
1548 DoSavegame(uLoadGameUI_SelectedSlot); | |
1549 stru_506E40.Release(); | |
1550 continue; | |
1551 case UIMSG_Game_OpenSaveGameDialog: | |
1552 pGUIWindow_CurrentMenu->Release(); | |
1553 pCurrentScreen = SCREEN_SAVEGAME; | |
1554 SaveUI_Load(); | |
1555 continue; | |
1556 case UIMSG_Game_OpenOptionsDialog://Open | |
1557 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1558 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1559 pGUIWindow_CurrentMenu->Release(); | |
1560 viewparams->field_48 = 1; | |
1561 pCurrentScreen = SCREEN_OPTIONS; | |
1562 | |
1563 options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE); | |
1564 options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE); | |
1565 options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE); | |
1566 options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE); | |
1567 options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); | |
1568 options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); | |
1569 options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); | |
1570 options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); | |
1571 options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); | |
1572 options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); | |
1573 options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); | |
1574 options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); | |
1575 options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); | |
1576 options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); | |
1577 options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); | |
1578 options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); | |
1579 options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE); | |
1580 options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE); | |
1581 options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE); | |
1582 options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE); | |
1583 | |
1584 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0); | |
1585 pGUIWindow_CurrentMenu->CreateButton(22, 270, | |
1586 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth, | |
1587 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight, | |
1588 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0); | |
1589 pGUIWindow_CurrentMenu->CreateButton(93, 270, | |
1590 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth, | |
1591 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight, | |
1592 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0); | |
1593 pGUIWindow_CurrentMenu->CreateButton(164, 270, | |
1594 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth, | |
1595 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight, | |
1596 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0); | |
1597 | |
1598 pGUIWindow_CurrentMenu->CreateButton(20, 303, | |
1599 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth, | |
1600 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight, | |
1601 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0); | |
1602 pGUIWindow_CurrentMenu->CreateButton(128, 303, | |
1603 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth, | |
1604 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight, | |
1605 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0); | |
1606 pGUIWindow_CurrentMenu->CreateButton(20, 325, | |
1607 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth, | |
1608 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight, | |
1609 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0); | |
1610 pGUIWindow_CurrentMenu->CreateButton(128, 325, | |
1611 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth, | |
1612 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight, | |
1613 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0); | |
1614 | |
1615 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
1616 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
1617 pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0); | |
1618 | |
1619 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
1620 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
1621 pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0); | |
1622 | |
1623 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
1624 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
1625 pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0); | |
1626 | |
1627 pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game" | |
1628 pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, "", 0); | |
1629 pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, "", 0); | |
1630 continue; | |
1631 | |
1632 case UIMSG_OpenKeyMappingOptions://Open | |
1633 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1634 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1635 pGUIWindow_CurrentMenu->Release(); | |
1636 viewparams->field_48 = 1; | |
1637 pCurrentScreen = SCREEN_KEYBOARD_OPTIONS; | |
1638 uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE); | |
1639 uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE); | |
1640 uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
1641 uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE); | |
1642 uTextureID_Optkb[4] = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE); | |
1643 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_KeyMappingOptions, 0, 0); | |
1644 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0); | |
1645 pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage1, 0, 0, "", 0); | |
1646 pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage2, 0, 0, "", 0); | |
1647 pGUIWindow_CurrentMenu->CreateButton(127u, 0x144u, 0x6Cu, 0x14u, 1, 0, UIMSG_ResetKeyMapping, 0, 0, "", 0); | |
1648 pGUIWindow_CurrentMenu->CreateButton(19u, 0x144u, 0x6Cu, 0x14u, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0, "", 0); | |
1649 pGUIWindow_CurrentMenu->CreateButton(129u, 0x94u, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0, 0, "", 0); | |
1650 pGUIWindow_CurrentMenu->CreateButton(129u, 0xA7u, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 1u, 0, "", 0); | |
1651 pGUIWindow_CurrentMenu->CreateButton(129u, 0xBAu, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 2u, 0, "", 0); | |
1652 pGUIWindow_CurrentMenu->CreateButton(129u, 0xCDu, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 3u, 0, "", 0); | |
1653 pGUIWindow_CurrentMenu->CreateButton(129u, 224u, 70u, 19u, 1, 0, UIMSG_ChangeKeyButton, 4u, 0, "", 0); | |
1654 pGUIWindow_CurrentMenu->CreateButton(129u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 5u, 0, "", 0); | |
1655 pGUIWindow_CurrentMenu->CreateButton(129u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 6u, 0, "", 0); | |
1656 pGUIWindow_CurrentMenu->CreateButton(350u, 148u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 7u, 0, "", 0); | |
1657 pGUIWindow_CurrentMenu->CreateButton(350u, 167u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 8u, 0, "", 0); | |
1658 pGUIWindow_CurrentMenu->CreateButton(350u, 186u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 9u, 0, "", 0); | |
1659 pGUIWindow_CurrentMenu->CreateButton(350u, 205u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xAu, 0, "", 0); | |
1660 pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xBu, 0, "", 0); | |
1661 pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xCu, 0, "", 0); | |
1662 pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xDu, 0, "", 0); | |
1663 uGameMenuUI_CurentlySelectedKeyIdx = -1; | |
1664 KeyboardPageNum = 1; | |
1665 memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags)); | |
1666 //*(_WORD *)KeyButtonArray[28] = 0; | |
1667 memcpy(pPrevVirtualCidesMapping.data(), pKeyActionMap->pVirtualKeyCodesMapping, 0x78u); | |
1668 //v1 = ""; | |
1669 //v0 = 1; | |
1670 continue; | |
1671 case UIMSG_ChangeKeyButton: | |
1672 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 ) | |
1673 { | |
1674 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
1675 continue; | |
1676 } | |
1677 v14 = uMessageParam; | |
1678 if ( KeyboardPageNum != 1 ) | |
1679 v14 = uMessageParam + 14; | |
1680 uGameMenuUI_CurentlySelectedKeyIdx = v14; | |
1681 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu); | |
1682 continue; | |
1683 case UIMSG_ResetKeyMapping: | |
1684 v197 = 1; | |
1685 pKeyActionMap->SetDefaultMapping(); | |
1686 uAction = 0; | |
1687 do | |
1688 { | |
1689 v15 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
1690 if ( v15 != pPrevVirtualCidesMapping[uAction] ) | |
1691 { | |
1692 if ( v197 ) | |
1693 { | |
1694 v16 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
1695 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v16, 1); | |
1696 v197 = 0; | |
1697 } | |
1698 else | |
1699 { | |
1700 v17 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
1701 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v17, 0); | |
1702 } | |
1703 } | |
1704 pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
1705 v18 = uAction++; | |
1706 v13 = uAction > 28; | |
1707 v12 = uAction - 28 < 0; | |
1708 GameMenuUI_InvaligKeyBindingsFlags[v18] = 0; | |
1709 } | |
1710 while ( v12 ^ v13 ); | |
1711 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0); | |
1712 continue; | |
1713 case UIMSG_SelectKeyPage1: | |
1714 KeyboardPageNum = 1; | |
1715 continue; | |
1716 case UIMSG_SelectKeyPage2: | |
1717 KeyboardPageNum = 2; | |
1718 continue; | |
1719 case UIMSG_OpenVideoOptions: | |
1720 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1721 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1722 pGUIWindow_CurrentMenu->Release(); | |
1723 viewparams->field_48 = 1; | |
1724 pCurrentScreen = SCREEN_VIDEO_OPTIONS; | |
1725 optvid_base_texture_id = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE); | |
1726 bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE); | |
1727 us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE); | |
1728 tinting_texture_id = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE); | |
1729 uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); | |
1730 uTextureID_507C24 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); | |
1731 pTextureIDs_GammaPositions[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); | |
1732 pTextureIDs_GammaPositions[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); | |
1733 pTextureIDs_GammaPositions[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); | |
1734 pTextureIDs_GammaPositions[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); | |
1735 pTextureIDs_GammaPositions[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); | |
1736 pTextureIDs_GammaPositions[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); | |
1737 pTextureIDs_GammaPositions[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); | |
1738 pTextureIDs_GammaPositions[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); | |
1739 pTextureIDs_GammaPositions[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); | |
1740 pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); | |
1741 not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE); | |
1742 not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE); | |
1743 not_available_tinting_texture_id = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE); | |
1744 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_VideoOptions, 0, 0); | |
1745 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0); | |
2153 | 1746 //if ( pRenderer->pRenderD3D ) |
1915 | 1747 { |
1748 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, "", 0); | |
1749 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0); | |
1750 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0); | |
1751 } | |
2155 | 1752 /*if ( !pRenderer->bWindowMode ) |
1915 | 1753 { |
1754 //v0 = 1; | |
2154 | 1755 if ( pRenderer->IsGammaSupported() ) |
1915 | 1756 { |
1757 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C20), 0); | |
1758 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C24), 0); | |
1759 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0); | |
1760 } | |
2155 | 1761 }*/ |
1915 | 1762 continue; |
1763 case UIMSG_1A9: | |
1764 __debugbreak(); | |
1765 if ( uMessageParam == 4 ) | |
1766 { | |
1767 //--uGammaPos; | |
1768 if ( (uGammaPos -- -1) < 0 ) | |
1769 { | |
1770 uGammaPos = 0; | |
1771 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); | |
1772 continue; | |
1773 } | |
1774 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6; | |
1775 pGame->pGammaController->Initialize(v19); | |
1776 GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); | |
1777 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); | |
1778 continue; | |
1779 } | |
1780 if ( uMessageParam == 5 ) | |
1781 { | |
1782 ++uGammaPos; | |
1783 if ( (signed int)uGammaPos <= 9 ) | |
1784 { | |
1785 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6; | |
1786 pGame->pGammaController->Initialize(v21); | |
1787 GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); | |
1788 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); | |
1789 continue; | |
1790 } | |
1791 uGammaPos = 9; | |
1792 } | |
1793 else | |
1794 { | |
1795 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17; | |
1796 v22 = (double)(signed int)uGammaPos * 0.1 + 0.6; | |
1797 pGame->pGammaController->Initialize(v22); | |
1798 } | |
1799 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); | |
1800 continue; | |
1801 case UIMSG_ToggleBloodsplats: | |
1802 pGame->ToggleFlags2(0x20u); | |
1803 continue; | |
1804 case UIMSG_ToggleColoredLights: | |
2153 | 1805 pRenderer->ToggleColoredLights(); |
1915 | 1806 continue; |
1807 case UIMSG_ToggleTint: | |
2153 | 1808 pRenderer->ToggleTint(); |
1915 | 1809 continue; |
2113 | 1810 case UIMSG_ChangeMusicVolume: //ãðîìêîñòü ìóçûêè |
1811 if ( uMessageParam == 4 )//êíîïêà ïîíèæåíèÿ | |
1915 | 1812 { |
1813 --uMusicVolimeMultiplier; | |
1814 if ( (char)uMusicVolimeMultiplier < 1 ) | |
1815 uMusicVolimeMultiplier = 0; | |
2113 | 1816 GUIWindow::Create(243, 216, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); |
2114 | 1817 if ( uMusicVolimeMultiplier ) |
1818 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0); | |
1819 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); | |
1915 | 1820 continue; |
1821 } | |
2113 | 1822 if ( uMessageParam == 5 )//êíîïêà ïîâûøåíèÿ |
1915 | 1823 { |
1824 ++uMusicVolimeMultiplier; | |
1825 if ( (char)uMusicVolimeMultiplier > 9 ) | |
1826 uMusicVolimeMultiplier = 9; | |
2113 | 1827 GUIWindow::Create(435, 216, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); |
1915 | 1828 if ( uMusicVolimeMultiplier ) |
2114 | 1829 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0); |
1830 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); | |
1915 | 1831 continue; |
1832 } | |
2113 | 1833 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17;//äëÿ çàäàíèÿ ãðîìêîñòè ìûøêîé |
1915 | 1834 if ( (char)uMusicVolimeMultiplier > 9 ) |
1835 uMusicVolimeMultiplier = 9; | |
1836 if ( uMusicVolimeMultiplier ) | |
2114 | 1837 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0); |
1838 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); | |
1915 | 1839 continue; |
1840 case UIMSG_ChangeSoundVolume: | |
1841 if ( uMessageParam == 4 )//reduce sound level button left | |
1842 { | |
1843 --uSoundVolumeMultiplier; | |
1844 if ( (char)uSoundVolumeMultiplier < 1 ) | |
1845 uSoundVolumeMultiplier = 0; | |
1846 GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); | |
1847 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); | |
1848 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); | |
1849 continue; | |
1850 } | |
1851 if ( uMessageParam == 5 )//Increase sound level button right | |
1852 { | |
1853 ++uSoundVolumeMultiplier; | |
1854 if ( (char)uSoundVolumeMultiplier > 8 ) | |
1855 uSoundVolumeMultiplier = 9; | |
1856 //v168 = 1; | |
1857 v24 = 435; | |
1858 //v154 = (int)pBtn_SliderRight; | |
1859 GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); | |
1860 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); | |
1861 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); | |
1862 continue; | |
1863 } | |
1864 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17; | |
1865 if ( (char)uSoundVolumeMultiplier > 8 ) | |
1866 uSoundVolumeMultiplier = 9; | |
1867 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); | |
1868 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); | |
1869 continue; | |
1870 case UIMSG_ToggleFlipOnExit: | |
1871 bFlipOnExit = bFlipOnExit == 0; | |
1872 continue; | |
1873 case UIMSG_ToggleAlwaysRun: | |
1874 bAlwaysRun = bAlwaysRun == 0; | |
1875 continue; | |
1876 case UIMSG_ToggleWalkSound: | |
1877 bWalkSound = bWalkSound == 0; | |
1878 continue; | |
1879 case UIMSG_ToggleShowDamage: | |
1880 bShowDamage = bShowDamage == 0; | |
1881 continue; | |
1882 case UIMSG_ChangeVoiceVolume: | |
1883 if ( uMessageParam == 4 ) | |
1884 { | |
1885 --uVoicesVolumeMultiplier; | |
1886 if ( (char)uVoicesVolumeMultiplier < 1 ) | |
1887 uVoicesVolumeMultiplier = 0; | |
1888 GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); | |
1889 if ( !uVoicesVolumeMultiplier ) | |
1890 continue; | |
1891 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); | |
1892 continue; | |
1893 } | |
1894 if ( uMessageParam == 5 ) | |
1895 { | |
1896 ++uVoicesVolumeMultiplier; | |
1897 if ( (char)uVoicesVolumeMultiplier > 8 ) | |
1898 uVoicesVolumeMultiplier = 9; | |
1899 GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); | |
1900 if ( !uVoicesVolumeMultiplier ) | |
1901 continue; | |
1902 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); | |
1903 continue; | |
1904 } | |
1905 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17; | |
1906 if ( (char)uVoicesVolumeMultiplier > 8 ) | |
1907 uVoicesVolumeMultiplier = 9; | |
1908 if ( !uVoicesVolumeMultiplier ) | |
1909 continue; | |
1910 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); | |
1911 continue; | |
1912 case UIMSG_SetTurnSpeed: | |
1913 if ( uMessageParam ) | |
1914 pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam; | |
1915 uTurnSpeed = uMessageParam; | |
1916 continue; | |
2151 | 1917 |
1915 | 1918 case UIMSG_SetGraphicsMode: |
2151 | 1919 /*if ( !bUseLoResSprites ) |
1915 | 1920 { |
1921 byte_6BE388_graphicsmode = uMessageParam; | |
1922 MM7Initialization(); | |
1923 continue; | |
1924 } | |
1925 if ( uMessageParam ) | |
1926 { | |
1927 if ( uMessageParam == 1 ) | |
1928 { | |
1929 byte_6BE388_graphicsmode = 0; | |
1930 } | |
1931 else | |
1932 { | |
1933 if ( uMessageParam != 2 ) | |
1934 continue; | |
1935 byte_6BE388_graphicsmode = 1; | |
1936 } | |
1937 MM7Initialization(); | |
1938 continue; | |
2151 | 1939 }*/ |
1915 | 1940 ModalWindow(pNPCTopics[453].pText, UIMSG_0); |
2151 | 1941 __debugbreak(); // Nomad: graphicsmode as it was now removed |
1915 | 1942 continue; |
2151 | 1943 |
1915 | 1944 case UIMSG_GameMenu_ReturnToGame: |
1945 pGUIWindow_CurrentMenu->Release(); | |
1946 pEventTimer->Resume(); | |
1947 pCurrentScreen = SCREEN_GAME; | |
1948 viewparams->bRedrawGameUI = 1; | |
1949 stru_506E40.Release(); | |
1950 continue; | |
1951 case UIMSG_OpenQuestBook: | |
1952 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1953 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1954 if ( pCurrentScreen ) | |
1955 pGUIWindow_CurrentMenu->Release(); | |
1956 pEventTimer->Pause(); | |
1957 pAudioPlayer->StopChannels(-1, -1); | |
1958 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); | |
1959 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0); | |
1960 bFlashQuestBook = 0; | |
1961 continue; | |
1962 case UIMSG_OpenAutonotes: | |
1963 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1964 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1965 if ( pCurrentScreen ) | |
1966 pGUIWindow_CurrentMenu->Release(); | |
1967 pEventTimer->Pause(); | |
1968 pAudioPlayer->StopChannels(-1, -1); | |
1969 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); | |
1970 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0); | |
1971 bFlashAutonotesBook = 0; | |
1972 continue; | |
1973 case UIMSG_OpenMapBook: | |
1974 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1975 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1976 if ( pCurrentScreen ) | |
1977 pGUIWindow_CurrentMenu->Release(); | |
1978 pEventTimer->Pause(); | |
1979 viewparams->sViewCenterX = pParty->vPosition.x; | |
1980 viewparams->sViewCenterY = pParty->vPosition.y; | |
1981 pAudioPlayer->StopChannels(-1, -1); | |
1982 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); | |
1983 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0); | |
1984 continue; | |
1985 case UIMSG_OpenCalendar: | |
1986 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1987 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1988 if ( pCurrentScreen ) | |
1989 pGUIWindow_CurrentMenu->Release(); | |
1990 pEventTimer->Pause(); | |
1991 pAudioPlayer->StopChannels(-1, -1); | |
1992 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); | |
1993 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0); | |
1994 continue; | |
1995 case UIMSG_OpenHistoryBook: | |
1996 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1997 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1998 if ( pCurrentScreen ) | |
1999 pGUIWindow_CurrentMenu->Release(); | |
2000 pEventTimer->Pause(); | |
2001 pAudioPlayer->StopChannels(-1, -1); | |
2002 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); | |
2003 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0); | |
2004 bFlashHistoryBook = 0; | |
2005 continue; | |
2006 case UIMSG_Escape:// íàæàòèå Escape and return to game | |
2007 back_to_game(); | |
2008 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2009 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2010 switch ( pCurrentScreen ) | |
2011 { | |
2012 case SCREEN_E: | |
2013 __debugbreak(); | |
2014 case SCREEN_NPC_DIALOGUE: | |
2015 case SCREEN_CHEST: | |
2016 case SCREEN_CHEST_INVENTORY: | |
2017 case SCREEN_CHANGE_LOCATION: | |
2018 case SCREEN_INPUT_BLV: | |
2019 case SCREEN_QUICK_REFERENCE: | |
2020 if ( dword_50CDC8 ) | |
2021 break; | |
2022 CloseWindowBackground(); | |
2023 uMessageParam = 1; | |
2024 break; | |
2025 case SCREEN_HOUSE: | |
2154 | 2026 if ( !dword_50CDC8 ) |
1915 | 2027 { |
2028 CloseWindowBackground(); | |
2029 uMessageParam = 1; | |
2030 break; | |
2031 } | |
2032 break; | |
2033 } | |
2034 if ( !pModalWindow ) | |
2035 { | |
2036 pRenderer->ClearZBuffer(0, 479); | |
2037 viewparams->bRedrawGameUI = 1; | |
2038 viewparams->field_48 = 1; | |
2039 if ( pCurrentScreen ) | |
2040 { | |
2041 if ( pCurrentScreen > SCREEN_67 ) | |
2042 { | |
2043 if ( pCurrentScreen == SCREEN_QUICK_REFERENCE ) | |
2044 { | |
2045 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2046 if ( pGUIWindow_Settings ) | |
2047 { | |
2048 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2049 pMouse->SetCursorBitmap("MICON2"); | |
2050 else | |
2051 { | |
2052 pGUIWindow_Settings->Release(); | |
2053 pGUIWindow_Settings = 0; | |
2054 pMouse->SetCursorBitmap("MICON1"); | |
2055 GameUI_Footer_TimeLeft = 0; | |
2056 _50C9A0_IsEnchantingInProgress = 0; | |
2057 back_to_game(); | |
2058 } | |
2059 } | |
2060 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2061 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2062 pGUIWindow_CurrentMenu->Release(); | |
2063 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2064 window_SpeakInHouse = 0; | |
2065 pGUIWindow_CurrentMenu = 0; | |
2066 pEventTimer->Resume(); | |
2067 pCurrentScreen = SCREEN_GAME; | |
2068 viewparams->bRedrawGameUI = 1; | |
2069 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2070 continue; | |
2071 } | |
2072 } | |
2073 else | |
2074 { | |
2075 if ( pCurrentScreen < SCREEN_64 ) | |
2076 { | |
2077 switch ( pCurrentScreen ) | |
2078 { | |
2079 case SCREEN_CASTING: | |
2080 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2081 if ( some_active_character ) | |
2082 { | |
2083 uActiveCharacter = some_active_character; | |
2084 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2085 some_active_character = 0; | |
2086 if ( pParty->bTurnBasedModeOn ) | |
2087 pTurnEngine->ApplyPlayerAction(); | |
2088 _50C9D0_AfterEnchClickEventId = 0; | |
2089 _50C9D4_AfterEnchClickEventSecondParam = 0; | |
2090 _50C9D8_AfterEnchClickEventTimeout = 0; | |
2091 } | |
2092 if ( ptr_50C9A4_ItemToEnchant && ptr_50C9A4_ItemToEnchant->uItemID ) | |
2093 { | |
2094 LOBYTE(ptr_50C9A4_ItemToEnchant->uAttributes) &= 0xFu; | |
2095 _50C9A8_item_enchantment_timer = 0; | |
2096 ptr_50C9A4_ItemToEnchant = 0; | |
2097 } | |
2098 if ( pGUIWindow_Settings ) | |
2099 { | |
2100 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2101 pMouse->SetCursorBitmap("MICON2"); | |
2102 else | |
2103 { | |
2104 pGUIWindow_Settings->Release(); | |
2105 pGUIWindow_Settings = 0; | |
2106 pMouse->SetCursorBitmap("MICON1"); | |
2107 GameUI_Footer_TimeLeft = 0; | |
2108 _50C9A0_IsEnchantingInProgress = 0; | |
2109 back_to_game(); | |
2110 } | |
2111 } | |
2112 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2113 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2114 pGUIWindow_CurrentMenu->Release(); | |
2115 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2116 window_SpeakInHouse = 0; | |
2117 pGUIWindow_CurrentMenu = 0; | |
2118 pEventTimer->Resume(); | |
2119 pCurrentScreen = SCREEN_GAME; | |
2120 viewparams->bRedrawGameUI = 1; | |
2121 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2122 continue; | |
2123 case SCREEN_BOOKS: | |
2124 pBooksWindow->Release(); | |
2125 //crt_deconstruct_ptr_6A0118(); | |
2126 pBooksWindow = 0; | |
2127 pEventTimer->Resume(); | |
2128 if ( pGUIWindow_Settings ) | |
2129 { | |
2130 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2131 pMouse->SetCursorBitmap("MICON2"); | |
2132 else | |
2133 { | |
2134 pGUIWindow_Settings->Release(); | |
2135 pGUIWindow_Settings = 0; | |
2136 pMouse->SetCursorBitmap("MICON1"); | |
2137 GameUI_Footer_TimeLeft = 0; | |
2138 _50C9A0_IsEnchantingInProgress = 0; | |
2139 back_to_game(); | |
2140 } | |
2141 } | |
2142 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2143 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2144 pGUIWindow_CurrentMenu->Release(); | |
2145 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2146 window_SpeakInHouse = 0; | |
2147 pGUIWindow_CurrentMenu = 0; | |
2148 pEventTimer->Resume(); | |
2149 pCurrentScreen = SCREEN_GAME; | |
2150 viewparams->bRedrawGameUI = 1; | |
2151 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2152 continue; | |
2153 case SCREEN_SAVEGAME: | |
2154 case SCREEN_LOADGAME: | |
2155 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2156 //crt_deconstruct_ptr_6A0118(); | |
2157 stru_506E40.Release(); | |
2158 break; | |
2159 case SCREEN_CHEST_INVENTORY: | |
2160 pCurrentScreen = SCREEN_CHEST; | |
2161 continue; | |
2162 case SCREEN_CHEST: | |
2163 pWindow2 = pChestWindow; | |
2164 pWindow2->Release(); | |
2165 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2166 pCurrentScreen = SCREEN_GAME; | |
2167 viewparams->bRedrawGameUI = 1; | |
2168 pEventTimer->Resume(); | |
2169 continue; | |
2170 case SCREEN_19: | |
2171 __debugbreak(); | |
2172 pWindow2 = ptr_507BC8; | |
2173 pWindow2->Release(); | |
2174 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2175 pCurrentScreen = SCREEN_GAME; | |
2176 viewparams->bRedrawGameUI = 1; | |
2177 pEventTimer->Resume(); | |
2178 continue; | |
2179 case SCREEN_OPTIONS://Close | |
2180 options_menu_skin.Relaease(); | |
2181 pIcons_LOD->SyncLoadedFilesCount(); | |
2182 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier); | |
2183 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier); | |
2184 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier); | |
2185 WriteWindowsRegistryInt("WalkSound", bWalkSound); | |
2186 WriteWindowsRegistryInt("ShowDamage", bShowDamage); | |
2151 | 2187 //WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode); |
1915 | 2188 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); |
2189 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit); | |
2190 if ( !uTurnSpeed ) | |
2191 { | |
2192 WriteWindowsRegistryInt("TurnDelta", 3); | |
2193 stru_506E40.Release(); | |
2194 break; | |
2195 } | |
2196 if ( uTurnSpeed == 64 ) | |
2197 { | |
2198 WriteWindowsRegistryInt("TurnDelta", 2); | |
2199 stru_506E40.Release(); | |
2200 break; | |
2201 } | |
2202 if ( uTurnSpeed != 128 ) | |
2203 { | |
2204 stru_506E40.Release(); | |
2205 break; | |
2206 } | |
2207 WriteWindowsRegistryInt("TurnDelta", 1); | |
2208 stru_506E40.Release(); | |
2209 break; | |
2210 case SCREEN_MENU: | |
2211 pIcons_LOD->SyncLoadedFilesCount(); | |
2212 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2213 pIcons_LOD->SyncLoadedFilesCount(); | |
2214 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2215 stru_506E40.Release(); | |
2216 break; | |
2217 case SCREEN_VIDEO_OPTIONS: | |
2153 | 2218 //if ( pRenderer->pRenderD3D ) |
1915 | 2219 { |
2220 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights); | |
2221 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting); | |
2222 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pGame->uFlags2) >> 5) & 1); | |
2223 } | |
2155 | 2224 /*if ( !pRenderer->bWindowMode ) |
2225 WriteWindowsRegistryInt("GammaPos", uGammaPos);*/ | |
2154 | 2226 |
1915 | 2227 stru_506E40.Release(); |
2228 break; | |
2229 | |
2230 case SCREEN_KEYBOARD_OPTIONS://Return to game | |
2231 v197 = 1; | |
2232 v32 = 0; | |
2233 while ( !GameMenuUI_InvaligKeyBindingsFlags[v32]) | |
2234 { | |
2235 ++v32; | |
2236 if ( v32 >= 28 ) | |
2237 { | |
2238 thisb = (signed int)&uTextureID_Optkb; | |
2239 assert(false && "Invalid condition values"); | |
2240 do | |
2241 { | |
2242 if ( *(int *)thisb ) | |
2243 pIcons_LOD->pTextures[*(int *)thisb].Release(); | |
2244 thisb += 4; | |
2245 } | |
2246 while ( thisb < (signed int)0x00507C08 ); | |
2247 | |
2248 memset(&uTextureID_Optkb, 0, 0x14u); | |
2249 pIcons_LOD->SyncLoadedFilesCount(); | |
2250 uAction = 0; | |
2251 do | |
2252 { | |
2253 v33 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
2254 if ( v33 != pPrevVirtualCidesMapping[uAction] ) | |
2255 { | |
2256 if ( v197 ) | |
2257 { | |
2258 v34 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
2259 GUI_ReplaceHotkey(v34, LOBYTE(pPrevVirtualCidesMapping[uAction]), 1); | |
2260 v197 = 0; | |
2261 } | |
2262 else | |
2263 { | |
2264 v35 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
2265 GUI_ReplaceHotkey(v35, LOBYTE(pPrevVirtualCidesMapping[uAction]), 0); | |
2266 } | |
2267 } | |
2268 if ( uAction && uAction != 2 && uAction != 3 && uAction != 1 && uAction != 25 && uAction != 26 ) | |
2201 | 2269 pKeyToggleType = TOGGLE_OneTimePress; |
1915 | 2270 else |
2201 | 2271 pKeyToggleType = TOGGLE_Continuously; |
1915 | 2272 pKeyActionMap->SetKeyMapping(uAction, pPrevVirtualCidesMapping[uAction], pKeyToggleType); |
2273 ++uAction; | |
2274 } | |
2275 while ( uAction < 28 ); | |
2276 pKeyActionMap->StoreMappings(); | |
2277 stru_506E40.Release(); | |
2278 break; | |
2279 } | |
2280 } | |
2281 break; | |
2282 case SCREEN_REST://close rest screen | |
2283 if ( dword_506F14 ) | |
2284 { | |
2285 Rest(_506F18_num_minutes_to_sleep); | |
2286 pParty->pPlayers[3].SetAsleep(false); | |
2287 pParty->pPlayers[2].SetAsleep(false); | |
2288 pParty->pPlayers[1].SetAsleep(false); | |
2289 pParty->pPlayers[0].SetAsleep(false); | |
2290 } | |
2291 pTexture_RestUI_CurrentSkyFrame->Release(); | |
2292 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
2293 pTexture_RestUI_CurrentHourglassFrame = 0; | |
2294 pTexture_RestUI_CurrentSkyFrame = 0; | |
2295 pIcons_LOD->SyncLoadedFilesCount(); | |
2296 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2297 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
2298 { | |
2299 pOutdoor->UpdateSunlightVectors(); | |
2300 pOutdoor->UpdateFog(); | |
2301 } | |
2302 _506F18_num_minutes_to_sleep = 0; | |
2303 dword_506F14 = 0; | |
2304 if ( pGUIWindow_Settings ) | |
2305 { | |
2306 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2307 { | |
2308 pMouse->SetCursorBitmap("MICON2"); | |
2309 } | |
2310 else | |
2311 { | |
2312 pGUIWindow_Settings->Release(); | |
2313 pGUIWindow_Settings = 0; | |
2314 pMouse->SetCursorBitmap("MICON1"); | |
2315 GameUI_Footer_TimeLeft = 0; | |
2316 _50C9A0_IsEnchantingInProgress = 0; | |
2317 back_to_game(); | |
2318 } | |
2319 } | |
2320 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2321 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2322 pGUIWindow_CurrentMenu->Release(); | |
2323 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2324 window_SpeakInHouse = 0; | |
2325 pGUIWindow_CurrentMenu = 0; | |
2326 pEventTimer->Resume(); | |
2327 pCurrentScreen = SCREEN_GAME; | |
2328 viewparams->bRedrawGameUI = 1; | |
2329 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2330 continue; | |
2331 case SCREEN_E: | |
2332 __debugbreak(); | |
2333 pGUIWindow_CurrentMenu->Release(); | |
2334 pCurrentScreen = SCREEN_HOUSE; | |
2335 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2336 continue; | |
2337 case SCREEN_HOUSE: | |
2338 if ( uDialogueType ) | |
2339 uDialogueType = 0; | |
2124 | 2340 if ( uGameState == GAME_STATE_CHANGE_LOCATION ) |
1915 | 2341 { |
1919 | 2342 while ( HouseDialogPressCloseBtn() ) |
1915 | 2343 ; |
2344 } | |
2345 else | |
2346 { | |
1919 | 2347 if ( HouseDialogPressCloseBtn() ) |
1915 | 2348 continue; |
2349 } | |
2350 GetHouseGoodbyeSpeech(); | |
2351 pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0); | |
2352 pVideoPlayer->Unload(); | |
2353 pGUIWindow_CurrentMenu = window_SpeakInHouse; | |
2354 if ( pGUIWindow_Settings ) | |
2355 { | |
2356 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2357 { | |
2358 pMouse->SetCursorBitmap("MICON2"); | |
2359 } | |
2360 else | |
2361 { | |
2362 pGUIWindow_Settings->Release(); | |
2363 pGUIWindow_Settings = 0; | |
2364 pMouse->SetCursorBitmap("MICON1"); | |
2365 GameUI_Footer_TimeLeft = 0; | |
2366 _50C9A0_IsEnchantingInProgress = 0; | |
2367 back_to_game(); | |
2368 } | |
2369 } | |
2370 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2371 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2372 pGUIWindow_CurrentMenu->Release(); | |
2373 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2374 window_SpeakInHouse = 0; | |
2375 pGUIWindow_CurrentMenu = 0; | |
2376 pEventTimer->Resume(); | |
2377 pCurrentScreen = SCREEN_GAME; | |
2378 viewparams->bRedrawGameUI = true; | |
2379 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2380 continue; | |
2381 case SCREEN_INPUT_BLV://click escape | |
2382 if ( uCurrentHouse_Animation == 153 ) | |
2383 PlayHouseSound(0x99u, HouseSound_Greeting_2); | |
2384 pVideoPlayer->Unload(); | |
2385 if ( npcIdToDismissAfterDialogue ) | |
2386 { | |
2387 pParty->hirelingScrollPosition = 0; | |
2388 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu; | |
2389 pParty->CountHirelings(); | |
2390 viewparams->bRedrawGameUI = true; | |
2391 npcIdToDismissAfterDialogue = 0; | |
2392 } | |
2393 DialogueEnding(); | |
2394 pCurrentScreen = SCREEN_GAME; | |
2395 viewparams->bRedrawGameUI = true; | |
2396 continue; | |
2397 case SCREEN_NPC_DIALOGUE://click escape | |
2398 if ( npcIdToDismissAfterDialogue ) | |
2399 { | |
2400 pParty->hirelingScrollPosition = 0; | |
2401 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu; | |
2402 pParty->CountHirelings(); | |
2403 viewparams->bRedrawGameUI = true; | |
2404 npcIdToDismissAfterDialogue = 0; | |
2405 } | |
2406 //goto LABEL_317; | |
2407 DialogueEnding(); | |
2408 pCurrentScreen = SCREEN_GAME; | |
2409 viewparams->bRedrawGameUI = true; | |
2410 continue; | |
2411 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape | |
2412 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); | |
2413 sub_4452BB(); | |
2414 DialogueEnding(); | |
2415 pCurrentScreen = SCREEN_GAME; | |
2416 viewparams->bRedrawGameUI = true; | |
2417 continue; | |
2418 case SCREEN_CHANGE_LOCATION://click escape | |
2419 if ( pParty->vPosition.x < -22528 ) | |
2420 pParty->vPosition.x = -22528; | |
2421 if ( pParty->vPosition.x > 22528 ) | |
2422 pParty->vPosition.x = 22528; | |
2423 if ( pParty->vPosition.y < -22528 ) | |
2424 pParty->vPosition.y = -22528; | |
2425 if ( pParty->vPosition.y > 22528 ) | |
2426 pParty->vPosition.y = 22528; | |
2427 DialogueEnding(); | |
2428 pCurrentScreen = SCREEN_GAME; | |
2429 viewparams->bRedrawGameUI = true; | |
2430 continue; | |
2431 case SCREEN_VIDEO: | |
2432 pVideoPlayer->Unload(); | |
2433 continue; | |
2434 case SCREEN_CHARACTERS: | |
2435 CharacterUI_ReleaseButtons(); | |
2436 ReleaseAwardsScrollBar(); | |
2437 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2438 if ( pGUIWindow_Settings ) | |
2439 { | |
2440 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2441 { | |
2442 pMouse->SetCursorBitmap("MICON2"); | |
2443 } | |
2444 else | |
2445 { | |
2446 pGUIWindow_Settings->Release(); | |
2447 pGUIWindow_Settings = 0; | |
2448 pMouse->SetCursorBitmap("MICON1"); | |
2449 GameUI_Footer_TimeLeft = 0; | |
2450 _50C9A0_IsEnchantingInProgress = 0; | |
2451 back_to_game(); | |
2452 } | |
2453 } | |
2454 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2455 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2456 pGUIWindow_CurrentMenu->Release(); | |
2457 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2458 window_SpeakInHouse = 0; | |
2459 pGUIWindow_CurrentMenu = 0; | |
2460 pEventTimer->Resume(); | |
2461 pCurrentScreen = SCREEN_GAME; | |
2462 viewparams->bRedrawGameUI = true; | |
2463 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2464 continue; | |
2465 default: | |
2466 if ( pGUIWindow_Settings ) | |
2467 { | |
2468 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2469 { | |
2470 pMouse->SetCursorBitmap("MICON2"); | |
2471 } | |
2472 else | |
2473 { | |
2474 pGUIWindow_Settings->Release(); | |
2475 pGUIWindow_Settings = 0; | |
2476 pMouse->SetCursorBitmap("MICON1"); | |
2477 GameUI_Footer_TimeLeft = 0; | |
2478 _50C9A0_IsEnchantingInProgress = 0; | |
2479 back_to_game(); | |
2480 } | |
2481 } | |
2482 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2483 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2484 pGUIWindow_CurrentMenu->Release(); | |
2485 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2486 window_SpeakInHouse = 0; | |
2487 pGUIWindow_CurrentMenu = 0; | |
2488 pEventTimer->Resume(); | |
2489 pCurrentScreen = SCREEN_GAME; | |
2490 viewparams->bRedrawGameUI = 1; | |
2491 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2492 continue; | |
2493 } | |
2494 if ( pGUIWindow_Settings ) | |
2495 { | |
2496 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2497 { | |
2498 pMouse->SetCursorBitmap("MICON2"); | |
2499 } | |
2500 else | |
2501 { | |
2502 pGUIWindow_Settings->Release(); | |
2503 pGUIWindow_Settings = 0; | |
2504 pMouse->SetCursorBitmap("MICON1"); | |
2505 GameUI_Footer_TimeLeft = 0; | |
2506 _50C9A0_IsEnchantingInProgress = 0; | |
2507 back_to_game(); | |
2508 } | |
2509 } | |
2510 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2511 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2512 pGUIWindow_CurrentMenu->Release(); | |
2513 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2514 window_SpeakInHouse = 0; | |
2515 pGUIWindow_CurrentMenu = 0; | |
2516 pEventTimer->Resume(); | |
2517 pCurrentScreen = SCREEN_GAME; | |
2518 viewparams->bRedrawGameUI = true; | |
2519 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2520 continue; | |
2521 } | |
2522 CharacterUI_ReleaseButtons(); | |
2523 ReleaseAwardsScrollBar(); | |
2524 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2525 } | |
2526 if ( pGUIWindow_Settings ) | |
2527 { | |
2528 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2529 { | |
2530 pMouse->SetCursorBitmap("MICON2"); | |
2531 } | |
2532 else | |
2533 { | |
2534 pGUIWindow_Settings->Release(); | |
2535 pGUIWindow_Settings = 0; | |
2536 pMouse->SetCursorBitmap("MICON1"); | |
2537 GameUI_Footer_TimeLeft = 0; | |
2538 _50C9A0_IsEnchantingInProgress = 0; | |
2539 back_to_game(); | |
2540 } | |
2541 } | |
2542 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2543 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2544 pGUIWindow_CurrentMenu->Release(); | |
2545 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2546 window_SpeakInHouse = 0; | |
2547 pGUIWindow_CurrentMenu = 0; | |
2548 pEventTimer->Resume(); | |
2549 pCurrentScreen = SCREEN_GAME; | |
2550 viewparams->bRedrawGameUI = true; | |
2551 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2552 continue; | |
2553 } | |
2554 if ( !pGUIWindow_Settings )//Draw Menu | |
2555 { | |
2556 dword_6BE138 = -1; | |
2557 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, (char *)1); | |
2558 pEventTimer->Pause(); | |
2559 pAudioPlayer->StopChannels(-1, -1); | |
2560 pCurrentScreen = SCREEN_MENU; | |
2561 | |
2562 ++pIcons_LOD->uTexturePacksCount; | |
2563 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2564 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2565 | |
2566 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_OptionsButtons, 0, 0); | |
2567 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); | |
2568 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); | |
2569 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE); | |
2570 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE); | |
2571 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); | |
2572 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
2573 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE); | |
2574 pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu, | |
2575 pGlobalTXT_LocalizationStrings[614],// "New Game" | |
2576 pIcons_LOD->GetTexture(uTextureID_New1), 0); | |
2577 pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u, | |
2578 pGlobalTXT_LocalizationStrings[615],// "Save Game" | |
2579 pIcons_LOD->GetTexture(uTextureID_Save1), 0); | |
2580 pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu, | |
2581 pGlobalTXT_LocalizationStrings[616],// "Load Game" | |
2582 pIcons_LOD->GetTexture(uTextureID_Load1), 0); | |
2583 pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u, | |
2584 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:"" | |
2585 pIcons_LOD->GetTexture(uTextureID_Controls1), 0); | |
2586 pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u, | |
2587 pGlobalTXT_LocalizationStrings[618],// "Quit" | |
2588 pIcons_LOD->GetTexture(uTextureID_Quit1), 0); | |
2589 pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u, | |
2590 pGlobalTXT_LocalizationStrings[619],// "Return to Game" | |
2591 pIcons_LOD->GetTexture(uTextureID_Resume1), 0); | |
2592 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0); | |
2593 viewparams->field_48 = 1; | |
2154 | 2594 |
1915 | 2595 stru_506E40.Release(); |
2154 | 2596 pRenderer->SaveScreenshot("gamma.pcx", 155, 117); |
2131 | 2597 stru_506E40.LoadPCXFile("gamma.pcx", 0); |
2154 | 2598 |
1915 | 2599 continue; |
2600 } | |
2601 pGUIWindow_Settings->Release(); | |
2602 pGUIWindow_Settings = 0; | |
2603 pMouse->SetCursorBitmap("MICON1"); | |
2604 GameUI_Footer_TimeLeft = 0; | |
2605 _50C9A0_IsEnchantingInProgress = 0; | |
2606 back_to_game(); | |
2607 continue; | |
2608 } | |
2609 ModalWindow_Release(); | |
2610 continue; | |
2611 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel | |
2612 if ( uMessageParam ) | |
2613 { | |
2614 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0); | |
2615 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2; | |
2616 if ( pParty->hirelingScrollPosition < v37 ) | |
2617 { | |
2618 ++pParty->hirelingScrollPosition;//??? maybe number of the first cell??? | |
2619 if ( pParty->hirelingScrollPosition >= v37 ) | |
2620 pParty->hirelingScrollPosition = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2; | |
2621 } | |
2622 } | |
2623 else | |
2624 { | |
2625 GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0); | |
2626 /*if ( pParty->field_709 ) | |
2627 { | |
2628 --pParty->field_709; | |
2629 if ( pParty->field_709 < 1 ) | |
2630 pParty->field_709 = 0; | |
2631 }*/ | |
2632 } | |
2633 GameUI_DrawHiredNPCs(); | |
2634 continue; | |
2635 case UIMSG_TransitionUI_Confirm: | |
2636 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2637 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2638 dword_50CDC8 = 1; | |
2639 sub_42FBDD(); | |
2640 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful); | |
2641 pVideoPlayer->Unload(); | |
2642 DialogueEnding(); | |
2124 | 2643 viewparams->bRedrawGameUI = true; |
1915 | 2644 if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz ) |
2645 { | |
2646 if ( dword_59117C_teleportx ) | |
2647 { | |
2648 pParty->vPosition.x = dword_59117C_teleportx; | |
2649 _5B65A8_npcdata_uflags_or_other = dword_59117C_teleportx; | |
2650 } | |
2651 if ( dword_591178_teleporty ) | |
2652 { | |
2653 pParty->vPosition.y = dword_591178_teleporty; | |
2654 _5B65AC_npcdata_fame_or_other = dword_591178_teleporty; | |
2655 } | |
2656 if ( dword_591174_teleportz ) | |
2657 { | |
2658 pParty->vPosition.z = dword_591174_teleportz; | |
2659 _5B65B0_npcdata_rep_or_other = dword_591174_teleportz; | |
2660 pParty->uFallStartY = dword_591174_teleportz; | |
2661 } | |
2662 if ( dword_591170_teleport_directiony ) | |
2663 { | |
2664 pParty->sRotationY = dword_591170_teleport_directiony; | |
2665 _5B65B4_npcdata_loword_house_or_other = dword_591170_teleport_directiony; | |
2666 } | |
2667 if ( dword_59116C_teleport_directionx ) | |
2668 { | |
2669 pParty->sRotationX = dword_59116C_teleport_directionx; | |
2670 _5B65B8_npcdata_hiword_house_or_other = dword_59116C_teleport_directionx; | |
2671 v38 = dword_591168_teleport_speedz; | |
2672 pParty->uFallSpeed = dword_591168_teleport_speedz; | |
2673 dword_5B65BC = dword_591168_teleport_speedz; | |
2674 } | |
2675 else | |
2676 v38 = dword_5B65BC; | |
2677 if ( *dword_591164_teleport_map_name != 48 ) | |
2678 { | |
2679 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2; | |
2680 dword_5B65C0 = _5B65A8_npcdata_uflags_or_other | _5B65AC_npcdata_fame_or_other | _5B65B0_npcdata_rep_or_other | _5B65B4_npcdata_loword_house_or_other | _5B65B8_npcdata_hiword_house_or_other | v38; | |
2681 OnMapLeave(); | |
2101 | 2682 Transition_StopSound_Autosave(dword_591164_teleport_map_name, MapStartPoint_Party); |
1915 | 2683 } |
2684 } | |
2685 else | |
2686 EventProcessor(dword_5C3418, 0, 1, dword_5C341C); | |
2687 if ( !_stricmp(byte_6BE3B0.data(), "d05.blv") ) | |
2688 pParty->uTimePlayed += 1474560i64; | |
2689 continue; | |
2690 case UIMSG_TransitionWindowCloseBtn: | |
2691 CloseWindowBackground(); | |
2692 pVideoPlayer->Unload(); | |
2693 DialogueEnding(); | |
2694 viewparams->bRedrawGameUI = true; | |
2695 continue; | |
2696 case UIMSG_CycleCharacters: | |
2697 v39 = GetAsyncKeyState(VK_SHIFT); | |
2698 uActiveCharacter = CycleCharacter(v39); | |
2699 viewparams->bRedrawGameUI = true; | |
2700 continue; | |
2701 case UIMSG_OnTravelByFoot: | |
2702 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2703 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2704 dword_50CDC8 = 1; | |
2705 sub_42FBDD(); | |
2706 //pNPCData4 = (NPCData *)GetTravelTime(); | |
2707 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); | |
2708 if ( bUnderwater != 1 && pParty->bFlying | |
2709 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) | |
2710 { | |
2711 viewparams->bRedrawGameUI = 1; | |
2712 CloseWindowBackground(); | |
2713 if ( pParty->vPosition.x < -22528 ) | |
2714 pParty->vPosition.x = -22528; | |
2715 if ( pParty->vPosition.x > 22528 ) | |
2716 pParty->vPosition.x = 22528; | |
2717 if ( pParty->vPosition.y < -22528 ) | |
2718 pParty->vPosition.y = -22528; | |
2719 if ( pParty->vPosition.y > 22528 ) | |
2720 pParty->vPosition.y = 22528; | |
2721 DialogueEnding(); | |
2722 pCurrentScreen = SCREEN_GAME; | |
2723 } | |
2724 else | |
2725 { | |
2726 pParty->field_6E4 = 0; | |
2727 pParty->field_6E0 = 0; | |
2728 CastSpellInfoHelpers::_427D48(); | |
2729 DialogueEnding(); | |
2730 pEventTimer->Pause(); | |
2731 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box); | |
2732 ++pGameLoadingUI_ProgressBar->uProgressMax; | |
2733 SaveGame(1, 0); | |
2734 pGameLoadingUI_ProgressBar->Progress(); | |
2735 RestAndHeal(1440 * (signed int)GetTravelTime()); | |
2736 if ( pParty->uNumFoodRations ) | |
2737 { | |
2738 pParty->RestAndHeal(); | |
2739 if ( ((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0 ) | |
2740 { | |
2741 pPlayer7 = pParty->pPlayers.data(); | |
2742 do | |
2743 { | |
2744 pPlayer7->SetCondition(1, 0); | |
2745 ++pPlayer7; | |
2746 } | |
2747 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings.data() ); | |
2748 ++pParty->days_played_without_rest; | |
2749 } | |
2750 Party::TakeFood((unsigned int)GetTravelTime()); | |
2751 } | |
2752 else | |
2753 { | |
2754 pPlayer8 = pParty->pPlayers.data(); | |
2755 do | |
2756 { | |
2757 pPlayer8->SetCondition(1, 0); | |
2758 ++pPlayer8; | |
2759 } | |
2760 while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings.data() ); | |
2761 ++pParty->days_played_without_rest; | |
2762 } | |
2763 pPaletteManager->ResetNonLocked(); | |
2764 pSpriteFrameTable->ResetSomeSpriteFlags(); | |
2765 strcpy(pCurrentMapName, pOut); | |
2766 strcpy(pLevelName, pCurrentMapName); | |
2767 v41 = strtok(pLevelName, "."); | |
2768 strcpy(pLevelName, v41); | |
2769 Level_LoadEvtAndStr(pLevelName); | |
2770 pDecalBuilder->Reset(0); | |
2771 LoadLevel_InitializeLevelEvt(); | |
2772 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName); | |
2773 bUnderwater = 0; | |
2774 bNoNPCHiring = 0; | |
2775 pGame->uFlags2 &= 0xFFFFFFF7u; | |
2776 if ( Is_out15odm_underwater() ) | |
2777 { | |
2778 bUnderwater = 1; | |
2779 pGame->uFlags2 |= 8u; | |
2780 } | |
2781 if ( !_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d47.blv") ) | |
2782 bNoNPCHiring = 1; | |
2783 PrepareToLoadODM(1u, (ODMRenderParams *)1); | |
2784 pAudioPlayer->SetMapEAX(); | |
2785 bDialogueUI_InitializeActor_NPC_ID = 0; | |
2786 OnMapLoad(); | |
2787 pOutdoor->SetFog(); | |
2788 TeleportToStartingPoint(uLevel_StartingPointType); | |
2789 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0); | |
2790 pParty->uFallStartY = pParty->vPosition.z; | |
2791 _461103_load_level_sub(); | |
2792 pEventTimer->Resume(); | |
2793 viewparams->bRedrawGameUI = 1; | |
2794 pCurrentScreen = SCREEN_GAME; | |
2795 pGameLoadingUI_ProgressBar->Release(); | |
2796 } | |
2797 viewparams->bRedrawGameUI = 1; | |
2798 continue; | |
2799 case UIMSG_CHANGE_LOCATION_ClickCencelBtn: | |
2800 CloseWindowBackground(); | |
2801 if ( pParty->vPosition.x < -22528 ) | |
2802 pParty->vPosition.x = -22528; | |
2803 if ( pParty->vPosition.x > 22528 ) | |
2804 pParty->vPosition.x = 22528; | |
2805 if ( pParty->vPosition.y < -22528 ) | |
2806 pParty->vPosition.y = -22528; | |
2807 if ( pParty->vPosition.y > 22528 ) | |
2808 pParty->vPosition.y = 22528; | |
2809 DialogueEnding(); | |
2810 pCurrentScreen = SCREEN_GAME; | |
2811 viewparams->bRedrawGameUI = 1; | |
2812 continue; | |
2813 case UIMSG_CastSpell_Telekinesis: | |
2153 | 2814 //if ( pRenderer->pRenderD3D ) |
1915 | 2815 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); |
2153 | 2816 /*else |
1915 | 2817 { |
2818 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210); | |
2819 pPoint = pMouse->GetCursorPos(&v208); | |
2820 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]]; | |
2153 | 2821 }*/ |
1915 | 2822 v44 = (unsigned __int16)v42; |
2823 v45 = PID_TYPE(v44); | |
2824 uNumSeconds = v44; | |
2825 v46 = PID_ID(v44); | |
2826 if ( v45 == 3 ) | |
2827 { | |
2828 v47 = pActors[v46].uAIState == Dead; | |
2829 if ( !v47 ) | |
2830 continue; | |
2831 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2832 pSpellInfo->uFlags &= ~0x40u; | |
2833 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2834 pSpellInfo->spell_target_pid = v44; | |
2835 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2836 pGUIWindow_Settings->Release(); | |
2837 pGUIWindow_Settings = 0; | |
2838 pMouse->SetCursorBitmap("MICON1"); | |
2839 GameUI_Footer_TimeLeft = 0; | |
2840 _50C9A0_IsEnchantingInProgress = 0; | |
2841 back_to_game(); | |
2842 continue; | |
2843 } | |
2844 if ( v45 == 2 ) | |
2845 { | |
2846 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; | |
2847 if ( !v47 ) | |
2848 continue; | |
2849 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2850 pSpellInfo->uFlags &= ~0x40u; | |
2851 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2852 pSpellInfo->spell_target_pid = v44; | |
2853 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2854 pGUIWindow_Settings->Release(); | |
2855 pGUIWindow_Settings = 0; | |
2856 pMouse->SetCursorBitmap("MICON1"); | |
2857 GameUI_Footer_TimeLeft = 0; | |
2858 _50C9A0_IsEnchantingInProgress = 0; | |
2859 back_to_game(); | |
2860 continue; | |
2861 } | |
2862 if ( v45 == 5 ) | |
2863 { | |
2864 v48 = pLevelDecorations[v46].uEventID == 0; | |
2865 } | |
2866 else | |
2867 { | |
2868 if ( v45 != 6 ) | |
2869 continue; | |
2870 if ( uCurrentlyLoadedLevelType != 1 ) | |
2871 { | |
2872 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; | |
2092 | 2873 if ( !pODMFace->Clickable() || !pODMFace->sCogTriggeredID ) |
1915 | 2874 continue; |
2875 v44 = uNumSeconds; | |
2876 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2877 pSpellInfo->uFlags &= ~0x40u; | |
2878 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2879 pSpellInfo->spell_target_pid = v44; | |
2880 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2881 pGUIWindow_Settings->Release(); | |
2882 pGUIWindow_Settings = 0; | |
2883 pMouse->SetCursorBitmap("MICON1"); | |
2884 GameUI_Footer_TimeLeft = 0; | |
2885 _50C9A0_IsEnchantingInProgress = 0; | |
2886 back_to_game(); | |
2887 continue; | |
2888 } | |
2889 pBLVFace = &pIndoor->pFaces[v46]; | |
2092 | 2890 if ( !pBLVFace->Clickable() ) |
1915 | 2891 continue; |
2892 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; | |
2893 } | |
2894 if ( v48 ) | |
2895 continue; | |
2896 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2897 pSpellInfo->uFlags &= ~0x40u; | |
2898 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2899 pSpellInfo->spell_target_pid = v44; | |
2900 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2901 pGUIWindow_Settings->Release(); | |
2902 pGUIWindow_Settings = 0; | |
2903 pMouse->SetCursorBitmap("MICON1"); | |
2904 GameUI_Footer_TimeLeft = 0; | |
2905 _50C9A0_IsEnchantingInProgress = 0; | |
2906 back_to_game(); | |
2907 continue; | |
2908 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade) | |
2909 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure | |
2910 case UIMSG_HiredNPC_CastSpell: | |
2911 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2912 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2913 if ( _50C9A0_IsEnchantingInProgress ) | |
2914 { | |
2915 uActiveCharacter = uMessageParam; | |
2916 viewparams->bRedrawGameUI = 1; | |
2917 } | |
2918 else | |
2919 { | |
2920 if ( pGUIWindow_Settings ) | |
2921 { | |
2922 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2923 switch ( uMessage ) | |
2924 { | |
2925 case UIMSG_CastSpell_Character_Big_Improvement: | |
2926 pSpellInfo->uFlags &= ~0x02u; | |
2927 break; | |
2928 case UIMSG_CastSpell_Character_Small_Improvement: | |
2929 pSpellInfo->uFlags &= ~0x0100u; | |
2930 break; | |
2931 case UIMSG_HiredNPC_CastSpell: | |
2932 pSpellInfo->uFlags &= ~0x0200u; | |
2933 break; | |
2934 } | |
2935 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2936 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2937 pGUIWindow_Settings->Release(); | |
2938 pGUIWindow_Settings = 0; | |
2939 pEventTimer->Resume(); | |
2940 pMouse->SetCursorBitmap("MICON1"); | |
2941 GameUI_Footer_TimeLeft = 0; | |
2942 _50C9A0_IsEnchantingInProgress = 0; | |
2943 } | |
2944 } | |
2945 continue; | |
2946 case UIMSG_BF: | |
2947 __debugbreak(); | |
2948 dword_50CDC8 = 1; | |
2949 sub_42FBDD(); | |
2950 SaveGame(1, 0); | |
2951 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); | |
2061 | 2952 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 2953 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 2954 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; |
2955 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related; | |
2956 if ( v53 < 0 ) | |
2957 { | |
2958 v54 = abs(v53) - 1; | |
2959 _5B65B8_npcdata_hiword_house_or_other = 0; | |
2960 dword_5B65BC = 0; | |
2961 v55 = dword_4E4560[v54]; | |
2962 _5B65AC_npcdata_fame_or_other = dword_4E4578[v54]; | |
2963 v56 = dword_4E4590[v54]; | |
2964 v57 = dword_4E45A8[v54]; | |
2965 _5B65A8_npcdata_uflags_or_other = v55; | |
2966 _5B65B4_npcdata_loword_house_or_other = v57; | |
2967 _5B65B0_npcdata_rep_or_other = v56; | |
2968 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57; | |
2969 } | |
1919 | 2970 HouseDialogPressCloseBtn(); |
1915 | 2971 //goto LABEL_434; |
2972 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
2973 { | |
2974 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
2975 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; | |
2976 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2977 ++pMessageQueue_50CBD0->uNumMessages; | |
2978 }*/ | |
2979 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2980 continue; | |
2981 | |
2982 case UIMSG_OnCastTownPortal: | |
2983 pAudioPlayer->StopChannels(-1, -1); | |
2984 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam); | |
2985 continue; | |
2986 | |
2987 case UIMSG_OnCastLloydsBeacon: | |
2988 pAudioPlayer->StopChannels(-1, -1); | |
2989 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_LloydsBeacon, 0); | |
2990 continue; | |
2991 | |
2992 case UIMSG_LloydsBeacon_FlippingBtn: | |
2993 bRecallingBeacon = uMessageParam; | |
2994 v127 = uMessageParam + 204; | |
2995 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); | |
2996 continue; | |
2997 case UIMSG_HintBeaconSlot: | |
2998 if ( !pGUIWindow_CurrentMenu ) | |
2999 continue; | |
3000 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1]; | |
3001 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam]; | |
3002 if ( bRecallingBeacon ) | |
3003 { | |
3004 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) ) | |
3005 continue; | |
3006 v173 = pMapStats->pInfos[sub_410D99_get_map_index(pPlayer->pInstalledBeacons[uMessageParam].SaveFileID)].pName; | |
3007 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s" | |
3008 GameUI_SetFooterString(pTmpBuf.data()); | |
3009 continue; | |
3010 } | |
3011 pMapNum = pMapStats->GetMapInfo(pCurrentMapName); | |
3012 pMapName = "Not in Map Stats"; | |
3013 if ( pMapNum ) | |
3014 pMapName = pMapStats->pInfos[pMapNum].pName; | |
3015 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) || !pMapNum ) | |
3016 { | |
3017 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], pMapName);// "Set to %s" | |
3018 GameUI_SetFooterString(pTmpBuf.data()); | |
3019 continue; | |
3020 } | |
3021 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; | |
3022 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], (unsigned int)pMapName, v174);// "Set %s over %s" | |
3023 GameUI_SetFooterString(pTmpBuf.data()); | |
3024 continue; | |
3025 case UIMSG_CloseAfterInstallBeacon: | |
3026 dword_50CDC8 = 1; | |
3027 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
3028 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
3029 continue; | |
3030 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3031 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
3032 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3033 ++pMessageQueue_50CBD0->uNumMessages;*/ | |
3034 continue; | |
3035 case UIMSG_InstallBeacon: | |
3036 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; | |
3037 if ( !pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon ) | |
3038 continue; | |
3039 byte_506360 = 1; | |
3040 pPlayer9->CanCastSpell(uRequiredMana); | |
3041 if ( pParty->bTurnBasedModeOn ) | |
3042 { | |
3043 v60 = sRecoveryTime; | |
3044 pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime; | |
3045 pPlayer9->SetRecoveryTime(v60); | |
3046 pTurnEngine->ApplyPlayerAction(); | |
3047 } | |
3048 else | |
3049 { | |
3050 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
3051 } | |
2185 | 3052 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[lloyds_beacon_spell_id], 0, 0, -1, 0, lloyds_beacon_sound_id, 0, 0); |
1915 | 3053 if ( bRecallingBeacon ) |
3054 { | |
3055 if ( _stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) ) | |
3056 { | |
3057 SaveGame(1, 0); | |
3058 OnMapLeave(); | |
3059 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]); | |
2061 | 3060 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 3061 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 3062 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; |
3063 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; | |
3064 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; | |
3065 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; | |
3066 _5B65B8_npcdata_hiword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; | |
3067 dword_5B65C0 = 1; | |
3068 } | |
3069 else | |
3070 { | |
3071 pParty->vPosition.x = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; | |
3072 pParty->vPosition.y = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; | |
3073 pParty->vPosition.z = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; | |
3074 pParty->uFallStartY = pParty->vPosition.z; | |
3075 pParty->sRotationY = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; | |
3076 pParty->sRotationX = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; | |
3077 } | |
3078 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
3079 pBooksWindow->Release(); | |
3080 pGUIWindow_CurrentMenu->Release(); | |
3081 pBooksWindow = 0; | |
3082 pGUIWindow_CurrentMenu = 0; | |
3083 } | |
3084 else | |
3085 { | |
3086 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1); | |
2154 | 3087 pRenderer->SaveScreenshot(a1, 92, 68); |
1915 | 3088 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1); |
2185 | 3089 pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(lloyds_beacon_spell_level << 7) * 0.033333335); |
1915 | 3090 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x; |
3091 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y; | |
3092 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z; | |
3093 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X = LOWORD(pParty->sRotationY); | |
3094 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y = LOWORD(pParty->sRotationX); | |
3095 if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 ) | |
3096 continue; | |
3097 for ( thisg = 0; thisg < (signed int)pGames_LOD->uNumSubDirs / 2; ++thisg ) | |
3098 { | |
3099 if ( !_stricmp((const char *)pGames_LOD->pSubIndices[thisg].pFilename, pCurrentMapName) ) | |
3100 pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID = thisg; | |
3101 } | |
3102 } | |
3103 continue; | |
3104 case UIMSG_ClickTownInTP: | |
3105 if ( uMessageParam ) | |
3106 { | |
3107 switch ( uMessageParam ) | |
3108 { | |
3109 case 1: | |
3110 v63 = 208; | |
3111 break; | |
3112 case 2: | |
3113 v63 = 207; | |
3114 break; | |
3115 case 3: | |
3116 v63 = 211; | |
3117 break; | |
3118 case 4: | |
3119 v63 = 209; | |
3120 break; | |
3121 default: | |
3122 if ( uMessageParam != 5 ) | |
3123 { | |
3124 LABEL_486: | |
3125 SaveGame(1, 0); | |
3126 v64 = pMapStats->GetMapInfo(pCurrentMapName); | |
3127 v65 = uMessageParam; | |
3128 if ( v64 == TownPortalList[uMessageParam].uMapInfoID ) | |
3129 { | |
3130 pParty->vPosition.x = TownPortalList[v65].pos.x; | |
3131 pParty->vPosition.y = TownPortalList[v65].pos.y; | |
3132 pParty->vPosition.z = TownPortalList[v65].pos.z; | |
3133 pParty->uFallStartY = pParty->vPosition.z; | |
3134 pParty->sRotationY = TownPortalList[v65].rot_y; | |
3135 pParty->sRotationX = TownPortalList[v65].rot_x; | |
3136 } | |
3137 else | |
3138 { | |
3139 SaveGame(1, 0); | |
3140 OnMapLeave(); | |
2061 | 3141 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 3142 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 3143 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename); |
3144 dword_5B65C0 = 1; | |
3145 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x; | |
3146 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y; | |
3147 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z; | |
3148 v66 = TownPortalList[uMessageParam].rot_x; | |
3149 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y; | |
3150 _5B65B8_npcdata_hiword_house_or_other = v66; | |
3151 InitializeActors(); | |
3152 } | |
3153 v67 = (char*)pGUIWindow_CurrentMenu->Hint; | |
3154 if ( v67 ) | |
3155 *((int *)v67 + 17) = 1; | |
3156 else | |
3157 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u); | |
3158 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
3159 { | |
3160 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3161 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; | |
3162 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3163 ++pMessageQueue_50CBD0->uNumMessages; | |
3164 }*/ | |
3165 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
3166 continue; | |
3167 } | |
3168 v63 = 210; | |
3169 break; | |
3170 } | |
3171 } | |
3172 else | |
3173 { | |
3174 v63 = 206; | |
3175 } | |
3176 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63) ) | |
3177 return; | |
3178 goto LABEL_486; | |
3179 case UIMSG_HintTownPortal: | |
3180 if ( uMessageParam ) | |
3181 { | |
3182 switch ( uMessageParam ) | |
3183 { | |
3184 case 1: | |
3185 v68 = 208; | |
3186 break; | |
3187 case 2: | |
3188 v68 = 207; | |
3189 break; | |
3190 case 3: | |
3191 v68 = 211; | |
3192 break; | |
3193 case 4: | |
3194 v68 = 209; | |
3195 break; | |
3196 default: | |
3197 if ( uMessageParam != 5 ) | |
3198 //goto LABEL_506; | |
3199 { | |
3200 if ( uMessageParam ) | |
3201 { | |
3202 switch ( uMessageParam ) | |
3203 { | |
3204 case 1: | |
3205 v69 = pMapStats->pInfos[4].pName; | |
3206 break; | |
3207 case 2: | |
3208 v69 = pMapStats->pInfos[3].pName; | |
3209 break; | |
3210 case 3: | |
3211 v69 = pMapStats->pInfos[10].pName; | |
3212 break; | |
3213 case 4: | |
3214 v69 = pMapStats->pInfos[7].pName; | |
3215 break; | |
3216 default: | |
3217 if ( uMessageParam != 5 ) | |
3218 { | |
3219 __debugbreak(); // warning C4700: uninitialized local variable 'v200' used | |
3220 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); | |
3221 GameUI_SetFooterString(pTmpBuf.data()); | |
3222 continue; | |
3223 } | |
3224 v69 = pMapStats->pInfos[8].pName; | |
3225 break; | |
3226 } | |
3227 } | |
3228 else | |
3229 { | |
3230 v69 = pMapStats->pInfos[21].pName; | |
3231 } | |
3232 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69); | |
3233 GameUI_SetFooterString(pTmpBuf.data()); | |
3234 continue; | |
3235 } | |
3236 v68 = 210; | |
3237 break; | |
3238 } | |
3239 } | |
3240 else | |
3241 { | |
3242 v68 = 206; | |
3243 } | |
3244 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v68) ) | |
3245 { | |
3246 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); | |
3247 continue; | |
3248 } | |
3249 //LABEL_506: | |
3250 if ( uMessageParam ) | |
3251 { | |
3252 switch ( uMessageParam ) | |
3253 { | |
3254 case 1: | |
3255 v69 = pMapStats->pInfos[4].pName; | |
3256 break; | |
3257 case 2: | |
3258 v69 = pMapStats->pInfos[3].pName; | |
3259 break; | |
3260 case 3: | |
3261 v69 = pMapStats->pInfos[10].pName; | |
3262 break; | |
3263 case 4: | |
3264 v69 = pMapStats->pInfos[7].pName; | |
3265 break; | |
3266 default: | |
3267 if ( uMessageParam != 5 ) | |
3268 //goto LABEL_519; | |
3269 { | |
3270 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); | |
3271 GameUI_SetFooterString(pTmpBuf.data()); | |
3272 continue; | |
3273 } | |
3274 v69 = pMapStats->pInfos[8].pName; | |
3275 break; | |
3276 } | |
3277 } | |
3278 else | |
3279 { | |
3280 v69 = pMapStats->pInfos[21].pName; | |
3281 } | |
3282 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69); | |
3283 GameUI_SetFooterString(pTmpBuf.data()); | |
3284 continue; | |
3285 case UIMSG_ShowFinalWindow: | |
3286 sprintfex(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." | |
3287 pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment." | |
3288 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." | |
3289 ModalWindow(pFinalMessage.data(), UIMSG_OnFinalWindowClose); | |
3290 uGameState = GAME_STATE_FINAL_WINDOW; | |
3291 continue; | |
3292 case UIMSG_OnFinalWindowClose: | |
3293 __debugbreak(); | |
3294 uGameState = GAME_STATE_PLAYING; | |
3295 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); | |
3296 __debugbreak(); // missed break/continue? | |
3297 case UIMSG_DD: | |
3298 __debugbreak(); | |
3299 sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer); | |
3300 memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); | |
3301 if ( v216.uPropCount == 1 ) | |
3302 { | |
3303 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2); | |
3304 v70 = atoi(v216.pProperties[0]); | |
3305 if ( v70 <= 0 || v70 >= 77 ) | |
3306 continue; | |
3307 v71 = v70; | |
3308 strcpy(Str2, pMapStats->pInfos[v70].pFilename); | |
3309 pNPCData3 = 0; | |
3310 if ( (signed int)pNPCData4 > 0 ) | |
3311 { | |
3312 thish = 0; | |
3313 do | |
3314 { | |
3315 if ( !_stricmp((const char *)&pGames_LOD->pSubIndices[thish], Str2) ) | |
3316 break; | |
3317 ++thish; | |
3318 pNPCData3 = (NPCData *)((char *)pNPCData3 + 1); | |
3319 } | |
3320 while ( (signed int)pNPCData3 < (signed int)pNPCData4 ); | |
3321 if ( (signed int)pNPCData3 < (signed int)pNPCData4 ) | |
3322 { | |
3323 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); | |
2061 | 3324 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 3325 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 3326 OnMapLeave(); |
3327 continue; | |
3328 } | |
3329 } | |
3330 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName); | |
3331 v73 = Str2; | |
3332 } | |
3333 else | |
3334 { | |
3335 if ( v216.uPropCount != 3 ) | |
3336 continue; | |
3337 v74 = atoi(v216.pProperties[0]); | |
3338 thisi = atoi(v216.pProperties[1]); | |
3339 v75 = atoi(v216.pProperties[2]); | |
3340 v76 = v75; | |
3341 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
3342 { | |
3343 if ( pIndoor->GetSector(v74, thisi, v75) ) | |
3344 { | |
3345 v77 = thisi; | |
3346 pParty->vPosition.x = v74; | |
3347 pParty->vPosition.y = v77; | |
3348 pParty->vPosition.z = v76; | |
3349 pParty->uFallStartY = v76; | |
3350 continue; | |
3351 } | |
3352 } | |
3353 else | |
3354 { | |
3355 if ( v74 > -32768 ) | |
3356 { | |
3357 if ( v74 < 32768 ) | |
3358 { | |
3359 v77 = thisi; | |
3360 if ( thisi > -32768 ) | |
3361 { | |
3362 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 ) | |
3363 { | |
3364 pParty->vPosition.x = v74; | |
3365 pParty->vPosition.y = v77; | |
3366 pParty->vPosition.z = v76; | |
3367 pParty->uFallStartY = v76; | |
3368 continue; | |
3369 } | |
3370 } | |
3371 } | |
3372 } | |
3373 } | |
3374 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
3375 v73 = "Can't jump to that location!"; | |
3376 } | |
3377 ShowStatusBarString(v73, 6u); | |
3378 continue; | |
3379 case UIMSG_CastQuickSpell: | |
3380 if ( bUnderwater == 1 ) | |
3381 { | |
3382 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" | |
3383 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3384 continue; | |
3385 } | |
3386 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) | |
3387 continue; | |
3388 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); | |
3389 continue; | |
3390 case UIMSG_CastSpell_Monster_Improvement: | |
3391 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm, | |
2154 | 3392 //if ( pRenderer->pRenderD3D ) |
1915 | 3393 { |
3394 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
3395 } | |
2154 | 3396 /*else |
1915 | 3397 { |
3398 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206); | |
3399 pPoint2 = pMouse->GetCursorPos(&v201); | |
3400 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]]; | |
2154 | 3401 }*/ |
1915 | 3402 v83 = v81; |
3403 v44 = (unsigned __int16)v81; | |
3404 v84 = v83 >> 16; | |
3405 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) | |
3406 continue; | |
3407 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
3408 if ( uMessage == UIMSG_CastSpell_Shoot_Monster ) | |
3409 { | |
3410 pSpellInfo->uFlags &= ~0x08; | |
3411 } | |
3412 else | |
3413 { | |
3414 if ( uMessage == UIMSG_CastSpell_Monster_Improvement ) | |
3415 pSpellInfo->uFlags &= ~0x0100u; | |
3416 else | |
3417 pSpellInfo->uFlags &= ~0x0200u; | |
3418 } | |
3419 pSpellInfo->uPlayerID_2 = uMessageParam; | |
3420 pSpellInfo->spell_target_pid = v44; | |
3421 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
3422 pGUIWindow_Settings->Release(); | |
3423 pGUIWindow_Settings = 0; | |
3424 pMouse->SetCursorBitmap("MICON1"); | |
3425 GameUI_Footer_TimeLeft = 0; | |
3426 _50C9A0_IsEnchantingInProgress = 0; | |
3427 back_to_game(); | |
3428 continue; | |
3429 case UIMSG_1C: | |
3430 __debugbreak(); | |
3431 if ( !uActiveCharacter || pCurrentScreen ) | |
3432 continue; | |
3433 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0); | |
3434 pCurrentScreen = SCREEN_19; | |
3435 pEventTimer->Pause(); | |
3436 continue; | |
3437 case UIMSG_STEALFROMACTOR: | |
3438 if ( !uActiveCharacter ) | |
3439 continue; | |
3440 if ( pParty->bTurnBasedModeOn != 1 ) | |
3441 { | |
3442 if ( pActors[uMessageParam].uAIState == 5 ) | |
1966
7840fe323f67
stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents:
1936
diff
changeset
|
3443 pActors[uMessageParam].LootActor(); |
1915 | 3444 else |
3445 Actor::StealFrom(uMessageParam); | |
3446 continue; | |
3447 } | |
3448 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3 ) | |
3449 continue; | |
3450 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) ) | |
3451 { | |
3452 if ( pActors[uMessageParam].uAIState == 5 ) | |
1966
7840fe323f67
stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents:
1936
diff
changeset
|
3453 pActors[uMessageParam].LootActor(); |
1915 | 3454 else |
3455 Actor::StealFrom(uMessageParam); | |
3456 } | |
3457 continue; | |
3458 | |
3459 case UIMSG_Attack: | |
3460 if ( !uActiveCharacter ) | |
3461 continue; | |
3462 if ( pParty->bTurnBasedModeOn != 1 ) | |
3463 { | |
3464 _42ECB5_PlayerAttacksActor(); | |
3465 continue; | |
3466 } | |
3467 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3 ) | |
3468 continue; | |
3469 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) ) | |
3470 _42ECB5_PlayerAttacksActor(); | |
3471 continue; | |
3472 case UIMSG_ExitRest: | |
3473 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" | |
3474 continue; | |
3475 case UIMSG_Wait5Minutes: | |
3476 if ( dword_506F14 == 2 ) | |
3477 { | |
3478 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3479 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3480 continue; | |
3481 } | |
3482 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2, | |
3483 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" | |
3484 dword_506F14 = 1; | |
3485 _506F18_num_minutes_to_sleep = 5; | |
3486 continue; | |
3487 case UIMSG_Wait1Hour: | |
3488 if ( dword_506F14 == 2 ) | |
3489 { | |
3490 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3491 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3492 continue; | |
3493 } | |
3494 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2, | |
3495 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" | |
3496 dword_506F14 = 1; | |
3497 _506F18_num_minutes_to_sleep = 60; | |
3498 continue; | |
3499 case UIMSG_RentRoom: | |
3500 dword_506F14 = 2; | |
3501 RestUI_Load(); | |
3502 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute; | |
3503 _506F18_num_minutes_to_sleep = v86; | |
3504 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 ) // 107 = Emerald Isle tavern | |
3505 _506F18_num_minutes_to_sleep = v86 + 12 * 60; | |
3506 dword_506F14 = 2; | |
3507 pParty->RestAndHeal(); | |
3508 pParty->days_played_without_rest = 0; | |
3509 pParty->pPlayers[3].SetAsleep(1); | |
3510 pParty->pPlayers[2].SetAsleep(1); | |
3511 pParty->pPlayers[1].SetAsleep(1); | |
3512 pParty->pPlayers[0].SetAsleep(1); | |
3513 continue; | |
3514 case UIMSG_RestWindow: | |
3515 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3516 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3517 if ( pCurrentScreen ) | |
3518 continue; | |
1936 | 3519 if ( CheckActors_proximity() ) |
1915 | 3520 { |
3521 if ( pParty->bTurnBasedModeOn == 1 ) | |
3522 { | |
3523 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
3524 continue; | |
3525 } | |
3526 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" | |
3527 if ( pParty->uFlags & 0x88 ) | |
3528 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | |
3529 ShowStatusBarString(v88, 2); | |
3530 if ( !uActiveCharacter ) | |
3531 continue; | |
3532 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); | |
3533 continue; | |
3534 } | |
3535 if ( pParty->bTurnBasedModeOn == 1 ) | |
3536 { | |
3537 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
3538 continue; | |
3539 } | |
3540 if ( !(pParty->uFlags & 0x88) ) | |
3541 { | |
3542 RestUI_Load(); | |
3543 continue; | |
3544 } | |
3545 if ( pParty->bTurnBasedModeOn == 1 ) | |
3546 { | |
3547 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
3548 continue; | |
3549 } | |
3550 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" | |
3551 if ( pParty->uFlags & 0x88 ) | |
3552 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | |
3553 ShowStatusBarString(v88, 2u); | |
3554 if ( !uActiveCharacter ) | |
3555 continue; | |
3556 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); | |
3557 continue; | |
3558 case UIMSG_Rest8Hour: | |
3559 if ( dword_506F14 ) | |
3560 { | |
3561 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3562 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3563 continue; | |
3564 } | |
3565 if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest ) | |
3566 { | |
3567 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest" | |
3568 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() ) | |
3569 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_108, 0); | |
3570 } | |
3571 else | |
3572 { | |
2185 | 3573 pParty->pPlayers[3].pConditions[Condition_Sleep] = pParty->uTimePlayed; |
3574 pParty->pPlayers[2].pConditions[Condition_Sleep] = pParty->uTimePlayed; | |
3575 pParty->pPlayers[1].pConditions[Condition_Sleep] = pParty->uTimePlayed; | |
3576 pParty->pPlayers[0].pConditions[Condition_Sleep] = pParty->uTimePlayed; | |
1915 | 3577 v90 = pMapStats->GetMapInfo(pCurrentMapName); |
3578 if ( !v90 ) | |
3579 v90 = rand() % (signed int)pMapStats->uNumMaps + 1; | |
3580 pMapInfo = &pMapStats->pInfos[v90]; | |
3581 if ( rand() % 100 + 1 <= pMapInfo->Encounter_percent ) | |
3582 { | |
3583 v91 = rand() % 100; | |
3584 v92 = pMapInfo->EncM1percent; | |
3585 v93 = v91 + 1; | |
3586 if ( v93 > v92 ) | |
3587 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2); | |
3588 else | |
3589 pNPCData4 = (NPCData *)1; | |
3590 if ( !_45063B_spawn_some_monster(pMapInfo, (int)pNPCData4) ) | |
3591 pNPCData4 = 0; | |
3592 if ( pNPCData4 ) | |
3593 { | |
3594 pPlayerNum = rand() % 4; | |
2185 | 3595 pParty->pPlayers[pPlayerNum].pConditions[Condition_Sleep] = 0; |
1915 | 3596 v95 = rand(); |
3597 Rest(v95 % 6 + 60); | |
3598 _506F18_num_minutes_to_sleep = 0; | |
3599 dword_506F14 = 0; | |
3600 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
3601 { | |
3602 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3603 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
3604 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3605 ++pMessageQueue_50CBD0->uNumMessages; | |
3606 }*/ | |
3607 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
3608 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!" | |
3609 pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0); | |
3610 continue; | |
3611 } | |
3612 } | |
3613 Party::TakeFood(uRestUI_FoodRequiredToRest); | |
3614 _506F18_num_minutes_to_sleep = 480; | |
3615 dword_506F14 = 2; | |
3616 pParty->RestAndHeal(); | |
3617 pParty->days_played_without_rest = 0; | |
3618 pParty->pPlayers[3].SetAsleep(1); | |
3619 pParty->pPlayers[2].SetAsleep(1); | |
3620 pParty->pPlayers[1].SetAsleep(1); | |
3621 pParty->pPlayers[0].SetAsleep(1); | |
3622 } | |
3623 continue; | |
3624 case UIMSG_AlreadyResting: | |
3625 if ( dword_506F14 == 2 ) | |
3626 { | |
3627 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3628 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3629 continue; | |
3630 } | |
3631 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2, | |
3632 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" | |
3633 v97 = _494820_training_time(pParty->uCurrentHour); | |
3634 dword_506F14 = 1; | |
3635 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute; | |
3636 continue; | |
3637 case UIMSG_HintSelectRemoveQuickSpellBtn: | |
3638 if ( quick_spell_at_page && byte_506550 ) | |
3639 { | |
3640 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName; | |
3641 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173); | |
3642 } | |
3643 else | |
3644 { | |
3645 if ( pPlayers[uActiveCharacter]->uQuickSpell ) | |
3646 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell" | |
3647 else | |
3648 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell" | |
3649 strcpy(pTmpBuf.data(), v177); | |
3650 } | |
3651 GameUI_SetFooterString(pTmpBuf.data()); | |
3652 continue; | |
3653 case UIMSG_SPellbook_ShowHightlightedSpellInfo: | |
3654 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter], | |
3655 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) ) | |
3656 continue; | |
3657 if ( sub_4637E0_is_there_popup_onscreen() ) | |
3658 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1; | |
3659 v98 = *(char *)(uNumSeconds + 6734); | |
3660 if ( quick_spell_at_page - 1 == uMessageParam ) | |
3661 { | |
3662 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | |
3663 v161 = pGlobalTXT_LocalizationStrings[485]; | |
3664 } | |
3665 else | |
3666 { | |
3667 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | |
3668 v161 = pGlobalTXT_LocalizationStrings[486]; | |
3669 } | |
3670 sprintfex(pTmpBuf.data(), v161, v178); | |
3671 GameUI_SetFooterString(pTmpBuf.data()); | |
3672 continue; | |
3673 case UIMSG_ClickInstallRemoveQuickSpellBtn: | |
3674 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); | |
3675 if ( !uActiveCharacter ) | |
3676 continue; | |
3677 pPlayer10 = pPlayers[uActiveCharacter]; | |
3678 if ( !byte_506550 || !quick_spell_at_page ) | |
3679 { | |
3680 pPlayer10->uQuickSpell = 0; | |
3681 quick_spell_at_page = 0; | |
3682 pAudioPlayer->PlaySound((SoundID)203, 0, 0, -1, 0, 0, 0, 0); | |
3683 continue; | |
3684 } | |
2184 | 3685 pPlayers[uActiveCharacter]->uQuickSpell = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage; |
3686 AA1058_PartyQuickSpellSound[uActiveCharacter - 1].AddPartySpellSound(pPlayers[uActiveCharacter]->uQuickSpell, uActiveCharacter); | |
1915 | 3687 if ( uActiveCharacter ) |
3688 pPlayer10->PlaySound(SPEECH_12, 0); | |
3689 byte_506550 = 0; | |
3690 continue; | |
2197 | 3691 case UIMSG_SpellBook_PressTab://ïåðåëèñòûâàíèå ñòðàíèö êëàâèøåé Tab |
2198 | 3692 { |
1915 | 3693 if ( !uActiveCharacter ) |
3694 continue; | |
2198 | 3695 int skill_count = 0; |
1915 | 3696 uAction = 0; |
2197 | 3697 for ( uint i = 0; i < 9; i++ ) |
1915 | 3698 { |
2197 | 3699 if ( pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_FIRE + i] ) |
1915 | 3700 { |
2197 | 3701 if ( pPlayers[uActiveCharacter]->lastOpenedSpellbookPage == i ) |
2198 | 3702 uAction = skill_count; |
3703 v217[skill_count++] = i; | |
1915 | 3704 } |
3705 } | |
2198 | 3706 if ( !skill_count )//íåò ñêèëëîâ |
3707 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0); | |
1915 | 3708 else |
3709 { | |
2198 | 3710 if ( GetAsyncKeyState(16) ) |
3711 { | |
3712 --uAction; | |
3713 if ( uAction < 0 ) | |
3714 uAction = skill_count - 1; | |
3715 } | |
3716 else | |
3717 { | |
3718 ++uAction; | |
3719 if ( uAction >= skill_count ) | |
3720 uAction = 0; | |
3721 } | |
3722 OnCloseSpellBookPage(); | |
3723 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]); | |
3724 pGUIWindow_CurrentMenu->OpenSpellBook(); | |
3725 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0); | |
1915 | 3726 } |
3727 continue; | |
2198 | 3728 } |
1915 | 3729 case UIMSG_OpenSpellbookPage: |
3730 if ( pTurnEngine->turn_stage == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage ) | |
3731 continue; | |
3732 OnCloseSpellBookPage(); | |
3733 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam; | |
3734 pGUIWindow_CurrentMenu->OpenSpellBook(); | |
2198 | 3735 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0); |
1915 | 3736 continue; |
3737 case UIMSG_SelectSpell: | |
3738 { | |
3739 if (pTurnEngine->turn_stage == 3) | |
3740 continue; | |
3741 if (!uActiveCharacter) | |
3742 continue; | |
3743 | |
3744 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter]; | |
1980 | 3745 Player* player = pPlayers[uActiveCharacter]; |
1915 | 3746 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam]) |
3747 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) ) | |
3748 { | |
3749 if ( quick_spell_at_page - 1 == uMessageParam ) | |
3750 { | |
3751 pGUIWindow_CurrentMenu->Release(); | |
3752 pEventTimer->Resume(); | |
3753 viewparams->bRedrawGameUI = 1; | |
3754 pCurrentScreen = SCREEN_GAME; | |
3755 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
3756 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage; | |
3757 /*if ( dword_50C9E8 < 40 ) | |
3758 { | |
3759 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook; | |
3760 dword_50C9EC[3 * dword_50C9E8 + 1] = v103; | |
3761 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1; | |
3762 ++dword_50C9E8; | |
3763 }*/ | |
3764 pMessageQueue_50C9E8->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); | |
3765 // pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); | |
3766 } | |
3767 else | |
3768 { | |
3769 byte_506550 = 1; | |
3770 quick_spell_at_page = uMessageParam + 1; | |
3771 } | |
3772 } | |
3773 } | |
3774 continue; | |
3775 | |
3776 case UIMSG_CastSpellFromBook: | |
3777 if ( pTurnEngine->turn_stage != 3 ) | |
3778 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); | |
3779 continue; | |
3780 | |
3781 case UIMSG_SpellScrollUse: | |
3782 __debugbreak(); | |
3783 if ( pTurnEngine->turn_stage != 3 ) | |
3784 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0); | |
3785 continue; | |
3786 case UIMSG_SpellBookWindow: | |
3787 if ( pTurnEngine->turn_stage == 3 ) | |
3788 continue; | |
2186 | 3789 if ( bUnderwater == true ) |
1915 | 3790 { |
3791 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" | |
3792 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3793 } | |
3794 else | |
3795 { | |
3796 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3797 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3798 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery ) | |
3799 { | |
2186 | 3800 if ( pCurrentScreen == SCREEN_GAME ) |
1915 | 3801 { |
2186 | 3802 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); |
1915 | 3803 pCurrentScreen = SCREEN_SPELL_BOOK; |
3804 pEventTimer->Pause(); | |
3805 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0); | |
3806 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); | |
3807 viewparams->field_48 = 1; | |
3808 continue; | |
3809 } | |
2186 | 3810 if ( pCurrentScreen != SCREEN_REST && pCurrentScreen != SCREEN_CHARACTERS |
3811 && (pCurrentScreen <= SCREEN_63 || pCurrentScreen > SCREEN_67) ) | |
1915 | 3812 { |
3813 pGUIWindow_CurrentMenu->Release(); | |
2186 | 3814 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); |
1915 | 3815 pCurrentScreen = SCREEN_SPELL_BOOK; |
3816 pEventTimer->Pause(); | |
3817 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0); | |
3818 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); | |
3819 viewparams->field_48 = 1; | |
3820 continue; | |
3821 } | |
3822 } | |
3823 } | |
3824 continue; | |
3825 case UIMSG_QuickReference: | |
3826 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3827 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3828 if ( pCurrentScreen ) | |
3829 pGUIWindow_CurrentMenu->Release(); | |
3830 ++pIcons_LOD->uTexturePacksCount; | |
3831 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
3832 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
3833 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0); | |
3834 viewparams->bRedrawGameUI = 1; | |
3835 pEventTimer->Pause(); | |
3836 pAudioPlayer->StopChannels(-1, -1); | |
3837 pCurrentScreen = SCREEN_QUICK_REFERENCE; | |
3838 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_QuickReference, 5, 0); | |
3839 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); | |
3840 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0, | |
3841 pGlobalTXT_LocalizationStrings[79],// "Exit" | |
3842 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179); | |
3843 continue; | |
3844 case UIMSG_GameMenuButton: | |
3845 if ( pCurrentScreen ) | |
3846 { | |
3847 pGUIWindow_CurrentMenu->Release(); | |
3848 pEventTimer->Resume(); | |
3849 pCurrentScreen = SCREEN_GAME; | |
3850 viewparams->bRedrawGameUI = 1; | |
3851 } | |
2154 | 3852 |
1915 | 3853 stru_506E40.Release(); |
2154 | 3854 pRenderer->SaveScreenshot("gamma.pcx", 155, 117); |
2131 | 3855 stru_506E40.LoadPCXFile("gamma.pcx", 0); |
2154 | 3856 |
1915 | 3857 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0); |
3858 //LABEL_453: | |
3859 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
3860 continue; | |
3861 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3862 //goto LABEL_770; | |
3863 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
3864 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3865 ++pMessageQueue_50CBD0->uNumMessages;*/ | |
3866 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
3867 continue; | |
3868 case UIMSG_ClickAwardScrollBar: | |
3869 books_page_number = 1; | |
3870 if ( pMouse->GetCursorPos(&v211)->y > 178 ) | |
3871 books_page_number = -1; | |
3872 continue; | |
3873 case UIMSG_ClickAwardsUpBtn: | |
3874 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0); | |
3875 BtnUp_flag = 1; | |
3876 continue; | |
3877 case UIMSG_ClickAwardsDownBtn: | |
3878 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0); | |
3879 BtnDown_flag = 1; | |
3880 continue; | |
3881 case UIMSG_ChangeDetaliz: | |
3882 bRingsShownInCharScreen ^= 1; | |
3883 pCharacterScreen_DetalizBtn->Release(); | |
3884 pCharacterScreen_DollBtn->Release(); | |
3885 if ( bRingsShownInCharScreen ) | |
3886 { | |
3887 v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight; | |
3888 v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth; | |
3889 v123 = 445; | |
3890 v121 = 470; | |
3891 } | |
3892 else | |
3893 { | |
3894 v128 = 30; | |
3895 v125 = 30; | |
3896 v123 = 300; | |
3897 v121 = 600; | |
3898 } | |
3899 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0, | |
3900 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle" | |
3901 0); | |
3902 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); | |
3903 viewparams->bRedrawGameUI = 1; | |
3904 continue; | |
3905 case UIMSG_ClickPaperdoll: | |
3906 OnPaperdollLeftClick(); | |
3907 continue; | |
3908 case UIMSG_ClickStatsBtn: | |
3909 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; | |
3910 CharacterUI_ReleaseButtons(); | |
3911 ReleaseAwardsScrollBar(); | |
3912 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0); | |
3913 continue; | |
3914 case UIMSG_ClickSkillsBtn: | |
3915 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; | |
3916 CharacterUI_ReleaseButtons(); | |
3917 ReleaseAwardsScrollBar(); | |
3918 CharacterUI_SkillsTab_CreateButtons(); | |
3919 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0); | |
3920 continue; | |
3921 case UIMSG_SkillUp: | |
3922 pPlayer4 = pPlayers[uActiveCharacter]; | |
3923 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; | |
3924 LOWORD(v2) = *(short *)v105; | |
3925 uNumSeconds = v2; | |
3926 if ( pPlayer4->uSkillPoints < (v2 & 0x3F) + 1 ) | |
3927 { | |
3928 v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!" | |
3929 } | |
3930 else | |
3931 { | |
3932 if ( (uNumSeconds & 0x3F) < 0x3C ) | |
3933 { | |
3934 *(short *)v105 = uNumSeconds + 1; | |
3935 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F; | |
3936 pPlayer4->PlaySound(SPEECH_14, 0); | |
3937 pAudioPlayer->PlaySound((SoundID)20001, 0, 0, -1, 0, 0, 0, 0); | |
3938 continue; | |
3939 } | |
3940 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!" | |
3941 } | |
3942 ShowStatusBarString(v87, 2); | |
3943 continue; | |
3944 case UIMSG_ClickInventoryBtn: | |
3945 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
3946 ReleaseAwardsScrollBar(); | |
3947 CharacterUI_ReleaseButtons(); | |
3948 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0); | |
3949 continue; | |
3950 case UIMSG_ClickExitCharacterWindowBtn: | |
3951 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0); | |
3952 continue; | |
3953 case UIMSG_ClickAwardsBtn: | |
3954 ReleaseAwardsScrollBar(); | |
3955 CharacterUI_ReleaseButtons(); | |
3956 CreateAwardsScrollBar(); | |
3957 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; | |
3958 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0); | |
3959 FillAwardsData(); | |
3960 continue; | |
3961 case UIMSG_ClickBooksBtn: | |
3962 switch ( uMessageParam ) | |
3963 { | |
3964 case 11://Page UP | |
3965 BtnUp_flag = 1; | |
3966 pButton = pBtn_Book_2; | |
3967 break; | |
3968 case 10://Page DOWN | |
3969 BtnDown_flag = 1; | |
3970 pButton = pBtn_Book_1; | |
3971 break; | |
3972 case 0://Zoom plus | |
3973 pButton = pBtn_Book_1; | |
3974 BtnDown_flag = 1; | |
3975 break; | |
3976 case 1://Zoom minus | |
3977 pButton = pBtn_Book_2; | |
3978 BtnUp_flag = 1; | |
3979 break; | |
3980 case 2://Potions | |
3981 Book_PageBtn3_flag = 1; | |
3982 if ( dword_506364 ) | |
3983 continue; | |
3984 pButton = pBtn_Book_3; | |
3985 break; | |
3986 case 3://fountains | |
3987 Book_PageBtn4_flag = 1; | |
3988 if ( dword_506364 ) | |
3989 continue; | |
3990 pButton = pBtn_Book_4; | |
3991 break; | |
3992 case 4://obelisks | |
3993 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag | |
3994 if ( dword_506364 ) | |
3995 continue; | |
3996 pButton = pBtn_Book_5; | |
3997 break; | |
3998 case 5://seer | |
3999 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag | |
4000 if ( dword_506364 ) | |
4001 continue; | |
4002 pButton = pBtn_Book_6; | |
4003 break; | |
4004 case 6://misc | |
4005 pButton = pBtn_Autonotes_Misc; | |
4006 Autonotes_Misc_page_flag = 1; | |
4007 break; | |
4008 case 7://Instructors | |
4009 pButton = pBtn_Autonotes_Instructors; | |
4010 Autonotes_Instructors_page_flag = 1; | |
4011 break; | |
4012 default: | |
4013 continue; | |
4014 } | |
4015 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); | |
4016 continue; | |
4017 case UIMSG_SelectCharacter: | |
4018 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4019 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4020 GameUI_OnPlayerPortraitLeftClick(uMessageParam); | |
4021 continue; | |
4022 case UIMSG_ShowStatus_Funds: | |
4023 v174 = (char *)pParty->uNumGoldInBank; | |
4024 //v158 = pParty->uNumGold + pParty->uNumGoldInBank; | |
4025 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], pParty->uNumGold + pParty->uNumGoldInBank, v174);// "You have %d total gold, %d in the Bank" | |
4026 GameUI_SetFooterString(pTmpBuf.data()); | |
4027 continue; | |
4028 case UIMSG_ShowStatus_DateTime: | |
4029 pNPCData4 = (NPCData *)pParty->uCurrentHour; | |
4030 if ( (signed int)pParty->uCurrentHour <= 12 ) | |
4031 { | |
4032 if ( !pNPCData4 ) | |
4033 pNPCData4 = (NPCData *)12; | |
4034 } | |
4035 else | |
4036 { | |
4037 pNPCData4 = (NPCData *)((char *)pNPCData4 - 12); | |
4038 } | |
4039 if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) ) | |
4040 uNumSeconds = 0; | |
4041 sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7], | |
4042 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear); | |
4043 GameUI_SetFooterString(pTmpBuf.data()); | |
4044 continue; | |
4045 case UIMSG_ShowStatus_Food: | |
4046 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food" | |
4047 GameUI_SetFooterString(pTmpBuf.data()); | |
4048 continue; | |
4049 case UIMSG_ShowStatus_Player: | |
4050 pPlayer5 = pPlayers[uMessageParam]; | |
4051 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s" | |
4052 strcat(pTmpBuf.data(), ": "); | |
4053 v107 = pPlayer5->GetMajorConditionIdx(); | |
4054 strcat(pTmpBuf.data(), aCharacterConditionNames[v107]); | |
4055 GameUI_SetFooterString(pTmpBuf.data()); | |
4056 v108 = 8 * uMessageParam - 8; | |
4057 LOBYTE(v108) = v108 | 4; | |
4058 pMouse->uPointingObjectID = PID(OBJECT_Player,v108); | |
4059 continue; | |
4060 case UIMSG_ShowStatus_ManaHP: | |
4061 sprintf(pTmpBuf.data(), "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(), | |
4062 pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(), | |
4063 pGlobalTXT_LocalizationStrings[212]); | |
4064 GameUI_SetFooterString(pTmpBuf.data()); | |
4065 continue; | |
4066 case UIMSG_CHEST_ClickItem: | |
4067 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) | |
4068 { | |
4069 pPlayers[uActiveCharacter]->OnInventoryLeftClick(); | |
4070 continue; | |
4071 } | |
4072 OnChestLeftClick(); | |
4073 continue; | |
4074 case UIMSG_InventoryLeftClick: | |
4075 pPlayers[uActiveCharacter]->OnInventoryLeftClick(); | |
4076 continue; | |
4077 case UIMSG_MouseLeftClickInGame: | |
2154 | 4078 /*if ( !pRenderer->pRenderD3D ) |
1915 | 4079 { |
4080 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4081 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4082 OnGameViewportClick(); | |
4083 continue; | |
2154 | 4084 }*/ |
1915 | 4085 v115 = pMessageQueue_50CBD0->uNumMessages; |
4086 if ( !pMessageQueue_50CBD0->uNumMessages ) | |
4087 { | |
4088 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); | |
4089 /*if ( (signed int)v115 < 40 ) | |
4090 //goto LABEL_769; | |
4091 { | |
4092 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; | |
4093 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
4094 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4095 ++pMessageQueue_50CBD0->uNumMessages; | |
4096 continue; | |
4097 }*/ | |
4098 continue; | |
4099 } | |
4100 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
4101 { | |
4102 pMessageQueue_50CBD0->uNumMessages = 1; | |
4103 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); | |
4104 /*v115 = v0; | |
4105 pMessageQueue_50CBD0->uNumMessages = v0; | |
4106 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; | |
4107 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
4108 //goto LABEL_771; | |
4109 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4110 ++pMessageQueue_50CBD0->uNumMessages;*/ | |
4111 continue; | |
4112 } | |
4113 v115 = 0; | |
4114 pMessageQueue_50CBD0->uNumMessages = 0; | |
4115 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); | |
4116 /*if ( (signed int)v115 < 40 ) | |
4117 //goto LABEL_769; | |
4118 { | |
4119 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; | |
4120 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
4121 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4122 ++pMessageQueue_50CBD0->uNumMessages; | |
4123 continue; | |
4124 }*/ | |
4125 continue; | |
4126 case UIMSG_MouseLeftClickInScreen://ñðàáàòûâàåò ïðè íàæàòèè íà ïðàâóþ êíîïêó ìûøè ïîñëå UIMSG_MouseLeftClickInGame | |
4127 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4128 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4129 OnGameViewportClick(); | |
4130 continue; | |
4131 case UIMSG_F: | |
4132 __debugbreak(); | |
2154 | 4133 //if ( pRenderer->pRenderD3D ) |
1915 | 4134 { |
4135 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
4136 } | |
2154 | 4137 /*else |
1915 | 4138 { |
4139 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209); | |
4140 pPoint3 = pMouse->GetCursorPos(&v204); | |
4141 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; | |
2154 | 4142 }*/ |
1915 | 4143 pButton2 = (GUIButton *)(unsigned __int16)v116; |
4144 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); | |
4145 continue; | |
4146 case UIMSG_54: | |
4147 __debugbreak(); | |
4148 pButton2 = (GUIButton *)uMessageParam; | |
4149 GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0); | |
4150 continue; | |
4151 case UIMSG_Game_Action: | |
4152 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4153 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4154 OnPressSpace(); | |
4155 continue; | |
4156 case UIMSG_ClickZoomOutBtn: | |
4157 if ( pCurrentScreen ) | |
4158 continue; | |
4159 pParty->uFlags |= 2u; | |
4160 GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0); | |
4161 uNumSeconds = 131072; | |
4162 v118 = 2 * viewparams->uMinimapZoom; | |
4163 ++viewparams->field_28; | |
4164 viewparams->uMinimapZoom *= 2; | |
4165 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) | |
4166 { | |
4167 if ( (signed int)v118 > 4096 ) | |
4168 { | |
4169 viewparams->uMinimapZoom = 4096; | |
4170 viewparams->field_28 = 12; | |
4171 } | |
4172 continue; | |
4173 } | |
4174 v119 = 2048; | |
4175 if ( (signed int)v118 <= 2048 ) | |
4176 { | |
4177 _576E2C_current_minimap_zoom = v118; | |
4178 dword_576E28 = viewparams->field_28; | |
4179 break; | |
4180 } | |
4181 viewparams->field_28 = 11; | |
4182 viewparams->uMinimapZoom = v119; | |
4183 _576E2C_current_minimap_zoom = v119; | |
4184 dword_576E28 = viewparams->field_28; | |
4185 break; | |
4186 case UIMSG_ClickZoomInBtn: | |
4187 if ( pCurrentScreen ) | |
4188 continue; | |
4189 pParty->uFlags |= 2u; | |
4190 GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0); | |
4191 uNumSeconds = 32768; | |
4192 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | |
4193 --viewparams->field_28; | |
4194 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | |
4195 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4196 { | |
4197 v119 = 512; | |
4198 if ( (signed int)v118 < 512 ) | |
4199 { | |
4200 viewparams->field_28 = 9; | |
4201 v118 = v119; | |
4202 viewparams->uMinimapZoom = v119; | |
4203 } | |
4204 _576E2C_current_minimap_zoom = v118; | |
4205 dword_576E28 = viewparams->field_28; | |
4206 } | |
4207 else | |
4208 { | |
4209 if ( (signed int)v118 < 256 ) | |
4210 { | |
4211 viewparams->uMinimapZoom = 256; | |
4212 viewparams->field_28 = 8; | |
4213 } | |
4214 } | |
4215 default: | |
4216 continue; | |
4217 } | |
4218 } | |
4219 } | |
4220 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8; | |
4221 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages); | |
4222 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8); | |
4223 //dword_50C9E8 = 0; | |
4224 | |
4225 | |
4226 pMessageQueue_50C9E8->uNumMessages=0; | |
4227 if ( dword_50C9DC ) | |
4228 { | |
4229 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4230 { | |
4231 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC; | |
4232 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0; | |
4233 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4234 ++pMessageQueue_50CBD0->uNumMessages; | |
4235 }*/ | |
4236 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0); | |
4237 dword_50C9DC = 0; | |
4238 } | |
4239 else | |
4240 { | |
4241 if ( _50C9D0_AfterEnchClickEventId > 0 ) | |
4242 { | |
4243 _50C9D8_AfterEnchClickEventTimeout -= pEventTimer->uTimeElapsed; | |
4244 if ( _50C9D8_AfterEnchClickEventTimeout <= 0 ) | |
4245 { | |
4246 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4247 { | |
4248 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0; | |
4249 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4; | |
4250 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4251 ++pMessageQueue_50CBD0->uNumMessages; | |
4252 }*/ | |
4253 pMessageQueue_50CBD0->AddMessage((UIMessageType)_50C9D0_AfterEnchClickEventId, _50C9D4_AfterEnchClickEventSecondParam, 0); | |
4254 _50C9D0_AfterEnchClickEventId = 0; | |
4255 _50C9D4_AfterEnchClickEventSecondParam = 0; | |
4256 _50C9D8_AfterEnchClickEventTimeout = 0; | |
4257 } | |
4258 } | |
4259 } | |
4260 CastSpellInfoHelpers::_427E01_cast_spell(); | |
4261 } | |
4262 //----- (00435748) -------------------------------------------------------- | |
4263 void GUI_MainMenuMessageProc() | |
4264 { | |
4265 Player *pPlayer; // ebx@2 | |
4266 void *v3; // edi@21 | |
4267 signed int v4; // eax@29 | |
4268 int v5; // ecx@29 | |
4269 PLAYER_SKILL_TYPE v6; // edi@37 | |
4270 GUIWindow *pWindow; // eax@56 | |
4271 GUIButton *pButton; // eax@59 | |
4272 int v15; // edi@70 | |
4273 char v20; // dl@116 | |
4274 unsigned int v21; // eax@116 | |
4275 unsigned int v25; // eax@120 | |
4276 unsigned int v26; // ecx@127 | |
4277 SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36 | |
4278 signed int v41; // [sp-10h] [bp-20h]@29 | |
4279 int pParam; // [sp+4h] [bp-Ch]@3 | |
4280 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 | |
4281 int pSex; // [sp+Ch] [bp-4h]@3 | |
4282 | |
4283 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4284 { | |
4285 pPlayer = pParty->pPlayers.data(); | |
4286 do | |
4287 { | |
4288 int param2; | |
4289 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, ¶m2); | |
1916 | 4290 //auto player = &pParty->pPlayers[pParam]; |
1915 | 4291 |
4292 switch (pUIMessageType) // For buttons of window MainMenu | |
4293 { | |
4294 case UIMSG_MainMenu_ShowPartyCreationWnd: | |
4295 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); | |
4296 SetCurrentMenuID(MENU_NEWGAME); | |
4297 break; | |
4298 case UIMSG_MainMenu_ShowLoadWindow: | |
4299 GUIWindow::Create(495, 227, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnLoad, 0); | |
4300 SetCurrentMenuID(MENU_SAVELOAD); | |
4301 break; | |
4302 case UIMSG_ShowCredits: | |
4303 GUIWindow::Create(495, 282, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnCredits, 0); | |
4304 SetCurrentMenuID(MENU_CREDITS); | |
4305 break; | |
4306 case UIMSG_ExitToWindows: | |
4307 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); | |
4308 SetCurrentMenuID(MENU_EXIT_GAME); | |
4309 break; | |
4310 case UIMSG_PlayerCreation_SelectAttribute: | |
4311 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | |
4312 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
4313 uPlayerCreationUI_SelectedCharacter = pParam; | |
4314 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
4315 break; | |
4316 case UIMSG_PlayerCreation_VoicePrev: | |
1916 | 4317 pSex = pParty->pPlayers[pParam].GetSexByVoice(); |
1915 | 4318 do |
4319 { | |
1916 | 4320 if (pParty->pPlayers[pParam].uVoiceID == 0) |
4321 pParty->pPlayers[pParam].uVoiceID = 19; | |
4322 else --pParty->pPlayers[pParam].uVoiceID; | |
1915 | 4323 } |
1916 | 4324 while (pParty->pPlayers[pParam].GetSexByVoice() != pSex); |
1915 | 4325 pButton = pCreationUI_BtnPressLeft2[pParam]; |
4326 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); | |
4327 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
1916 | 4328 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4329 break; |
4330 case UIMSG_PlayerCreation_VoiceNext: | |
1916 | 4331 pSex = pParty->pPlayers[pParam].GetSexByVoice(); |
1915 | 4332 do |
4333 { | |
1916 | 4334 pParty->pPlayers[pParam].uVoiceID = (pParty->pPlayers[pParam].uVoiceID + 1) % 20; |
1915 | 4335 } |
1916 | 4336 while (pParty->pPlayers[pParam].GetSexByVoice() != pSex); |
1915 | 4337 pButton = pCreationUI_BtnPressRight2[pParam]; |
4338 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); | |
4339 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
1916 | 4340 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4341 break; |
4342 case UIMSG_PlayerCreation_FacePrev: | |
1916 | 4343 //pPlayer = &pParty->pPlayers[pParam]; |
4344 if (!pParty->pPlayers[pParam].uCurrentFace) | |
4345 pParty->pPlayers[pParam].uCurrentFace = 19; | |
1915 | 4346 else |
1916 | 4347 pParty->pPlayers[pParam].uCurrentFace -= 1; |
4348 pParty->pPlayers[pParam].uVoiceID = pParty->pPlayers[pParam].uCurrentFace; | |
4349 pParty->pPlayers[pParam].SetInitialStats(); | |
4350 pParty->pPlayers[pParam].SetSexByVoice(); | |
4351 pParty->pPlayers[pParam].RandomizeName(); | |
1915 | 4352 v25 = pParam; |
4353 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | |
4354 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
4355 uPlayerCreationUI_SelectedCharacter = v25; | |
4356 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], (char *)1); | |
4357 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); | |
1916 | 4358 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4359 break; |
4360 case UIMSG_PlayerCreation_FaceNext: | |
1916 | 4361 //pPlayer = &pParty->pPlayers[pParam]; |
4362 v20 = (char)((int)pParty->pPlayers[pParam].uCurrentFace + 1) % 20; | |
4363 pParty->pPlayers[pParam].uCurrentFace = v20; | |
4364 pParty->pPlayers[pParam].uVoiceID = v20; | |
4365 pParty->pPlayers[pParam].SetInitialStats(); | |
4366 pParty->pPlayers[pParam].SetSexByVoice(); | |
4367 pParty->pPlayers[pParam].RandomizeName(); | |
1915 | 4368 v21 = pParam; |
4369 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | |
4370 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
4371 uPlayerCreationUI_SelectedCharacter = v21; | |
4372 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], (char *)1); | |
4373 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
1916 | 4374 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4375 break; |
4376 case UIMSG_PlayerCreationClickPlus: | |
4377 GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, (char *)1); | |
4378 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | |
4379 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); | |
4380 break; | |
4381 case UIMSG_PlayerCreationClickMinus: | |
4382 GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, (char *)1); | |
4383 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | |
4384 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); | |
4385 break; | |
4386 case UIMSG_PlayerCreationSelectActiveSkill: | |
4387 if ( pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(3) == 37 ) | |
4388 pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pParam + 4)] = 1; | |
4389 pAudioPlayer->PlaySound(SOUND_24, 0, 0, -1, 0, 0, 0, 0); | |
4390 break; | |
4391 case UIMSG_PlayerCreationSelectClass: | |
4392 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam); | |
4393 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
4394 break; | |
4395 case UIMSG_PlayerCreationClickOK: | |
4396 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0); | |
4397 if ( PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Choose4Skills() ) | |
4398 GameUI_Footer_TimeLeft = GetTickCount() + 4000; | |
4399 else | |
4400 uGameState = GAME_STATE_STARTING_NEW_GAME; | |
4401 break; | |
4402 case UIMSG_PlayerCreationClickReset: | |
4403 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0); | |
4404 pParty->Reset(); | |
4405 break; | |
4406 case UIMSG_PlayerCreationRemoveUpSkill: | |
4407 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
4408 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
2110
18b0ff5e1bf1
pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents:
2101
diff
changeset
|
4409 if ( pPlayer[pParam].GetSkillIdxByOrder(2) != 37 )//37 - None(Íåò) |
18b0ff5e1bf1
pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents:
2101
diff
changeset
|
4410 pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(2)] = 0; |
1915 | 4411 break; |
4412 case UIMSG_PlayerCreationRemoveDownSkill: | |
4413 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
4414 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
2110
18b0ff5e1bf1
pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents:
2101
diff
changeset
|
4415 if ( pPlayer[pParam].GetSkillIdxByOrder(3) != 37 )//37 - None(Íåò) |
18b0ff5e1bf1
pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents:
2101
diff
changeset
|
4416 pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(3)] = 0; |
1915 | 4417 break; |
4418 case UIMSG_PlayerCreationChangeName: | |
4419 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
4420 v3 = (void *)pParam; | |
4421 uPlayerCreationUI_SelectedCharacter = pParam; | |
4422 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); | |
4423 pGUIWindow_CurrentMenu->ptr_1C = v3; | |
4424 break; | |
4425 case UIMSG_ChangeGameState: | |
4426 uGameState = GAME_FINISHED; | |
4427 break; | |
4428 case UIMSG_ChangeCursor: | |
4429 pMouse->SetCursorBitmap("MICON2"); | |
4430 break; | |
4431 case UIMSG_3A: | |
4432 SetCurrentMenuID(MENU_DebugBLVLevel); | |
4433 break; | |
4434 case UIMSG_LoadGame: | |
4435 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) | |
4436 break; | |
4437 SetCurrentMenuID(MENU_LoadingProcInMainMenu); | |
4438 break; | |
4439 case UIMSG_SelectLoadSlot: | |
4440 //main menu save/load wnd clicking on savegame lines | |
4441 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
4442 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
4443 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pParam + pSaveListPosition ) | |
4444 { | |
4445 //load clicked line | |
4446 v26 = pParam + pSaveListPosition; | |
4447 if ( dword_6BE138 == pParam + pSaveListPosition ) | |
4448 { | |
4449 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0); | |
4450 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); | |
4451 } | |
4452 uLoadGameUI_SelectedSlot = v26; | |
4453 dword_6BE138 = v26; | |
4454 } | |
4455 else | |
4456 { | |
4457 //typing in the line | |
4458 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); | |
4459 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); | |
4460 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); | |
4461 } | |
4462 break; | |
4463 case UIMSG_SaveLoadBtn: | |
4464 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); | |
4465 break; | |
4466 case UIMSG_DownArrow: | |
4467 ++pSaveListPosition; | |
4468 if ( pSaveListPosition >= pParam ) | |
4469 pSaveListPosition = pParam - 1; | |
4470 if ( pSaveListPosition < 1 ) | |
4471 pSaveListPosition = 0; | |
4472 pWindow = pGUIWindow_CurrentMenu; | |
4473 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); | |
4474 break; | |
4475 case UIMSG_Cancel: | |
4476 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0); | |
4477 break; | |
4478 case UIMSG_ArrowUp: | |
4479 --pSaveListPosition; | |
4480 if ( pSaveListPosition < 0 ) | |
4481 pSaveListPosition = 0; | |
4482 pWindow = pGUIWindow_CurrentMenu; | |
4483 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_PressedButton2, (int)pBtnArrowUp, 0); | |
4484 break; | |
4485 case UIMSG_AD: | |
4486 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); | |
4487 SetCurrentMenuID(MENU_LoadingProcInMainMenu); | |
4488 break; | |
4489 case UIMSG_AE: | |
4490 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); | |
4491 SetCurrentMenuID(MENU_DebugBLVLevel); | |
4492 break; | |
4493 case UIMSG_Escape: | |
4494 if ( pModalWindow ) | |
4495 { | |
4496 ModalWindow_Release(); | |
4497 break; | |
4498 } | |
2061 | 4499 if ( !(dword_6BE364_game_settings_1 & GAME_SETTINGS_4000)) |
1915 | 4500 break; |
4501 v15 = 1; | |
4502 pVideoPlayer->bStopBeforeSchedule = 1; | |
4503 viewparams->bRedrawGameUI = 1; | |
4504 viewparams->field_48 = 1; | |
4505 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC ) | |
4506 { | |
2137
d24ee391fd1f
libavcodec playing movies and houses, loops not working yet
zipi
parents:
2132
diff
changeset
|
4507 //if ( pCurrentScreen == SCREEN_VIDEO ) |
d24ee391fd1f
libavcodec playing movies and houses, loops not working yet
zipi
parents:
2132
diff
changeset
|
4508 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); |
1915 | 4509 if (GetCurrentMenuID() == MENU_NAMEPANELESC) |
4510 { | |
4511 SetCurrentMenuID(MENU_CREATEPARTY); | |
4512 break; | |
4513 } | |
4514 if (GetCurrentMenuID() == MENU_CREDITSPROC) | |
4515 { | |
4516 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
4517 break; | |
4518 } | |
4519 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | |
4520 break; | |
4521 } | |
4522 if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen ) | |
4523 { | |
2142
ca548138d6aa
some code cleaning in video playing, loops play but there is a memory leak
zipi
parents:
2137
diff
changeset
|
4524 //if ( pCurrentScreen == SCREEN_VIDEO ) |
ca548138d6aa
some code cleaning in video playing, loops play but there is a memory leak
zipi
parents:
2137
diff
changeset
|
4525 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); |
1915 | 4526 if (GetCurrentMenuID() == MENU_NAMEPANELESC) |
4527 { | |
4528 SetCurrentMenuID(MENU_CREATEPARTY); | |
4529 break; | |
4530 } | |
4531 if (GetCurrentMenuID() == MENU_CREDITSPROC) | |
4532 { | |
4533 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
4534 break; | |
4535 } | |
4536 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | |
4537 break; | |
4538 } | |
4539 if ( pCurrentScreen == SCREEN_LOADGAME ) | |
4540 { | |
4541 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
4542 //crt_deconstruct_ptr_6A0118(); | |
4543 pTexture_PCX.Release(); | |
4544 pTexture_PCX.Load("title.pcx", 0); | |
4545 SetCurrentMenuID(MENU_MAIN); | |
4546 v15 = 1; | |
4547 pGUIWindow_CurrentMenu->Release(); | |
4548 pGUIWindow2->Release(); | |
4549 pGUIWindow2 = 0; | |
4550 pEventTimer->Resume(); | |
4551 pCurrentScreen = SCREEN_GAME; | |
4552 viewparams->bRedrawGameUI = v15; | |
4553 break; | |
4554 } | |
4555 if ( pCurrentScreen == SCREEN_VIDEO ) | |
4556 { | |
4557 pVideoPlayer->Unload(); | |
4558 } | |
4559 else | |
4560 { | |
4561 if ( pCurrentScreen != SCREEN_1B ) | |
4562 { | |
4563 pGUIWindow_CurrentMenu->Release(); | |
4564 pGUIWindow2->Release(); | |
4565 pGUIWindow2 = 0; | |
4566 pEventTimer->Resume(); | |
4567 pCurrentScreen = SCREEN_GAME; | |
4568 viewparams->bRedrawGameUI = v15; | |
4569 break; | |
4570 } | |
4571 //VideoPlayer::dtor(); | |
4572 } | |
4573 break; | |
4574 default: | |
4575 break; | |
4576 } | |
4577 } | |
4578 while ( pMessageQueue_50CBD0->uNumMessages ); | |
4579 } | |
0 | 4580 } |