Mercurial > mm7
annotate Game.cpp @ 2215:e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
author | Ritor1 |
---|---|
date | Fri, 14 Feb 2014 18:08:30 +0600 |
parents | e18200fcfb50 |
children | 3f375342de12 |
rev | line source |
---|---|
1016 | 1 #include "Vis.h" |
2121 | 2 #include "Weather.h" |
1016 | 3 #include "LightmapBuilder.h" |
4 #include "DecalBuilder.h" | |
5 #include "ParticleEngine.h" | |
6 #include "Mouse.h" | |
7 #include "Keyboard.h" | |
8 #include "CShow.h" | |
9 #include "GammaControl.h" | |
10 #include "stru6.h" | |
11 #include "stru9.h" | |
12 #include "stru10.h" | |
13 | |
0 | 14 #include "Game.h" |
15 #include "Party.h" | |
16 #include "Viewport.h" | |
2044 | 17 #include "Timer.h" |
0 | 18 #include "Outdoor.h" |
1277 | 19 #include "Outdoor_stuff.h" |
0 | 20 #include "Overlays.h" |
21 #include "AudioPlayer.h" | |
22 #include "LOD.h" | |
23 #include "GUIWindow.h" | |
24 #include "TurnEngine.h" | |
25 #include "VideoPlayer.h" | |
26 #include "Bink_Smacker.h" | |
27 #include "Events.h" | |
28 #include "Arcomage.h" | |
189 | 29 #include "texts.h" |
791 | 30 #include "GUIFont.h" |
194 | 31 #include "Log.h" |
1262 | 32 #include "Lights.h" |
33 #include "mm7_data.h" | |
1915 | 34 #include "MapInfo.h" |
35 #include "CastSpellInfo.h" | |
36 #include "FrameTableInc.h" | |
37 #include "Actor.h" | |
38 #include "Events2D.h" | |
39 #include "GUIProgressBar.h" | |
40 #include "ObjectList.h" | |
41 #include "Level/Decoration.h" | |
42 #include "PaletteManager.h" | |
43 #include "UI\UIHouses.h" | |
44 #include "SaveLoad.h" | |
45 #include "SpriteObject.h" | |
46 #include "mm7.h" | |
47 #include "Sprites.h" | |
0 | 48 |
49 | |
50 | |
51 | |
52 | |
53 Game *pGame; | |
54 | |
55 | |
56 | |
57 | |
58 | |
59 //----- (00435694) -------------------------------------------------------- | |
60 void Game::ToggleFlags2(unsigned int uFlag) | |
61 { | |
62 unsigned int v2; // eax@1 | |
63 | |
64 v2 = this->uFlags2; | |
65 if ( v2 & uFlag ) | |
66 this->uFlags2 = v2 & ~uFlag; | |
67 else | |
68 this->uFlags2 = uFlag | v2; | |
69 } | |
70 | |
71 //----- (0044103C) -------------------------------------------------------- | |
72 void Game::Draw() | |
73 { | |
142 | 74 //float v2; // ST24_4@11 |
0 | 75 //double v3; // ST28_8@11 |
76 int v4; // edi@26 | |
142 | 77 //int v5; // eax@35 |
0 | 78 |
1556 | 79 uFlags2 &= ~0x02; |
0 | 80 if ( pParty->_497FC5_check_party_perception_against_level() ) |
81 uFlags2 |= 2u; | |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1556
diff
changeset
|
82 |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
83 pGame->pIndoorCameraD3D->sRotationX = pParty->sRotationX; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
84 pGame->pIndoorCameraD3D->sRotationY = pParty->sRotationY; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
85 pGame->pIndoorCameraD3D->vPartyPos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * 3.141592653589 * pParty->sRotationY / 2048.0); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
86 pGame->pIndoorCameraD3D->vPartyPos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * 3.141592653589 * pParty->sRotationY / 2048.0); |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
87 pGame->pIndoorCameraD3D->vPartyPos.z = pParty->vPosition.z + pParty->sEyelevel;//193, but real 353 |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1556
diff
changeset
|
88 |
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1556
diff
changeset
|
89 //pIndoorCamera->Initialize2(); |
1642 | 90 pIndoorCameraD3D->CalculateRotations(pParty->sRotationX, pParty->sRotationY); |
0 | 91 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff(); |
92 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum(); | |
93 | |
94 if ( pVideoPlayer->AnyMovieLoaded() ) | |
95 { | |
2154 | 96 /*if ( !pRenderer->pRenderD3D ) |
1421 | 97 { |
98 pRenderer->BeginSceneD3D(); | |
99 pMouse->DrawCursorToTarget(); | |
100 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); | |
2154 | 101 }*/ |
0 | 102 } |
103 else | |
104 { | |
1110 | 105 if ( pParty->vPosition.x != pParty->vPrevPosition.x || pParty->sRotationY != pParty->sPrevRotationY || pParty->vPosition.y != pParty->vPrevPosition.y |
106 || pParty->sRotationX != pParty->sPrevRotationX || pParty->vPosition.z != pParty->vPrevPosition.z || pParty->sEyelevel != pParty->sPrevEyelevel ) | |
0 | 107 pParty->uFlags |= 2u; |
847 | 108 pParty->vPrevPosition.x = pParty->vPosition.x; |
78 | 109 pParty->vPrevPosition.y = pParty->vPosition.y; |
847 | 110 pParty->vPrevPosition.z = pParty->vPosition.z; |
0 | 111 //v0 = &pRenderer; |
112 pParty->sPrevRotationY = pParty->sRotationY; | |
113 pParty->sPrevRotationX = pParty->sRotationX; | |
847 | 114 |
0 | 115 pParty->sPrevEyelevel = pParty->sEyelevel; |
116 pRenderer->BeginSceneD3D(); | |
117 | |
2154 | 118 //if ( !pRenderer->pRenderD3D ) |
119 //pMouse->DrawCursorToTarget(); | |
265 | 120 if ( !PauseGameDrawing() || viewparams->field_48 == 1 ) |
0 | 121 { |
2154 | 122 //if ( pRenderer->pRenderD3D ) |
0 | 123 { |
142 | 124 float v2 = (double)(((signed int)pMiscTimer->uTotalGameTimeElapsed >> 2) & 0x1F) * 0.032258064 * 6.0; |
0 | 125 //v3 = v2 + 6.7553994e15; |
126 //pRenderer->field_1036A8_bitmapid = LODWORD(v3); | |
265 | 127 pRenderer->hd_water_current_frame = floorf(v2 + 0.5f); |
0 | 128 } |
129 | |
130 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
131 pIndoor->Draw(); | |
132 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
133 pOutdoor->Draw(); | |
1545 | 134 else Error("Invalid level type: %u", uCurrentlyLoadedLevelType); |
0 | 135 |
2154 | 136 //if (pRenderer->pRenderD3D) |
0 | 137 { |
138 pDecalBuilder->DrawBloodsplats(); | |
1394 | 139 pGame->pLightmapBuilder->DrawLightmapsType(2); |
0 | 140 } |
141 } | |
1421 | 142 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); |
0 | 143 } |
791 | 144 |
145 //DEBUG: force redraw gui | |
146 viewparams->bRedrawGameUI = true; | |
147 | |
148 | |
0 | 149 pRenderer->BeginScene(); |
2154 | 150 //if (pRenderer->pRenderD3D) |
0 | 151 pMouse->DrawCursorToTarget(); |
142 | 152 if (pOtherOverlayList->bRedraw) |
153 viewparams->bRedrawGameUI = true; | |
0 | 154 v4 = viewparams->bRedrawGameUI; |
783 | 155 GameUI_Footer(); |
0 | 156 if (!viewparams->bRedrawGameUI) |
157 GameUI_DrawRightPanelItems(); | |
158 else | |
159 { | |
160 GameUI_DrawRightPanelFrames(); | |
783 | 161 GameUI_Footer_2(); |
0 | 162 viewparams->bRedrawGameUI = false; |
163 } | |
2142
ca548138d6aa
some code cleaning in video playing, loops play but there is a memory leak
zipi
parents:
2137
diff
changeset
|
164 if (!pVideoPlayer->pMovie)//!pVideoPlayer->pSmackerMovie) |
0 | 165 { |
2070 | 166 GameUI_DrawMinimap(488, 16, 625, 133, viewparams->uMinimapZoom, true);//redraw = pParty->uFlags & 2); |
0 | 167 if (v4) |
168 { | |
2154 | 169 if ( !PauseGameDrawing() /*&& pRenderer->pRenderD3D*/) // clear game viewport with transparent color |
693 | 170 pRenderer->FillRectFast(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pViewport->uViewportBR_X - pViewport->uViewportTL_X, |
171 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1, | |
2155 | 172 0x7FF); |
0 | 173 viewparams->field_48 = 0; |
174 } | |
175 } | |
142 | 176 |
177 viewparams->bRedrawGameUI = pOtherOverlayList->bRedraw; | |
178 pOtherOverlayList->bRedraw = 0; | |
179 | |
0 | 180 GameUI_DrawPartySpells(); |
291 | 181 if (v4 || pParty->pHirelings[0].evt_C || pParty->pHirelings[1].evt_C ) |
994 | 182 GameUI_DrawHiredNPCs(); |
0 | 183 GameUI_DrawPortraits(v4); |
184 GameUI_DrawLifeManaBars(); | |
185 GameUI_DrawCharacterSelectionFrame(); | |
2205 | 186 if ( _44100D_should_alter_right_panel() ) |
994 | 187 GameUI_DrawRightPanel(); |
0 | 188 if ( !pVideoPlayer->AnyMovieLoaded() ) |
189 { | |
190 pStru6Instance->DrawPlayerBuffAnims(); | |
569 | 191 pOtherOverlayList->DrawTurnBasedIcon(v4); |
0 | 192 GameUI_DrawTorchlightAndWizardEye(); |
193 } | |
791 | 194 |
794 | 195 |
196 static bool render_framerate = false; | |
197 static float framerate = 0.0f; | |
198 static uint frames_this_second = 0; | |
199 static uint last_frame_time = GetTickCount(); | |
200 static uint framerate_time_elapsed = 0; | |
2123 | 201 if ( pCurrentScreen == SCREEN_GAME && uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
2122 | 202 pWeather->Draw();//Ritor1: my include |
794 | 203 |
1980 | 204 uint frame_dt = GetTickCount() - last_frame_time; |
794 | 205 last_frame_time = GetTickCount(); |
206 | |
207 framerate_time_elapsed += frame_dt; | |
208 if (framerate_time_elapsed >= 1000) | |
209 { | |
210 framerate = frames_this_second * (1000.0f / framerate_time_elapsed); | |
211 | |
212 framerate_time_elapsed = 0; | |
213 frames_this_second = 0; | |
214 render_framerate = true; | |
215 } | |
216 | |
217 ++frames_this_second; | |
218 | |
1507 | 219 extern bool debug_information; |
220 if ( debug_information ) | |
794 | 221 { |
1507 | 222 if (render_framerate) |
223 { | |
224 sprintf(pTmpBuf.data(), "FPS: % .4f", framerate); | |
2069 | 225 pPrimaryWindow->DrawText(pFontArrus, 494, 0, Color16(0, 0, 0), pTmpBuf.data(), 0, 0, 0); |
1507 | 226 } |
794 | 227 |
1507 | 228 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
229 { | |
1980 | 230 int sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); |
1507 | 231 sprintf(pTmpBuf.data(), "Party Sector ID: %u/%u\n", sector_id, pIndoor->uNumSectors); |
2069 | 232 pPrimaryWindow->DrawText(pFontArrus, 16, 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, -1); |
1507 | 233 } |
234 sprintf(pTmpBuf.data(), "Party Position: % d % d % d", pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); | |
2069 | 235 pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, -1); |
1507 | 236 |
237 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
238 { | |
239 uint uFaceID; | |
1980 | 240 int sector_id = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); |
241 int floor_level = BLV_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + 40, sector_id, &uFaceID); | |
1507 | 242 sprintf(pTmpBuf.data(), "BLV_GetFloorLevel: %d face_id %d\n", floor_level, uFaceID); |
243 } | |
244 else | |
245 { | |
246 int on_water, _a6; | |
1980 | 247 int floor_level = ODM_GetFloorLevel(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z, 0, &on_water, &_a6, false); |
1507 | 248 sprintf(pTmpBuf.data(), "ODM_GetFloorLevel: %d on_water: %s a6 = %d\n", floor_level, on_water ? "true" : "false", _a6); |
249 } | |
2069 | 250 pPrimaryWindow->DrawText(pFontArrus, 16, 16 + 16 + 16, Color16(255, 255, 255), pTmpBuf.data(), 0, 0, -1); |
791 | 251 } |
252 | |
0 | 253 GUI_UpdateWindows(); |
130 | 254 pParty->UpdatePlayersAndHirelingsEmotions(); |
937 | 255 |
434 | 256 _unused_5B5924_is_travel_ui_drawn = false; |
0 | 257 if (v4) |
791 | 258 pMouse->bRedraw = true; |
0 | 259 pMouse->_469EA4(); |
260 pMouse->DrawCursor(); | |
261 pMouse->_469E1C(); | |
262 pRenderer->EndScene(); | |
263 pRenderer->Present(); | |
569 | 264 pParty->uFlags &= ~2; |
0 | 265 } |
266 | |
267 //----- (0047A815) -------------------------------------------------------- | |
268 void Game::DrawParticles() | |
269 { | |
270 pParticleEngine->Draw(); | |
271 } | |
272 | |
273 //----- (00463149) -------------------------------------------------------- | |
274 void Game::Loop() | |
275 { | |
276 const char *pLocationName; // [sp-4h] [bp-68h]@74 | |
277 bool bLoading; // [sp+10h] [bp-54h]@1 | |
278 signed int v16; // [sp+14h] [bp-50h]@8 | |
279 MSG Msg; // [sp+28h] [bp-3Ch]@20 | |
280 char Source[64]; // [sp+44h] [bp-20h]@76 | |
281 | |
2006 | 282 bLoading = sCurrentMenuID == MENU_LoadingProcInMainMenu; |
0 | 283 SetCurrentMenuID((MENU_STATE)-1); |
2126 | 284 if (bLoading) |
0 | 285 { |
286 pParty->Reset(); | |
982 | 287 uGameState = GAME_STATE_PLAYING; |
0 | 288 LoadGame(uLoadGameUI_SelectedSlot); |
289 } | |
290 | |
291 for (uint i = 1; i < 5; ++i) | |
292 for (uint j = 1; j < 6; ++j) | |
293 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1165
diff
changeset
|
294 sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1165
diff
changeset
|
295 remove(pTmpBuf.data()); |
0 | 296 } |
297 | |
298 LoadPlayerPortraintsAndVoices(); | |
783 | 299 pIcons_LOD->_inlined_sub1(); |
328 | 300 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); |
0 | 301 |
302 while ( 2 ) | |
303 { | |
304 v16 = 1; | |
783 | 305 pMessageQueue_50CBD0->Flush(); |
0 | 306 |
307 pPartyActionQueue->uNumActions = 0; | |
308 if (pParty->bTurnBasedModeOn) | |
309 { | |
310 pTurnEngine->End(false); | |
311 pParty->bTurnBasedModeOn = false; | |
312 } | |
313 DoPrepareWorld(bLoading, 1); | |
314 pEventTimer->Resume(); | |
2061 | 315 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME; |
0 | 316 // uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0; |
151 | 317 pCurrentScreen = SCREEN_GAME; |
1038 | 318 |
2154 | 319 //if ( pRenderer->pRenderD3D ) |
0 | 320 pGame->pVisInstance->_4C1A02(); |
982 | 321 |
322 bool game_finished = false; | |
0 | 323 do |
324 { | |
325 while ( PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE) ) | |
326 { | |
327 if ( Msg.message == WM_QUIT ) | |
328 Game_DeinitializeAndTerminate(0); | |
329 TranslateMessage(&Msg); | |
330 DispatchMessageA(&Msg); | |
331 } | |
2061 | 332 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE) |
0 | 333 { |
334 WaitMessage(); | |
335 continue; | |
336 } | |
337 pGame->_44EEA7(); | |
338 GameUI_WritePointedObjectStatusString(); | |
339 ProcessInputActions(); | |
340 GameUI_MsgProc(); | |
341 if ( pArcomageGame->bGameInProgress ) | |
342 { | |
343 ArcomageGame::Loop(); | |
344 pRenderer->Present(); | |
345 continue; | |
346 } | |
1802 | 347 |
348 pVideoPlayer->_inlined_in_463149(); | |
983 | 349 |
350 pEventTimer->Update(); | |
351 pMiscTimer->Update(); | |
352 | |
0 | 353 OnTimer(0); |
354 GameUI_StatusBar_UpdateTimedString(0); | |
355 if ( pMiscTimer->bPaused && !pEventTimer->bPaused ) | |
356 pMiscTimer->Resume(); | |
357 if ( pEventTimer->bTackGameTime && !pParty->bTurnBasedModeOn ) | |
358 pEventTimer->bTackGameTime = 0; | |
982 | 359 if ( !pEventTimer->bPaused && uGameState == GAME_STATE_PLAYING) |
0 | 360 { |
361 if ( !pEventTimer->bTackGameTime ) | |
362 _494035_timed_effects__water_walking_damage__etc(); | |
2061 | 363 |
364 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0001) | |
365 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0001; | |
0 | 366 else |
367 { | |
783 | 368 UpdateActorAI(); |
369 UpdateUserInput_and_MapSpecificStuff(); | |
0 | 370 } |
371 } | |
372 if ( v16 ) | |
373 { | |
374 v16 = 0; | |
375 viewparams->bRedrawGameUI = true; | |
376 } | |
378 | 377 pAudioPlayer->UpdateSounds(); |
2124 | 378 if ( (signed int)uGameState == GAME_STATE_PLAYING ) |
379 { | |
380 pGame->Draw(); | |
381 continue; | |
382 } | |
978 | 383 if (uGameState == GAME_FINISHED) |
4 | 384 { |
982 | 385 game_finished = true; |
0 | 386 continue; |
4 | 387 } |
2124 | 388 if (uGameState == GAME_STATE_CHANGE_LOCATION)// ñìåíà ëîêàöèè |
0 | 389 { |
390 pAudioPlayer->StopChannels(-1, -1); | |
391 PrepareWorld(0); | |
982 | 392 uGameState = GAME_STATE_PLAYING; |
0 | 393 continue; |
394 } | |
2132 | 395 if ( (signed int)uGameState <= GAME_STATE_5 || uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU )//GAME_STATE_NEWGAME_OUT_GAMEMENU, GAME_STATE_LOADING_GAME |
4 | 396 { |
2124 | 397 game_finished = true; |
0 | 398 continue; |
4 | 399 } |
2124 | 400 if ( uGameState == GAME_STATE_FINAL_WINDOW ) |
0 | 401 { |
2124 | 402 pRenderer->BeginScene(); |
403 GUI_UpdateWindows(); | |
404 pRenderer->EndScene(); | |
405 pRenderer->Present(); | |
0 | 406 continue; |
407 } | |
981 | 408 if ( uGameState != GAME_STATE_PARTY_DIED ) |
0 | 409 { |
2124 | 410 pGame->Draw(); |
411 continue; | |
412 } | |
413 if ( uGameState == GAME_STATE_PARTY_DIED ) | |
414 { | |
415 pAudioPlayer->StopChannels(-1, -1); | |
416 memset(&pParty->pHirelings[0], 0, 0x4Cu); | |
417 memset(&pParty->pHirelings[1], 0, 0x4Cu); | |
418 for ( int i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i ) | |
0 | 419 { |
2124 | 420 if ( pNPCStats->pNewNPCData[i].field_24 ) |
421 pNPCStats->pNewNPCData[i].uFlags &= 0xFFFFFF7Fu; | |
422 } | |
423 pVideoPlayer->PlayDeathMovie(); | |
424 if ( pVideoPlayer->AnyMovieLoaded() ) | |
425 pVideoPlayer->Unload(); | |
426 SaveGame(0, 0); | |
427 ++pParty->uNumDeaths; | |
428 for ( uint i = 0; i < 4; ++i ) | |
429 pParty->pPlayers[i].SetVariable(VAR_Award, 85); | |
430 pParty->days_played_without_rest = 0; | |
431 pParty->uTimePlayed += 0x276000ui64; | |
432 LOWORD(pParty->uFlags) &= ~0x204; | |
433 pParty->SetGold(0); | |
434 pOtherOverlayList->Reset(); | |
435 memset(pParty->pPartyBuffs.data(), 0, 0x140u); | |
436 | |
437 if ( pParty->bTurnBasedModeOn == 1 ) | |
438 { | |
439 pTurnEngine->End(true); | |
440 pParty->bTurnBasedModeOn = 0; | |
441 } | |
442 for( int i = 0; i < 4; ++i) | |
443 { | |
444 memset(pParty->pPlayers[i].pConditions.data(), 0, 0xA0u);//(pConditions, 0, 160) | |
445 memset(pParty->pPlayers[i].pPlayerBuffs.data(), 0, 0x180u);//(pPlayerBuffs[0], 0, 384) | |
446 pParty->pPlayers[i].sHealth = 1; | |
447 uActiveCharacter = 1; | |
448 } | |
449 if (_449B57_test_bit(pParty->_quest_bits, PARTY_QUEST_FINISHED_EMERALD_ISLE)) | |
450 { | |
451 pParty->vPosition.x = -17331; // respawn in harmondale | |
452 pParty->vPosition.y = 12547; | |
453 pParty->vPosition.z = 465; | |
454 pParty->sRotationY = 0; | |
455 pLocationName = "out02.odm"; | |
0 | 456 } |
981 | 457 else |
458 { | |
2124 | 459 pParty->vPosition.x = 12552; // respawn on emerald isle |
460 pParty->vPosition.y = 1816; | |
461 pParty->vPosition.z = 0; | |
462 pParty->sRotationY = 512; | |
463 pLocationName = "out01.odm"; | |
0 | 464 } |
2124 | 465 strcpy(Source, pLocationName); |
466 pParty->uFallStartY = pParty->vPosition.z; | |
467 pParty->sRotationX = 0; | |
468 pParty->uFallSpeed = 0; | |
469 pParty->field_6E4 = 0; | |
470 pParty->field_6E0 = 0; | |
471 if ( _stricmp(Source, pCurrentMapName) ) | |
472 { | |
473 strcpy(pCurrentMapName, Source); | |
474 _5B65A8_npcdata_uflags_or_other = pParty->vPosition.x; | |
475 _5B65AC_npcdata_fame_or_other = pParty->vPosition.y; | |
476 _5B65B0_npcdata_rep_or_other = pParty->vPosition.z; | |
477 _5B65B4_npcdata_loword_house_or_other = pParty->sRotationY; | |
478 _5B65B8_npcdata_hiword_house_or_other = pParty->sRotationX; | |
479 dword_5B65C0 = 1; | |
480 PrepareWorld(1); | |
481 } | |
482 InitializeActors(); | |
981 | 483 |
2124 | 484 int num_conscious_players = 0; |
485 int conscious_players_ids[4] = {-1, -1, -1, -1}; | |
486 for (int i = 0; i < 4; ++i) | |
487 { | |
488 if (pParty->pPlayers[i].CanAct()) | |
489 conscious_players_ids[num_conscious_players++] = i; | |
490 } | |
491 if (num_conscious_players) | |
492 { | |
493 int idx = conscious_players_ids[rand() % num_conscious_players]; | |
494 Assert(idx >= 0); | |
495 pParty->pPlayers[idx].PlaySound(SPEECH_99, 0); | |
496 } | |
497 | |
498 ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2);// "Once again you've cheated death!.." "Âû ñíîâà îáõèòðèëè ñìåðòü! …" | |
499 uGameState = GAME_STATE_PLAYING; | |
0 | 500 } |
501 } | |
982 | 502 while (!game_finished); |
503 | |
0 | 504 pEventTimer->Pause(); |
505 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); | |
1214
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
506 if ( uGameState == GAME_STATE_LOADING_GAME ) |
0 | 507 { |
508 sub_491E3A(); | |
509 LoadPlayerPortraintsAndVoices(); | |
982 | 510 uGameState = GAME_STATE_PLAYING; |
0 | 511 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles; |
512 bLoading = true; | |
513 continue; | |
514 } | |
515 break; | |
516 } | |
151 | 517 pCurrentScreen = SCREEN_VIDEO; |
0 | 518 sub_491E3A(); |
519 } | |
520 | |
521 | |
522 //----- (0044F192) -------------------------------------------------------- | |
523 void Game::PrepareBloodsplats() | |
524 { | |
525 for (uint i = 0; i < uNumBloodsplats; ++i) | |
526 { | |
2210 | 527 pBloodsplatContainer->AddBloodsplat(pBloodsplats[i].x, pBloodsplats[i].y, pBloodsplats[i].z, |
528 pBloodsplats[i].radius, pBloodsplats[i].r, pBloodsplats[i].g, pBloodsplats[i].b); | |
0 | 529 } |
530 } | |
531 | |
532 | |
533 //----- (0044F120) -------------------------------------------------------- | |
534 void Game::PushStationaryLights(int a2) | |
535 { | |
1094 | 536 Game__StationaryLight* pLight; |
537 | |
538 for( int i=0; i<uNumStationaryLights; ++i ) | |
539 { | |
540 pLight=&pStationaryLights[i]; | |
2210 | 541 pStationaryLightsStack->AddLight(pLight->vPosition.x, pLight->vPosition.y, pLight->vPosition.z, |
542 pLight->flt_18, pLight->vRGBColor.x, pLight->vRGBColor.y, pLight->vRGBColor.z, _4E94D0_light_type); | |
1094 | 543 } |
0 | 544 } |
2154 | 545 // 4E94D0: using guessed type char _4E94D0_light_type; |
0 | 546 |
547 //----- (0044F0FD) -------------------------------------------------------- | |
548 void Game::_44F0FD() | |
549 { | |
550 ToggleFlags(0x40u); | |
551 | |
552 if ( !(uFlags & 0x40) ) | |
553 { | |
554 uNumBloodsplats = 0; | |
555 field_E0C = 0; | |
556 } | |
557 } | |
558 | |
559 //----- (0044F0D8) -------------------------------------------------------- | |
560 void Game::ToggleFlags(uint uMask) | |
561 { | |
562 if (uFlags & uMask) | |
563 uFlags &= ~uMask; | |
564 else | |
565 uFlags |= uMask; | |
566 } | |
567 | |
568 | |
569 //----- (0044F07B) -------------------------------------------------------- | |
570 bool Game::_44F07B() | |
571 { | |
2210 | 572 if (!pKeyboardInstance->IsKeyBeingHeld(VK_SHIFT) && !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) && |
573 !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) || (pKeyboardInstance->WasKeyPressed(VK_F11) == 0 && | |
0 | 574 pKeyboardInstance->WasKeyPressed(VK_F11))) |
575 return true; | |
576 return false; | |
577 } | |
578 | |
579 //----- (0044EEA7) -------------------------------------------------------- | |
580 bool Game::_44EEA7() | |
581 { | |
582 //Game *v1; // esi@1 | |
194 | 583 //double v2; // st7@2 |
0 | 584 float depth; // ST00_4@9 |
194 | 585 //bool result; // eax@9 |
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 { | |
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(); | |
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 ) | |
2128 pMouse->SetCursorBitmap("MICON2"); | |
2129 else | |
2130 { | |
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(); | |
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 { | |
2302 pMouse->SetCursorBitmap("MICON2"); | |
2303 } | |
2304 else | |
2305 { | |
2306 pGUIWindow_Settings->Release(); | |
2307 pGUIWindow_Settings = 0; | |
2308 pMouse->SetCursorBitmap("MICON1"); | |
2309 GameUI_Footer_TimeLeft = 0; | |
2310 _50C9A0_IsEnchantingInProgress = 0; | |
2311 back_to_game(); | |
2312 } | |
2313 } | |
2314 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2315 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2316 pGUIWindow_CurrentMenu->Release(); | |
2317 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2318 window_SpeakInHouse = 0; | |
2319 pGUIWindow_CurrentMenu = 0; | |
2320 pEventTimer->Resume(); | |
2321 pCurrentScreen = SCREEN_GAME; | |
2322 viewparams->bRedrawGameUI = 1; | |
2323 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2324 continue; | |
2325 case SCREEN_E: | |
2326 __debugbreak(); | |
2327 pGUIWindow_CurrentMenu->Release(); | |
2328 pCurrentScreen = SCREEN_HOUSE; | |
2329 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2330 continue; | |
2331 case SCREEN_HOUSE: | |
2332 if ( uDialogueType ) | |
2333 uDialogueType = 0; | |
2124 | 2334 if ( uGameState == GAME_STATE_CHANGE_LOCATION ) |
1915 | 2335 { |
1919 | 2336 while ( HouseDialogPressCloseBtn() ) |
1915 | 2337 ; |
2338 } | |
2339 else | |
2340 { | |
1919 | 2341 if ( HouseDialogPressCloseBtn() ) |
1915 | 2342 continue; |
2343 } | |
2344 GetHouseGoodbyeSpeech(); | |
2345 pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0); | |
2346 pVideoPlayer->Unload(); | |
2347 pGUIWindow_CurrentMenu = window_SpeakInHouse; | |
2348 if ( pGUIWindow_Settings ) | |
2349 { | |
2350 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2351 { | |
2352 pMouse->SetCursorBitmap("MICON2"); | |
2353 } | |
2354 else | |
2355 { | |
2356 pGUIWindow_Settings->Release(); | |
2357 pGUIWindow_Settings = 0; | |
2358 pMouse->SetCursorBitmap("MICON1"); | |
2359 GameUI_Footer_TimeLeft = 0; | |
2360 _50C9A0_IsEnchantingInProgress = 0; | |
2361 back_to_game(); | |
2362 } | |
2363 } | |
2364 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2365 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2366 pGUIWindow_CurrentMenu->Release(); | |
2367 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2368 window_SpeakInHouse = 0; | |
2369 pGUIWindow_CurrentMenu = 0; | |
2370 pEventTimer->Resume(); | |
2371 pCurrentScreen = SCREEN_GAME; | |
2372 viewparams->bRedrawGameUI = true; | |
2373 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2374 continue; | |
2375 case SCREEN_INPUT_BLV://click escape | |
2376 if ( uCurrentHouse_Animation == 153 ) | |
2377 PlayHouseSound(0x99u, HouseSound_Greeting_2); | |
2378 pVideoPlayer->Unload(); | |
2379 if ( npcIdToDismissAfterDialogue ) | |
2380 { | |
2381 pParty->hirelingScrollPosition = 0; | |
2382 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu; | |
2383 pParty->CountHirelings(); | |
2384 viewparams->bRedrawGameUI = true; | |
2385 npcIdToDismissAfterDialogue = 0; | |
2386 } | |
2387 DialogueEnding(); | |
2388 pCurrentScreen = SCREEN_GAME; | |
2389 viewparams->bRedrawGameUI = true; | |
2390 continue; | |
2391 case SCREEN_NPC_DIALOGUE://click escape | |
2392 if ( npcIdToDismissAfterDialogue ) | |
2393 { | |
2394 pParty->hirelingScrollPosition = 0; | |
2395 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu; | |
2396 pParty->CountHirelings(); | |
2397 viewparams->bRedrawGameUI = true; | |
2398 npcIdToDismissAfterDialogue = 0; | |
2399 } | |
2400 //goto LABEL_317; | |
2401 DialogueEnding(); | |
2402 pCurrentScreen = SCREEN_GAME; | |
2403 viewparams->bRedrawGameUI = true; | |
2404 continue; | |
2405 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape | |
2406 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); | |
2407 sub_4452BB(); | |
2408 DialogueEnding(); | |
2409 pCurrentScreen = SCREEN_GAME; | |
2410 viewparams->bRedrawGameUI = true; | |
2411 continue; | |
2412 case SCREEN_CHANGE_LOCATION://click escape | |
2413 if ( pParty->vPosition.x < -22528 ) | |
2414 pParty->vPosition.x = -22528; | |
2415 if ( pParty->vPosition.x > 22528 ) | |
2416 pParty->vPosition.x = 22528; | |
2417 if ( pParty->vPosition.y < -22528 ) | |
2418 pParty->vPosition.y = -22528; | |
2419 if ( pParty->vPosition.y > 22528 ) | |
2420 pParty->vPosition.y = 22528; | |
2421 DialogueEnding(); | |
2422 pCurrentScreen = SCREEN_GAME; | |
2423 viewparams->bRedrawGameUI = true; | |
2424 continue; | |
2425 case SCREEN_VIDEO: | |
2426 pVideoPlayer->Unload(); | |
2427 continue; | |
2428 case SCREEN_CHARACTERS: | |
2429 CharacterUI_ReleaseButtons(); | |
2430 ReleaseAwardsScrollBar(); | |
2431 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2432 if ( pGUIWindow_Settings ) | |
2433 { | |
2434 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2435 { | |
2436 pMouse->SetCursorBitmap("MICON2"); | |
2437 } | |
2438 else | |
2439 { | |
2440 pGUIWindow_Settings->Release(); | |
2441 pGUIWindow_Settings = 0; | |
2442 pMouse->SetCursorBitmap("MICON1"); | |
2443 GameUI_Footer_TimeLeft = 0; | |
2444 _50C9A0_IsEnchantingInProgress = 0; | |
2445 back_to_game(); | |
2446 } | |
2447 } | |
2448 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2449 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2450 pGUIWindow_CurrentMenu->Release(); | |
2451 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2452 window_SpeakInHouse = 0; | |
2453 pGUIWindow_CurrentMenu = 0; | |
2454 pEventTimer->Resume(); | |
2455 pCurrentScreen = SCREEN_GAME; | |
2456 viewparams->bRedrawGameUI = true; | |
2457 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2458 continue; | |
2459 default: | |
2460 if ( pGUIWindow_Settings ) | |
2461 { | |
2462 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2463 { | |
2464 pMouse->SetCursorBitmap("MICON2"); | |
2465 } | |
2466 else | |
2467 { | |
2468 pGUIWindow_Settings->Release(); | |
2469 pGUIWindow_Settings = 0; | |
2470 pMouse->SetCursorBitmap("MICON1"); | |
2471 GameUI_Footer_TimeLeft = 0; | |
2472 _50C9A0_IsEnchantingInProgress = 0; | |
2473 back_to_game(); | |
2474 } | |
2475 } | |
2476 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2477 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2478 pGUIWindow_CurrentMenu->Release(); | |
2479 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2480 window_SpeakInHouse = 0; | |
2481 pGUIWindow_CurrentMenu = 0; | |
2482 pEventTimer->Resume(); | |
2483 pCurrentScreen = SCREEN_GAME; | |
2484 viewparams->bRedrawGameUI = 1; | |
2485 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2486 continue; | |
2487 } | |
2488 if ( pGUIWindow_Settings ) | |
2489 { | |
2490 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2491 { | |
2492 pMouse->SetCursorBitmap("MICON2"); | |
2493 } | |
2494 else | |
2495 { | |
2496 pGUIWindow_Settings->Release(); | |
2497 pGUIWindow_Settings = 0; | |
2498 pMouse->SetCursorBitmap("MICON1"); | |
2499 GameUI_Footer_TimeLeft = 0; | |
2500 _50C9A0_IsEnchantingInProgress = 0; | |
2501 back_to_game(); | |
2502 } | |
2503 } | |
2504 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2505 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2506 pGUIWindow_CurrentMenu->Release(); | |
2507 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2508 window_SpeakInHouse = 0; | |
2509 pGUIWindow_CurrentMenu = 0; | |
2510 pEventTimer->Resume(); | |
2511 pCurrentScreen = SCREEN_GAME; | |
2512 viewparams->bRedrawGameUI = true; | |
2513 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2514 continue; | |
2515 } | |
2516 CharacterUI_ReleaseButtons(); | |
2517 ReleaseAwardsScrollBar(); | |
2518 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
2519 } | |
2520 if ( pGUIWindow_Settings ) | |
2521 { | |
2522 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
2523 { | |
2524 pMouse->SetCursorBitmap("MICON2"); | |
2525 } | |
2526 else | |
2527 { | |
2528 pGUIWindow_Settings->Release(); | |
2529 pGUIWindow_Settings = 0; | |
2530 pMouse->SetCursorBitmap("MICON1"); | |
2531 GameUI_Footer_TimeLeft = 0; | |
2532 _50C9A0_IsEnchantingInProgress = 0; | |
2533 back_to_game(); | |
2534 } | |
2535 } | |
2536 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
2537 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
2538 pGUIWindow_CurrentMenu->Release(); | |
2539 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
2540 window_SpeakInHouse = 0; | |
2541 pGUIWindow_CurrentMenu = 0; | |
2542 pEventTimer->Resume(); | |
2543 pCurrentScreen = SCREEN_GAME; | |
2544 viewparams->bRedrawGameUI = true; | |
2545 pIcons_LOD->RemoveTexturesFromTextureList(); | |
2546 continue; | |
2547 } | |
2548 if ( !pGUIWindow_Settings )//Draw Menu | |
2549 { | |
2550 dword_6BE138 = -1; | |
2551 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, (char *)1); | |
2552 pEventTimer->Pause(); | |
2553 pAudioPlayer->StopChannels(-1, -1); | |
2554 pCurrentScreen = SCREEN_MENU; | |
2555 | |
2556 ++pIcons_LOD->uTexturePacksCount; | |
2557 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2558 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
2559 | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
2560 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_OptionsButtons, 0, 0); |
1915 | 2561 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); |
2562 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); | |
2563 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE); | |
2564 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE); | |
2565 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); | |
2566 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
2567 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE); | |
2568 pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu, | |
2569 pGlobalTXT_LocalizationStrings[614],// "New Game" | |
2570 pIcons_LOD->GetTexture(uTextureID_New1), 0); | |
2571 pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u, | |
2572 pGlobalTXT_LocalizationStrings[615],// "Save Game" | |
2573 pIcons_LOD->GetTexture(uTextureID_Save1), 0); | |
2574 pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu, | |
2575 pGlobalTXT_LocalizationStrings[616],// "Load Game" | |
2576 pIcons_LOD->GetTexture(uTextureID_Load1), 0); | |
2577 pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u, | |
2578 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:"" | |
2579 pIcons_LOD->GetTexture(uTextureID_Controls1), 0); | |
2580 pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u, | |
2581 pGlobalTXT_LocalizationStrings[618],// "Quit" | |
2582 pIcons_LOD->GetTexture(uTextureID_Quit1), 0); | |
2583 pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u, | |
2584 pGlobalTXT_LocalizationStrings[619],// "Return to Game" | |
2585 pIcons_LOD->GetTexture(uTextureID_Resume1), 0); | |
2586 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0); | |
2587 viewparams->field_48 = 1; | |
2154 | 2588 |
1915 | 2589 stru_506E40.Release(); |
2154 | 2590 pRenderer->SaveScreenshot("gamma.pcx", 155, 117); |
2131 | 2591 stru_506E40.LoadPCXFile("gamma.pcx", 0); |
2154 | 2592 |
1915 | 2593 continue; |
2594 } | |
2595 pGUIWindow_Settings->Release(); | |
2596 pGUIWindow_Settings = 0; | |
2597 pMouse->SetCursorBitmap("MICON1"); | |
2598 GameUI_Footer_TimeLeft = 0; | |
2599 _50C9A0_IsEnchantingInProgress = 0; | |
2600 back_to_game(); | |
2601 continue; | |
2602 } | |
2603 ModalWindow_Release(); | |
2604 continue; | |
2605 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel | |
2606 if ( uMessageParam ) | |
2607 { | |
2608 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0); | |
2609 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2; | |
2610 if ( pParty->hirelingScrollPosition < v37 ) | |
2611 { | |
2612 ++pParty->hirelingScrollPosition;//??? maybe number of the first cell??? | |
2613 if ( pParty->hirelingScrollPosition >= v37 ) | |
2614 pParty->hirelingScrollPosition = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2; | |
2615 } | |
2616 } | |
2617 else | |
2618 { | |
2619 GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0); | |
2620 /*if ( pParty->field_709 ) | |
2621 { | |
2622 --pParty->field_709; | |
2623 if ( pParty->field_709 < 1 ) | |
2624 pParty->field_709 = 0; | |
2625 }*/ | |
2626 } | |
2627 GameUI_DrawHiredNPCs(); | |
2628 continue; | |
2629 case UIMSG_TransitionUI_Confirm: | |
2630 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2631 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2632 dword_50CDC8 = 1; | |
2633 sub_42FBDD(); | |
2634 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful); | |
2635 pVideoPlayer->Unload(); | |
2636 DialogueEnding(); | |
2124 | 2637 viewparams->bRedrawGameUI = true; |
1915 | 2638 if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz ) |
2639 { | |
2640 if ( dword_59117C_teleportx ) | |
2641 { | |
2642 pParty->vPosition.x = dword_59117C_teleportx; | |
2643 _5B65A8_npcdata_uflags_or_other = dword_59117C_teleportx; | |
2644 } | |
2645 if ( dword_591178_teleporty ) | |
2646 { | |
2647 pParty->vPosition.y = dword_591178_teleporty; | |
2648 _5B65AC_npcdata_fame_or_other = dword_591178_teleporty; | |
2649 } | |
2650 if ( dword_591174_teleportz ) | |
2651 { | |
2652 pParty->vPosition.z = dword_591174_teleportz; | |
2653 _5B65B0_npcdata_rep_or_other = dword_591174_teleportz; | |
2654 pParty->uFallStartY = dword_591174_teleportz; | |
2655 } | |
2656 if ( dword_591170_teleport_directiony ) | |
2657 { | |
2658 pParty->sRotationY = dword_591170_teleport_directiony; | |
2659 _5B65B4_npcdata_loword_house_or_other = dword_591170_teleport_directiony; | |
2660 } | |
2661 if ( dword_59116C_teleport_directionx ) | |
2662 { | |
2663 pParty->sRotationX = dword_59116C_teleport_directionx; | |
2664 _5B65B8_npcdata_hiword_house_or_other = dword_59116C_teleport_directionx; | |
2665 v38 = dword_591168_teleport_speedz; | |
2666 pParty->uFallSpeed = dword_591168_teleport_speedz; | |
2667 dword_5B65BC = dword_591168_teleport_speedz; | |
2668 } | |
2669 else | |
2670 v38 = dword_5B65BC; | |
2671 if ( *dword_591164_teleport_map_name != 48 ) | |
2672 { | |
2673 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2; | |
2674 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; | |
2675 OnMapLeave(); | |
2101 | 2676 Transition_StopSound_Autosave(dword_591164_teleport_map_name, MapStartPoint_Party); |
1915 | 2677 } |
2678 } | |
2679 else | |
2680 EventProcessor(dword_5C3418, 0, 1, dword_5C341C); | |
2681 if ( !_stricmp(byte_6BE3B0.data(), "d05.blv") ) | |
2682 pParty->uTimePlayed += 1474560i64; | |
2683 continue; | |
2684 case UIMSG_TransitionWindowCloseBtn: | |
2685 CloseWindowBackground(); | |
2686 pVideoPlayer->Unload(); | |
2687 DialogueEnding(); | |
2688 viewparams->bRedrawGameUI = true; | |
2689 continue; | |
2690 case UIMSG_CycleCharacters: | |
2691 v39 = GetAsyncKeyState(VK_SHIFT); | |
2692 uActiveCharacter = CycleCharacter(v39); | |
2693 viewparams->bRedrawGameUI = true; | |
2694 continue; | |
2695 case UIMSG_OnTravelByFoot: | |
2696 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2697 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2698 dword_50CDC8 = 1; | |
2699 sub_42FBDD(); | |
2700 //pNPCData4 = (NPCData *)GetTravelTime(); | |
2701 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); | |
2702 if ( bUnderwater != 1 && pParty->bFlying | |
2703 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) | |
2704 { | |
2705 viewparams->bRedrawGameUI = 1; | |
2706 CloseWindowBackground(); | |
2707 if ( pParty->vPosition.x < -22528 ) | |
2708 pParty->vPosition.x = -22528; | |
2709 if ( pParty->vPosition.x > 22528 ) | |
2710 pParty->vPosition.x = 22528; | |
2711 if ( pParty->vPosition.y < -22528 ) | |
2712 pParty->vPosition.y = -22528; | |
2713 if ( pParty->vPosition.y > 22528 ) | |
2714 pParty->vPosition.y = 22528; | |
2715 DialogueEnding(); | |
2716 pCurrentScreen = SCREEN_GAME; | |
2717 } | |
2718 else | |
2719 { | |
2720 pParty->field_6E4 = 0; | |
2721 pParty->field_6E0 = 0; | |
2722 CastSpellInfoHelpers::_427D48(); | |
2723 DialogueEnding(); | |
2724 pEventTimer->Pause(); | |
2725 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box); | |
2726 ++pGameLoadingUI_ProgressBar->uProgressMax; | |
2727 SaveGame(1, 0); | |
2728 pGameLoadingUI_ProgressBar->Progress(); | |
2729 RestAndHeal(1440 * (signed int)GetTravelTime()); | |
2730 if ( pParty->uNumFoodRations ) | |
2731 { | |
2732 pParty->RestAndHeal(); | |
2733 if ( ((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0 ) | |
2734 { | |
2735 pPlayer7 = pParty->pPlayers.data(); | |
2736 do | |
2737 { | |
2738 pPlayer7->SetCondition(1, 0); | |
2739 ++pPlayer7; | |
2740 } | |
2741 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings.data() ); | |
2742 ++pParty->days_played_without_rest; | |
2743 } | |
2744 Party::TakeFood((unsigned int)GetTravelTime()); | |
2745 } | |
2746 else | |
2747 { | |
2748 pPlayer8 = pParty->pPlayers.data(); | |
2749 do | |
2750 { | |
2751 pPlayer8->SetCondition(1, 0); | |
2752 ++pPlayer8; | |
2753 } | |
2754 while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings.data() ); | |
2755 ++pParty->days_played_without_rest; | |
2756 } | |
2757 pPaletteManager->ResetNonLocked(); | |
2758 pSpriteFrameTable->ResetSomeSpriteFlags(); | |
2759 strcpy(pCurrentMapName, pOut); | |
2760 strcpy(pLevelName, pCurrentMapName); | |
2761 v41 = strtok(pLevelName, "."); | |
2762 strcpy(pLevelName, v41); | |
2763 Level_LoadEvtAndStr(pLevelName); | |
2764 pDecalBuilder->Reset(0); | |
2765 LoadLevel_InitializeLevelEvt(); | |
2766 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName); | |
2767 bUnderwater = 0; | |
2768 bNoNPCHiring = 0; | |
2769 pGame->uFlags2 &= 0xFFFFFFF7u; | |
2770 if ( Is_out15odm_underwater() ) | |
2771 { | |
2772 bUnderwater = 1; | |
2773 pGame->uFlags2 |= 8u; | |
2774 } | |
2775 if ( !_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d47.blv") ) | |
2776 bNoNPCHiring = 1; | |
2777 PrepareToLoadODM(1u, (ODMRenderParams *)1); | |
2778 pAudioPlayer->SetMapEAX(); | |
2779 bDialogueUI_InitializeActor_NPC_ID = 0; | |
2780 OnMapLoad(); | |
2781 pOutdoor->SetFog(); | |
2782 TeleportToStartingPoint(uLevel_StartingPointType); | |
2783 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0); | |
2784 pParty->uFallStartY = pParty->vPosition.z; | |
2785 _461103_load_level_sub(); | |
2786 pEventTimer->Resume(); | |
2787 viewparams->bRedrawGameUI = 1; | |
2788 pCurrentScreen = SCREEN_GAME; | |
2789 pGameLoadingUI_ProgressBar->Release(); | |
2790 } | |
2791 viewparams->bRedrawGameUI = 1; | |
2792 continue; | |
2793 case UIMSG_CHANGE_LOCATION_ClickCencelBtn: | |
2794 CloseWindowBackground(); | |
2795 if ( pParty->vPosition.x < -22528 ) | |
2796 pParty->vPosition.x = -22528; | |
2797 if ( pParty->vPosition.x > 22528 ) | |
2798 pParty->vPosition.x = 22528; | |
2799 if ( pParty->vPosition.y < -22528 ) | |
2800 pParty->vPosition.y = -22528; | |
2801 if ( pParty->vPosition.y > 22528 ) | |
2802 pParty->vPosition.y = 22528; | |
2803 DialogueEnding(); | |
2804 pCurrentScreen = SCREEN_GAME; | |
2805 viewparams->bRedrawGameUI = 1; | |
2806 continue; | |
2807 case UIMSG_CastSpell_Telekinesis: | |
2153 | 2808 //if ( pRenderer->pRenderD3D ) |
1915 | 2809 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); |
2153 | 2810 /*else |
1915 | 2811 { |
2812 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210); | |
2813 pPoint = pMouse->GetCursorPos(&v208); | |
2814 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]]; | |
2153 | 2815 }*/ |
1915 | 2816 v44 = (unsigned __int16)v42; |
2817 v45 = PID_TYPE(v44); | |
2818 uNumSeconds = v44; | |
2819 v46 = PID_ID(v44); | |
2820 if ( v45 == 3 ) | |
2821 { | |
2822 v47 = pActors[v46].uAIState == Dead; | |
2823 if ( !v47 ) | |
2824 continue; | |
2825 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2826 pSpellInfo->uFlags &= ~0x40u; | |
2827 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2828 pSpellInfo->spell_target_pid = v44; | |
2829 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2830 pGUIWindow_Settings->Release(); | |
2831 pGUIWindow_Settings = 0; | |
2832 pMouse->SetCursorBitmap("MICON1"); | |
2833 GameUI_Footer_TimeLeft = 0; | |
2834 _50C9A0_IsEnchantingInProgress = 0; | |
2835 back_to_game(); | |
2836 continue; | |
2837 } | |
2838 if ( v45 == 2 ) | |
2839 { | |
2840 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; | |
2841 if ( !v47 ) | |
2842 continue; | |
2843 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2844 pSpellInfo->uFlags &= ~0x40u; | |
2845 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2846 pSpellInfo->spell_target_pid = v44; | |
2847 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2848 pGUIWindow_Settings->Release(); | |
2849 pGUIWindow_Settings = 0; | |
2850 pMouse->SetCursorBitmap("MICON1"); | |
2851 GameUI_Footer_TimeLeft = 0; | |
2852 _50C9A0_IsEnchantingInProgress = 0; | |
2853 back_to_game(); | |
2854 continue; | |
2855 } | |
2856 if ( v45 == 5 ) | |
2857 { | |
2858 v48 = pLevelDecorations[v46].uEventID == 0; | |
2859 } | |
2860 else | |
2861 { | |
2862 if ( v45 != 6 ) | |
2863 continue; | |
2864 if ( uCurrentlyLoadedLevelType != 1 ) | |
2865 { | |
2866 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; | |
2092 | 2867 if ( !pODMFace->Clickable() || !pODMFace->sCogTriggeredID ) |
1915 | 2868 continue; |
2869 v44 = uNumSeconds; | |
2870 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2871 pSpellInfo->uFlags &= ~0x40u; | |
2872 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2873 pSpellInfo->spell_target_pid = v44; | |
2874 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2875 pGUIWindow_Settings->Release(); | |
2876 pGUIWindow_Settings = 0; | |
2877 pMouse->SetCursorBitmap("MICON1"); | |
2878 GameUI_Footer_TimeLeft = 0; | |
2879 _50C9A0_IsEnchantingInProgress = 0; | |
2880 back_to_game(); | |
2881 continue; | |
2882 } | |
2883 pBLVFace = &pIndoor->pFaces[v46]; | |
2092 | 2884 if ( !pBLVFace->Clickable() ) |
1915 | 2885 continue; |
2886 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; | |
2887 } | |
2888 if ( v48 ) | |
2889 continue; | |
2890 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2891 pSpellInfo->uFlags &= ~0x40u; | |
2892 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2893 pSpellInfo->spell_target_pid = v44; | |
2894 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2895 pGUIWindow_Settings->Release(); | |
2896 pGUIWindow_Settings = 0; | |
2897 pMouse->SetCursorBitmap("MICON1"); | |
2898 GameUI_Footer_TimeLeft = 0; | |
2899 _50C9A0_IsEnchantingInProgress = 0; | |
2900 back_to_game(); | |
2901 continue; | |
2902 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade) | |
2903 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure | |
2904 case UIMSG_HiredNPC_CastSpell: | |
2905 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2906 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2907 if ( _50C9A0_IsEnchantingInProgress ) | |
2908 { | |
2909 uActiveCharacter = uMessageParam; | |
2910 viewparams->bRedrawGameUI = 1; | |
2911 } | |
2912 else | |
2913 { | |
2914 if ( pGUIWindow_Settings ) | |
2915 { | |
2916 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
2917 switch ( uMessage ) | |
2918 { | |
2919 case UIMSG_CastSpell_Character_Big_Improvement: | |
2920 pSpellInfo->uFlags &= ~0x02u; | |
2921 break; | |
2922 case UIMSG_CastSpell_Character_Small_Improvement: | |
2923 pSpellInfo->uFlags &= ~0x0100u; | |
2924 break; | |
2925 case UIMSG_HiredNPC_CastSpell: | |
2926 pSpellInfo->uFlags &= ~0x0200u; | |
2927 break; | |
2928 } | |
2929 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2930 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2931 pGUIWindow_Settings->Release(); | |
2932 pGUIWindow_Settings = 0; | |
2933 pEventTimer->Resume(); | |
2934 pMouse->SetCursorBitmap("MICON1"); | |
2935 GameUI_Footer_TimeLeft = 0; | |
2936 _50C9A0_IsEnchantingInProgress = 0; | |
2937 } | |
2938 } | |
2939 continue; | |
2940 case UIMSG_BF: | |
2941 __debugbreak(); | |
2942 dword_50CDC8 = 1; | |
2943 sub_42FBDD(); | |
2944 SaveGame(1, 0); | |
2945 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); | |
2061 | 2946 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 2947 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 2948 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; |
2949 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related; | |
2950 if ( v53 < 0 ) | |
2951 { | |
2952 v54 = abs(v53) - 1; | |
2953 _5B65B8_npcdata_hiword_house_or_other = 0; | |
2954 dword_5B65BC = 0; | |
2955 v55 = dword_4E4560[v54]; | |
2956 _5B65AC_npcdata_fame_or_other = dword_4E4578[v54]; | |
2957 v56 = dword_4E4590[v54]; | |
2958 v57 = dword_4E45A8[v54]; | |
2959 _5B65A8_npcdata_uflags_or_other = v55; | |
2960 _5B65B4_npcdata_loword_house_or_other = v57; | |
2961 _5B65B0_npcdata_rep_or_other = v56; | |
2962 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57; | |
2963 } | |
1919 | 2964 HouseDialogPressCloseBtn(); |
1915 | 2965 //goto LABEL_434; |
2966 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
2967 { | |
2968 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
2969 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; | |
2970 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2971 ++pMessageQueue_50CBD0->uNumMessages; | |
2972 }*/ | |
2973 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2974 continue; | |
2975 | |
2976 case UIMSG_OnCastTownPortal: | |
2977 pAudioPlayer->StopChannels(-1, -1); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
2978 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam); |
1915 | 2979 continue; |
2980 | |
2981 case UIMSG_OnCastLloydsBeacon: | |
2982 pAudioPlayer->StopChannels(-1, -1); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
2983 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Book, WINDOW_LloydsBeacon, 0); |
1915 | 2984 continue; |
2985 | |
2986 case UIMSG_LloydsBeacon_FlippingBtn: | |
2987 bRecallingBeacon = uMessageParam; | |
2988 v127 = uMessageParam + 204; | |
2989 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); | |
2990 continue; | |
2991 case UIMSG_HintBeaconSlot: | |
2992 if ( !pGUIWindow_CurrentMenu ) | |
2993 continue; | |
2994 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1]; | |
2995 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam]; | |
2996 if ( bRecallingBeacon ) | |
2997 { | |
2998 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) ) | |
2999 continue; | |
3000 v173 = pMapStats->pInfos[sub_410D99_get_map_index(pPlayer->pInstalledBeacons[uMessageParam].SaveFileID)].pName; | |
3001 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s" | |
3002 GameUI_SetFooterString(pTmpBuf.data()); | |
3003 continue; | |
3004 } | |
3005 pMapNum = pMapStats->GetMapInfo(pCurrentMapName); | |
3006 pMapName = "Not in Map Stats"; | |
3007 if ( pMapNum ) | |
3008 pMapName = pMapStats->pInfos[pMapNum].pName; | |
3009 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) || !pMapNum ) | |
3010 { | |
3011 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], pMapName);// "Set to %s" | |
3012 GameUI_SetFooterString(pTmpBuf.data()); | |
3013 continue; | |
3014 } | |
3015 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; | |
3016 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], (unsigned int)pMapName, v174);// "Set %s over %s" | |
3017 GameUI_SetFooterString(pTmpBuf.data()); | |
3018 continue; | |
3019 case UIMSG_CloseAfterInstallBeacon: | |
3020 dword_50CDC8 = 1; | |
3021 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
3022 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
3023 continue; | |
3024 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3025 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
3026 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3027 ++pMessageQueue_50CBD0->uNumMessages;*/ | |
3028 continue; | |
3029 case UIMSG_InstallBeacon: | |
3030 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; | |
3031 if ( !pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon ) | |
3032 continue; | |
3033 byte_506360 = 1; | |
3034 pPlayer9->CanCastSpell(uRequiredMana); | |
3035 if ( pParty->bTurnBasedModeOn ) | |
3036 { | |
3037 v60 = sRecoveryTime; | |
3038 pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime; | |
3039 pPlayer9->SetRecoveryTime(v60); | |
3040 pTurnEngine->ApplyPlayerAction(); | |
3041 } | |
3042 else | |
3043 { | |
3044 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
3045 } | |
2185 | 3046 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[lloyds_beacon_spell_id], 0, 0, -1, 0, lloyds_beacon_sound_id, 0, 0); |
1915 | 3047 if ( bRecallingBeacon ) |
3048 { | |
3049 if ( _stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) ) | |
3050 { | |
3051 SaveGame(1, 0); | |
3052 OnMapLeave(); | |
3053 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]); | |
2061 | 3054 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 3055 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 3056 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; |
3057 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; | |
3058 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; | |
3059 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; | |
3060 _5B65B8_npcdata_hiword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; | |
3061 dword_5B65C0 = 1; | |
3062 } | |
3063 else | |
3064 { | |
3065 pParty->vPosition.x = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; | |
3066 pParty->vPosition.y = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; | |
3067 pParty->vPosition.z = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; | |
3068 pParty->uFallStartY = pParty->vPosition.z; | |
3069 pParty->sRotationY = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; | |
3070 pParty->sRotationX = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; | |
3071 } | |
3072 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
3073 pBooksWindow->Release(); | |
3074 pGUIWindow_CurrentMenu->Release(); | |
3075 pBooksWindow = 0; | |
3076 pGUIWindow_CurrentMenu = 0; | |
3077 } | |
3078 else | |
3079 { | |
3080 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1); | |
2154 | 3081 pRenderer->SaveScreenshot(a1, 92, 68); |
1915 | 3082 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1); |
2185 | 3083 pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(lloyds_beacon_spell_level << 7) * 0.033333335); |
1915 | 3084 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x; |
3085 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y; | |
3086 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z; | |
3087 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X = LOWORD(pParty->sRotationY); | |
3088 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y = LOWORD(pParty->sRotationX); | |
3089 if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 ) | |
3090 continue; | |
3091 for ( thisg = 0; thisg < (signed int)pGames_LOD->uNumSubDirs / 2; ++thisg ) | |
3092 { | |
3093 if ( !_stricmp((const char *)pGames_LOD->pSubIndices[thisg].pFilename, pCurrentMapName) ) | |
3094 pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID = thisg; | |
3095 } | |
3096 } | |
3097 continue; | |
3098 case UIMSG_ClickTownInTP: | |
3099 if ( uMessageParam ) | |
3100 { | |
3101 switch ( uMessageParam ) | |
3102 { | |
3103 case 1: | |
3104 v63 = 208; | |
3105 break; | |
3106 case 2: | |
3107 v63 = 207; | |
3108 break; | |
3109 case 3: | |
3110 v63 = 211; | |
3111 break; | |
3112 case 4: | |
3113 v63 = 209; | |
3114 break; | |
3115 default: | |
3116 if ( uMessageParam != 5 ) | |
3117 { | |
3118 LABEL_486: | |
3119 SaveGame(1, 0); | |
3120 v64 = pMapStats->GetMapInfo(pCurrentMapName); | |
3121 v65 = uMessageParam; | |
3122 if ( v64 == TownPortalList[uMessageParam].uMapInfoID ) | |
3123 { | |
3124 pParty->vPosition.x = TownPortalList[v65].pos.x; | |
3125 pParty->vPosition.y = TownPortalList[v65].pos.y; | |
3126 pParty->vPosition.z = TownPortalList[v65].pos.z; | |
3127 pParty->uFallStartY = pParty->vPosition.z; | |
3128 pParty->sRotationY = TownPortalList[v65].rot_y; | |
3129 pParty->sRotationX = TownPortalList[v65].rot_x; | |
3130 } | |
3131 else | |
3132 { | |
3133 SaveGame(1, 0); | |
3134 OnMapLeave(); | |
2061 | 3135 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 3136 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 3137 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename); |
3138 dword_5B65C0 = 1; | |
3139 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x; | |
3140 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y; | |
3141 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z; | |
3142 v66 = TownPortalList[uMessageParam].rot_x; | |
3143 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y; | |
3144 _5B65B8_npcdata_hiword_house_or_other = v66; | |
3145 InitializeActors(); | |
3146 } | |
3147 v67 = (char*)pGUIWindow_CurrentMenu->Hint; | |
3148 if ( v67 ) | |
3149 *((int *)v67 + 17) = 1; | |
3150 else | |
3151 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u); | |
3152 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
3153 { | |
3154 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3155 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; | |
3156 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3157 ++pMessageQueue_50CBD0->uNumMessages; | |
3158 }*/ | |
3159 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
3160 continue; | |
3161 } | |
3162 v63 = 210; | |
3163 break; | |
3164 } | |
3165 } | |
3166 else | |
3167 { | |
3168 v63 = 206; | |
3169 } | |
3170 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63) ) | |
3171 return; | |
3172 goto LABEL_486; | |
3173 case UIMSG_HintTownPortal: | |
3174 if ( uMessageParam ) | |
3175 { | |
3176 switch ( uMessageParam ) | |
3177 { | |
3178 case 1: | |
3179 v68 = 208; | |
3180 break; | |
3181 case 2: | |
3182 v68 = 207; | |
3183 break; | |
3184 case 3: | |
3185 v68 = 211; | |
3186 break; | |
3187 case 4: | |
3188 v68 = 209; | |
3189 break; | |
3190 default: | |
3191 if ( uMessageParam != 5 ) | |
3192 //goto LABEL_506; | |
3193 { | |
3194 if ( uMessageParam ) | |
3195 { | |
3196 switch ( uMessageParam ) | |
3197 { | |
3198 case 1: | |
3199 v69 = pMapStats->pInfos[4].pName; | |
3200 break; | |
3201 case 2: | |
3202 v69 = pMapStats->pInfos[3].pName; | |
3203 break; | |
3204 case 3: | |
3205 v69 = pMapStats->pInfos[10].pName; | |
3206 break; | |
3207 case 4: | |
3208 v69 = pMapStats->pInfos[7].pName; | |
3209 break; | |
3210 default: | |
3211 if ( uMessageParam != 5 ) | |
3212 { | |
3213 __debugbreak(); // warning C4700: uninitialized local variable 'v200' used | |
3214 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); | |
3215 GameUI_SetFooterString(pTmpBuf.data()); | |
3216 continue; | |
3217 } | |
3218 v69 = pMapStats->pInfos[8].pName; | |
3219 break; | |
3220 } | |
3221 } | |
3222 else | |
3223 { | |
3224 v69 = pMapStats->pInfos[21].pName; | |
3225 } | |
3226 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69); | |
3227 GameUI_SetFooterString(pTmpBuf.data()); | |
3228 continue; | |
3229 } | |
3230 v68 = 210; | |
3231 break; | |
3232 } | |
3233 } | |
3234 else | |
3235 { | |
3236 v68 = 206; | |
3237 } | |
3238 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v68) ) | |
3239 { | |
3240 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); | |
3241 continue; | |
3242 } | |
3243 //LABEL_506: | |
3244 if ( uMessageParam ) | |
3245 { | |
3246 switch ( uMessageParam ) | |
3247 { | |
3248 case 1: | |
3249 v69 = pMapStats->pInfos[4].pName; | |
3250 break; | |
3251 case 2: | |
3252 v69 = pMapStats->pInfos[3].pName; | |
3253 break; | |
3254 case 3: | |
3255 v69 = pMapStats->pInfos[10].pName; | |
3256 break; | |
3257 case 4: | |
3258 v69 = pMapStats->pInfos[7].pName; | |
3259 break; | |
3260 default: | |
3261 if ( uMessageParam != 5 ) | |
3262 //goto LABEL_519; | |
3263 { | |
3264 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); | |
3265 GameUI_SetFooterString(pTmpBuf.data()); | |
3266 continue; | |
3267 } | |
3268 v69 = pMapStats->pInfos[8].pName; | |
3269 break; | |
3270 } | |
3271 } | |
3272 else | |
3273 { | |
3274 v69 = pMapStats->pInfos[21].pName; | |
3275 } | |
3276 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69); | |
3277 GameUI_SetFooterString(pTmpBuf.data()); | |
3278 continue; | |
3279 case UIMSG_ShowFinalWindow: | |
3280 sprintfex(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." | |
3281 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." | |
3282 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." | |
3283 ModalWindow(pFinalMessage.data(), UIMSG_OnFinalWindowClose); | |
3284 uGameState = GAME_STATE_FINAL_WINDOW; | |
3285 continue; | |
3286 case UIMSG_OnFinalWindowClose: | |
3287 __debugbreak(); | |
3288 uGameState = GAME_STATE_PLAYING; | |
3289 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); | |
3290 __debugbreak(); // missed break/continue? | |
3291 case UIMSG_DD: | |
3292 __debugbreak(); | |
3293 sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer); | |
3294 memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); | |
3295 if ( v216.uPropCount == 1 ) | |
3296 { | |
3297 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2); | |
3298 v70 = atoi(v216.pProperties[0]); | |
3299 if ( v70 <= 0 || v70 >= 77 ) | |
3300 continue; | |
3301 v71 = v70; | |
3302 strcpy(Str2, pMapStats->pInfos[v70].pFilename); | |
3303 pNPCData3 = 0; | |
3304 if ( (signed int)pNPCData4 > 0 ) | |
3305 { | |
3306 thish = 0; | |
3307 do | |
3308 { | |
3309 if ( !_stricmp((const char *)&pGames_LOD->pSubIndices[thish], Str2) ) | |
3310 break; | |
3311 ++thish; | |
3312 pNPCData3 = (NPCData *)((char *)pNPCData3 + 1); | |
3313 } | |
3314 while ( (signed int)pNPCData3 < (signed int)pNPCData4 ); | |
3315 if ( (signed int)pNPCData3 < (signed int)pNPCData4 ) | |
3316 { | |
3317 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); | |
2061 | 3318 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
2124 | 3319 uGameState = GAME_STATE_CHANGE_LOCATION; |
1915 | 3320 OnMapLeave(); |
3321 continue; | |
3322 } | |
3323 } | |
3324 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName); | |
3325 v73 = Str2; | |
3326 } | |
3327 else | |
3328 { | |
3329 if ( v216.uPropCount != 3 ) | |
3330 continue; | |
3331 v74 = atoi(v216.pProperties[0]); | |
3332 thisi = atoi(v216.pProperties[1]); | |
3333 v75 = atoi(v216.pProperties[2]); | |
3334 v76 = v75; | |
3335 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
3336 { | |
3337 if ( pIndoor->GetSector(v74, thisi, v75) ) | |
3338 { | |
3339 v77 = thisi; | |
3340 pParty->vPosition.x = v74; | |
3341 pParty->vPosition.y = v77; | |
3342 pParty->vPosition.z = v76; | |
3343 pParty->uFallStartY = v76; | |
3344 continue; | |
3345 } | |
3346 } | |
3347 else | |
3348 { | |
3349 if ( v74 > -32768 ) | |
3350 { | |
3351 if ( v74 < 32768 ) | |
3352 { | |
3353 v77 = thisi; | |
3354 if ( thisi > -32768 ) | |
3355 { | |
3356 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 ) | |
3357 { | |
3358 pParty->vPosition.x = v74; | |
3359 pParty->vPosition.y = v77; | |
3360 pParty->vPosition.z = v76; | |
3361 pParty->uFallStartY = v76; | |
3362 continue; | |
3363 } | |
3364 } | |
3365 } | |
3366 } | |
3367 } | |
3368 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); | |
3369 v73 = "Can't jump to that location!"; | |
3370 } | |
3371 ShowStatusBarString(v73, 6u); | |
3372 continue; | |
3373 case UIMSG_CastQuickSpell: | |
3374 if ( bUnderwater == 1 ) | |
3375 { | |
3376 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" | |
3377 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3378 continue; | |
3379 } | |
3380 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) | |
3381 continue; | |
3382 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); | |
3383 continue; | |
3384 case UIMSG_CastSpell_Monster_Improvement: | |
3385 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm, | |
2154 | 3386 //if ( pRenderer->pRenderD3D ) |
1915 | 3387 { |
3388 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
3389 } | |
2154 | 3390 /*else |
1915 | 3391 { |
3392 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206); | |
3393 pPoint2 = pMouse->GetCursorPos(&v201); | |
3394 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]]; | |
2154 | 3395 }*/ |
1915 | 3396 v83 = v81; |
3397 v44 = (unsigned __int16)v81; | |
3398 v84 = v83 >> 16; | |
3399 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) | |
3400 continue; | |
3401 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
3402 if ( uMessage == UIMSG_CastSpell_Shoot_Monster ) | |
3403 { | |
3404 pSpellInfo->uFlags &= ~0x08; | |
3405 } | |
3406 else | |
3407 { | |
3408 if ( uMessage == UIMSG_CastSpell_Monster_Improvement ) | |
3409 pSpellInfo->uFlags &= ~0x0100u; | |
3410 else | |
3411 pSpellInfo->uFlags &= ~0x0200u; | |
3412 } | |
3413 pSpellInfo->uPlayerID_2 = uMessageParam; | |
3414 pSpellInfo->spell_target_pid = v44; | |
3415 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
3416 pGUIWindow_Settings->Release(); | |
3417 pGUIWindow_Settings = 0; | |
3418 pMouse->SetCursorBitmap("MICON1"); | |
3419 GameUI_Footer_TimeLeft = 0; | |
3420 _50C9A0_IsEnchantingInProgress = 0; | |
3421 back_to_game(); | |
3422 continue; | |
3423 case UIMSG_1C: | |
3424 __debugbreak(); | |
3425 if ( !uActiveCharacter || pCurrentScreen ) | |
3426 continue; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
3427 ptr_507BC8 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_68, uMessageParam, 0); |
1915 | 3428 pCurrentScreen = SCREEN_19; |
3429 pEventTimer->Pause(); | |
3430 continue; | |
3431 case UIMSG_STEALFROMACTOR: | |
3432 if ( !uActiveCharacter ) | |
3433 continue; | |
3434 if ( pParty->bTurnBasedModeOn != 1 ) | |
3435 { | |
3436 if ( pActors[uMessageParam].uAIState == 5 ) | |
1966
7840fe323f67
stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents:
1936
diff
changeset
|
3437 pActors[uMessageParam].LootActor(); |
1915 | 3438 else |
3439 Actor::StealFrom(uMessageParam); | |
3440 continue; | |
3441 } | |
3442 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3 ) | |
3443 continue; | |
3444 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) ) | |
3445 { | |
3446 if ( pActors[uMessageParam].uAIState == 5 ) | |
1966
7840fe323f67
stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents:
1936
diff
changeset
|
3447 pActors[uMessageParam].LootActor(); |
1915 | 3448 else |
3449 Actor::StealFrom(uMessageParam); | |
3450 } | |
3451 continue; | |
3452 | |
3453 case UIMSG_Attack: | |
3454 if ( !uActiveCharacter ) | |
3455 continue; | |
3456 if ( pParty->bTurnBasedModeOn != 1 ) | |
3457 { | |
3458 _42ECB5_PlayerAttacksActor(); | |
3459 continue; | |
3460 } | |
3461 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3 ) | |
3462 continue; | |
3463 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) ) | |
3464 _42ECB5_PlayerAttacksActor(); | |
3465 continue; | |
3466 case UIMSG_ExitRest: | |
3467 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" | |
3468 continue; | |
3469 case UIMSG_Wait5Minutes: | |
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_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2, | |
3477 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" | |
3478 dword_506F14 = 1; | |
3479 _506F18_num_minutes_to_sleep = 5; | |
3480 continue; | |
3481 case UIMSG_Wait1Hour: | |
3482 if ( dword_506F14 == 2 ) | |
3483 { | |
3484 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3485 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3486 continue; | |
3487 } | |
3488 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2, | |
3489 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" | |
3490 dword_506F14 = 1; | |
3491 _506F18_num_minutes_to_sleep = 60; | |
3492 continue; | |
3493 case UIMSG_RentRoom: | |
3494 dword_506F14 = 2; | |
3495 RestUI_Load(); | |
3496 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute; | |
3497 _506F18_num_minutes_to_sleep = v86; | |
3498 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 ) // 107 = Emerald Isle tavern | |
3499 _506F18_num_minutes_to_sleep = v86 + 12 * 60; | |
3500 dword_506F14 = 2; | |
3501 pParty->RestAndHeal(); | |
3502 pParty->days_played_without_rest = 0; | |
3503 pParty->pPlayers[3].SetAsleep(1); | |
3504 pParty->pPlayers[2].SetAsleep(1); | |
3505 pParty->pPlayers[1].SetAsleep(1); | |
3506 pParty->pPlayers[0].SetAsleep(1); | |
3507 continue; | |
3508 case UIMSG_RestWindow: | |
3509 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3510 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3511 if ( pCurrentScreen ) | |
3512 continue; | |
1936 | 3513 if ( CheckActors_proximity() ) |
1915 | 3514 { |
3515 if ( pParty->bTurnBasedModeOn == 1 ) | |
3516 { | |
3517 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
3518 continue; | |
3519 } | |
3520 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" | |
3521 if ( pParty->uFlags & 0x88 ) | |
3522 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | |
3523 ShowStatusBarString(v88, 2); | |
3524 if ( !uActiveCharacter ) | |
3525 continue; | |
3526 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); | |
3527 continue; | |
3528 } | |
3529 if ( pParty->bTurnBasedModeOn == 1 ) | |
3530 { | |
3531 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
3532 continue; | |
3533 } | |
3534 if ( !(pParty->uFlags & 0x88) ) | |
3535 { | |
3536 RestUI_Load(); | |
3537 continue; | |
3538 } | |
3539 if ( pParty->bTurnBasedModeOn == 1 ) | |
3540 { | |
3541 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
3542 continue; | |
3543 } | |
3544 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" | |
3545 if ( pParty->uFlags & 0x88 ) | |
3546 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | |
3547 ShowStatusBarString(v88, 2u); | |
3548 if ( !uActiveCharacter ) | |
3549 continue; | |
3550 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); | |
3551 continue; | |
3552 case UIMSG_Rest8Hour: | |
3553 if ( dword_506F14 ) | |
3554 { | |
3555 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3556 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3557 continue; | |
3558 } | |
3559 if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest ) | |
3560 { | |
3561 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest" | |
3562 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() ) | |
3563 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_108, 0); | |
3564 } | |
3565 else | |
3566 { | |
2185 | 3567 pParty->pPlayers[3].pConditions[Condition_Sleep] = pParty->uTimePlayed; |
3568 pParty->pPlayers[2].pConditions[Condition_Sleep] = pParty->uTimePlayed; | |
3569 pParty->pPlayers[1].pConditions[Condition_Sleep] = pParty->uTimePlayed; | |
3570 pParty->pPlayers[0].pConditions[Condition_Sleep] = pParty->uTimePlayed; | |
1915 | 3571 v90 = pMapStats->GetMapInfo(pCurrentMapName); |
3572 if ( !v90 ) | |
3573 v90 = rand() % (signed int)pMapStats->uNumMaps + 1; | |
3574 pMapInfo = &pMapStats->pInfos[v90]; | |
3575 if ( rand() % 100 + 1 <= pMapInfo->Encounter_percent ) | |
3576 { | |
3577 v91 = rand() % 100; | |
3578 v92 = pMapInfo->EncM1percent; | |
3579 v93 = v91 + 1; | |
3580 if ( v93 > v92 ) | |
3581 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2); | |
3582 else | |
3583 pNPCData4 = (NPCData *)1; | |
3584 if ( !_45063B_spawn_some_monster(pMapInfo, (int)pNPCData4) ) | |
3585 pNPCData4 = 0; | |
3586 if ( pNPCData4 ) | |
3587 { | |
3588 pPlayerNum = rand() % 4; | |
2185 | 3589 pParty->pPlayers[pPlayerNum].pConditions[Condition_Sleep] = 0; |
1915 | 3590 v95 = rand(); |
3591 Rest(v95 % 6 + 60); | |
3592 _506F18_num_minutes_to_sleep = 0; | |
3593 dword_506F14 = 0; | |
3594 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
3595 { | |
3596 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3597 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
3598 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3599 ++pMessageQueue_50CBD0->uNumMessages; | |
3600 }*/ | |
3601 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
3602 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!" | |
3603 pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0); | |
3604 continue; | |
3605 } | |
3606 } | |
3607 Party::TakeFood(uRestUI_FoodRequiredToRest); | |
3608 _506F18_num_minutes_to_sleep = 480; | |
3609 dword_506F14 = 2; | |
3610 pParty->RestAndHeal(); | |
3611 pParty->days_played_without_rest = 0; | |
3612 pParty->pPlayers[3].SetAsleep(1); | |
3613 pParty->pPlayers[2].SetAsleep(1); | |
3614 pParty->pPlayers[1].SetAsleep(1); | |
3615 pParty->pPlayers[0].SetAsleep(1); | |
3616 } | |
3617 continue; | |
3618 case UIMSG_AlreadyResting: | |
3619 if ( dword_506F14 == 2 ) | |
3620 { | |
3621 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
3622 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3623 continue; | |
3624 } | |
3625 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2, | |
3626 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" | |
3627 v97 = _494820_training_time(pParty->uCurrentHour); | |
3628 dword_506F14 = 1; | |
3629 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute; | |
3630 continue; | |
3631 case UIMSG_HintSelectRemoveQuickSpellBtn: | |
3632 if ( quick_spell_at_page && byte_506550 ) | |
3633 { | |
3634 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName; | |
3635 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173); | |
3636 } | |
3637 else | |
3638 { | |
3639 if ( pPlayers[uActiveCharacter]->uQuickSpell ) | |
3640 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell" | |
3641 else | |
3642 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell" | |
3643 strcpy(pTmpBuf.data(), v177); | |
3644 } | |
3645 GameUI_SetFooterString(pTmpBuf.data()); | |
3646 continue; | |
3647 case UIMSG_SPellbook_ShowHightlightedSpellInfo: | |
3648 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter], | |
3649 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) ) | |
3650 continue; | |
3651 if ( sub_4637E0_is_there_popup_onscreen() ) | |
3652 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1; | |
3653 v98 = *(char *)(uNumSeconds + 6734); | |
3654 if ( quick_spell_at_page - 1 == uMessageParam ) | |
3655 { | |
3656 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | |
3657 v161 = pGlobalTXT_LocalizationStrings[485]; | |
3658 } | |
3659 else | |
3660 { | |
3661 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | |
3662 v161 = pGlobalTXT_LocalizationStrings[486]; | |
3663 } | |
3664 sprintfex(pTmpBuf.data(), v161, v178); | |
3665 GameUI_SetFooterString(pTmpBuf.data()); | |
3666 continue; | |
3667 case UIMSG_ClickInstallRemoveQuickSpellBtn: | |
3668 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); | |
3669 if ( !uActiveCharacter ) | |
3670 continue; | |
3671 pPlayer10 = pPlayers[uActiveCharacter]; | |
3672 if ( !byte_506550 || !quick_spell_at_page ) | |
3673 { | |
3674 pPlayer10->uQuickSpell = 0; | |
3675 quick_spell_at_page = 0; | |
3676 pAudioPlayer->PlaySound((SoundID)203, 0, 0, -1, 0, 0, 0, 0); | |
3677 continue; | |
3678 } | |
2184 | 3679 pPlayers[uActiveCharacter]->uQuickSpell = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage; |
3680 AA1058_PartyQuickSpellSound[uActiveCharacter - 1].AddPartySpellSound(pPlayers[uActiveCharacter]->uQuickSpell, uActiveCharacter); | |
1915 | 3681 if ( uActiveCharacter ) |
3682 pPlayer10->PlaySound(SPEECH_12, 0); | |
3683 byte_506550 = 0; | |
3684 continue; | |
2197 | 3685 case UIMSG_SpellBook_PressTab://ïåðåëèñòûâàíèå ñòðàíèö êëàâèøåé Tab |
2198 | 3686 { |
1915 | 3687 if ( !uActiveCharacter ) |
3688 continue; | |
2198 | 3689 int skill_count = 0; |
1915 | 3690 uAction = 0; |
2197 | 3691 for ( uint i = 0; i < 9; i++ ) |
1915 | 3692 { |
2197 | 3693 if ( pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_FIRE + i] ) |
1915 | 3694 { |
2197 | 3695 if ( pPlayers[uActiveCharacter]->lastOpenedSpellbookPage == i ) |
2198 | 3696 uAction = skill_count; |
3697 v217[skill_count++] = i; | |
1915 | 3698 } |
3699 } | |
2198 | 3700 if ( !skill_count )//íåò ñêèëëîâ |
3701 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0); | |
1915 | 3702 else |
3703 { | |
2198 | 3704 if ( GetAsyncKeyState(16) ) |
3705 { | |
3706 --uAction; | |
3707 if ( uAction < 0 ) | |
3708 uAction = skill_count - 1; | |
3709 } | |
3710 else | |
3711 { | |
3712 ++uAction; | |
3713 if ( uAction >= skill_count ) | |
3714 uAction = 0; | |
3715 } | |
3716 OnCloseSpellBookPage(); | |
3717 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]); | |
3718 pGUIWindow_CurrentMenu->OpenSpellBook(); | |
3719 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0); | |
1915 | 3720 } |
3721 continue; | |
2198 | 3722 } |
1915 | 3723 case UIMSG_OpenSpellbookPage: |
3724 if ( pTurnEngine->turn_stage == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage ) | |
3725 continue; | |
3726 OnCloseSpellBookPage(); | |
3727 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam; | |
3728 pGUIWindow_CurrentMenu->OpenSpellBook(); | |
2198 | 3729 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0); |
1915 | 3730 continue; |
3731 case UIMSG_SelectSpell: | |
3732 { | |
3733 if (pTurnEngine->turn_stage == 3) | |
3734 continue; | |
3735 if (!uActiveCharacter) | |
3736 continue; | |
3737 | |
3738 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter]; | |
1980 | 3739 Player* player = pPlayers[uActiveCharacter]; |
1915 | 3740 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam]) |
3741 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) ) | |
3742 { | |
3743 if ( quick_spell_at_page - 1 == uMessageParam ) | |
3744 { | |
3745 pGUIWindow_CurrentMenu->Release(); | |
3746 pEventTimer->Resume(); | |
3747 viewparams->bRedrawGameUI = 1; | |
3748 pCurrentScreen = SCREEN_GAME; | |
3749 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
3750 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage; | |
3751 /*if ( dword_50C9E8 < 40 ) | |
3752 { | |
3753 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook; | |
3754 dword_50C9EC[3 * dword_50C9E8 + 1] = v103; | |
3755 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1; | |
3756 ++dword_50C9E8; | |
3757 }*/ | |
3758 pMessageQueue_50C9E8->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); | |
3759 // pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); | |
3760 } | |
3761 else | |
3762 { | |
3763 byte_506550 = 1; | |
3764 quick_spell_at_page = uMessageParam + 1; | |
3765 } | |
3766 } | |
3767 } | |
3768 continue; | |
3769 | |
3770 case UIMSG_CastSpellFromBook: | |
3771 if ( pTurnEngine->turn_stage != 3 ) | |
3772 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); | |
3773 continue; | |
3774 | |
3775 case UIMSG_SpellScrollUse: | |
3776 __debugbreak(); | |
3777 if ( pTurnEngine->turn_stage != 3 ) | |
3778 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0); | |
3779 continue; | |
3780 case UIMSG_SpellBookWindow: | |
3781 if ( pTurnEngine->turn_stage == 3 ) | |
3782 continue; | |
2186 | 3783 if ( bUnderwater == true ) |
1915 | 3784 { |
3785 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" | |
3786 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
3787 } | |
3788 else | |
3789 { | |
3790 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3791 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3792 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery ) | |
3793 { | |
2186 | 3794 if ( pCurrentScreen == SCREEN_GAME ) |
1915 | 3795 { |
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 } | |
2186 | 3804 if ( pCurrentScreen != SCREEN_REST && pCurrentScreen != SCREEN_CHARACTERS |
3805 && (pCurrentScreen <= SCREEN_63 || pCurrentScreen > SCREEN_67) ) | |
1915 | 3806 { |
3807 pGUIWindow_CurrentMenu->Release(); | |
2186 | 3808 GUIWindow::Create(476, 450, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); |
1915 | 3809 pCurrentScreen = SCREEN_SPELL_BOOK; |
3810 pEventTimer->Pause(); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
3811 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0); |
1915 | 3812 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); |
3813 viewparams->field_48 = 1; | |
3814 continue; | |
3815 } | |
3816 } | |
3817 } | |
3818 continue; | |
3819 case UIMSG_QuickReference: | |
3820 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3821 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3822 if ( pCurrentScreen ) | |
3823 pGUIWindow_CurrentMenu->Release(); | |
3824 ++pIcons_LOD->uTexturePacksCount; | |
3825 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
3826 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
3827 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0); | |
3828 viewparams->bRedrawGameUI = 1; | |
3829 pEventTimer->Pause(); | |
3830 pAudioPlayer->StopChannels(-1, -1); | |
3831 pCurrentScreen = SCREEN_QUICK_REFERENCE; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
3832 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_QuickReference, 5, 0); |
1915 | 3833 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); |
3834 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0, | |
3835 pGlobalTXT_LocalizationStrings[79],// "Exit" | |
3836 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179); | |
3837 continue; | |
3838 case UIMSG_GameMenuButton: | |
3839 if ( pCurrentScreen ) | |
3840 { | |
3841 pGUIWindow_CurrentMenu->Release(); | |
3842 pEventTimer->Resume(); | |
3843 pCurrentScreen = SCREEN_GAME; | |
3844 viewparams->bRedrawGameUI = 1; | |
3845 } | |
2154 | 3846 |
1915 | 3847 stru_506E40.Release(); |
2154 | 3848 pRenderer->SaveScreenshot("gamma.pcx", 155, 117); |
2131 | 3849 stru_506E40.LoadPCXFile("gamma.pcx", 0); |
2154 | 3850 |
1915 | 3851 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0); |
3852 //LABEL_453: | |
3853 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
3854 continue; | |
3855 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3856 //goto LABEL_770; | |
3857 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
3858 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3859 ++pMessageQueue_50CBD0->uNumMessages;*/ | |
3860 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
3861 continue; | |
3862 case UIMSG_ClickAwardScrollBar: | |
3863 books_page_number = 1; | |
3864 if ( pMouse->GetCursorPos(&v211)->y > 178 ) | |
3865 books_page_number = -1; | |
3866 continue; | |
3867 case UIMSG_ClickAwardsUpBtn: | |
3868 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0); | |
3869 BtnUp_flag = 1; | |
3870 continue; | |
3871 case UIMSG_ClickAwardsDownBtn: | |
3872 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0); | |
3873 BtnDown_flag = 1; | |
3874 continue; | |
3875 case UIMSG_ChangeDetaliz: | |
3876 bRingsShownInCharScreen ^= 1; | |
3877 pCharacterScreen_DetalizBtn->Release(); | |
3878 pCharacterScreen_DollBtn->Release(); | |
3879 if ( bRingsShownInCharScreen ) | |
3880 { | |
3881 v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight; | |
3882 v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth; | |
3883 v123 = 445; | |
3884 v121 = 470; | |
3885 } | |
3886 else | |
3887 { | |
3888 v128 = 30; | |
3889 v125 = 30; | |
3890 v123 = 300; | |
3891 v121 = 600; | |
3892 } | |
3893 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0, | |
3894 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle" | |
3895 0); | |
3896 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); | |
3897 viewparams->bRedrawGameUI = 1; | |
3898 continue; | |
3899 case UIMSG_ClickPaperdoll: | |
3900 OnPaperdollLeftClick(); | |
3901 continue; | |
3902 case UIMSG_ClickStatsBtn: | |
3903 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; | |
3904 CharacterUI_ReleaseButtons(); | |
3905 ReleaseAwardsScrollBar(); | |
3906 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0); | |
3907 continue; | |
3908 case UIMSG_ClickSkillsBtn: | |
3909 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; | |
3910 CharacterUI_ReleaseButtons(); | |
3911 ReleaseAwardsScrollBar(); | |
3912 CharacterUI_SkillsTab_CreateButtons(); | |
3913 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0); | |
3914 continue; | |
3915 case UIMSG_SkillUp: | |
3916 pPlayer4 = pPlayers[uActiveCharacter]; | |
3917 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; | |
3918 LOWORD(v2) = *(short *)v105; | |
3919 uNumSeconds = v2; | |
3920 if ( pPlayer4->uSkillPoints < (v2 & 0x3F) + 1 ) | |
3921 { | |
3922 v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!" | |
3923 } | |
3924 else | |
3925 { | |
3926 if ( (uNumSeconds & 0x3F) < 0x3C ) | |
3927 { | |
3928 *(short *)v105 = uNumSeconds + 1; | |
3929 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F; | |
3930 pPlayer4->PlaySound(SPEECH_14, 0); | |
3931 pAudioPlayer->PlaySound((SoundID)20001, 0, 0, -1, 0, 0, 0, 0); | |
3932 continue; | |
3933 } | |
3934 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!" | |
3935 } | |
3936 ShowStatusBarString(v87, 2); | |
3937 continue; | |
3938 case UIMSG_ClickInventoryBtn: | |
3939 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
3940 ReleaseAwardsScrollBar(); | |
3941 CharacterUI_ReleaseButtons(); | |
3942 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0); | |
3943 continue; | |
3944 case UIMSG_ClickExitCharacterWindowBtn: | |
3945 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0); | |
3946 continue; | |
3947 case UIMSG_ClickAwardsBtn: | |
3948 ReleaseAwardsScrollBar(); | |
3949 CharacterUI_ReleaseButtons(); | |
3950 CreateAwardsScrollBar(); | |
3951 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; | |
3952 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0); | |
3953 FillAwardsData(); | |
3954 continue; | |
3955 case UIMSG_ClickBooksBtn: | |
3956 switch ( uMessageParam ) | |
3957 { | |
3958 case 11://Page UP | |
3959 BtnUp_flag = 1; | |
3960 pButton = pBtn_Book_2; | |
3961 break; | |
3962 case 10://Page DOWN | |
3963 BtnDown_flag = 1; | |
3964 pButton = pBtn_Book_1; | |
3965 break; | |
3966 case 0://Zoom plus | |
3967 pButton = pBtn_Book_1; | |
3968 BtnDown_flag = 1; | |
3969 break; | |
3970 case 1://Zoom minus | |
3971 pButton = pBtn_Book_2; | |
3972 BtnUp_flag = 1; | |
3973 break; | |
3974 case 2://Potions | |
3975 Book_PageBtn3_flag = 1; | |
3976 if ( dword_506364 ) | |
3977 continue; | |
3978 pButton = pBtn_Book_3; | |
3979 break; | |
3980 case 3://fountains | |
3981 Book_PageBtn4_flag = 1; | |
3982 if ( dword_506364 ) | |
3983 continue; | |
3984 pButton = pBtn_Book_4; | |
3985 break; | |
3986 case 4://obelisks | |
3987 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag | |
3988 if ( dword_506364 ) | |
3989 continue; | |
3990 pButton = pBtn_Book_5; | |
3991 break; | |
3992 case 5://seer | |
3993 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag | |
3994 if ( dword_506364 ) | |
3995 continue; | |
3996 pButton = pBtn_Book_6; | |
3997 break; | |
3998 case 6://misc | |
3999 pButton = pBtn_Autonotes_Misc; | |
4000 Autonotes_Misc_page_flag = 1; | |
4001 break; | |
4002 case 7://Instructors | |
4003 pButton = pBtn_Autonotes_Instructors; | |
4004 Autonotes_Instructors_page_flag = 1; | |
4005 break; | |
4006 default: | |
4007 continue; | |
4008 } | |
4009 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); | |
4010 continue; | |
4011 case UIMSG_SelectCharacter: | |
4012 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4013 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4014 GameUI_OnPlayerPortraitLeftClick(uMessageParam); | |
4015 continue; | |
4016 case UIMSG_ShowStatus_Funds: | |
4017 v174 = (char *)pParty->uNumGoldInBank; | |
4018 //v158 = pParty->uNumGold + pParty->uNumGoldInBank; | |
4019 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], pParty->uNumGold + pParty->uNumGoldInBank, v174);// "You have %d total gold, %d in the Bank" | |
4020 GameUI_SetFooterString(pTmpBuf.data()); | |
4021 continue; | |
4022 case UIMSG_ShowStatus_DateTime: | |
4023 pNPCData4 = (NPCData *)pParty->uCurrentHour; | |
4024 if ( (signed int)pParty->uCurrentHour <= 12 ) | |
4025 { | |
4026 if ( !pNPCData4 ) | |
4027 pNPCData4 = (NPCData *)12; | |
4028 } | |
4029 else | |
4030 { | |
4031 pNPCData4 = (NPCData *)((char *)pNPCData4 - 12); | |
4032 } | |
4033 if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) ) | |
4034 uNumSeconds = 0; | |
4035 sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7], | |
4036 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear); | |
4037 GameUI_SetFooterString(pTmpBuf.data()); | |
4038 continue; | |
4039 case UIMSG_ShowStatus_Food: | |
4040 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food" | |
4041 GameUI_SetFooterString(pTmpBuf.data()); | |
4042 continue; | |
4043 case UIMSG_ShowStatus_Player: | |
4044 pPlayer5 = pPlayers[uMessageParam]; | |
4045 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s" | |
4046 strcat(pTmpBuf.data(), ": "); | |
4047 v107 = pPlayer5->GetMajorConditionIdx(); | |
4048 strcat(pTmpBuf.data(), aCharacterConditionNames[v107]); | |
4049 GameUI_SetFooterString(pTmpBuf.data()); | |
4050 v108 = 8 * uMessageParam - 8; | |
4051 LOBYTE(v108) = v108 | 4; | |
4052 pMouse->uPointingObjectID = PID(OBJECT_Player,v108); | |
4053 continue; | |
4054 case UIMSG_ShowStatus_ManaHP: | |
4055 sprintf(pTmpBuf.data(), "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(), | |
4056 pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(), | |
4057 pGlobalTXT_LocalizationStrings[212]); | |
4058 GameUI_SetFooterString(pTmpBuf.data()); | |
4059 continue; | |
4060 case UIMSG_CHEST_ClickItem: | |
4061 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) | |
4062 { | |
4063 pPlayers[uActiveCharacter]->OnInventoryLeftClick(); | |
4064 continue; | |
4065 } | |
4066 OnChestLeftClick(); | |
4067 continue; | |
4068 case UIMSG_InventoryLeftClick: | |
4069 pPlayers[uActiveCharacter]->OnInventoryLeftClick(); | |
4070 continue; | |
4071 case UIMSG_MouseLeftClickInGame: | |
2154 | 4072 /*if ( !pRenderer->pRenderD3D ) |
1915 | 4073 { |
4074 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4075 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4076 OnGameViewportClick(); | |
4077 continue; | |
2154 | 4078 }*/ |
1915 | 4079 v115 = pMessageQueue_50CBD0->uNumMessages; |
4080 if ( !pMessageQueue_50CBD0->uNumMessages ) | |
4081 { | |
4082 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); | |
4083 /*if ( (signed int)v115 < 40 ) | |
4084 //goto LABEL_769; | |
4085 { | |
4086 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; | |
4087 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
4088 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4089 ++pMessageQueue_50CBD0->uNumMessages; | |
4090 continue; | |
4091 }*/ | |
4092 continue; | |
4093 } | |
4094 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) | |
4095 { | |
4096 pMessageQueue_50CBD0->uNumMessages = 1; | |
4097 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); | |
4098 /*v115 = v0; | |
4099 pMessageQueue_50CBD0->uNumMessages = v0; | |
4100 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; | |
4101 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
4102 //goto LABEL_771; | |
4103 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4104 ++pMessageQueue_50CBD0->uNumMessages;*/ | |
4105 continue; | |
4106 } | |
4107 v115 = 0; | |
4108 pMessageQueue_50CBD0->uNumMessages = 0; | |
4109 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); | |
4110 /*if ( (signed int)v115 < 40 ) | |
4111 //goto LABEL_769; | |
4112 { | |
4113 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; | |
4114 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
4115 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4116 ++pMessageQueue_50CBD0->uNumMessages; | |
4117 continue; | |
4118 }*/ | |
4119 continue; | |
4120 case UIMSG_MouseLeftClickInScreen://ñðàáàòûâàåò ïðè íàæàòèè íà ïðàâóþ êíîïêó ìûøè ïîñëå UIMSG_MouseLeftClickInGame | |
4121 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4122 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4123 OnGameViewportClick(); | |
4124 continue; | |
4125 case UIMSG_F: | |
4126 __debugbreak(); | |
2154 | 4127 //if ( pRenderer->pRenderD3D ) |
1915 | 4128 { |
4129 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
4130 } | |
2154 | 4131 /*else |
1915 | 4132 { |
4133 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209); | |
4134 pPoint3 = pMouse->GetCursorPos(&v204); | |
4135 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; | |
2154 | 4136 }*/ |
1915 | 4137 pButton2 = (GUIButton *)(unsigned __int16)v116; |
4138 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); | |
4139 continue; | |
4140 case UIMSG_54: | |
4141 __debugbreak(); | |
4142 pButton2 = (GUIButton *)uMessageParam; | |
4143 GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0); | |
4144 continue; | |
4145 case UIMSG_Game_Action: | |
4146 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4147 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4148 OnPressSpace(); | |
4149 continue; | |
4150 case UIMSG_ClickZoomOutBtn: | |
4151 if ( pCurrentScreen ) | |
4152 continue; | |
4153 pParty->uFlags |= 2u; | |
4154 GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0); | |
4155 uNumSeconds = 131072; | |
4156 v118 = 2 * viewparams->uMinimapZoom; | |
4157 ++viewparams->field_28; | |
4158 viewparams->uMinimapZoom *= 2; | |
4159 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) | |
4160 { | |
4161 if ( (signed int)v118 > 4096 ) | |
4162 { | |
4163 viewparams->uMinimapZoom = 4096; | |
4164 viewparams->field_28 = 12; | |
4165 } | |
4166 continue; | |
4167 } | |
4168 v119 = 2048; | |
4169 if ( (signed int)v118 <= 2048 ) | |
4170 { | |
4171 _576E2C_current_minimap_zoom = v118; | |
4172 dword_576E28 = viewparams->field_28; | |
4173 break; | |
4174 } | |
4175 viewparams->field_28 = 11; | |
4176 viewparams->uMinimapZoom = v119; | |
4177 _576E2C_current_minimap_zoom = v119; | |
4178 dword_576E28 = viewparams->field_28; | |
4179 break; | |
4180 case UIMSG_ClickZoomInBtn: | |
4181 if ( pCurrentScreen ) | |
4182 continue; | |
4183 pParty->uFlags |= 2u; | |
4184 GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0); | |
4185 uNumSeconds = 32768; | |
4186 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | |
4187 --viewparams->field_28; | |
4188 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | |
4189 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4190 { | |
4191 v119 = 512; | |
4192 if ( (signed int)v118 < 512 ) | |
4193 { | |
4194 viewparams->field_28 = 9; | |
4195 v118 = v119; | |
4196 viewparams->uMinimapZoom = v119; | |
4197 } | |
4198 _576E2C_current_minimap_zoom = v118; | |
4199 dword_576E28 = viewparams->field_28; | |
4200 } | |
4201 else | |
4202 { | |
4203 if ( (signed int)v118 < 256 ) | |
4204 { | |
4205 viewparams->uMinimapZoom = 256; | |
4206 viewparams->field_28 = 8; | |
4207 } | |
4208 } | |
4209 default: | |
4210 continue; | |
4211 } | |
4212 } | |
4213 } | |
4214 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8; | |
4215 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages); | |
4216 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8); | |
4217 //dword_50C9E8 = 0; | |
4218 | |
4219 | |
4220 pMessageQueue_50C9E8->uNumMessages=0; | |
4221 if ( dword_50C9DC ) | |
4222 { | |
4223 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4224 { | |
4225 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC; | |
4226 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0; | |
4227 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4228 ++pMessageQueue_50CBD0->uNumMessages; | |
4229 }*/ | |
4230 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0); | |
4231 dword_50C9DC = 0; | |
4232 } | |
4233 else | |
4234 { | |
4235 if ( _50C9D0_AfterEnchClickEventId > 0 ) | |
4236 { | |
4237 _50C9D8_AfterEnchClickEventTimeout -= pEventTimer->uTimeElapsed; | |
4238 if ( _50C9D8_AfterEnchClickEventTimeout <= 0 ) | |
4239 { | |
4240 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4241 { | |
4242 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0; | |
4243 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4; | |
4244 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4245 ++pMessageQueue_50CBD0->uNumMessages; | |
4246 }*/ | |
4247 pMessageQueue_50CBD0->AddMessage((UIMessageType)_50C9D0_AfterEnchClickEventId, _50C9D4_AfterEnchClickEventSecondParam, 0); | |
4248 _50C9D0_AfterEnchClickEventId = 0; | |
4249 _50C9D4_AfterEnchClickEventSecondParam = 0; | |
4250 _50C9D8_AfterEnchClickEventTimeout = 0; | |
4251 } | |
4252 } | |
4253 } | |
4254 CastSpellInfoHelpers::_427E01_cast_spell(); | |
4255 } | |
4256 //----- (00435748) -------------------------------------------------------- | |
4257 void GUI_MainMenuMessageProc() | |
4258 { | |
4259 Player *pPlayer; // ebx@2 | |
4260 void *v3; // edi@21 | |
4261 signed int v4; // eax@29 | |
4262 int v5; // ecx@29 | |
4263 PLAYER_SKILL_TYPE v6; // edi@37 | |
4264 GUIWindow *pWindow; // eax@56 | |
4265 GUIButton *pButton; // eax@59 | |
4266 int v15; // edi@70 | |
4267 char v20; // dl@116 | |
4268 unsigned int v21; // eax@116 | |
4269 unsigned int v25; // eax@120 | |
4270 unsigned int v26; // ecx@127 | |
4271 SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36 | |
4272 signed int v41; // [sp-10h] [bp-20h]@29 | |
4273 int pParam; // [sp+4h] [bp-Ch]@3 | |
4274 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 | |
4275 int pSex; // [sp+Ch] [bp-4h]@3 | |
4276 | |
4277 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4278 { | |
4279 pPlayer = pParty->pPlayers.data(); | |
4280 do | |
4281 { | |
4282 int param2; | |
4283 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, ¶m2); | |
1916 | 4284 //auto player = &pParty->pPlayers[pParam]; |
1915 | 4285 |
4286 switch (pUIMessageType) // For buttons of window MainMenu | |
4287 { | |
4288 case UIMSG_MainMenu_ShowPartyCreationWnd: | |
4289 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); | |
4290 SetCurrentMenuID(MENU_NEWGAME); | |
4291 break; | |
4292 case UIMSG_MainMenu_ShowLoadWindow: | |
4293 GUIWindow::Create(495, 227, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnLoad, 0); | |
4294 SetCurrentMenuID(MENU_SAVELOAD); | |
4295 break; | |
4296 case UIMSG_ShowCredits: | |
4297 GUIWindow::Create(495, 282, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnCredits, 0); | |
4298 SetCurrentMenuID(MENU_CREDITS); | |
4299 break; | |
4300 case UIMSG_ExitToWindows: | |
4301 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); | |
4302 SetCurrentMenuID(MENU_EXIT_GAME); | |
4303 break; | |
4304 case UIMSG_PlayerCreation_SelectAttribute: | |
4305 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | |
4306 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
4307 uPlayerCreationUI_SelectedCharacter = pParam; | |
4308 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
4309 break; | |
4310 case UIMSG_PlayerCreation_VoicePrev: | |
1916 | 4311 pSex = pParty->pPlayers[pParam].GetSexByVoice(); |
1915 | 4312 do |
4313 { | |
1916 | 4314 if (pParty->pPlayers[pParam].uVoiceID == 0) |
4315 pParty->pPlayers[pParam].uVoiceID = 19; | |
4316 else --pParty->pPlayers[pParam].uVoiceID; | |
1915 | 4317 } |
1916 | 4318 while (pParty->pPlayers[pParam].GetSexByVoice() != pSex); |
1915 | 4319 pButton = pCreationUI_BtnPressLeft2[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_VoiceNext: | |
1916 | 4325 pSex = pParty->pPlayers[pParam].GetSexByVoice(); |
1915 | 4326 do |
4327 { | |
1916 | 4328 pParty->pPlayers[pParam].uVoiceID = (pParty->pPlayers[pParam].uVoiceID + 1) % 20; |
1915 | 4329 } |
1916 | 4330 while (pParty->pPlayers[pParam].GetSexByVoice() != pSex); |
1915 | 4331 pButton = pCreationUI_BtnPressRight2[pParam]; |
4332 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); | |
4333 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
1916 | 4334 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4335 break; |
4336 case UIMSG_PlayerCreation_FacePrev: | |
1916 | 4337 //pPlayer = &pParty->pPlayers[pParam]; |
4338 if (!pParty->pPlayers[pParam].uCurrentFace) | |
4339 pParty->pPlayers[pParam].uCurrentFace = 19; | |
1915 | 4340 else |
1916 | 4341 pParty->pPlayers[pParam].uCurrentFace -= 1; |
4342 pParty->pPlayers[pParam].uVoiceID = pParty->pPlayers[pParam].uCurrentFace; | |
4343 pParty->pPlayers[pParam].SetInitialStats(); | |
4344 pParty->pPlayers[pParam].SetSexByVoice(); | |
4345 pParty->pPlayers[pParam].RandomizeName(); | |
1915 | 4346 v25 = pParam; |
4347 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | |
4348 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
4349 uPlayerCreationUI_SelectedCharacter = v25; | |
4350 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], (char *)1); | |
4351 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); | |
1916 | 4352 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4353 break; |
4354 case UIMSG_PlayerCreation_FaceNext: | |
1916 | 4355 //pPlayer = &pParty->pPlayers[pParam]; |
4356 v20 = (char)((int)pParty->pPlayers[pParam].uCurrentFace + 1) % 20; | |
4357 pParty->pPlayers[pParam].uCurrentFace = v20; | |
4358 pParty->pPlayers[pParam].uVoiceID = v20; | |
4359 pParty->pPlayers[pParam].SetInitialStats(); | |
4360 pParty->pPlayers[pParam].SetSexByVoice(); | |
4361 pParty->pPlayers[pParam].RandomizeName(); | |
1915 | 4362 v21 = pParam; |
4363 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | |
4364 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
4365 uPlayerCreationUI_SelectedCharacter = v21; | |
4366 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], (char *)1); | |
4367 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
1916 | 4368 pParty->pPlayers[pParam].PlaySound(SPEECH_PickMe, 0); |
1915 | 4369 break; |
4370 case UIMSG_PlayerCreationClickPlus: | |
4371 GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, (char *)1); | |
4372 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | |
4373 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); | |
4374 break; | |
4375 case UIMSG_PlayerCreationClickMinus: | |
4376 GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, (char *)1); | |
4377 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | |
4378 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); | |
4379 break; | |
4380 case UIMSG_PlayerCreationSelectActiveSkill: | |
4381 if ( pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(3) == 37 ) | |
4382 pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pParam + 4)] = 1; | |
4383 pAudioPlayer->PlaySound(SOUND_24, 0, 0, -1, 0, 0, 0, 0); | |
4384 break; | |
4385 case UIMSG_PlayerCreationSelectClass: | |
4386 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam); | |
4387 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
4388 break; | |
4389 case UIMSG_PlayerCreationClickOK: | |
4390 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0); | |
4391 if ( PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Choose4Skills() ) | |
4392 GameUI_Footer_TimeLeft = GetTickCount() + 4000; | |
4393 else | |
4394 uGameState = GAME_STATE_STARTING_NEW_GAME; | |
4395 break; | |
4396 case UIMSG_PlayerCreationClickReset: | |
4397 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0); | |
4398 pParty->Reset(); | |
4399 break; | |
4400 case UIMSG_PlayerCreationRemoveUpSkill: | |
4401 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
4402 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
|
4403 if ( pPlayer[pParam].GetSkillIdxByOrder(2) != 37 )//37 - None(Íåò) |
18b0ff5e1bf1
pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents:
2101
diff
changeset
|
4404 pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(2)] = 0; |
1915 | 4405 break; |
4406 case UIMSG_PlayerCreationRemoveDownSkill: | |
4407 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
4408 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; | |
2110
18b0ff5e1bf1
pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents:
2101
diff
changeset
|
4409 if ( pPlayer[pParam].GetSkillIdxByOrder(3) != 37 )//37 - None(Íåò) |
18b0ff5e1bf1
pSounds[20] error and GetSkillIdxByOrder(2) != 37 //37 - None(Ðет)
Ritor1
parents:
2101
diff
changeset
|
4410 pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(3)] = 0; |
1915 | 4411 break; |
4412 case UIMSG_PlayerCreationChangeName: | |
4413 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
4414 v3 = (void *)pParam; | |
4415 uPlayerCreationUI_SelectedCharacter = pParam; | |
4416 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); | |
4417 pGUIWindow_CurrentMenu->ptr_1C = v3; | |
4418 break; | |
4419 case UIMSG_ChangeGameState: | |
4420 uGameState = GAME_FINISHED; | |
4421 break; | |
4422 case UIMSG_ChangeCursor: | |
4423 pMouse->SetCursorBitmap("MICON2"); | |
4424 break; | |
4425 case UIMSG_3A: | |
4426 SetCurrentMenuID(MENU_DebugBLVLevel); | |
4427 break; | |
4428 case UIMSG_LoadGame: | |
4429 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) | |
4430 break; | |
4431 SetCurrentMenuID(MENU_LoadingProcInMainMenu); | |
4432 break; | |
4433 case UIMSG_SelectLoadSlot: | |
4434 //main menu save/load wnd clicking on savegame lines | |
4435 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
4436 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
4437 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pParam + pSaveListPosition ) | |
4438 { | |
4439 //load clicked line | |
4440 v26 = pParam + pSaveListPosition; | |
4441 if ( dword_6BE138 == pParam + pSaveListPosition ) | |
4442 { | |
4443 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0); | |
4444 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); | |
4445 } | |
4446 uLoadGameUI_SelectedSlot = v26; | |
4447 dword_6BE138 = v26; | |
4448 } | |
4449 else | |
4450 { | |
4451 //typing in the line | |
4452 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); | |
4453 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); | |
4454 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); | |
4455 } | |
4456 break; | |
4457 case UIMSG_SaveLoadBtn: | |
4458 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); | |
4459 break; | |
4460 case UIMSG_DownArrow: | |
4461 ++pSaveListPosition; | |
4462 if ( pSaveListPosition >= pParam ) | |
4463 pSaveListPosition = pParam - 1; | |
4464 if ( pSaveListPosition < 1 ) | |
4465 pSaveListPosition = 0; | |
4466 pWindow = pGUIWindow_CurrentMenu; | |
4467 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); | |
4468 break; | |
4469 case UIMSG_Cancel: | |
4470 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0); | |
4471 break; | |
4472 case UIMSG_ArrowUp: | |
4473 --pSaveListPosition; | |
4474 if ( pSaveListPosition < 0 ) | |
4475 pSaveListPosition = 0; | |
4476 pWindow = pGUIWindow_CurrentMenu; | |
4477 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_PressedButton2, (int)pBtnArrowUp, 0); | |
4478 break; | |
4479 case UIMSG_AD: | |
4480 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); | |
4481 SetCurrentMenuID(MENU_LoadingProcInMainMenu); | |
4482 break; | |
4483 case UIMSG_AE: | |
4484 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); | |
4485 SetCurrentMenuID(MENU_DebugBLVLevel); | |
4486 break; | |
4487 case UIMSG_Escape: | |
4488 if ( pModalWindow ) | |
4489 { | |
4490 ModalWindow_Release(); | |
4491 break; | |
4492 } | |
2061 | 4493 if ( !(dword_6BE364_game_settings_1 & GAME_SETTINGS_4000)) |
1915 | 4494 break; |
4495 v15 = 1; | |
4496 pVideoPlayer->bStopBeforeSchedule = 1; | |
4497 viewparams->bRedrawGameUI = 1; | |
4498 viewparams->field_48 = 1; | |
4499 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC ) | |
4500 { | |
2137
d24ee391fd1f
libavcodec playing movies and houses, loops not working yet
zipi
parents:
2132
diff
changeset
|
4501 //if ( pCurrentScreen == SCREEN_VIDEO ) |
d24ee391fd1f
libavcodec playing movies and houses, loops not working yet
zipi
parents:
2132
diff
changeset
|
4502 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); |
1915 | 4503 if (GetCurrentMenuID() == MENU_NAMEPANELESC) |
4504 { | |
4505 SetCurrentMenuID(MENU_CREATEPARTY); | |
4506 break; | |
4507 } | |
4508 if (GetCurrentMenuID() == MENU_CREDITSPROC) | |
4509 { | |
4510 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
4511 break; | |
4512 } | |
4513 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | |
4514 break; | |
4515 } | |
4516 if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen ) | |
4517 { | |
2142
ca548138d6aa
some code cleaning in video playing, loops play but there is a memory leak
zipi
parents:
2137
diff
changeset
|
4518 //if ( pCurrentScreen == SCREEN_VIDEO ) |
ca548138d6aa
some code cleaning in video playing, loops play but there is a memory leak
zipi
parents:
2137
diff
changeset
|
4519 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); |
1915 | 4520 if (GetCurrentMenuID() == MENU_NAMEPANELESC) |
4521 { | |
4522 SetCurrentMenuID(MENU_CREATEPARTY); | |
4523 break; | |
4524 } | |
4525 if (GetCurrentMenuID() == MENU_CREDITSPROC) | |
4526 { | |
4527 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
4528 break; | |
4529 } | |
4530 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | |
4531 break; | |
4532 } | |
4533 if ( pCurrentScreen == SCREEN_LOADGAME ) | |
4534 { | |
4535 pIcons_LOD->RemoveTexturesPackFromTextureList(); | |
4536 //crt_deconstruct_ptr_6A0118(); | |
4537 pTexture_PCX.Release(); | |
4538 pTexture_PCX.Load("title.pcx", 0); | |
4539 SetCurrentMenuID(MENU_MAIN); | |
4540 v15 = 1; | |
4541 pGUIWindow_CurrentMenu->Release(); | |
4542 pGUIWindow2->Release(); | |
4543 pGUIWindow2 = 0; | |
4544 pEventTimer->Resume(); | |
4545 pCurrentScreen = SCREEN_GAME; | |
4546 viewparams->bRedrawGameUI = v15; | |
4547 break; | |
4548 } | |
4549 if ( pCurrentScreen == SCREEN_VIDEO ) | |
4550 { | |
4551 pVideoPlayer->Unload(); | |
4552 } | |
4553 else | |
4554 { | |
4555 if ( pCurrentScreen != SCREEN_1B ) | |
4556 { | |
4557 pGUIWindow_CurrentMenu->Release(); | |
4558 pGUIWindow2->Release(); | |
4559 pGUIWindow2 = 0; | |
4560 pEventTimer->Resume(); | |
4561 pCurrentScreen = SCREEN_GAME; | |
4562 viewparams->bRedrawGameUI = v15; | |
4563 break; | |
4564 } | |
4565 //VideoPlayer::dtor(); | |
4566 } | |
4567 break; | |
4568 default: | |
4569 break; | |
4570 } | |
4571 } | |
4572 while ( pMessageQueue_50CBD0->uNumMessages ); | |
4573 } | |
0 | 4574 } |