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