Mercurial > mm7
annotate Game.cpp @ 2217:744ed51880ed
expand button
author | Ritor1 |
---|---|
date | Sat, 15 Feb 2014 22:00:13 +0600 |
parents | 3f375342de12 |
children | 080fd5a5433d |
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; |
1915 | 1315 |
1316 dword_50CDC8 = 0; | |
1317 if ( !pEventTimer->bPaused ) | |
1318 { | |
1319 pParty->sEyelevel = pParty->uDefaultEyelevel; | |
1320 pParty->uPartyHeight = pParty->uDefaultPartyHeight; | |
1321 } | |
1322 if ( bDialogueUI_InitializeActor_NPC_ID ) | |
1323 { | |
1324 //Actor::Actor(&actor); | |
1325 memset(&actor, 0, 0x344u); | |
1326 dword_5B65D0_dialogue_actor_npc_id = bDialogueUI_InitializeActor_NPC_ID; | |
1327 actor.sNPC_ID = bDialogueUI_InitializeActor_NPC_ID; | |
1328 GameUI_InitializeDialogue(&actor, false); | |
1329 bDialogueUI_InitializeActor_NPC_ID = 0; | |
1330 } | |
1331 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1332 { | |
1333 //v1 = ""; | |
1334 while ( 2 ) | |
1335 { | |
1336 if ( !pMessageQueue_50CBD0->uNumMessages ) | |
1337 break; | |
1338 | |
1339 pMessageQueue_50CBD0->PopMessage(&uMessage, &uMessageParam, (int *)&v199); | |
1340 switch ( uMessage ) | |
1341 { | |
1342 case UIMSG_ChangeGameState: | |
1343 uGameState = GAME_FINISHED; | |
1344 continue; | |
1345 case UIMSG_PlayArcomage: | |
1346 pVideoPlayer->_4BF5B2(); | |
1347 pArcomageGame->bGameInProgress = 1; | |
1348 PrepareArcomage(); | |
1349 continue; | |
1350 case UIMSG_StartNPCDialogue: | |
1351 if ( !uActiveCharacter ) | |
1352 continue; | |
1353 viewparams->field_48 = 1; | |
1354 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1355 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1356 dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].sNPC_ID; | |
1357 pActor = &pActors[uMessageParam]; | |
1358 //goto _actor_init_dlg; | |
1359 GameUI_InitializeDialogue(pActor, true); | |
1360 continue; | |
1361 case UIMSG_StartHireling1Dialogue: | |
1362 case UIMSG_StartHireling2Dialogue: | |
1363 { | |
1364 if (bNoNPCHiring || pCurrentScreen) | |
1365 continue; | |
1366 | |
1367 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1368 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1369 uAction = 0; | |
1370 int hireling_idx = uMessage - UIMSG_StartHireling1Dialogue; | |
1371 v4 = 0; | |
1372 | |
1373 for (uint i = 0; i < 2; ++i) | |
1374 //pNPCData0 = pParty->pHirelings; | |
1375 //do | |
1376 { | |
1377 if (pParty->pHirelings[i].pName) | |
1378 //{ | |
1379 //v6 = uAction++; | |
1380 pTmpBuf[uAction++] = i; | |
1381 //} | |
1382 //++pNPCData0; | |
1383 //++v4; | |
1384 } | |
1385 //while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem ); | |
1386 | |
1387 //_this = 0; | |
1388 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
1389 { | |
1980 | 1390 NPCData* npc = &pNPCStats->pNewNPCData[i]; |
1915 | 1391 //do |
1392 //{ | |
1393 if (npc->Hired() && | |
1394 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)) && | |
1395 (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) ) | |
1396 { | |
1397 //v7 =; | |
1398 pTmpBuf[uAction++] = i + 2; | |
1399 } | |
1400 //++_this; | |
1401 //++pNPCData4; | |
1402 //} | |
1403 //while ( _this < (signed int)pNPCStats->uNumNewNPCs ); | |
1404 } | |
1405 | |
1406 if ( (signed int)(hireling_idx + pParty->hirelingScrollPosition) < uAction ) | |
1407 { | |
1408 //Actor::Actor(&actor); | |
1409 memset(&actor, 0, 0x344u); | |
1410 actor.sNPC_ID += -1 - pParty->hirelingScrollPosition - hireling_idx; | |
1411 pActor = &actor; | |
1412 GameUI_InitializeDialogue(&actor, true); | |
1413 } | |
1414 } | |
1415 continue; | |
1416 | |
1417 case UIMSG_BuyInShop_Identify_Repair: | |
1418 UIShop_Buy_Identify_Repair(); | |
1419 continue; | |
1420 case UIMSG_ClickNPCTopic: | |
1421 ClickNPCTopic(uMessageParam); | |
1422 continue; | |
1423 case UIMSG_SelectShopDialogueOption: | |
1424 OnSelectShopDialogueOption(uMessageParam); | |
1425 continue; | |
1426 case UIMSG_SelectNPCDialogueOption: | |
1427 OnSelectNPCDialogueOption((DIALOGUE_TYPE)uMessageParam); | |
1428 continue; | |
1429 case UIMSG_ClickHouseNPCPortrait: | |
1430 _4B4224_UpdateNPCTopics(uMessageParam); | |
1431 continue; | |
1432 case UIMSG_StartNewGame: | |
1433 if ( dword_6BE138 == 124 || uMessageParam ) | |
1434 { | |
1435 pIcons_LOD->SyncLoadedFilesCount(); | |
1436 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
1437 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1438 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1439 pGUIWindow_CurrentMenu->Release(); | |
1440 uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU; | |
1441 pCurrentScreen = SCREEN_GAME; | |
1442 viewparams->bRedrawGameUI = 1; | |
1443 } | |
1444 else | |
1445 { | |
1446 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2u);// "Are you sure? Click again to start a New Game" | |
1447 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0); | |
1448 dword_6BE138 = 124; | |
1449 } | |
1450 stru_506E40.Release(); | |
1451 continue; | |
1452 case UIMSG_Game_OpenLoadGameDialog: | |
1453 pIcons_LOD->SyncLoadedFilesCount(); | |
1454 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
1455 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1456 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1457 pGUIWindow_CurrentMenu->Release(); | |
1458 pCurrentScreen = SCREEN_LOADGAME; | |
1459 LoadUI_Load(1); | |
1460 continue; | |
1461 case UIMSG_Quit: | |
1462 if ( dword_6BE138 == 132 || uMessageParam ) | |
1463 { | |
1464 pIcons_LOD->SyncLoadedFilesCount(); | |
1465 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
1466 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1467 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1468 pGUIWindow_CurrentMenu->Release(); | |
1469 pCurrentScreen = SCREEN_GAME; | |
1470 viewparams->bRedrawGameUI = 1; | |
1471 if ( !uMessageParam ) | |
1472 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0); | |
1473 uGameState = GAME_STATE_GAME_QUITTING_TO_MAIN_MENU; | |
1474 } | |
1475 else | |
1476 { | |
1477 ShowStatusBarString(pGlobalTXT_LocalizationStrings[82], 2);// "Are you sure? Click again to quit" | |
1478 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0); | |
1479 dword_6BE138 = 132; | |
1480 } | |
1481 stru_506E40.Release(); | |
1482 continue; | |
1483 case UIMSG_80: | |
1484 __debugbreak(); | |
1485 pIcons_LOD->SyncLoadedFilesCount(); | |
1486 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
1487 pGUIWindow_CurrentMenu->Release(); | |
1488 pCurrentScreen = SCREEN_OPTIONS; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
1489 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_8, 0, 0); |
1915 | 1490 continue; |
1491 case UIMSG_ArrowUp: | |
1492 --pSaveListPosition; | |
1493 if ( pSaveListPosition < 0 ) | |
1494 pSaveListPosition = 0; | |
1495 GUIWindow::Create(215, 199, 17, 17, WINDOW_PressedButton2, (int)pBtnArrowUp, 0); | |
1496 continue; | |
1497 case UIMSG_DownArrow: | |
1498 ++pSaveListPosition; | |
1499 if ( pSaveListPosition >= uMessageParam ) | |
1500 pSaveListPosition = uMessageParam - 1; | |
1501 GUIWindow::Create(215, 323, 17, 17, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); | |
1502 continue; | |
1503 case UIMSG_Cancel: | |
1504 GUIWindow::Create(350, 302, 106, 42, WINDOW_CloseRestWindowBtn, (int)pBtnCancel, 0); | |
1505 continue; | |
1506 case UIMSG_SaveLoadBtn: | |
1507 GUIWindow::Create(241, 302, 106, 42, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); | |
1508 continue; | |
1509 case UIMSG_SelectLoadSlot: | |
1510 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
1511 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
1512 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam ) | |
1513 { | |
1514 v10 = pSaveListPosition + uMessageParam; | |
1515 if ( dword_6BE138 == pSaveListPosition + uMessageParam ) | |
1516 { | |
1517 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0); | |
1518 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); | |
1519 } | |
1520 uLoadGameUI_SelectedSlot = v10; | |
1521 dword_6BE138 = v10; | |
1522 } | |
1523 else | |
1524 { | |
1525 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); | |
1526 if ( strcmp((const char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], pGlobalTXT_LocalizationStrings[72]) )// "Empty" | |
1527 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, (const char *)&pSavegameHeader[uLoadGameUI_SelectedSlot]); | |
1528 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); | |
1529 } | |
1530 continue; | |
1531 case UIMSG_LoadGame: | |
1532 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] ) | |
1533 { | |
1534 LoadGame(uLoadGameUI_SelectedSlot); | |
1535 uGameState = GAME_STATE_LOADING_GAME; | |
1536 } | |
1537 stru_506E40.Release(); | |
1538 continue; | |
1539 case UIMSG_SaveGame: | |
1540 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
1541 { | |
1542 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
1543 strcpy((char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], (const char *)pKeyActionMap->pPressedKeysBuffer); | |
1544 } | |
1545 DoSavegame(uLoadGameUI_SelectedSlot); | |
1546 stru_506E40.Release(); | |
1547 continue; | |
1548 case UIMSG_Game_OpenSaveGameDialog: | |
1549 pGUIWindow_CurrentMenu->Release(); | |
1550 pCurrentScreen = SCREEN_SAVEGAME; | |
1551 SaveUI_Load(); | |
1552 continue; | |
1553 case UIMSG_Game_OpenOptionsDialog://Open | |
1554 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1555 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1556 pGUIWindow_CurrentMenu->Release(); | |
1557 viewparams->field_48 = 1; | |
1558 pCurrentScreen = SCREEN_OPTIONS; | |
1559 | |
1560 options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE); | |
1561 options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE); | |
1562 options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE); | |
1563 options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE); | |
1564 options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); | |
1565 options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); | |
1566 options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); | |
1567 options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); | |
1568 options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); | |
1569 options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); | |
1570 options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); | |
1571 options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); | |
1572 options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); | |
1573 options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); | |
1574 options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); | |
1575 options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); | |
1576 options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE); | |
1577 options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE); | |
1578 options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE); | |
1579 options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE); | |
1580 | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
1581 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Options, 0, 0); |
1915 | 1582 pGUIWindow_CurrentMenu->CreateButton(22, 270, |
1583 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth, | |
1584 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight, | |
1585 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0); | |
1586 pGUIWindow_CurrentMenu->CreateButton(93, 270, | |
1587 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth, | |
1588 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight, | |
1589 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0); | |
1590 pGUIWindow_CurrentMenu->CreateButton(164, 270, | |
1591 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth, | |
1592 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight, | |
1593 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0); | |
1594 | |
1595 pGUIWindow_CurrentMenu->CreateButton(20, 303, | |
1596 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth, | |
1597 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight, | |
1598 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0); | |
1599 pGUIWindow_CurrentMenu->CreateButton(128, 303, | |
1600 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth, | |
1601 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight, | |
1602 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0); | |
1603 pGUIWindow_CurrentMenu->CreateButton(20, 325, | |
1604 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth, | |
1605 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight, | |
1606 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0); | |
1607 pGUIWindow_CurrentMenu->CreateButton(128, 325, | |
1608 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth, | |
1609 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight, | |
1610 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0); | |
1611 | |
1612 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
1613 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
1614 pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0); | |
1615 | |
1616 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
1617 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
1618 pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0); | |
1619 | |
1620 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
1621 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
1622 pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0); | |
1623 | |
1624 pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game" | |
1625 pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, "", 0); | |
1626 pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, "", 0); | |
1627 continue; | |
1628 | |
1629 case UIMSG_OpenKeyMappingOptions://Open | |
1630 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1631 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1632 pGUIWindow_CurrentMenu->Release(); | |
1633 viewparams->field_48 = 1; | |
1634 pCurrentScreen = SCREEN_KEYBOARD_OPTIONS; | |
1635 uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE); | |
1636 uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE); | |
1637 uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
1638 uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE); | |
1639 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
|
1640 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_KeyMappingOptions, 0, 0); |
1915 | 1641 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0); |
1642 pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage1, 0, 0, "", 0); | |
1643 pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage2, 0, 0, "", 0); | |
1644 pGUIWindow_CurrentMenu->CreateButton(127u, 0x144u, 0x6Cu, 0x14u, 1, 0, UIMSG_ResetKeyMapping, 0, 0, "", 0); | |
1645 pGUIWindow_CurrentMenu->CreateButton(19u, 0x144u, 0x6Cu, 0x14u, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0, "", 0); | |
1646 pGUIWindow_CurrentMenu->CreateButton(129u, 0x94u, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0, 0, "", 0); | |
1647 pGUIWindow_CurrentMenu->CreateButton(129u, 0xA7u, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 1u, 0, "", 0); | |
1648 pGUIWindow_CurrentMenu->CreateButton(129u, 0xBAu, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 2u, 0, "", 0); | |
1649 pGUIWindow_CurrentMenu->CreateButton(129u, 0xCDu, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 3u, 0, "", 0); | |
1650 pGUIWindow_CurrentMenu->CreateButton(129u, 224u, 70u, 19u, 1, 0, UIMSG_ChangeKeyButton, 4u, 0, "", 0); | |
1651 pGUIWindow_CurrentMenu->CreateButton(129u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 5u, 0, "", 0); | |
1652 pGUIWindow_CurrentMenu->CreateButton(129u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 6u, 0, "", 0); | |
1653 pGUIWindow_CurrentMenu->CreateButton(350u, 148u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 7u, 0, "", 0); | |
1654 pGUIWindow_CurrentMenu->CreateButton(350u, 167u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 8u, 0, "", 0); | |
1655 pGUIWindow_CurrentMenu->CreateButton(350u, 186u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 9u, 0, "", 0); | |
1656 pGUIWindow_CurrentMenu->CreateButton(350u, 205u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xAu, 0, "", 0); | |
1657 pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xBu, 0, "", 0); | |
1658 pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xCu, 0, "", 0); | |
1659 pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xDu, 0, "", 0); | |
1660 uGameMenuUI_CurentlySelectedKeyIdx = -1; | |
1661 KeyboardPageNum = 1; | |
1662 memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags)); | |
1663 //*(_WORD *)KeyButtonArray[28] = 0; | |
1664 memcpy(pPrevVirtualCidesMapping.data(), pKeyActionMap->pVirtualKeyCodesMapping, 0x78u); | |
1665 //v1 = ""; | |
1666 //v0 = 1; | |
1667 continue; | |
1668 case UIMSG_ChangeKeyButton: | |
1669 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 ) | |
1670 { | |
1671 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
1672 continue; | |
1673 } | |
1674 v14 = uMessageParam; | |
1675 if ( KeyboardPageNum != 1 ) | |
1676 v14 = uMessageParam + 14; | |
1677 uGameMenuUI_CurentlySelectedKeyIdx = v14; | |
1678 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu); | |
1679 continue; | |
1680 case UIMSG_ResetKeyMapping: | |
1681 v197 = 1; | |
1682 pKeyActionMap->SetDefaultMapping(); | |
1683 uAction = 0; | |
1684 do | |
1685 { | |
1686 v15 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
1687 if ( v15 != pPrevVirtualCidesMapping[uAction] ) | |
1688 { | |
1689 if ( v197 ) | |
1690 { | |
1691 v16 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
1692 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v16, 1); | |
1693 v197 = 0; | |
1694 } | |
1695 else | |
1696 { | |
1697 v17 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
1698 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v17, 0); | |
1699 } | |
1700 } | |
1701 pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
1702 v18 = uAction++; | |
1703 v13 = uAction > 28; | |
1704 v12 = uAction - 28 < 0; | |
1705 GameMenuUI_InvaligKeyBindingsFlags[v18] = 0; | |
1706 } | |
1707 while ( v12 ^ v13 ); | |
1708 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0); | |
1709 continue; | |
1710 case UIMSG_SelectKeyPage1: | |
1711 KeyboardPageNum = 1; | |
1712 continue; | |
1713 case UIMSG_SelectKeyPage2: | |
1714 KeyboardPageNum = 2; | |
1715 continue; | |
1716 case UIMSG_OpenVideoOptions: | |
1717 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1718 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1719 pGUIWindow_CurrentMenu->Release(); | |
1720 viewparams->field_48 = 1; | |
1721 pCurrentScreen = SCREEN_VIDEO_OPTIONS; | |
1722 optvid_base_texture_id = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE); | |
1723 bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE); | |
1724 us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE); | |
1725 tinting_texture_id = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE); | |
1726 uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); | |
1727 uTextureID_507C24 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); | |
1728 pTextureIDs_GammaPositions[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); | |
1729 pTextureIDs_GammaPositions[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); | |
1730 pTextureIDs_GammaPositions[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); | |
1731 pTextureIDs_GammaPositions[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); | |
1732 pTextureIDs_GammaPositions[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); | |
1733 pTextureIDs_GammaPositions[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); | |
1734 pTextureIDs_GammaPositions[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); | |
1735 pTextureIDs_GammaPositions[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); | |
1736 pTextureIDs_GammaPositions[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); | |
1737 pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); | |
1738 not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE); | |
1739 not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE); | |
1740 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
|
1741 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_VideoOptions, 0, 0); |
1915 | 1742 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0); |
2153 | 1743 //if ( pRenderer->pRenderD3D ) |
1915 | 1744 { |
1745 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, "", 0); | |
1746 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0); | |
1747 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0); | |
1748 } | |
2155 | 1749 /*if ( !pRenderer->bWindowMode ) |
1915 | 1750 { |
1751 //v0 = 1; | |
2154 | 1752 if ( pRenderer->IsGammaSupported() ) |
1915 | 1753 { |
1754 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C20), 0); | |
1755 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C24), 0); | |
1756 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0); | |
1757 } | |
2155 | 1758 }*/ |
1915 | 1759 continue; |
1760 case UIMSG_1A9: | |
1761 __debugbreak(); | |
1762 if ( uMessageParam == 4 ) | |
1763 { | |
1764 //--uGammaPos; | |
1765 if ( (uGammaPos -- -1) < 0 ) | |
1766 { | |
1767 uGammaPos = 0; | |
1768 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); | |
1769 continue; | |
1770 } | |
1771 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6; | |
1772 pGame->pGammaController->Initialize(v19); | |
1773 GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); | |
1774 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); | |
1775 continue; | |
1776 } | |
1777 if ( uMessageParam == 5 ) | |
1778 { | |
1779 ++uGammaPos; | |
1780 if ( (signed int)uGammaPos <= 9 ) | |
1781 { | |
1782 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6; | |
1783 pGame->pGammaController->Initialize(v21); | |
1784 GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); | |
1785 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); | |
1786 continue; | |
1787 } | |
1788 uGammaPos = 9; | |
1789 } | |
1790 else | |
1791 { | |
1792 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17; | |
1793 v22 = (double)(signed int)uGammaPos * 0.1 + 0.6; | |
1794 pGame->pGammaController->Initialize(v22); | |
1795 } | |
1796 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); | |
1797 continue; | |
1798 case UIMSG_ToggleBloodsplats: | |
1799 pGame->ToggleFlags2(0x20u); | |
1800 continue; | |
1801 case UIMSG_ToggleColoredLights: | |
2153 | 1802 pRenderer->ToggleColoredLights(); |
1915 | 1803 continue; |
1804 case UIMSG_ToggleTint: | |
2153 | 1805 pRenderer->ToggleTint(); |
1915 | 1806 continue; |
2113 | 1807 case UIMSG_ChangeMusicVolume: //ãðîìêîñòü ìóçûêè |
1808 if ( uMessageParam == 4 )//êíîïêà ïîíèæåíèÿ | |
1915 | 1809 { |
1810 --uMusicVolimeMultiplier; | |
1811 if ( (char)uMusicVolimeMultiplier < 1 ) | |
1812 uMusicVolimeMultiplier = 0; | |
2113 | 1813 GUIWindow::Create(243, 216, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); |
2114 | 1814 if ( uMusicVolimeMultiplier ) |
1815 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0); | |
1816 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); | |
1915 | 1817 continue; |
1818 } | |
2113 | 1819 if ( uMessageParam == 5 )//êíîïêà ïîâûøåíèÿ |
1915 | 1820 { |
1821 ++uMusicVolimeMultiplier; | |
1822 if ( (char)uMusicVolimeMultiplier > 9 ) | |
1823 uMusicVolimeMultiplier = 9; | |
2113 | 1824 GUIWindow::Create(435, 216, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); |
1915 | 1825 if ( uMusicVolimeMultiplier ) |
2114 | 1826 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0); |
1827 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); | |
1915 | 1828 continue; |
1829 } | |
2113 | 1830 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17;//äëÿ çàäàíèÿ ãðîìêîñòè ìûøêîé |
1915 | 1831 if ( (char)uMusicVolimeMultiplier > 9 ) |
1832 uMusicVolimeMultiplier = 9; | |
1833 if ( uMusicVolimeMultiplier ) | |
2114 | 1834 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0); |
1835 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); | |
1915 | 1836 continue; |
1837 case UIMSG_ChangeSoundVolume: | |
1838 if ( uMessageParam == 4 )//reduce sound level button left | |
1839 { | |
1840 --uSoundVolumeMultiplier; | |
1841 if ( (char)uSoundVolumeMultiplier < 1 ) | |
1842 uSoundVolumeMultiplier = 0; | |
1843 GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); | |
1844 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); | |
1845 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); | |
1846 continue; | |
1847 } | |
1848 if ( uMessageParam == 5 )//Increase sound level button right | |
1849 { | |
1850 ++uSoundVolumeMultiplier; | |
1851 if ( (char)uSoundVolumeMultiplier > 8 ) | |
1852 uSoundVolumeMultiplier = 9; | |
1853 //v168 = 1; | |
1854 v24 = 435; | |
1855 //v154 = (int)pBtn_SliderRight; | |
1856 GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); | |
1857 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); | |
1858 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); | |
1859 continue; | |
1860 } | |
1861 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17; | |
1862 if ( (char)uSoundVolumeMultiplier > 8 ) | |
1863 uSoundVolumeMultiplier = 9; | |
1864 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); | |
1865 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); | |
1866 continue; | |
1867 case UIMSG_ToggleFlipOnExit: | |
1868 bFlipOnExit = bFlipOnExit == 0; | |
1869 continue; | |
1870 case UIMSG_ToggleAlwaysRun: | |
1871 bAlwaysRun = bAlwaysRun == 0; | |
1872 continue; | |
1873 case UIMSG_ToggleWalkSound: | |
1874 bWalkSound = bWalkSound == 0; | |
1875 continue; | |
1876 case UIMSG_ToggleShowDamage: | |
1877 bShowDamage = bShowDamage == 0; | |
1878 continue; | |
1879 case UIMSG_ChangeVoiceVolume: | |
1880 if ( uMessageParam == 4 ) | |
1881 { | |
1882 --uVoicesVolumeMultiplier; | |
1883 if ( (char)uVoicesVolumeMultiplier < 1 ) | |
1884 uVoicesVolumeMultiplier = 0; | |
1885 GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); | |
1886 if ( !uVoicesVolumeMultiplier ) | |
1887 continue; | |
1888 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); | |
1889 continue; | |
1890 } | |
1891 if ( uMessageParam == 5 ) | |
1892 { | |
1893 ++uVoicesVolumeMultiplier; | |
1894 if ( (char)uVoicesVolumeMultiplier > 8 ) | |
1895 uVoicesVolumeMultiplier = 9; | |
1896 GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); | |
1897 if ( !uVoicesVolumeMultiplier ) | |
1898 continue; | |
1899 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); | |
1900 continue; | |
1901 } | |
1902 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17; | |
1903 if ( (char)uVoicesVolumeMultiplier > 8 ) | |
1904 uVoicesVolumeMultiplier = 9; | |
1905 if ( !uVoicesVolumeMultiplier ) | |
1906 continue; | |
1907 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); | |
1908 continue; | |
1909 case UIMSG_SetTurnSpeed: | |
1910 if ( uMessageParam ) | |
1911 pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam; | |
1912 uTurnSpeed = uMessageParam; | |
1913 continue; | |
2151 | 1914 |
1915 | 1915 case UIMSG_SetGraphicsMode: |
2151 | 1916 /*if ( !bUseLoResSprites ) |
1915 | 1917 { |
1918 byte_6BE388_graphicsmode = uMessageParam; | |
1919 MM7Initialization(); | |
1920 continue; | |
1921 } | |
1922 if ( uMessageParam ) | |
1923 { | |
1924 if ( uMessageParam == 1 ) | |
1925 { | |
1926 byte_6BE388_graphicsmode = 0; | |
1927 } | |
1928 else | |
1929 { | |
1930 if ( uMessageParam != 2 ) | |
1931 continue; | |
1932 byte_6BE388_graphicsmode = 1; | |
1933 } | |
1934 MM7Initialization(); | |
1935 continue; | |
2151 | 1936 }*/ |
1915 | 1937 ModalWindow(pNPCTopics[453].pText, UIMSG_0); |
2151 | 1938 __debugbreak(); // Nomad: graphicsmode as it was now removed |
1915 | 1939 continue; |
2151 | 1940 |
1915 | 1941 case UIMSG_GameMenu_ReturnToGame: |
1942 pGUIWindow_CurrentMenu->Release(); | |
1943 pEventTimer->Resume(); | |
1944 pCurrentScreen = SCREEN_GAME; | |
1945 viewparams->bRedrawGameUI = 1; | |
1946 stru_506E40.Release(); | |
1947 continue; | |
1948 case UIMSG_OpenQuestBook: | |
1949 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1950 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1951 if ( pCurrentScreen ) | |
1952 pGUIWindow_CurrentMenu->Release(); | |
1953 pEventTimer->Pause(); | |
1954 pAudioPlayer->StopChannels(-1, -1); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
1955 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); |
1915 | 1956 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0); |
1957 bFlashQuestBook = 0; | |
1958 continue; | |
1959 case UIMSG_OpenAutonotes: | |
1960 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1961 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1962 if ( pCurrentScreen ) | |
1963 pGUIWindow_CurrentMenu->Release(); | |
1964 pEventTimer->Pause(); | |
1965 pAudioPlayer->StopChannels(-1, -1); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
1966 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); |
1915 | 1967 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0); |
1968 bFlashAutonotesBook = 0; | |
1969 continue; | |
1970 case UIMSG_OpenMapBook: | |
1971 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1972 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1973 if ( pCurrentScreen ) | |
1974 pGUIWindow_CurrentMenu->Release(); | |
1975 pEventTimer->Pause(); | |
1976 viewparams->sViewCenterX = pParty->vPosition.x; | |
1977 viewparams->sViewCenterY = pParty->vPosition.y; | |
1978 pAudioPlayer->StopChannels(-1, -1); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
1979 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); |
1915 | 1980 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0); |
1981 continue; | |
1982 case UIMSG_OpenCalendar: | |
1983 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1984 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1985 if ( pCurrentScreen ) | |
1986 pGUIWindow_CurrentMenu->Release(); | |
1987 pEventTimer->Pause(); | |
1988 pAudioPlayer->StopChannels(-1, -1); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
1989 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); |
1915 | 1990 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0); |
1991 continue; | |
1992 case UIMSG_OpenHistoryBook: | |
1993 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1994 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1995 if ( pCurrentScreen ) | |
1996 pGUIWindow_CurrentMenu->Release(); | |
1997 pEventTimer->Pause(); | |
1998 pAudioPlayer->StopChannels(-1, -1); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
1999 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, uMessage, 0); |
1915 | 2000 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0); |
2001 bFlashHistoryBook = 0; | |
2002 continue; | |
2003 case UIMSG_Escape:// íàæàòèå Escape and return to game | |
2004 back_to_game(); | |
2005 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2006 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2007 switch ( pCurrentScreen ) | |
2008 { | |
2009 case SCREEN_E: | |
2010 __debugbreak(); | |
2011 case SCREEN_NPC_DIALOGUE: | |
2012 case SCREEN_CHEST: | |
2013 case SCREEN_CHEST_INVENTORY: | |
2014 case SCREEN_CHANGE_LOCATION: | |
2015 case SCREEN_INPUT_BLV: | |
2016 case SCREEN_QUICK_REFERENCE: | |
2017 if ( dword_50CDC8 ) | |
2018 break; | |
2019 CloseWindowBackground(); | |
2020 uMessageParam = 1; | |
2021 break; | |
2022 case SCREEN_HOUSE: | |
2154 | 2023 if ( !dword_50CDC8 ) |
1915 | 2024 { |
2025 CloseWindowBackground(); | |
2026 uMessageParam = 1; | |
2027 break; | |
2028 } | |
2029 break; | |
2030 } | |
2031 if ( !pModalWindow ) | |
2032 { | |
2033 pRenderer->ClearZBuffer(0, 479); | |
2034 viewparams->bRedrawGameUI = 1; | |
2035 viewparams->field_48 = 1; | |
2036 if ( pCurrentScreen ) | |
2037 { | |
2038 if ( pCurrentScreen > SCREEN_67 ) | |
2039 { | |
2040 if ( pCurrentScreen == SCREEN_QUICK_REFERENCE ) | |
2041 { | |
2042 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2043 if ( pGUIWindow_Settings ) | |
2044 { | |
2045 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2046 pMouse->SetCursorBitmap("MICON2"); | |
2047 else | |
2048 { | |
2049 pGUIWindow_Settings->Release(); | |
2050 pGUIWindow_Settings = 0; | |
2051 pMouse->SetCursorBitmap("MICON1"); | |
2052 GameUI_Footer_TimeLeft = 0; | |
2053 _50C9A0_IsEnchantingInProgress = 0; | |
2054 back_to_game(); | |
2055 } | |
2056 } | |
2057 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2058 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2059 pGUIWindow_CurrentMenu->Release(); | |
2060 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2061 window_SpeakInHouse = 0; | |
2062 pGUIWindow_CurrentMenu = 0; | |
2063 pEventTimer->Resume(); | |
2064 pCurrentScreen = SCREEN_GAME; | |
2065 viewparams->bRedrawGameUI = 1; | |
2066 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2067 continue; | |
2068 } | |
2069 } | |
2070 else | |
2071 { | |
2072 if ( pCurrentScreen < SCREEN_64 ) | |
2073 { | |
2074 switch ( pCurrentScreen ) | |
2075 { | |
2076 case SCREEN_CASTING: | |
2077 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2078 if ( some_active_character ) | |
2079 { | |
2080 uActiveCharacter = some_active_character; | |
2081 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2082 some_active_character = 0; | |
2083 if ( pParty->bTurnBasedModeOn ) | |
2084 pTurnEngine->ApplyPlayerAction(); | |
2085 _50C9D0_AfterEnchClickEventId = 0; | |
2086 _50C9D4_AfterEnchClickEventSecondParam = 0; | |
2087 _50C9D8_AfterEnchClickEventTimeout = 0; | |
2088 } | |
2089 if ( ptr_50C9A4_ItemToEnchant && ptr_50C9A4_ItemToEnchant->uItemID ) | |
2090 { | |
2091 LOBYTE(ptr_50C9A4_ItemToEnchant->uAttributes) &= 0xFu; | |
2092 _50C9A8_item_enchantment_timer = 0; | |
2093 ptr_50C9A4_ItemToEnchant = 0; | |
2094 } | |
2095 if ( pGUIWindow_Settings ) | |
2096 { | |
2217 | 2097 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
2098 pMouse->SetCursorBitmap("MICON2"); | |
2099 else | |
2100 { | |
2101 pGUIWindow_Settings->Release(); | |
2102 pGUIWindow_Settings = 0; | |
2103 pMouse->SetCursorBitmap("MICON1"); | |
2104 GameUI_Footer_TimeLeft = 0; | |
2105 _50C9A0_IsEnchantingInProgress = 0; | |
2106 back_to_game(); | |
1915 | 2107 } |
2108 } | |
2109 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2110 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2111 pGUIWindow_CurrentMenu->Release(); | |
2112 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2113 window_SpeakInHouse = 0; | |
2114 pGUIWindow_CurrentMenu = 0; | |
2115 pEventTimer->Resume(); | |
2116 pCurrentScreen = SCREEN_GAME; | |
2117 viewparams->bRedrawGameUI = 1; | |
2118 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2119 continue; | |
2120 case SCREEN_BOOKS: | |
2121 pBooksWindow->Release(); | |
2122 //crt_deconstruct_ptr_6A0118(); | |
2123 pBooksWindow = 0; | |
2124 pEventTimer->Resume(); | |
2125 if ( pGUIWindow_Settings ) | |
2126 { | |
2127 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2217 | 2128 pMouse->SetCursorBitmap("MICON2"); |
1915 | 2129 else |
2130 { | |
2217 | 2131 pGUIWindow_Settings->Release(); |
2132 pGUIWindow_Settings = 0; | |
2133 pMouse->SetCursorBitmap("MICON1"); | |
2134 GameUI_Footer_TimeLeft = 0; | |
2135 _50C9A0_IsEnchantingInProgress = 0; | |
2136 back_to_game(); | |
1915 | 2137 } |
2138 } | |
2139 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2140 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2141 pGUIWindow_CurrentMenu->Release(); | |
2142 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2143 window_SpeakInHouse = 0; | |
2144 pGUIWindow_CurrentMenu = 0; | |
2145 pEventTimer->Resume(); | |
2146 pCurrentScreen = SCREEN_GAME; | |
2147 viewparams->bRedrawGameUI = 1; | |
2148 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2149 continue; | |
2150 case SCREEN_SAVEGAME: | |
2151 case SCREEN_LOADGAME: | |
2152 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2153 //crt_deconstruct_ptr_6A0118(); | |
2154 stru_506E40.Release(); | |
2155 break; | |
2156 case SCREEN_CHEST_INVENTORY: | |
2157 pCurrentScreen = SCREEN_CHEST; | |
2158 continue; | |
2159 case SCREEN_CHEST: | |
2160 pWindow2 = pChestWindow; | |
2161 pWindow2->Release(); | |
2162 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2163 pCurrentScreen = SCREEN_GAME; | |
2164 viewparams->bRedrawGameUI = 1; | |
2165 pEventTimer->Resume(); | |
2166 continue; | |
2167 case SCREEN_19: | |
2168 __debugbreak(); | |
2169 pWindow2 = ptr_507BC8; | |
2170 pWindow2->Release(); | |
2171 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2172 pCurrentScreen = SCREEN_GAME; | |
2173 viewparams->bRedrawGameUI = 1; | |
2174 pEventTimer->Resume(); | |
2175 continue; | |
2176 case SCREEN_OPTIONS://Close | |
2177 options_menu_skin.Relaease(); | |
2178 pIcons_LOD->SyncLoadedFilesCount(); | |
2179 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier); | |
2180 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier); | |
2181 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier); | |
2182 WriteWindowsRegistryInt("WalkSound", bWalkSound); | |
2183 WriteWindowsRegistryInt("ShowDamage", bShowDamage); | |
2151 | 2184 //WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode); |
1915 | 2185 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); |
2186 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit); | |
2187 if ( !uTurnSpeed ) | |
2188 { | |
2189 WriteWindowsRegistryInt("TurnDelta", 3); | |
2190 stru_506E40.Release(); | |
2191 break; | |
2192 } | |
2193 if ( uTurnSpeed == 64 ) | |
2194 { | |
2195 WriteWindowsRegistryInt("TurnDelta", 2); | |
2196 stru_506E40.Release(); | |
2197 break; | |
2198 } | |
2199 if ( uTurnSpeed != 128 ) | |
2200 { | |
2201 stru_506E40.Release(); | |
2202 break; | |
2203 } | |
2204 WriteWindowsRegistryInt("TurnDelta", 1); | |
2205 stru_506E40.Release(); | |
2206 break; | |
2207 case SCREEN_MENU: | |
2208 pIcons_LOD->SyncLoadedFilesCount(); | |
2209 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2210 pIcons_LOD->SyncLoadedFilesCount(); | |
2211 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2212 stru_506E40.Release(); | |
2213 break; | |
2214 case SCREEN_VIDEO_OPTIONS: | |
2153 | 2215 //if ( pRenderer->pRenderD3D ) |
1915 | 2216 { |
2217 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights); | |
2218 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting); | |
2219 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pGame->uFlags2) >> 5) & 1); | |
2220 } | |
2155 | 2221 /*if ( !pRenderer->bWindowMode ) |
2222 WriteWindowsRegistryInt("GammaPos", uGammaPos);*/ | |
2154 | 2223 |
1915 | 2224 stru_506E40.Release(); |
2225 break; | |
2226 | |
2227 case SCREEN_KEYBOARD_OPTIONS://Return to game | |
2228 v197 = 1; | |
2229 v32 = 0; | |
2230 while ( !GameMenuUI_InvaligKeyBindingsFlags[v32]) | |
2231 { | |
2232 ++v32; | |
2233 if ( v32 >= 28 ) | |
2234 { | |
2235 thisb = (signed int)&uTextureID_Optkb; | |
2236 assert(false && "Invalid condition values"); | |
2237 do | |
2238 { | |
2239 if ( *(int *)thisb ) | |
2240 pIcons_LOD->pTextures[*(int *)thisb].Release(); | |
2241 thisb += 4; | |
2242 } | |
2243 while ( thisb < (signed int)0x00507C08 ); | |
2244 | |
2245 memset(&uTextureID_Optkb, 0, 0x14u); | |
2246 pIcons_LOD->SyncLoadedFilesCount(); | |
2212 | 2247 for ( uAction = 0; uAction < 28; ++uAction ) |
1915 | 2248 { |
2249 v33 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
2250 if ( v33 != pPrevVirtualCidesMapping[uAction] ) | |
2251 { | |
2252 if ( v197 ) | |
2253 { | |
2254 v34 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
2255 GUI_ReplaceHotkey(v34, LOBYTE(pPrevVirtualCidesMapping[uAction]), 1); | |
2256 v197 = 0; | |
2257 } | |
2258 else | |
2259 { | |
2260 v35 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
2261 GUI_ReplaceHotkey(v35, LOBYTE(pPrevVirtualCidesMapping[uAction]), 0); | |
2262 } | |
2263 } | |
2264 if ( uAction && uAction != 2 && uAction != 3 && uAction != 1 && uAction != 25 && uAction != 26 ) | |
2201 | 2265 pKeyToggleType = TOGGLE_OneTimePress; |
1915 | 2266 else |
2201 | 2267 pKeyToggleType = TOGGLE_Continuously; |
1915 | 2268 pKeyActionMap->SetKeyMapping(uAction, pPrevVirtualCidesMapping[uAction], pKeyToggleType); |
2269 } | |
2270 pKeyActionMap->StoreMappings(); | |
2271 stru_506E40.Release(); | |
2272 break; | |
2273 } | |
2274 } | |
2275 break; | |
2276 case SCREEN_REST://close rest screen | |
2277 if ( dword_506F14 ) | |
2278 { | |
2279 Rest(_506F18_num_minutes_to_sleep); | |
2280 pParty->pPlayers[3].SetAsleep(false); | |
2281 pParty->pPlayers[2].SetAsleep(false); | |
2282 pParty->pPlayers[1].SetAsleep(false); | |
2283 pParty->pPlayers[0].SetAsleep(false); | |
2284 } | |
2285 pTexture_RestUI_CurrentSkyFrame->Release(); | |
2286 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
2287 pTexture_RestUI_CurrentHourglassFrame = 0; | |
2288 pTexture_RestUI_CurrentSkyFrame = 0; | |
2289 pIcons_LOD->SyncLoadedFilesCount(); | |
2290 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2291 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
2292 { | |
2293 pOutdoor->UpdateSunlightVectors(); | |
2294 pOutdoor->UpdateFog(); | |
2295 } | |
2296 _506F18_num_minutes_to_sleep = 0; | |
2297 dword_506F14 = 0; | |
2298 if ( pGUIWindow_Settings ) | |
2299 { | |
2300 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2301 pMouse->SetCursorBitmap("MICON2"); | |
2302 else | |
2303 { | |
2304 pGUIWindow_Settings->Release(); | |
2305 pGUIWindow_Settings = 0; | |
2306 pMouse->SetCursorBitmap("MICON1"); | |
2307 GameUI_Footer_TimeLeft = 0; | |
2308 _50C9A0_IsEnchantingInProgress = 0; | |
2309 back_to_game(); | |
2217 | 2310 } |
1915 | 2311 } |
2312 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2313 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2314 pGUIWindow_CurrentMenu->Release(); | |
2315 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2316 window_SpeakInHouse = 0; | |
2317 pGUIWindow_CurrentMenu = 0; | |
2318 pEventTimer->Resume(); | |
2319 pCurrentScreen = SCREEN_GAME; | |
2320 viewparams->bRedrawGameUI = 1; | |
2321 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2322 continue; | |
2323 case SCREEN_E: | |
2324 __debugbreak(); | |
2325 pGUIWindow_CurrentMenu->Release(); | |
2326 pCurrentScreen = SCREEN_HOUSE; | |
2327 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2328 continue; | |
2329 case SCREEN_HOUSE: | |
2330 if ( uDialogueType ) | |
2331 uDialogueType = 0; | |
2124 | 2332 if ( uGameState == GAME_STATE_CHANGE_LOCATION ) |
1915 | 2333 { |
1919 | 2334 while ( HouseDialogPressCloseBtn() ) |
1915 | 2335 ; |
2336 } | |
2337 else | |
2338 { | |
1919 | 2339 if ( HouseDialogPressCloseBtn() ) |
1915 | 2340 continue; |
2341 } | |
2342 GetHouseGoodbyeSpeech(); | |
2343 pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0); | |
2344 pVideoPlayer->Unload(); | |
2345 pGUIWindow_CurrentMenu = window_SpeakInHouse; | |
2346 if ( pGUIWindow_Settings ) | |
2347 { | |
2348 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2349 pMouse->SetCursorBitmap("MICON2"); | |
2350 else | |
2351 { | |
2352 pGUIWindow_Settings->Release(); | |
2353 pGUIWindow_Settings = 0; | |
2354 pMouse->SetCursorBitmap("MICON1"); | |
2355 GameUI_Footer_TimeLeft = 0; | |
2356 _50C9A0_IsEnchantingInProgress = 0; | |
2357 back_to_game(); | |
2358 } | |
2359 } | |
2360 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2361 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2362 pGUIWindow_CurrentMenu->Release(); | |
2363 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2364 window_SpeakInHouse = 0; | |
2365 pGUIWindow_CurrentMenu = 0; | |
2366 pEventTimer->Resume(); | |
2367 pCurrentScreen = SCREEN_GAME; | |
2368 viewparams->bRedrawGameUI = true; | |
2369 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2370 continue; | |
2371 case SCREEN_INPUT_BLV://click escape | |
2372 if ( uCurrentHouse_Animation == 153 ) | |
2373 PlayHouseSound(0x99u, HouseSound_Greeting_2); | |
2374 pVideoPlayer->Unload(); | |
2375 if ( npcIdToDismissAfterDialogue ) | |
2376 { | |
2377 pParty->hirelingScrollPosition = 0; | |
2378 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu; | |
2379 pParty->CountHirelings(); | |
2380 viewparams->bRedrawGameUI = true; | |
2381 npcIdToDismissAfterDialogue = 0; | |
2382 } | |
2383 DialogueEnding(); | |
2384 pCurrentScreen = SCREEN_GAME; | |
2385 viewparams->bRedrawGameUI = true; | |
2386 continue; | |
2387 case SCREEN_NPC_DIALOGUE://click escape | |
2388 if ( npcIdToDismissAfterDialogue ) | |
2389 { | |
2390 pParty->hirelingScrollPosition = 0; | |
2391 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu; | |
2392 pParty->CountHirelings(); | |
2393 viewparams->bRedrawGameUI = true; | |
2394 npcIdToDismissAfterDialogue = 0; | |
2395 } | |
2396 //goto LABEL_317; | |
2397 DialogueEnding(); | |
2398 pCurrentScreen = SCREEN_GAME; | |
2399 viewparams->bRedrawGameUI = true; | |
2400 continue; | |
2401 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape | |
2402 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); | |
2403 sub_4452BB(); | |
2404 DialogueEnding(); | |
2405 pCurrentScreen = SCREEN_GAME; | |
2406 viewparams->bRedrawGameUI = true; | |
2407 continue; | |
2408 case SCREEN_CHANGE_LOCATION://click escape | |
2409 if ( pParty->vPosition.x < -22528 ) | |
2410 pParty->vPosition.x = -22528; | |
2411 if ( pParty->vPosition.x > 22528 ) | |
2412 pParty->vPosition.x = 22528; | |
2413 if ( pParty->vPosition.y < -22528 ) | |
2414 pParty->vPosition.y = -22528; | |
2415 if ( pParty->vPosition.y > 22528 ) | |
2416 pParty->vPosition.y = 22528; | |
2417 DialogueEnding(); | |
2418 pCurrentScreen = SCREEN_GAME; | |
2419 viewparams->bRedrawGameUI = true; | |
2420 continue; | |
2421 case SCREEN_VIDEO: | |
2422 pVideoPlayer->Unload(); | |
2423 continue; | |
2424 case SCREEN_CHARACTERS: | |
2425 CharacterUI_ReleaseButtons(); | |
2426 ReleaseAwardsScrollBar(); | |
2427 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2428 if ( pGUIWindow_Settings ) | |
2429 { | |
2430 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2431 pMouse->SetCursorBitmap("MICON2"); | |
2432 else | |
2433 { | |
2434 pGUIWindow_Settings->Release(); | |
2435 pGUIWindow_Settings = 0; | |
2436 pMouse->SetCursorBitmap("MICON1"); | |
2437 GameUI_Footer_TimeLeft = 0; | |
2438 _50C9A0_IsEnchantingInProgress = 0; | |
2439 back_to_game(); | |
2440 } | |
2441 } | |
2442 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2443 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2444 pGUIWindow_CurrentMenu->Release(); | |
2445 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2446 window_SpeakInHouse = 0; | |
2447 pGUIWindow_CurrentMenu = 0; | |
2448 pEventTimer->Resume(); | |
2449 pCurrentScreen = SCREEN_GAME; | |
2450 viewparams->bRedrawGameUI = true; | |
2451 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2452 continue; | |
2453 default: | |
2454 if ( pGUIWindow_Settings ) | |
2455 { | |
2456 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2457 pMouse->SetCursorBitmap("MICON2"); | |
2458 else | |
2459 { | |
2460 pGUIWindow_Settings->Release(); | |
2461 pGUIWindow_Settings = 0; | |
2462 pMouse->SetCursorBitmap("MICON1"); | |
2463 GameUI_Footer_TimeLeft = 0; | |
2464 _50C9A0_IsEnchantingInProgress = 0; | |
2465 back_to_game(); | |
2466 } | |
2467 } | |
2468 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2469 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2470 pGUIWindow_CurrentMenu->Release(); | |
2471 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2472 window_SpeakInHouse = 0; | |
2473 pGUIWindow_CurrentMenu = 0; | |
2474 pEventTimer->Resume(); | |
2475 pCurrentScreen = SCREEN_GAME; | |
2476 viewparams->bRedrawGameUI = 1; | |
2477 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2478 continue; | |
2479 } | |
2480 if ( pGUIWindow_Settings ) | |
2481 { | |
2482 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2483 pMouse->SetCursorBitmap("MICON2"); | |
2484 else | |
2485 { | |
2486 pGUIWindow_Settings->Release(); | |
2487 pGUIWindow_Settings = 0; | |
2488 pMouse->SetCursorBitmap("MICON1"); | |
2489 GameUI_Footer_TimeLeft = 0; | |
2490 _50C9A0_IsEnchantingInProgress = 0; | |
2491 back_to_game(); | |
2492 } | |
2493 } | |
2494 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2495 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2496 pGUIWindow_CurrentMenu->Release(); | |
2497 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2498 window_SpeakInHouse = 0; | |
2499 pGUIWindow_CurrentMenu = 0; | |
2500 pEventTimer->Resume(); | |
2501 pCurrentScreen = SCREEN_GAME; | |
2502 viewparams->bRedrawGameUI = true; | |
2503 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2504 continue; | |
2505 } | |
2506 CharacterUI_ReleaseButtons(); | |
2507 ReleaseAwardsScrollBar(); | |
2508 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2509 } | |
2510 if ( pGUIWindow_Settings ) | |
2511 { | |
2512 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2513 pMouse->SetCursorBitmap("MICON2"); | |
2514 else | |
2515 { | |
2516 pGUIWindow_Settings->Release(); | |
2517 pGUIWindow_Settings = 0; | |
2518 pMouse->SetCursorBitmap("MICON1"); | |
2519 GameUI_Footer_TimeLeft = 0; | |
2520 _50C9A0_IsEnchantingInProgress = 0; | |
2521 back_to_game(); | |
2522 } | |
2523 } | |
2524 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2525 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2526 pGUIWindow_CurrentMenu->Release(); | |
2527 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2528 window_SpeakInHouse = 0; | |
2529 pGUIWindow_CurrentMenu = 0; | |
2530 pEventTimer->Resume(); | |
2531 pCurrentScreen = SCREEN_GAME; | |
2532 viewparams->bRedrawGameUI = true; | |
2533 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2534 continue; | |
2535 } | |
2536 if ( !pGUIWindow_Settings )//Draw Menu | |
2537 { | |
2538 dword_6BE138 = -1; | |
2539 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, (char *)1); | |
2540 pEventTimer->Pause(); | |
2541 pAudioPlayer->StopChannels(-1, -1); | |
2542 pCurrentScreen = SCREEN_MENU; | |
2543 | |
2544 ++pIcons_LOD->uTexturePacksCount; | |
2545 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2546 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2547 | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
2548 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_OptionsButtons, 0, 0); |
1915 | 2549 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); |
2550 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); | |
2551 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE); | |
2552 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE); | |
2553 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); | |
2554 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
2555 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE); | |
2556 pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu, | |
2557 pGlobalTXT_LocalizationStrings[614],// "New Game" | |
2558 pIcons_LOD->GetTexture(uTextureID_New1), 0); | |
2559 pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u, | |
2560 pGlobalTXT_LocalizationStrings[615],// "Save Game" | |
2561 pIcons_LOD->GetTexture(uTextureID_Save1), 0); | |
2562 pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu, | |
2563 pGlobalTXT_LocalizationStrings[616],// "Load Game" | |
2564 pIcons_LOD->GetTexture(uTextureID_Load1), 0); | |
2565 pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u, | |
2566 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:"" | |
2567 pIcons_LOD->GetTexture(uTextureID_Controls1), 0); | |
2568 pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u, | |
2569 pGlobalTXT_LocalizationStrings[618],// "Quit" | |
2570 pIcons_LOD->GetTexture(uTextureID_Quit1), 0); | |
2571 pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u, | |
2572 pGlobalTXT_LocalizationStrings[619],// "Return to Game" | |
2573 pIcons_LOD->GetTexture(uTextureID_Resume1), 0); | |
2574 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0); | |
2575 viewparams->field_48 = 1; | |
2154 | 2576 |
1915 | 2577 stru_506E40.Release(); |
2154 | 2578 pRenderer->SaveScreenshot("gamma.pcx", 155, 117); |
2131 | 2579 stru_506E40.LoadPCXFile("gamma.pcx", 0); |
2154 | 2580 |
1915 | 2581 continue; |
2582 } | |
2583 pGUIWindow_Settings->Release(); | |
2584 pGUIWindow_Settings = 0; | |
2585 pMouse->SetCursorBitmap("MICON1"); | |
2586 GameUI_Footer_TimeLeft = 0; | |
2587 _50C9A0_IsEnchantingInProgress = 0; | |
2588 back_to_game(); | |
2589 continue; | |
2590 } | |
2591 ModalWindow_Release(); | |
2592 continue; | |
2593 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel | |
2594 if ( uMessageParam ) | |
2595 { | |
2596 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0); | |
2597 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2; | |
2598 if ( pParty->hirelingScrollPosition < v37 ) | |
2599 { | |
2600 ++pParty->hirelingScrollPosition;//??? maybe number of the first cell??? | |
2601 if ( pParty->hirelingScrollPosition >= v37 ) | |
2602 pParty->hirelingScrollPosition = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2; | |
2603 } | |
2604 } | |
2605 else | |
2606 { | |
2607 GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0); | |
2608 /*if ( pParty->field_709 ) | |
2609 { | |
2610 --pParty->field_709; | |
2611 if ( pParty->field_709 < 1 ) | |
2612 pParty->field_709 = 0; | |
2613 }*/ | |
2614 } | |
2615 GameUI_DrawHiredNPCs(); | |
2616 continue; | |
2617 case UIMSG_TransitionUI_Confirm: | |
2618 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2619 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2620 dword_50CDC8 = 1; | |
2621 sub_42FBDD(); | |
2622 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful); | |
2623 pVideoPlayer->Unload(); | |
2624 DialogueEnding(); | |
2124 | 2625 viewparams->bRedrawGameUI = true; |
1915 | 2626 if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz ) |
2627 { | |
2628 if ( dword_59117C_teleportx ) | |
2629 { | |
2630 pParty->vPosition.x = dword_59117C_teleportx; | |
2631 _5B65A8_npcdata_uflags_or_other = dword_59117C_teleportx; | |
2632 } | |
2633 if ( dword_591178_teleporty ) | |
2634 { | |
2635 pParty->vPosition.y = dword_591178_teleporty; | |
2636 _5B65AC_npcdata_fame_or_other = dword_591178_teleporty; | |
2637 } | |
2638 if ( dword_591174_teleportz ) | |
2639 { | |
2640 pParty->vPosition.z = dword_591174_teleportz; | |
2641 _5B65B0_npcdata_rep_or_other = dword_591174_teleportz; | |
2642 pParty->uFallStartY = dword_591174_teleportz; | |
2643 } | |
2644 if ( dword_591170_teleport_directiony ) | |
2645 { | |
2646 pParty->sRotationY = dword_591170_teleport_directiony; | |
2647 _5B65B4_npcdata_loword_house_or_other = dword_591170_teleport_directiony; | |
2648 } | |
2649 if ( dword_59116C_teleport_directionx ) | |
2650 { | |
2651 pParty->sRotationX = dword_59116C_teleport_directionx; | |
2652 _5B65B8_npcdata_hiword_house_or_other = dword_59116C_teleport_directionx; | |
2653 v38 = dword_591168_teleport_speedz; | |
2654 pParty->uFallSpeed = dword_591168_teleport_speedz; | |
2655 dword_5B65BC = dword_591168_teleport_speedz; | |
2656 } | |
2657 else | |
2658 v38 = dword_5B65BC; | |
2659 if ( *dword_591164_teleport_map_name != 48 ) | |
2660 { | |
2661 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2; | |
2662 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; | |
2663 OnMapLeave(); | |
2101 | 2664 Transition_StopSound_Autosave(dword_591164_teleport_map_name, MapStartPoint_Party); |
1915 | 2665 } |
2666 } | |
2667 else | |
2668 EventProcessor(dword_5C3418, 0, 1, dword_5C341C); | |
2669 if ( !_stricmp(byte_6BE3B0.data(), "d05.blv") ) | |
2670 pParty->uTimePlayed += 1474560i64; | |
2671 continue; | |
2672 case UIMSG_TransitionWindowCloseBtn: | |
2673 CloseWindowBackground(); | |
2674 pVideoPlayer->Unload(); | |
2675 DialogueEnding(); | |
2676 viewparams->bRedrawGameUI = true; | |
2677 continue; | |
2678 case UIMSG_CycleCharacters: | |
2679 v39 = GetAsyncKeyState(VK_SHIFT); | |
2680 uActiveCharacter = CycleCharacter(v39); | |
2681 viewparams->bRedrawGameUI = true; | |
2682 continue; | |
2683 case UIMSG_OnTravelByFoot: | |
2684 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2685 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2686 dword_50CDC8 = 1; | |
2687 sub_42FBDD(); | |
2688 //pNPCData4 = (NPCData *)GetTravelTime(); | |
2689 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); | |
2690 if ( bUnderwater != 1 && pParty->bFlying | |
2691 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) | |
2692 { | |
2693 viewparams->bRedrawGameUI = 1; | |
2694 CloseWindowBackground(); | |
2695 if ( pParty->vPosition.x < -22528 ) | |
2696 pParty->vPosition.x = -22528; | |
2697 if ( pParty->vPosition.x > 22528 ) | |
2698 pParty->vPosition.x = 22528; | |
2699 if ( pParty->vPosition.y < -22528 ) | |
2700 pParty->vPosition.y = -22528; | |
2701 if ( pParty->vPosition.y > 22528 ) | |
2702 pParty->vPosition.y = 22528; | |
2703 DialogueEnding(); | |
2704 pCurrentScreen = SCREEN_GAME; | |
2705 } | |
2706 else | |
2707 { | |
2708 pParty->field_6E4 = 0; | |
2709 pParty->field_6E0 = 0; | |
2710 CastSpellInfoHelpers::_427D48(); | |
2711 DialogueEnding(); | |
2712 pEventTimer->Pause(); | |
2713 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box); | |
2714 ++pGameLoadingUI_ProgressBar->uProgressMax; | |
2715 SaveGame(1, 0); | |
2716 pGameLoadingUI_ProgressBar->Progress(); | |
2717 RestAndHeal(1440 * (signed int)GetTravelTime()); | |
2718 if ( pParty->uNumFoodRations ) | |
2719 { | |
2720 pParty->RestAndHeal(); | |
2721 if ( ((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0 ) | |
2722 { | |
2723 pPlayer7 = pParty->pPlayers.data(); | |
2724 do | |
2725 { | |
2726 pPlayer7->SetCondition(1, 0); | |
2727 ++pPlayer7; | |
2728 } | |
2729 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings.data() ); | |
2730 ++pParty->days_played_without_rest; | |
2731 } | |
2732 Party::TakeFood((unsigned int)GetTravelTime()); | |
2733 } | |
2734 else | |
2735 { | |
2736 pPlayer8 = pParty->pPlayers.data(); | |
2737 do | |
2738 { | |
2739 pPlayer8->SetCondition(1, 0); | |
2740 ++pPlayer8; | |
2741 } | |
2742 while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings.data() ); | |
2743 ++pParty->days_played_without_rest; | |
2744 } | |
2745 pPaletteManager->ResetNonLocked(); | |
2746 pSpriteFrameTable->ResetSomeSpriteFlags(); | |
2747 strcpy(pCurrentMapName, pOut); | |
2748 strcpy(pLevelName, pCurrentMapName); | |
2749 v41 = strtok(pLevelName, "."); | |
2750 strcpy(pLevelName, v41); | |
2751 Level_LoadEvtAndStr(pLevelName); | |
2752 pDecalBuilder->Reset(0); | |
2753 LoadLevel_InitializeLevelEvt(); | |
2754 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName); | |
2755 bUnderwater = 0; | |
2756 bNoNPCHiring = 0; | |
2757 pGame->uFlags2 &= 0xFFFFFFF7u; | |
2758 if ( Is_out15odm_underwater() ) | |
2759 { | |
2760 bUnderwater = 1; | |
2761 pGame->uFlags2 |= 8u; | |
2762 } | |
2763 if ( !_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d47.blv") ) | |
2764 bNoNPCHiring = 1; | |
2765 PrepareToLoadODM(1u, (ODMRenderParams *)1); | |
2766 pAudioPlayer->SetMapEAX(); | |
2767 bDialogueUI_InitializeActor_NPC_ID = 0; | |
2768 OnMapLoad(); | |
2769 pOutdoor->SetFog(); | |
2770 TeleportToStartingPoint(uLevel_StartingPointType); | |
2771 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0); | |
2772 pParty->uFallStartY = pParty->vPosition.z; | |
2773 _461103_load_level_sub(); | |
2774 pEventTimer->Resume(); | |
2775 viewparams->bRedrawGameUI = 1; | |
2776 pCurrentScreen = SCREEN_GAME; | |
2777 pGameLoadingUI_ProgressBar->Release(); | |
2778 } | |
2779 viewparams->bRedrawGameUI = 1; | |
2780 continue; | |
2781 case UIMSG_CHANGE_LOCATION_ClickCencelBtn: | |
2782 CloseWindowBackground(); | |
2783 if ( pParty->vPosition.x < -22528 ) | |
2784 pParty->vPosition.x = -22528; | |
2785 if ( pParty->vPosition.x > 22528 ) | |
2786 pParty->vPosition.x = 22528; | |
2787 if ( pParty->vPosition.y < -22528 ) | |
2788 pParty->vPosition.y = -22528; | |
2789 if ( pParty->vPosition.y > 22528 ) | |
2790 pParty->vPosition.y = 22528; | |
2791 DialogueEnding(); | |
2792 pCurrentScreen = SCREEN_GAME; | |
2793 viewparams->bRedrawGameUI = 1; | |
2794 continue; | |
2795 case UIMSG_CastSpell_Telekinesis: | |
2153 | 2796 //if ( pRenderer->pRenderD3D ) |
1915 | 2797 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); |
2153 | 2798 /*else |
1915 | 2799 { |
2800 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210); | |
2801 pPoint = pMouse->GetCursorPos(&v208); | |
2802 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]]; | |
2153 | 2803 }*/ |
1915 | 2804 v44 = (unsigned __int16)v42; |
2805 v45 = PID_TYPE(v44); | |
2806 uNumSeconds = v44; | |
2807 v46 = PID_ID(v44); | |
2808 if ( v45 == 3 ) | |
2809 { | |
2810 v47 = pActors[v46].uAIState == Dead; | |
2811 if ( !v47 ) | |
2812 continue; | |
2813 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2814 pSpellInfo->uFlags &= ~0x40u; | |
2815 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2816 pSpellInfo->spell_target_pid = v44; | |
2817 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2818 pGUIWindow_Settings->Release(); | |
2819 pGUIWindow_Settings = 0; | |
2820 pMouse->SetCursorBitmap("MICON1"); | |
2821 GameUI_Footer_TimeLeft = 0; | |
2822 _50C9A0_IsEnchantingInProgress = 0; | |
2823 back_to_game(); | |
2824 continue; | |
2825 } | |
2826 if ( v45 == 2 ) | |
2827 { | |
2828 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; | |
2829 if ( !v47 ) | |
2830 continue; | |
2831 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2832 pSpellInfo->uFlags &= ~0x40u; | |
2833 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2834 pSpellInfo->spell_target_pid = v44; | |
2835 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2836 pGUIWindow_Settings->Release(); | |
2837 pGUIWindow_Settings = 0; | |
2838 pMouse->SetCursorBitmap("MICON1"); | |
2839 GameUI_Footer_TimeLeft = 0; | |
2840 _50C9A0_IsEnchantingInProgress = 0; | |
2841 back_to_game(); | |
2842 continue; | |
2843 } | |
2844 if ( v45 == 5 ) | |
2845 { | |
2846 v48 = pLevelDecorations[v46].uEventID == 0; | |
2847 } | |
2848 else | |
2849 { | |
2850 if ( v45 != 6 ) | |
2851 continue; | |
2852 if ( uCurrentlyLoadedLevelType != 1 ) | |
2853 { | |
2854 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; | |
2092 | 2855 if ( !pODMFace->Clickable() || !pODMFace->sCogTriggeredID ) |
1915 | 2856 continue; |
2857 v44 = uNumSeconds; | |
2858 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2859 pSpellInfo->uFlags &= ~0x40u; | |
2860 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2861 pSpellInfo->spell_target_pid = v44; | |
2862 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2863 pGUIWindow_Settings->Release(); | |
2864 pGUIWindow_Settings = 0; | |
2865 pMouse->SetCursorBitmap("MICON1"); | |
2866 GameUI_Footer_TimeLeft = 0; | |
2867 _50C9A0_IsEnchantingInProgress = 0; | |
2868 back_to_game(); | |
2869 continue; | |
2870 } | |
2871 pBLVFace = &pIndoor->pFaces[v46]; | |
2092 | 2872 if ( !pBLVFace->Clickable() ) |
1915 | 2873 continue; |
2874 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; | |
2875 } | |
2876 if ( v48 ) | |
2877 continue; | |
2878 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2879 pSpellInfo->uFlags &= ~0x40u; | |
2880 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2881 pSpellInfo->spell_target_pid = v44; | |
2882 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2883 pGUIWindow_Settings->Release(); | |
2884 pGUIWindow_Settings = 0; | |
2885 pMouse->SetCursorBitmap("MICON1"); | |
2886 GameUI_Footer_TimeLeft = 0; | |
2887 _50C9A0_IsEnchantingInProgress = 0; | |
2888 back_to_game(); | |
2889 continue; | |
2890 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade) | |
2891 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure | |
2892 case UIMSG_HiredNPC_CastSpell: | |
2893 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2894 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2895 if ( _50C9A0_IsEnchantingInProgress ) | |
2896 { | |
2897 uActiveCharacter = uMessageParam; | |
2898 viewparams->bRedrawGameUI = 1; | |
2899 } | |
2900 else | |
2901 { | |
2902 if ( pGUIWindow_Settings ) | |
2903 { | |
2904 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2905 switch ( uMessage ) | |
2906 { | |
2907 case UIMSG_CastSpell_Character_Big_Improvement: | |
2908 pSpellInfo->uFlags &= ~0x02u; | |
2909 break; | |
2910 case UIMSG_CastSpell_Character_Small_Improvement: | |
2911 pSpellInfo->uFlags &= ~0x0100u; | |
2912 break; | |
2913 case UIMSG_HiredNPC_CastSpell: | |
2914 pSpellInfo->uFlags &= ~0x0200u; | |
2915 break; | |
2916 } | |
2917 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2918 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2919 pGUIWindow_Settings->Release(); | |
2920 pGUIWindow_Settings = 0; | |
2921 pEventTimer->Resume(); | |
2922 pMouse->SetCursorBitmap("MICON1"); | |
2923 GameUI_Footer_TimeLeft = 0; | |
2924 _50C9A0_IsEnchantingInProgress = 0; | |
2925 } | |
2926 } | |
2927 continue; | |
2928 case UIMSG_BF: | |
2929 __debugbreak(); | |
2930 dword_50CDC8 = 1; | |
2931 sub_42FBDD(); | |
2932 SaveGame(1, 0); | |
2933 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); | |
2061 | 2934 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 2935 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 2936 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; |
2937 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related; | |
2938 if ( v53 < 0 ) | |
2939 { | |
2940 v54 = abs(v53) - 1; | |
2941 _5B65B8_npcdata_hiword_house_or_other = 0; | |
2942 dword_5B65BC = 0; | |
2943 v55 = dword_4E4560[v54]; | |
2944 _5B65AC_npcdata_fame_or_other = dword_4E4578[v54]; | |
2945 v56 = dword_4E4590[v54]; | |
2946 v57 = dword_4E45A8[v54]; | |
2947 _5B65A8_npcdata_uflags_or_other = v55; | |
2948 _5B65B4_npcdata_loword_house_or_other = v57; | |
2949 _5B65B0_npcdata_rep_or_other = v56; | |
2950 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57; | |
2951 } | |
1919 | 2952 HouseDialogPressCloseBtn(); |
1915 | 2953 //goto LABEL_434; |
2954 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
2955 { | |
2956 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
2957 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; | |
2958 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2959 ++pMessageQueue_50CBD0->uNumMessages; | |
2960 }*/ | |
2961 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2962 continue; | |
2963 | |
2964 case UIMSG_OnCastTownPortal: | |
2965 pAudioPlayer->StopChannels(-1, -1); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
2966 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam); |
1915 | 2967 continue; |
2968 | |
2969 case UIMSG_OnCastLloydsBeacon: | |
2970 pAudioPlayer->StopChannels(-1, -1); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
2971 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, WINDOW_LloydsBeacon, 0); |
1915 | 2972 continue; |
2973 | |
2974 case UIMSG_LloydsBeacon_FlippingBtn: | |
2975 bRecallingBeacon = uMessageParam; | |
2976 v127 = uMessageParam + 204; | |
2977 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); | |
2978 continue; | |
2979 case UIMSG_HintBeaconSlot: | |
2980 if ( !pGUIWindow_CurrentMenu ) | |
2981 continue; | |
2982 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1]; | |
2983 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam]; | |
2984 if ( bRecallingBeacon ) | |
2985 { | |
2986 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) ) | |
2987 continue; | |
2988 v173 = pMapStats->pInfos[sub_410D99_get_map_index(pPlayer->pInstalledBeacons[uMessageParam].SaveFileID)].pName; | |
2989 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s" | |
2990 GameUI_SetFooterString(pTmpBuf.data()); | |
2991 continue; | |
2992 } | |
2993 pMapNum = pMapStats->GetMapInfo(pCurrentMapName); | |
2994 pMapName = "Not in Map Stats"; | |
2995 if ( pMapNum ) | |
2996 pMapName = pMapStats->pInfos[pMapNum].pName; | |
2997 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) || !pMapNum ) | |
2998 { | |
2999 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], pMapName);// "Set to %s" | |
3000 GameUI_SetFooterString(pTmpBuf.data()); | |
3001 continue; | |
3002 } | |
3003 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; | |
3004 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], (unsigned int)pMapName, v174);// "Set %s over %s" | |
3005 GameUI_SetFooterString(pTmpBuf.data()); | |
3006 continue; | |
3007 case UIMSG_CloseAfterInstallBeacon: | |
3008 dword_50CDC8 = 1; | |
3009 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
3010 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
3011 continue; | |
3012 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3013 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
3014 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3015 ++pMessageQueue_50CBD0->uNumMessages;*/ | |
3016 continue; | |
3017 case UIMSG_InstallBeacon: | |
3018 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; | |
3019 if ( !pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon ) | |
3020 continue; | |
3021 byte_506360 = 1; | |
3022 pPlayer9->CanCastSpell(uRequiredMana); | |
3023 if ( pParty->bTurnBasedModeOn ) | |
3024 { | |
3025 v60 = sRecoveryTime; | |
3026 pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime; | |
3027 pPlayer9->SetRecoveryTime(v60); | |
3028 pTurnEngine->ApplyPlayerAction(); | |
3029 } | |
3030 else | |
3031 { | |
3032 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
3033 } | |
2185 | 3034 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[lloyds_beacon_spell_id], 0, 0, -1, 0, lloyds_beacon_sound_id, 0, 0); |
1915 | 3035 if ( bRecallingBeacon ) |
3036 { | |
3037 if ( _stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) ) | |
3038 { | |
3039 SaveGame(1, 0); | |
3040 OnMapLeave(); | |
3041 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]); | |
2061 | 3042 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 3043 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 3044 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; |
3045 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; | |
3046 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; | |
3047 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; | |
3048 _5B65B8_npcdata_hiword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; | |
3049 dword_5B65C0 = 1; | |
3050 } | |
3051 else | |
3052 { | |
3053 pParty->vPosition.x = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; | |
3054 pParty->vPosition.y = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; | |
3055 pParty->vPosition.z = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; | |
3056 pParty->uFallStartY = pParty->vPosition.z; | |
3057 pParty->sRotationY = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; | |
3058 pParty->sRotationX = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; | |
3059 } | |
3060 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
3061 pBooksWindow->Release(); | |
3062 pGUIWindow_CurrentMenu->Release(); | |
3063 pBooksWindow = 0; | |
3064 pGUIWindow_CurrentMenu = 0; | |
3065 } | |
3066 else | |
3067 { | |
3068 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1); | |
2154 | 3069 pRenderer->SaveScreenshot(a1, 92, 68); |
1915 | 3070 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1); |
2185 | 3071 pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(lloyds_beacon_spell_level << 7) * 0.033333335); |
1915 | 3072 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x; |
3073 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y; | |
3074 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z; | |
3075 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X = LOWORD(pParty->sRotationY); | |
3076 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y = LOWORD(pParty->sRotationX); | |
3077 if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 ) | |
3078 continue; | |
3079 for ( thisg = 0; thisg < (signed int)pGames_LOD->uNumSubDirs / 2; ++thisg ) | |
3080 { | |
3081 if ( !_stricmp((const char *)pGames_LOD->pSubIndices[thisg].pFilename, pCurrentMapName) ) | |
3082 pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID = thisg; | |
3083 } | |
3084 } | |
3085 continue; | |
3086 case UIMSG_ClickTownInTP: | |
3087 if ( uMessageParam ) | |
3088 { | |
3089 switch ( uMessageParam ) | |
3090 { | |
3091 case 1: | |
3092 v63 = 208; | |
3093 break; | |
3094 case 2: | |
3095 v63 = 207; | |
3096 break; | |
3097 case 3: | |
3098 v63 = 211; | |
3099 break; | |
3100 case 4: | |
3101 v63 = 209; | |
3102 break; | |
3103 default: | |
3104 if ( uMessageParam != 5 ) | |
3105 { | |
3106 LABEL_486: | |
3107 SaveGame(1, 0); | |
3108 v64 = pMapStats->GetMapInfo(pCurrentMapName); | |
3109 v65 = uMessageParam; | |
3110 if ( v64 == TownPortalList[uMessageParam].uMapInfoID ) | |
3111 { | |
3112 pParty->vPosition.x = TownPortalList[v65].pos.x; | |
3113 pParty->vPosition.y = TownPortalList[v65].pos.y; | |
3114 pParty->vPosition.z = TownPortalList[v65].pos.z; | |
3115 pParty->uFallStartY = pParty->vPosition.z; | |
3116 pParty->sRotationY = TownPortalList[v65].rot_y; | |
3117 pParty->sRotationX = TownPortalList[v65].rot_x; | |
3118 } | |
3119 else | |
3120 { | |
3121 SaveGame(1, 0); | |
3122 OnMapLeave(); | |
2061 | 3123 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 3124 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 3125 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename); |
3126 dword_5B65C0 = 1; | |
3127 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x; | |
3128 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y; | |
3129 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z; | |
3130 v66 = TownPortalList[uMessageParam].rot_x; | |
3131 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y; | |
3132 _5B65B8_npcdata_hiword_house_or_other = v66; | |
3133 InitializeActors(); | |
3134 } | |
3135 v67 = (char*)pGUIWindow_CurrentMenu->Hint; | |
3136 if ( v67 ) | |
3137 *((int *)v67 + 17) = 1; | |
3138 else | |
3139 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u); | |
3140 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
3141 { | |
3142 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3143 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; | |
3144 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3145 ++pMessageQueue_50CBD0->uNumMessages; | |
3146 }*/ | |
3147 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
3148 continue; | |
3149 } | |
3150 v63 = 210; | |
3151 break; | |
3152 } | |
3153 } | |
3154 else | |
3155 { | |
3156 v63 = 206; | |
3157 } | |
3158 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63) ) | |
3159 return; | |
3160 goto LABEL_486; | |
3161 case UIMSG_HintTownPortal: | |
3162 if ( uMessageParam ) | |
3163 { | |
3164 switch ( uMessageParam ) | |
3165 { | |
3166 case 1: | |
3167 v68 = 208; | |
3168 break; | |
3169 case 2: | |
3170 v68 = 207; | |
3171 break; | |
3172 case 3: | |
3173 v68 = 211; | |
3174 break; | |
3175 case 4: | |
3176 v68 = 209; | |
3177 break; | |
3178 default: | |
3179 if ( uMessageParam != 5 ) | |
3180 //goto LABEL_506; | |
3181 { | |
3182 if ( uMessageParam ) | |
3183 { | |
3184 switch ( uMessageParam ) | |
3185 { | |
3186 case 1: | |
3187 v69 = pMapStats->pInfos[4].pName; | |
3188 break; | |
3189 case 2: | |
3190 v69 = pMapStats->pInfos[3].pName; | |
3191 break; | |
3192 case 3: | |
3193 v69 = pMapStats->pInfos[10].pName; | |
3194 break; | |
3195 case 4: | |
3196 v69 = pMapStats->pInfos[7].pName; | |
3197 break; | |
3198 default: | |
3199 if ( uMessageParam != 5 ) | |
3200 { | |
3201 __debugbreak(); // warning C4700: uninitialized local variable 'v200' used | |
3202 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); | |
3203 GameUI_SetFooterString(pTmpBuf.data()); | |
3204 continue; | |
3205 } | |
3206 v69 = pMapStats->pInfos[8].pName; | |
3207 break; | |
3208 } | |
3209 } | |
3210 else | |
3211 { | |
3212 v69 = pMapStats->pInfos[21].pName; | |
3213 } | |
3214 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69); | |
3215 GameUI_SetFooterString(pTmpBuf.data()); | |
3216 continue; | |
3217 } | |
3218 v68 = 210; | |
3219 break; | |
3220 } | |
3221 } | |
3222 else | |
3223 { | |
3224 v68 = 206; | |
3225 } | |
3226 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v68) ) | |
3227 { | |
3228 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); | |
3229 continue; | |
3230 } | |
3231 //LABEL_506: | |
3232 if ( uMessageParam ) | |
3233 { | |
3234 switch ( uMessageParam ) | |
3235 { | |
3236 case 1: | |
3237 v69 = pMapStats->pInfos[4].pName; | |
3238 break; | |
3239 case 2: | |
3240 v69 = pMapStats->pInfos[3].pName; | |
3241 break; | |
3242 case 3: | |
3243 v69 = pMapStats->pInfos[10].pName; | |
3244 break; | |
3245 case 4: | |
3246 v69 = pMapStats->pInfos[7].pName; | |
3247 break; | |
3248 default: | |
3249 if ( uMessageParam != 5 ) | |
3250 //goto LABEL_519; | |
3251 { | |
3252 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); | |
3253 GameUI_SetFooterString(pTmpBuf.data()); | |
3254 continue; | |
3255 } | |
3256 v69 = pMapStats->pInfos[8].pName; | |
3257 break; | |
3258 } | |
3259 } | |
3260 else | |
3261 { | |
3262 v69 = pMapStats->pInfos[21].pName; | |
3263 } | |
3264 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69); | |
3265 GameUI_SetFooterString(pTmpBuf.data()); | |
3266 continue; | |
3267 case UIMSG_ShowFinalWindow: | |
3268 sprintfex(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." | |
3269 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." | |
3270 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." | |
3271 ModalWindow(pFinalMessage.data(), UIMSG_OnFinalWindowClose); | |
3272 uGameState = GAME_STATE_FINAL_WINDOW; | |
3273 continue; | |
3274 case UIMSG_OnFinalWindowClose: | |
3275 __debugbreak(); | |
3276 uGameState = GAME_STATE_PLAYING; | |
3277 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); | |
3278 __debugbreak(); // missed break/continue? | |
3279 case UIMSG_DD: | |
3280 __debugbreak(); | |
3281 sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer); | |
3282 memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); | |
3283 if ( v216.uPropCount == 1 ) | |
3284 { | |
3285 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2); | |
3286 v70 = atoi(v216.pProperties[0]); | |
3287 if ( v70 <= 0 || v70 >= 77 ) | |
3288 continue; | |
3289 v71 = v70; | |
3290 strcpy(Str2, pMapStats->pInfos[v70].pFilename); | |
3291 pNPCData3 = 0; | |
3292 if ( (signed int)pNPCData4 > 0 ) | |
3293 { | |
3294 thish = 0; | |
3295 do | |
3296 { | |
3297 if ( !_stricmp((const char *)&pGames_LOD->pSubIndices[thish], Str2) ) | |
3298 break; | |
3299 ++thish; | |
3300 pNPCData3 = (NPCData *)((char *)pNPCData3 + 1); | |
3301 } | |
3302 while ( (signed int)pNPCData3 < (signed int)pNPCData4 ); | |
3303 if ( (signed int)pNPCData3 < (signed int)pNPCData4 ) | |
3304 { | |
3305 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); | |
2061 | 3306 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 3307 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 3308 OnMapLeave(); |
3309 continue; | |
3310 } | |
3311 } | |
3312 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName); | |
3313 v73 = Str2; | |
3314 } | |
3315 else | |
3316 { | |
3317 if ( v216.uPropCount != 3 ) | |
3318 continue; | |
3319 v74 = atoi(v216.pProperties[0]); | |
3320 thisi = atoi(v216.pProperties[1]); | |
3321 v75 = atoi(v216.pProperties[2]); | |
3322 v76 = v75; | |
3323 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
3324 { | |
3325 if ( pIndoor->GetSector(v74, thisi, v75) ) | |
3326 { | |
3327 v77 = thisi; | |
3328 pParty->vPosition.x = v74; | |
3329 pParty->vPosition.y = v77; | |
3330 pParty->vPosition.z = v76; | |
3331 pParty->uFallStartY = v76; | |
3332 continue; | |
3333 } | |
3334 } | |
3335 else | |
3336 { | |
3337 if ( v74 > -32768 ) | |
3338 { | |
3339 if ( v74 < 32768 ) | |
3340 { | |
3341 v77 = thisi; | |
3342 if ( thisi > -32768 ) | |
3343 { | |
3344 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 ) | |
3345 { | |
3346 pParty->vPosition.x = v74; | |
3347 pParty->vPosition.y = v77; | |
3348 pParty->vPosition.z = v76; | |
3349 pParty->uFallStartY = v76; | |
3350 continue; | |
3351 } | |
3352 } | |
3353 } | |
3354 } | |
3355 } | |
3356 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
3357 v73 = "Can't jump to that location!"; | |
3358 } | |
3359 ShowStatusBarString(v73, 6u); | |
3360 continue; | |
3361 case UIMSG_CastQuickSpell: | |
3362 if ( bUnderwater == 1 ) | |
3363 { | |
3364 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" | |
3365 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3366 continue; | |
3367 } | |
3368 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) | |
3369 continue; | |
3370 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); | |
3371 continue; | |
3372 case UIMSG_CastSpell_Monster_Improvement: | |
3373 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm, | |
2154 | 3374 //if ( pRenderer->pRenderD3D ) |
1915 | 3375 { |
3376 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
3377 } | |
2154 | 3378 /*else |
1915 | 3379 { |
3380 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206); | |
3381 pPoint2 = pMouse->GetCursorPos(&v201); | |
3382 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]]; | |
2154 | 3383 }*/ |
1915 | 3384 v83 = v81; |
3385 v44 = (unsigned __int16)v81; | |
3386 v84 = v83 >> 16; | |
3387 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) | |
3388 continue; | |
3389 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
3390 if ( uMessage == UIMSG_CastSpell_Shoot_Monster ) | |
3391 { | |
3392 pSpellInfo->uFlags &= ~0x08; | |
3393 } | |
3394 else | |
3395 { | |
3396 if ( uMessage == UIMSG_CastSpell_Monster_Improvement ) | |
3397 pSpellInfo->uFlags &= ~0x0100u; | |
3398 else | |
3399 pSpellInfo->uFlags &= ~0x0200u; | |
3400 } | |
3401 pSpellInfo->uPlayerID_2 = uMessageParam; | |
3402 pSpellInfo->spell_target_pid = v44; | |
3403 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
3404 pGUIWindow_Settings->Release(); | |
3405 pGUIWindow_Settings = 0; | |
3406 pMouse->SetCursorBitmap("MICON1"); | |
3407 GameUI_Footer_TimeLeft = 0; | |
3408 _50C9A0_IsEnchantingInProgress = 0; | |
3409 back_to_game(); | |
3410 continue; | |
3411 case UIMSG_1C: | |
3412 __debugbreak(); | |
3413 if ( !uActiveCharacter || pCurrentScreen ) | |
3414 continue; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
3415 ptr_507BC8 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_68, uMessageParam, 0); |
1915 | 3416 pCurrentScreen = SCREEN_19; |
3417 pEventTimer->Pause(); | |
3418 continue; | |
3419 case UIMSG_STEALFROMACTOR: | |
3420 if ( !uActiveCharacter ) | |
3421 continue; | |
3422 if ( pParty->bTurnBasedModeOn != 1 ) | |
3423 { | |
3424 if ( pActors[uMessageParam].uAIState == 5 ) | |
1966
7840fe323f67
stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents:
1936
diff
changeset
|
3425 pActors[uMessageParam].LootActor(); |
1915 | 3426 else |
3427 Actor::StealFrom(uMessageParam); | |
3428 continue; | |
3429 } | |
3430 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3 ) | |
3431 continue; | |
3432 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) ) | |
3433 { | |
3434 if ( pActors[uMessageParam].uAIState == 5 ) | |
1966
7840fe323f67
stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents:
1936
diff
changeset
|
3435 pActors[uMessageParam].LootActor(); |
1915 | 3436 else |
3437 Actor::StealFrom(uMessageParam); | |
3438 } | |
3439 continue; | |
3440 | |
3441 case UIMSG_Attack: | |
3442 if ( !uActiveCharacter ) | |
3443 continue; | |
3444 if ( pParty->bTurnBasedModeOn != 1 ) | |
3445 { | |
3446 _42ECB5_PlayerAttacksActor(); | |
3447 continue; | |
3448 } | |
3449 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3 ) | |
3450 continue; | |
3451 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) ) | |
3452 _42ECB5_PlayerAttacksActor(); | |
3453 continue; | |
3454 case UIMSG_ExitRest: | |
3455 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" | |
3456 continue; | |
3457 case UIMSG_Wait5Minutes: | |
3458 if ( dword_506F14 == 2 ) | |
3459 { | |
3460 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3461 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3462 continue; | |
3463 } | |
3464 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2, | |
3465 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" | |
3466 dword_506F14 = 1; | |
3467 _506F18_num_minutes_to_sleep = 5; | |
3468 continue; | |
3469 case UIMSG_Wait1Hour: | |
3470 if ( dword_506F14 == 2 ) | |
3471 { | |
3472 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3473 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3474 continue; | |
3475 } | |
3476 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2, | |
3477 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" | |
3478 dword_506F14 = 1; | |
3479 _506F18_num_minutes_to_sleep = 60; | |
3480 continue; | |
3481 case UIMSG_RentRoom: | |
3482 dword_506F14 = 2; | |
3483 RestUI_Load(); | |
3484 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute; | |
3485 _506F18_num_minutes_to_sleep = v86; | |
3486 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 ) // 107 = Emerald Isle tavern | |
3487 _506F18_num_minutes_to_sleep = v86 + 12 * 60; | |
3488 dword_506F14 = 2; | |
3489 pParty->RestAndHeal(); | |
3490 pParty->days_played_without_rest = 0; | |
3491 pParty->pPlayers[3].SetAsleep(1); | |
3492 pParty->pPlayers[2].SetAsleep(1); | |
3493 pParty->pPlayers[1].SetAsleep(1); | |
3494 pParty->pPlayers[0].SetAsleep(1); | |
3495 continue; | |
3496 case UIMSG_RestWindow: | |
3497 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3498 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3499 if ( pCurrentScreen ) | |
3500 continue; | |
1936 | 3501 if ( CheckActors_proximity() ) |
1915 | 3502 { |
3503 if ( pParty->bTurnBasedModeOn == 1 ) | |
3504 { | |
3505 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
3506 continue; | |
3507 } | |
3508 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" | |
3509 if ( pParty->uFlags & 0x88 ) | |
3510 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | |
3511 ShowStatusBarString(v88, 2); | |
3512 if ( !uActiveCharacter ) | |
3513 continue; | |
3514 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); | |
3515 continue; | |
3516 } | |
3517 if ( pParty->bTurnBasedModeOn == 1 ) | |
3518 { | |
3519 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
3520 continue; | |
3521 } | |
3522 if ( !(pParty->uFlags & 0x88) ) | |
3523 { | |
3524 RestUI_Load(); | |
3525 continue; | |
3526 } | |
3527 if ( pParty->bTurnBasedModeOn == 1 ) | |
3528 { | |
3529 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
3530 continue; | |
3531 } | |
3532 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" | |
3533 if ( pParty->uFlags & 0x88 ) | |
3534 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | |
3535 ShowStatusBarString(v88, 2u); | |
3536 if ( !uActiveCharacter ) | |
3537 continue; | |
3538 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); | |
3539 continue; | |
3540 case UIMSG_Rest8Hour: | |
3541 if ( dword_506F14 ) | |
3542 { | |
3543 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3544 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3545 continue; | |
3546 } | |
3547 if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest ) | |
3548 { | |
3549 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest" | |
3550 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() ) | |
3551 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_108, 0); | |
3552 } | |
3553 else | |
3554 { | |
2185 | 3555 pParty->pPlayers[3].pConditions[Condition_Sleep] = pParty->uTimePlayed; |
3556 pParty->pPlayers[2].pConditions[Condition_Sleep] = pParty->uTimePlayed; | |
3557 pParty->pPlayers[1].pConditions[Condition_Sleep] = pParty->uTimePlayed; | |
3558 pParty->pPlayers[0].pConditions[Condition_Sleep] = pParty->uTimePlayed; | |
1915 | 3559 v90 = pMapStats->GetMapInfo(pCurrentMapName); |
3560 if ( !v90 ) | |
3561 v90 = rand() % (signed int)pMapStats->uNumMaps + 1; | |
3562 pMapInfo = &pMapStats->pInfos[v90]; | |
3563 if ( rand() % 100 + 1 <= pMapInfo->Encounter_percent ) | |
3564 { | |
3565 v91 = rand() % 100; | |
3566 v92 = pMapInfo->EncM1percent; | |
3567 v93 = v91 + 1; | |
3568 if ( v93 > v92 ) | |
3569 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2); | |
3570 else | |
3571 pNPCData4 = (NPCData *)1; | |
3572 if ( !_45063B_spawn_some_monster(pMapInfo, (int)pNPCData4) ) | |
3573 pNPCData4 = 0; | |
3574 if ( pNPCData4 ) | |
3575 { | |
3576 pPlayerNum = rand() % 4; | |
2185 | 3577 pParty->pPlayers[pPlayerNum].pConditions[Condition_Sleep] = 0; |
1915 | 3578 v95 = rand(); |
3579 Rest(v95 % 6 + 60); | |
3580 _506F18_num_minutes_to_sleep = 0; | |
3581 dword_506F14 = 0; | |
3582 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
3583 { | |
3584 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3585 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
3586 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3587 ++pMessageQueue_50CBD0->uNumMessages; | |
3588 }*/ | |
3589 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
3590 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!" | |
3591 pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0); | |
3592 continue; | |
3593 } | |
3594 } | |
3595 Party::TakeFood(uRestUI_FoodRequiredToRest); | |
3596 _506F18_num_minutes_to_sleep = 480; | |
3597 dword_506F14 = 2; | |
3598 pParty->RestAndHeal(); | |
3599 pParty->days_played_without_rest = 0; | |
3600 pParty->pPlayers[3].SetAsleep(1); | |
3601 pParty->pPlayers[2].SetAsleep(1); | |
3602 pParty->pPlayers[1].SetAsleep(1); | |
3603 pParty->pPlayers[0].SetAsleep(1); | |
3604 } | |
3605 continue; | |
3606 case UIMSG_AlreadyResting: | |
3607 if ( dword_506F14 == 2 ) | |
3608 { | |
3609 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3610 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3611 continue; | |
3612 } | |
3613 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2, | |
3614 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" | |
3615 v97 = _494820_training_time(pParty->uCurrentHour); | |
3616 dword_506F14 = 1; | |
3617 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute; | |
3618 continue; | |
3619 case UIMSG_HintSelectRemoveQuickSpellBtn: | |
3620 if ( quick_spell_at_page && byte_506550 ) | |
3621 { | |
3622 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName; | |
3623 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173); | |
3624 } | |
3625 else | |
3626 { | |
3627 if ( pPlayers[uActiveCharacter]->uQuickSpell ) | |
3628 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell" | |
3629 else | |
3630 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell" | |
3631 strcpy(pTmpBuf.data(), v177); | |
3632 } | |
3633 GameUI_SetFooterString(pTmpBuf.data()); | |
3634 continue; | |
3635 case UIMSG_SPellbook_ShowHightlightedSpellInfo: | |
3636 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter], | |
3637 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) ) | |
3638 continue; | |
3639 if ( sub_4637E0_is_there_popup_onscreen() ) | |
3640 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1; | |
3641 v98 = *(char *)(uNumSeconds + 6734); | |
3642 if ( quick_spell_at_page - 1 == uMessageParam ) | |
3643 { | |
3644 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | |
3645 v161 = pGlobalTXT_LocalizationStrings[485]; | |
3646 } | |
3647 else | |
3648 { | |
3649 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | |
3650 v161 = pGlobalTXT_LocalizationStrings[486]; | |
3651 } | |
3652 sprintfex(pTmpBuf.data(), v161, v178); | |
3653 GameUI_SetFooterString(pTmpBuf.data()); | |
3654 continue; | |
3655 case UIMSG_ClickInstallRemoveQuickSpellBtn: | |
3656 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); | |
3657 if ( !uActiveCharacter ) | |
3658 continue; | |
3659 pPlayer10 = pPlayers[uActiveCharacter]; | |
3660 if ( !byte_506550 || !quick_spell_at_page ) | |
3661 { | |
3662 pPlayer10->uQuickSpell = 0; | |
3663 quick_spell_at_page = 0; | |
3664 pAudioPlayer->PlaySound((SoundID)203, 0, 0, -1, 0, 0, 0, 0); | |
3665 continue; | |
3666 } | |
2184 | 3667 pPlayers[uActiveCharacter]->uQuickSpell = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage; |
3668 AA1058_PartyQuickSpellSound[uActiveCharacter - 1].AddPartySpellSound(pPlayers[uActiveCharacter]->uQuickSpell, uActiveCharacter); | |
1915 | 3669 if ( uActiveCharacter ) |
3670 pPlayer10->PlaySound(SPEECH_12, 0); | |
3671 byte_506550 = 0; | |
3672 continue; | |
2197 | 3673 case UIMSG_SpellBook_PressTab://ïåðåëèñòûâàíèå ñòðàíèö êëàâèøåé Tab |
2198 | 3674 { |
1915 | 3675 if ( !uActiveCharacter ) |
3676 continue; | |
2198 | 3677 int skill_count = 0; |
1915 | 3678 uAction = 0; |
2197 | 3679 for ( uint i = 0; i < 9; i++ ) |
1915 | 3680 { |
2197 | 3681 if ( pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_FIRE + i] ) |
1915 | 3682 { |
2197 | 3683 if ( pPlayers[uActiveCharacter]->lastOpenedSpellbookPage == i ) |
2198 | 3684 uAction = skill_count; |
3685 v217[skill_count++] = i; | |
1915 | 3686 } |
3687 } | |
2198 | 3688 if ( !skill_count )//íåò ñêèëëîâ |
3689 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0); | |
1915 | 3690 else |
3691 { | |
2198 | 3692 if ( GetAsyncKeyState(16) ) |
3693 { | |
3694 --uAction; | |
3695 if ( uAction < 0 ) | |
3696 uAction = skill_count - 1; | |
3697 } | |
3698 else | |
3699 { | |
3700 ++uAction; | |
3701 if ( uAction >= skill_count ) | |
3702 uAction = 0; | |
3703 } | |
3704 OnCloseSpellBookPage(); | |
3705 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]); | |
3706 pGUIWindow_CurrentMenu->OpenSpellBook(); | |
3707 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0); | |
1915 | 3708 } |
3709 continue; | |
2198 | 3710 } |
1915 | 3711 case UIMSG_OpenSpellbookPage: |
3712 if ( pTurnEngine->turn_stage == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage ) | |
3713 continue; | |
3714 OnCloseSpellBookPage(); | |
3715 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam; | |
3716 pGUIWindow_CurrentMenu->OpenSpellBook(); | |
2198 | 3717 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0); |
1915 | 3718 continue; |
3719 case UIMSG_SelectSpell: | |
3720 { | |
3721 if (pTurnEngine->turn_stage == 3) | |
3722 continue; | |
3723 if (!uActiveCharacter) | |
3724 continue; | |
3725 | |
3726 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter]; | |
1980 | 3727 Player* player = pPlayers[uActiveCharacter]; |
1915 | 3728 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam]) |
3729 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) ) | |
3730 { | |
3731 if ( quick_spell_at_page - 1 == uMessageParam ) | |
3732 { | |
3733 pGUIWindow_CurrentMenu->Release(); | |
3734 pEventTimer->Resume(); | |
3735 viewparams->bRedrawGameUI = 1; | |
3736 pCurrentScreen = SCREEN_GAME; | |
3737 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
3738 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage; | |
3739 /*if ( dword_50C9E8 < 40 ) | |
3740 { | |
3741 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook; | |
3742 dword_50C9EC[3 * dword_50C9E8 + 1] = v103; | |
3743 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1; | |
3744 ++dword_50C9E8; | |
3745 }*/ | |
3746 pMessageQueue_50C9E8->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); | |
3747 // pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); | |
3748 } | |
3749 else | |
3750 { | |
3751 byte_506550 = 1; | |
3752 quick_spell_at_page = uMessageParam + 1; | |
3753 } | |
3754 } | |
3755 } | |
3756 continue; | |
3757 | |
3758 case UIMSG_CastSpellFromBook: | |
3759 if ( pTurnEngine->turn_stage != 3 ) | |
3760 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); | |
3761 continue; | |
3762 | |
3763 case UIMSG_SpellScrollUse: | |
3764 __debugbreak(); | |
3765 if ( pTurnEngine->turn_stage != 3 ) | |
3766 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0); | |
3767 continue; | |
3768 case UIMSG_SpellBookWindow: | |
3769 if ( pTurnEngine->turn_stage == 3 ) | |
3770 continue; | |
2186 | 3771 if ( bUnderwater == true ) |
1915 | 3772 { |
3773 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" | |
3774 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3775 } | |
3776 else | |
3777 { | |
3778 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3779 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3780 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery ) | |
3781 { | |
2186 | 3782 if ( pCurrentScreen == SCREEN_GAME ) |
1915 | 3783 { |
2186 | 3784 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); |
1915 | 3785 pCurrentScreen = SCREEN_SPELL_BOOK; |
3786 pEventTimer->Pause(); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
3787 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0); |
1915 | 3788 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); |
3789 viewparams->field_48 = 1; | |
3790 continue; | |
3791 } | |
2186 | 3792 if ( pCurrentScreen != SCREEN_REST && pCurrentScreen != SCREEN_CHARACTERS |
3793 && (pCurrentScreen <= SCREEN_63 || pCurrentScreen > SCREEN_67) ) | |
1915 | 3794 { |
3795 pGUIWindow_CurrentMenu->Release(); | |
2186 | 3796 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); |
1915 | 3797 pCurrentScreen = SCREEN_SPELL_BOOK; |
3798 pEventTimer->Pause(); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
3799 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0); |
1915 | 3800 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); |
3801 viewparams->field_48 = 1; | |
3802 continue; | |
3803 } | |
3804 } | |
3805 } | |
3806 continue; | |
3807 case UIMSG_QuickReference: | |
3808 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3809 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3810 if ( pCurrentScreen ) | |
3811 pGUIWindow_CurrentMenu->Release(); | |
3812 ++pIcons_LOD->uTexturePacksCount; | |
3813 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
3814 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
3815 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0); | |
3816 viewparams->bRedrawGameUI = 1; | |
3817 pEventTimer->Pause(); | |
3818 pAudioPlayer->StopChannels(-1, -1); | |
3819 pCurrentScreen = SCREEN_QUICK_REFERENCE; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
3820 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_QuickReference, 5, 0); |
1915 | 3821 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); |
3822 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0, | |
3823 pGlobalTXT_LocalizationStrings[79],// "Exit" | |
3824 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179); | |
3825 continue; | |
3826 case UIMSG_GameMenuButton: | |
3827 if ( pCurrentScreen ) | |
3828 { | |
3829 pGUIWindow_CurrentMenu->Release(); | |
3830 pEventTimer->Resume(); | |
3831 pCurrentScreen = SCREEN_GAME; | |
3832 viewparams->bRedrawGameUI = 1; | |
3833 } | |
2154 | 3834 |
1915 | 3835 stru_506E40.Release(); |
2154 | 3836 pRenderer->SaveScreenshot("gamma.pcx", 155, 117); |
2131 | 3837 stru_506E40.LoadPCXFile("gamma.pcx", 0); |
2154 | 3838 |
1915 | 3839 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0); |
3840 //LABEL_453: | |
3841 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
3842 continue; | |
3843 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3844 //goto LABEL_770; | |
3845 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
3846 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3847 ++pMessageQueue_50CBD0->uNumMessages;*/ | |
3848 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
3849 continue; | |
3850 case UIMSG_ClickAwardScrollBar: | |
3851 books_page_number = 1; | |
3852 if ( pMouse->GetCursorPos(&v211)->y > 178 ) | |
3853 books_page_number = -1; | |
3854 continue; | |
3855 case UIMSG_ClickAwardsUpBtn: | |
3856 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0); | |
3857 BtnUp_flag = 1; | |
3858 continue; | |
3859 case UIMSG_ClickAwardsDownBtn: | |
3860 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0); | |
3861 BtnDown_flag = 1; | |
3862 continue; | |
3863 case UIMSG_ChangeDetaliz: | |
3864 bRingsShownInCharScreen ^= 1; | |
3865 pCharacterScreen_DetalizBtn->Release(); | |
3866 pCharacterScreen_DollBtn->Release(); | |
3867 if ( bRingsShownInCharScreen ) | |
3868 { | |
3869 v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight; | |
3870 v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth; | |
3871 v123 = 445; | |
3872 v121 = 470; | |
3873 } | |
3874 else | |
3875 { | |
3876 v128 = 30; | |
3877 v125 = 30; | |
3878 v123 = 300; | |
3879 v121 = 600; | |
3880 } | |
3881 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0, | |
3882 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle" | |
3883 0); | |
3884 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); | |
3885 viewparams->bRedrawGameUI = 1; | |
3886 continue; | |
3887 case UIMSG_ClickPaperdoll: | |
3888 OnPaperdollLeftClick(); | |
3889 continue; | |
3890 case UIMSG_ClickStatsBtn: | |
3891 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; | |
3892 CharacterUI_ReleaseButtons(); | |
3893 ReleaseAwardsScrollBar(); | |
3894 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0); | |
3895 continue; | |
3896 case UIMSG_ClickSkillsBtn: | |
3897 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; | |
3898 CharacterUI_ReleaseButtons(); | |
3899 ReleaseAwardsScrollBar(); | |
3900 CharacterUI_SkillsTab_CreateButtons(); | |
3901 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0); | |
3902 continue; | |
3903 case UIMSG_SkillUp: | |
3904 pPlayer4 = pPlayers[uActiveCharacter]; | |
3905 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; | |
3906 LOWORD(v2) = *(short *)v105; | |
3907 uNumSeconds = v2; | |
3908 if ( pPlayer4->uSkillPoints < (v2 & 0x3F) + 1 ) | |
3909 { | |
3910 v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!" | |
3911 } | |
3912 else | |
3913 { | |
3914 if ( (uNumSeconds & 0x3F) < 0x3C ) | |
3915 { | |
3916 *(short *)v105 = uNumSeconds + 1; | |
3917 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F; | |
3918 pPlayer4->PlaySound(SPEECH_14, 0); | |
3919 pAudioPlayer->PlaySound((SoundID)20001, 0, 0, -1, 0, 0, 0, 0); | |
3920 continue; | |
3921 } | |
3922 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!" | |
3923 } | |
3924 ShowStatusBarString(v87, 2); | |
3925 continue; | |
3926 case UIMSG_ClickInventoryBtn: | |
3927 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
3928 ReleaseAwardsScrollBar(); | |
3929 CharacterUI_ReleaseButtons(); | |
3930 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0); | |
3931 continue; | |
3932 case UIMSG_ClickExitCharacterWindowBtn: | |
3933 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0); | |
3934 continue; | |
3935 case UIMSG_ClickAwardsBtn: | |
3936 ReleaseAwardsScrollBar(); | |
3937 CharacterUI_ReleaseButtons(); | |
3938 CreateAwardsScrollBar(); | |
3939 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; | |
3940 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0); | |
3941 FillAwardsData(); | |
3942 continue; | |
3943 case UIMSG_ClickBooksBtn: | |
3944 switch ( uMessageParam ) | |
3945 { | |
3946 case 11://Page UP | |
3947 BtnUp_flag = 1; | |
3948 pButton = pBtn_Book_2; | |
3949 break; | |
3950 case 10://Page DOWN | |
3951 BtnDown_flag = 1; | |
3952 pButton = pBtn_Book_1; | |
3953 break; | |
3954 case 0://Zoom plus | |
3955 pButton = pBtn_Book_1; | |
3956 BtnDown_flag = 1; | |
3957 break; | |
3958 case 1://Zoom minus | |
3959 pButton = pBtn_Book_2; | |
3960 BtnUp_flag = 1; | |
3961 break; | |
3962 case 2://Potions | |
3963 Book_PageBtn3_flag = 1; | |
3964 if ( dword_506364 ) | |
3965 continue; | |
3966 pButton = pBtn_Book_3; | |
3967 break; | |
3968 case 3://fountains | |
3969 Book_PageBtn4_flag = 1; | |
3970 if ( dword_506364 ) | |
3971 continue; | |
3972 pButton = pBtn_Book_4; | |
3973 break; | |
3974 case 4://obelisks | |
3975 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag | |
3976 if ( dword_506364 ) | |
3977 continue; | |
3978 pButton = pBtn_Book_5; | |
3979 break; | |
3980 case 5://seer | |
3981 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag | |
3982 if ( dword_506364 ) | |
3983 continue; | |
3984 pButton = pBtn_Book_6; | |
3985 break; | |
3986 case 6://misc | |
3987 pButton = pBtn_Autonotes_Misc; | |
3988 Autonotes_Misc_page_flag = 1; | |
3989 break; | |
3990 case 7://Instructors | |
3991 pButton = pBtn_Autonotes_Instructors; | |
3992 Autonotes_Instructors_page_flag = 1; | |
3993 break; | |
3994 default: | |
3995 continue; | |
3996 } | |
3997 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); | |
3998 continue; | |
3999 case UIMSG_SelectCharacter: | |
4000 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4001 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4002 GameUI_OnPlayerPortraitLeftClick(uMessageParam); | |
4003 continue; | |
4004 case UIMSG_ShowStatus_Funds: | |
4005 v174 = (char *)pParty->uNumGoldInBank; | |
4006 //v158 = pParty->uNumGold + pParty->uNumGoldInBank; | |
4007 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], pParty->uNumGold + pParty->uNumGoldInBank, v174);// "You have %d total gold, %d in the Bank" | |
4008 GameUI_SetFooterString(pTmpBuf.data()); | |
4009 continue; | |
4010 case UIMSG_ShowStatus_DateTime: | |
4011 pNPCData4 = (NPCData *)pParty->uCurrentHour; | |
4012 if ( (signed int)pParty->uCurrentHour <= 12 ) | |
4013 { | |
4014 if ( !pNPCData4 ) | |
4015 pNPCData4 = (NPCData *)12; | |
4016 } | |
4017 else | |
4018 { | |
4019 pNPCData4 = (NPCData *)((char *)pNPCData4 - 12); | |
4020 } | |
4021 if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) ) | |
4022 uNumSeconds = 0; | |
4023 sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7], | |
4024 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear); | |
4025 GameUI_SetFooterString(pTmpBuf.data()); | |
4026 continue; | |
4027 case UIMSG_ShowStatus_Food: | |
4028 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food" | |
4029 GameUI_SetFooterString(pTmpBuf.data()); | |
4030 continue; | |
4031 case UIMSG_ShowStatus_Player: | |
4032 pPlayer5 = pPlayers[uMessageParam]; | |
4033 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s" | |
4034 strcat(pTmpBuf.data(), ": "); | |
4035 v107 = pPlayer5->GetMajorConditionIdx(); | |
4036 strcat(pTmpBuf.data(), aCharacterConditionNames[v107]); | |
4037 GameUI_SetFooterString(pTmpBuf.data()); | |
4038 v108 = 8 * uMessageParam - 8; | |
4039 LOBYTE(v108) = v108 | 4; | |
4040 pMouse->uPointingObjectID = PID(OBJECT_Player,v108); | |
4041 continue; | |
4042 case UIMSG_ShowStatus_ManaHP: | |
4043 sprintf(pTmpBuf.data(), "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(), | |
4044 pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(), | |
4045 pGlobalTXT_LocalizationStrings[212]); | |
4046 GameUI_SetFooterString(pTmpBuf.data()); | |
4047 continue; | |
4048 case UIMSG_CHEST_ClickItem: | |
4049 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) | |
4050 { | |
4051 pPlayers[uActiveCharacter]->OnInventoryLeftClick(); | |
4052 continue; | |
4053 } | |
4054 OnChestLeftClick(); | |
4055 continue; | |
4056 case UIMSG_InventoryLeftClick: | |
4057 pPlayers[uActiveCharacter]->OnInventoryLeftClick(); | |
4058 continue; | |
4059 case UIMSG_MouseLeftClickInGame: | |
2154 | 4060 /*if ( !pRenderer->pRenderD3D ) |
1915 | 4061 { |
4062 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4063 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4064 OnGameViewportClick(); | |
4065 continue; | |
2154 | 4066 }*/ |
1915 | 4067 v115 = pMessageQueue_50CBD0->uNumMessages; |
4068 if ( !pMessageQueue_50CBD0->uNumMessages ) | |
4069 { | |
4070 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); | |
4071 /*if ( (signed int)v115 < 40 ) | |
4072 //goto LABEL_769; | |
4073 { | |
4074 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; | |
4075 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
4076 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4077 ++pMessageQueue_50CBD0->uNumMessages; | |
4078 continue; | |
4079 }*/ | |
4080 continue; | |
4081 } | |
4082 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
4083 { | |
4084 pMessageQueue_50CBD0->uNumMessages = 1; | |
4085 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); | |
4086 /*v115 = v0; | |
4087 pMessageQueue_50CBD0->uNumMessages = v0; | |
4088 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; | |
4089 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
4090 //goto LABEL_771; | |
4091 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4092 ++pMessageQueue_50CBD0->uNumMessages;*/ | |
4093 continue; | |
4094 } | |
4095 v115 = 0; | |
4096 pMessageQueue_50CBD0->uNumMessages = 0; | |
4097 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); | |
4098 /*if ( (signed int)v115 < 40 ) | |
4099 //goto LABEL_769; | |
4100 { | |
4101 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; | |
4102 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
4103 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4104 ++pMessageQueue_50CBD0->uNumMessages; | |
4105 continue; | |
4106 }*/ | |
4107 continue; | |
4108 case UIMSG_MouseLeftClickInScreen://ñðàáàòûâàåò ïðè íàæàòèè íà ïðàâóþ êíîïêó ìûøè ïîñëå UIMSG_MouseLeftClickInGame | |
4109 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4110 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4111 OnGameViewportClick(); | |
4112 continue; | |
4113 case UIMSG_F: | |
4114 __debugbreak(); | |
2154 | 4115 //if ( pRenderer->pRenderD3D ) |
1915 | 4116 { |
4117 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
4118 } | |
2154 | 4119 /*else |
1915 | 4120 { |
4121 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209); | |
4122 pPoint3 = pMouse->GetCursorPos(&v204); | |
4123 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; | |
2154 | 4124 }*/ |
1915 | 4125 pButton2 = (GUIButton *)(unsigned __int16)v116; |
4126 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); | |
4127 continue; | |
4128 case UIMSG_54: | |
4129 __debugbreak(); | |
4130 pButton2 = (GUIButton *)uMessageParam; | |
4131 GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0); | |
4132 continue; | |
4133 case UIMSG_Game_Action: | |
4134 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4135 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4136 OnPressSpace(); | |
4137 continue; | |
4138 case UIMSG_ClickZoomOutBtn: | |
4139 if ( pCurrentScreen ) | |
4140 continue; | |
4141 pParty->uFlags |= 2u; | |
4142 GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0); | |
4143 uNumSeconds = 131072; | |
4144 v118 = 2 * viewparams->uMinimapZoom; | |
4145 ++viewparams->field_28; | |
4146 viewparams->uMinimapZoom *= 2; | |
4147 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) | |
4148 { | |
4149 if ( (signed int)v118 > 4096 ) | |
4150 { | |
4151 viewparams->uMinimapZoom = 4096; | |
4152 viewparams->field_28 = 12; | |
4153 } | |
4154 continue; | |
4155 } | |
4156 v119 = 2048; | |
4157 if ( (signed int)v118 <= 2048 ) | |
4158 { | |
4159 _576E2C_current_minimap_zoom = v118; | |
4160 dword_576E28 = viewparams->field_28; | |
4161 break; | |
4162 } | |
4163 viewparams->field_28 = 11; | |
4164 viewparams->uMinimapZoom = v119; | |
4165 _576E2C_current_minimap_zoom = v119; | |
4166 dword_576E28 = viewparams->field_28; | |
4167 break; | |
4168 case UIMSG_ClickZoomInBtn: | |
4169 if ( pCurrentScreen ) | |
4170 continue; | |
4171 pParty->uFlags |= 2u; | |
4172 GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0); | |
4173 uNumSeconds = 32768; | |
4174 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | |
4175 --viewparams->field_28; | |
4176 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | |
4177 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4178 { | |
4179 v119 = 512; | |
4180 if ( (signed int)v118 < 512 ) | |
4181 { | |
4182 viewparams->field_28 = 9; | |
4183 v118 = v119; | |
4184 viewparams->uMinimapZoom = v119; | |
4185 } | |
4186 _576E2C_current_minimap_zoom = v118; | |
4187 dword_576E28 = viewparams->field_28; | |
4188 } | |
4189 else | |
4190 { | |
4191 if ( (signed int)v118 < 256 ) | |
4192 { | |
4193 viewparams->uMinimapZoom = 256; | |
4194 viewparams->field_28 = 8; | |
4195 } | |
4196 } | |
4197 default: | |
4198 continue; | |
4199 } | |
4200 } | |
4201 } | |
4202 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8; | |
4203 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages); | |
4204 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8); | |
4205 //dword_50C9E8 = 0; | |
4206 | |
4207 | |
4208 pMessageQueue_50C9E8->uNumMessages=0; | |
4209 if ( dword_50C9DC ) | |
4210 { | |
4211 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4212 { | |
4213 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC; | |
4214 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0; | |
4215 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4216 ++pMessageQueue_50CBD0->uNumMessages; | |
4217 }*/ | |
4218 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0); | |
4219 dword_50C9DC = 0; | |
4220 } | |
4221 else | |
4222 { | |
4223 if ( _50C9D0_AfterEnchClickEventId > 0 ) | |
4224 { | |
4225 _50C9D8_AfterEnchClickEventTimeout -= pEventTimer->uTimeElapsed; | |
4226 if ( _50C9D8_AfterEnchClickEventTimeout <= 0 ) | |
4227 { | |
4228 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4229 { | |
4230 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0; | |
4231 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4; | |
4232 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4233 ++pMessageQueue_50CBD0->uNumMessages; | |
4234 }*/ | |
4235 pMessageQueue_50CBD0->AddMessage((UIMessageType)_50C9D0_AfterEnchClickEventId, _50C9D4_AfterEnchClickEventSecondParam, 0); | |
4236 _50C9D0_AfterEnchClickEventId = 0; | |
4237 _50C9D4_AfterEnchClickEventSecondParam = 0; | |
4238 _50C9D8_AfterEnchClickEventTimeout = 0; | |
4239 } | |
4240 } | |
4241 } | |
4242 CastSpellInfoHelpers::_427E01_cast_spell(); | |
4243 } | |
4244 //----- (00435748) -------------------------------------------------------- | |
4245 void GUI_MainMenuMessageProc() | |
4246 { | |
4247 Player *pPlayer; // ebx@2 | |
4248 void *v3; // edi@21 | |
4249 signed int v4; // eax@29 | |
4250 int v5; // ecx@29 | |
4251 PLAYER_SKILL_TYPE v6; // edi@37 | |
4252 GUIWindow *pWindow; // eax@56 | |
4253 GUIButton *pButton; // eax@59 | |
4254 int v15; // edi@70 | |
4255 char v20; // dl@116 | |
4256 unsigned int v21; // eax@116 | |
4257 unsigned int v25; // eax@120 | |
4258 unsigned int v26; // ecx@127 | |
4259 SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36 | |
4260 signed int v41; // [sp-10h] [bp-20h]@29 | |
4261 int pParam; // [sp+4h] [bp-Ch]@3 | |
4262 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 | |
4263 int pSex; // [sp+Ch] [bp-4h]@3 | |
4264 | |
4265 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4266 { | |
4267 pPlayer = pParty->pPlayers.data(); | |
4268 do | |
4269 { | |
4270 int param2; | |
4271 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, ¶m2); | |
1916 | 4272 //auto player = &pParty->pPlayers[pParam]; |
1915 | 4273 |
4274 switch (pUIMessageType) // For buttons of window MainMenu | |
4275 { | |
4276 case UIMSG_MainMenu_ShowPartyCreationWnd: | |
4277 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); | |
4278 SetCurrentMenuID(MENU_NEWGAME); | |
4279 break; | |
4280 case UIMSG_MainMenu_ShowLoadWindow: | |
4281 GUIWindow::Create(495, 227, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnLoad, 0); | |
4282 SetCurrentMenuID(MENU_SAVELOAD); | |
4283 break; | |
4284 case UIMSG_ShowCredits: | |
4285 GUIWindow::Create(495, 282, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnCredits, 0); | |
4286 SetCurrentMenuID(MENU_CREDITS); | |
4287 break; | |
4288 case UIMSG_ExitToWindows: | |
4289 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); | |
4290 SetCurrentMenuID(MENU_EXIT_GAME); | |
4291 break; | |
4292 case UIMSG_PlayerCreation_SelectAttribute: | |
4293 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | |
4294 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
4295 uPlayerCreationUI_SelectedCharacter = pParam; | |
4296 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
4297 break; | |
4298 case UIMSG_PlayerCreation_VoicePrev: | |
1916 | 4299 pSex = pParty->pPlayers[pParam].GetSexByVoice(); |
1915 | 4300 do |
4301 { | |
1916 | 4302 if (pParty->pPlayers[pParam].uVoiceID == 0) |
4303 pParty->pPlayers[pParam].uVoiceID = 19; | |
4304 else --pParty->pPlayers[pParam].uVoiceID; | |
1915 | 4305 } |
1916 | 4306 while (pParty->pPlayers[pParam].GetSexByVoice() != pSex); |
1915 | 4307 pButton = pCreationUI_BtnPressLeft2[pParam]; |
4308 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); | |
4309 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
1916 | 4310 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4311 break; |
4312 case UIMSG_PlayerCreation_VoiceNext: | |
1916 | 4313 pSex = pParty->pPlayers[pParam].GetSexByVoice(); |
1915 | 4314 do |
4315 { | |
1916 | 4316 pParty->pPlayers[pParam].uVoiceID = (pParty->pPlayers[pParam].uVoiceID + 1) % 20; |
1915 | 4317 } |
1916 | 4318 while (pParty->pPlayers[pParam].GetSexByVoice() != pSex); |
1915 | 4319 pButton = pCreationUI_BtnPressRight2[pParam]; |
4320 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); | |
4321 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
1916 | 4322 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4323 break; |
4324 case UIMSG_PlayerCreation_FacePrev: | |
1916 | 4325 //pPlayer = &pParty->pPlayers[pParam]; |
4326 if (!pParty->pPlayers[pParam].uCurrentFace) | |
4327 pParty->pPlayers[pParam].uCurrentFace = 19; | |
1915 | 4328 else |
1916 | 4329 pParty->pPlayers[pParam].uCurrentFace -= 1; |
4330 pParty->pPlayers[pParam].uVoiceID = pParty->pPlayers[pParam].uCurrentFace; | |
4331 pParty->pPlayers[pParam].SetInitialStats(); | |
4332 pParty->pPlayers[pParam].SetSexByVoice(); | |
4333 pParty->pPlayers[pParam].RandomizeName(); | |
1915 | 4334 v25 = pParam; |
4335 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | |
4336 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
4337 uPlayerCreationUI_SelectedCharacter = v25; | |
4338 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], (char *)1); | |
4339 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); | |
1916 | 4340 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4341 break; |
4342 case UIMSG_PlayerCreation_FaceNext: | |
1916 | 4343 //pPlayer = &pParty->pPlayers[pParam]; |
4344 v20 = (char)((int)pParty->pPlayers[pParam].uCurrentFace + 1) % 20; | |
4345 pParty->pPlayers[pParam].uCurrentFace = v20; | |
4346 pParty->pPlayers[pParam].uVoiceID = v20; | |
4347 pParty->pPlayers[pParam].SetInitialStats(); | |
4348 pParty->pPlayers[pParam].SetSexByVoice(); | |
4349 pParty->pPlayers[pParam].RandomizeName(); | |
1915 | 4350 v21 = pParam; |
4351 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | |
4352 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
4353 uPlayerCreationUI_SelectedCharacter = v21; | |
4354 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], (char *)1); | |
4355 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
1916 | 4356 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4357 break; |
4358 case UIMSG_PlayerCreationClickPlus: | |
4359 GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, (char *)1); | |
4360 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | |
4361 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); | |
4362 break; | |
4363 case UIMSG_PlayerCreationClickMinus: | |
4364 GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, (char *)1); | |
4365 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | |
4366 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); | |
4367 break; | |
4368 case UIMSG_PlayerCreationSelectActiveSkill: | |
4369 if ( pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(3) == 37 ) | |
4370 pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pParam + 4)] = 1; | |
4371 pAudioPlayer->PlaySound(SOUND_24, 0, 0, -1, 0, 0, 0, 0); | |
4372 break; | |
4373 case UIMSG_PlayerCreationSelectClass: | |
4374 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam); | |
4375 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
4376 break; | |
4377 case UIMSG_PlayerCreationClickOK: | |
4378 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0); | |
4379 if ( PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Choose4Skills() ) | |
4380 GameUI_Footer_TimeLeft = GetTickCount() + 4000; | |
4381 else | |
4382 uGameState = GAME_STATE_STARTING_NEW_GAME; | |
4383 break; | |
4384 case UIMSG_PlayerCreationClickReset: | |
4385 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0); | |
4386 pParty->Reset(); | |
4387 break; | |
4388 case UIMSG_PlayerCreationRemoveUpSkill: | |
4389 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
4390 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
|
4391 if ( pPlayer[pParam].GetSkillIdxByOrder(2) != 37 )//37 - None(Íåò) |
18b0ff5e1bf1
pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents:
2101
diff
changeset
|
4392 pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(2)] = 0; |
1915 | 4393 break; |
4394 case UIMSG_PlayerCreationRemoveDownSkill: | |
4395 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
4396 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
|
4397 if ( pPlayer[pParam].GetSkillIdxByOrder(3) != 37 )//37 - None(Íåò) |
18b0ff5e1bf1
pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents:
2101
diff
changeset
|
4398 pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(3)] = 0; |
1915 | 4399 break; |
4400 case UIMSG_PlayerCreationChangeName: | |
4401 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
4402 v3 = (void *)pParam; | |
4403 uPlayerCreationUI_SelectedCharacter = pParam; | |
4404 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); | |
4405 pGUIWindow_CurrentMenu->ptr_1C = v3; | |
4406 break; | |
4407 case UIMSG_ChangeGameState: | |
4408 uGameState = GAME_FINISHED; | |
4409 break; | |
4410 case UIMSG_ChangeCursor: | |
4411 pMouse->SetCursorBitmap("MICON2"); | |
4412 break; | |
4413 case UIMSG_3A: | |
4414 SetCurrentMenuID(MENU_DebugBLVLevel); | |
4415 break; | |
4416 case UIMSG_LoadGame: | |
4417 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) | |
4418 break; | |
4419 SetCurrentMenuID(MENU_LoadingProcInMainMenu); | |
4420 break; | |
4421 case UIMSG_SelectLoadSlot: | |
4422 //main menu save/load wnd clicking on savegame lines | |
4423 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
4424 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
4425 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pParam + pSaveListPosition ) | |
4426 { | |
4427 //load clicked line | |
4428 v26 = pParam + pSaveListPosition; | |
4429 if ( dword_6BE138 == pParam + pSaveListPosition ) | |
4430 { | |
4431 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0); | |
4432 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); | |
4433 } | |
4434 uLoadGameUI_SelectedSlot = v26; | |
4435 dword_6BE138 = v26; | |
4436 } | |
4437 else | |
4438 { | |
4439 //typing in the line | |
4440 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); | |
4441 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); | |
4442 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); | |
4443 } | |
4444 break; | |
4445 case UIMSG_SaveLoadBtn: | |
4446 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); | |
4447 break; | |
4448 case UIMSG_DownArrow: | |
4449 ++pSaveListPosition; | |
4450 if ( pSaveListPosition >= pParam ) | |
4451 pSaveListPosition = pParam - 1; | |
4452 if ( pSaveListPosition < 1 ) | |
4453 pSaveListPosition = 0; | |
4454 pWindow = pGUIWindow_CurrentMenu; | |
4455 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); | |
4456 break; | |
4457 case UIMSG_Cancel: | |
4458 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0); | |
4459 break; | |
4460 case UIMSG_ArrowUp: | |
4461 --pSaveListPosition; | |
4462 if ( pSaveListPosition < 0 ) | |
4463 pSaveListPosition = 0; | |
4464 pWindow = pGUIWindow_CurrentMenu; | |
4465 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_PressedButton2, (int)pBtnArrowUp, 0); | |
4466 break; | |
4467 case UIMSG_AD: | |
4468 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); | |
4469 SetCurrentMenuID(MENU_LoadingProcInMainMenu); | |
4470 break; | |
4471 case UIMSG_AE: | |
4472 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); | |
4473 SetCurrentMenuID(MENU_DebugBLVLevel); | |
4474 break; | |
4475 case UIMSG_Escape: | |
4476 if ( pModalWindow ) | |
4477 { | |
4478 ModalWindow_Release(); | |
4479 break; | |
4480 } | |
2061 | 4481 if ( !(dword_6BE364_game_settings_1 & GAME_SETTINGS_4000)) |
1915 | 4482 break; |
4483 v15 = 1; | |
4484 pVideoPlayer->bStopBeforeSchedule = 1; | |
4485 viewparams->bRedrawGameUI = 1; | |
4486 viewparams->field_48 = 1; | |
4487 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC ) | |
4488 { | |
2137
d24ee391fd1f
libavcodec playing movies and houses, loops not working yet
zipi
parents:
2132
diff
changeset
|
4489 //if ( pCurrentScreen == SCREEN_VIDEO ) |
d24ee391fd1f
libavcodec playing movies and houses, loops not working yet
zipi
parents:
2132
diff
changeset
|
4490 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); |
1915 | 4491 if (GetCurrentMenuID() == MENU_NAMEPANELESC) |
4492 { | |
4493 SetCurrentMenuID(MENU_CREATEPARTY); | |
4494 break; | |
4495 } | |
4496 if (GetCurrentMenuID() == MENU_CREDITSPROC) | |
4497 { | |
4498 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
4499 break; | |
4500 } | |
4501 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | |
4502 break; | |
4503 } | |
4504 if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen ) | |
4505 { | |
2142
ca548138d6aa
some code cleaning in video playing, loops play but there is a memory leak
zipi
parents:
2137
diff
changeset
|
4506 //if ( pCurrentScreen == SCREEN_VIDEO ) |
ca548138d6aa
some code cleaning in video playing, loops play but there is a memory leak
zipi
parents:
2137
diff
changeset
|
4507 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); |
1915 | 4508 if (GetCurrentMenuID() == MENU_NAMEPANELESC) |
4509 { | |
4510 SetCurrentMenuID(MENU_CREATEPARTY); | |
4511 break; | |
4512 } | |
4513 if (GetCurrentMenuID() == MENU_CREDITSPROC) | |
4514 { | |
4515 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
4516 break; | |
4517 } | |
4518 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | |
4519 break; | |
4520 } | |
4521 if ( pCurrentScreen == SCREEN_LOADGAME ) | |
4522 { | |
4523 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
4524 //crt_deconstruct_ptr_6A0118(); | |
4525 pTexture_PCX.Release(); | |
4526 pTexture_PCX.Load("title.pcx", 0); | |
4527 SetCurrentMenuID(MENU_MAIN); | |
4528 v15 = 1; | |
4529 pGUIWindow_CurrentMenu->Release(); | |
4530 pGUIWindow2->Release(); | |
4531 pGUIWindow2 = 0; | |
4532 pEventTimer->Resume(); | |
4533 pCurrentScreen = SCREEN_GAME; | |
4534 viewparams->bRedrawGameUI = v15; | |
4535 break; | |
4536 } | |
4537 if ( pCurrentScreen == SCREEN_VIDEO ) | |
4538 { | |
4539 pVideoPlayer->Unload(); | |
4540 } | |
4541 else | |
4542 { | |
4543 if ( pCurrentScreen != SCREEN_1B ) | |
4544 { | |
4545 pGUIWindow_CurrentMenu->Release(); | |
4546 pGUIWindow2->Release(); | |
4547 pGUIWindow2 = 0; | |
4548 pEventTimer->Resume(); | |
4549 pCurrentScreen = SCREEN_GAME; | |
4550 viewparams->bRedrawGameUI = v15; | |
4551 break; | |
4552 } | |
4553 //VideoPlayer::dtor(); | |
4554 } | |
4555 break; | |
4556 default: | |
4557 break; | |
4558 } | |
4559 } | |
4560 while ( pMessageQueue_50CBD0->uNumMessages ); | |
4561 } | |
0 | 4562 } |