MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / CallInventory

Method CallInventory

TombEngine/Game/gui.cpp:3238–3380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3236 }
3237
3238 bool GuiController::CallInventory(ItemInfo* item, bool resetMode)
3239 {
3240 auto& player = GetLaraInfo(*item);
3241
3242 bool doLoad = false;
3243
3244 player.Inventory.OldBusy = player.Inventory.IsBusy;
3245
3246 g_Renderer.DumpGameScene(SceneRenderMode::NoHud);
3247 g_VideoPlayer.Pause();
3248 PauseAllSounds(SoundPauseMode::Inventory);
3249 SoundEffect(SFX_TR4_MENU_SELECT, nullptr, SoundEnvironment::Always);
3250
3251 if (resetMode)
3252 SetInventoryMode(InventoryMode::InGame);
3253
3254 InitializeInventory(item);
3255
3256 g_Synchronizer.Init();
3257
3258 bool legacy30FpsDoneDraw = false;
3259 bool exitLoop = false;
3260
3261 while (!exitLoop)
3262 {
3263 if (ThreadEnded)
3264 {
3265 App.ResetClock = true;
3266 return false;
3267 }
3268
3269 g_Synchronizer.Sync();
3270
3271 while (g_Synchronizer.Synced())
3272 {
3273 TimeInMenu++;
3274 GlobalCounter++;
3275 SaveGame::Statistics.Game.TimeTaken++;
3276 SaveGame::Statistics.Level.TimeTaken++;
3277
3278 UpdateInputActions();
3279
3280 if (GuiIsDeselected() || IsClicked(In::Inventory))
3281 exitLoop = true;
3282
3283 g_Renderer.PrepareScene();
3284
3285 switch (InvMode)
3286 {
3287 case InventoryMode::InGame:
3288 if (exitLoop)
3289 SoundEffect(SFX_TR4_MENU_SELECT, nullptr, SoundEnvironment::Always);
3290
3291 DoInventory(item);
3292 break;
3293
3294 case InventoryMode::Statistics:
3295 exitLoop = !resetMode;

Callers 1

HandleMenuCallsFunction · 0.80

Calls 15

PauseAllSoundsFunction · 0.85
SoundEffectFunction · 0.85
UpdateInputActionsFunction · 0.85
IsClickedFunction · 0.85
NoActionFunction · 0.85
UseItemFunction · 0.85
AlterFOVFunction · 0.85
ResumeAllSoundsFunction · 0.85
DumpGameSceneMethod · 0.80
PauseMethod · 0.80
SyncMethod · 0.80
SyncedMethod · 0.80

Tested by

no test coverage detected