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