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