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