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