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