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