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

Method RenderLoadSaveMenu

TombEngine/Renderer/RendererDrawMenu.cpp:661–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659 }
660
661 void Renderer::RenderLoadSaveMenu()
662 {
663 if (!g_GameFlow->IsLoadSaveEnabled())
664 {
665 g_Gui.SetInventoryMode(InventoryMode::InGame);
666 return;
667 }
668
669 // Setup needed parameters
670 int y = MenuVerticalLineSpacing;
671 short selection = g_Gui.GetLoadSaveSelection();
672 char stringBuffer[255];
673 auto plainColor = g_GameFlow->GetSettings()->UI.PlainTextColor;
674
675 // Title
676 AddString(MenuCenterEntry, MenuVerticalNarrowLineSpacing, Str_LoadSave(g_Gui.GetInventoryMode() == InventoryMode::Save),
677 g_GameFlow->GetSettings()->UI.HeaderTextColor, SF_Center());
678 GetNextBlockPosition(&y);
679
680 // Savegame listing
681 for (int n = 0; n < SAVEGAME_MAX; n++)
682 {
683 auto& save = SaveGame::Infos[n];
684
685 if (!save.Present)
686 {
687 AddString(MenuCenterEntry, y, g_GameFlow->GetString(STRING_EMPTY), plainColor, SF_Center(selection == n));
688 }
689 else
690 {
691 // Number
692 sprintf(stringBuffer, "%03d", save.Count);
693 AddString(MenuLoadNumberLeftSide, y, stringBuffer, plainColor, SF(selection == n));
694
695 // Level name
696 AddString(MenuLoadNameLeftSide, y, (char*)save.LevelName.c_str(), plainColor, SF(selection == n));
697
698 // Timestamp
699 sprintf(stringBuffer, g_GameFlow->GetString(STRING_SAVEGAME_TIMESTAMP), save.Hours, save.Minutes, save.Seconds);
700 AddString(MenuLoadTimestampRightSide, y, stringBuffer, plainColor, SF(selection == n));
701 }
702
703 GetNextLinePosition(&y);
704 }
705
706 DrawAllStrings();
707 }
708
709 void Renderer::DrawStatistics()
710 {

Callers

nothing calls this directly

Calls 13

Str_LoadSaveFunction · 0.85
SF_CenterFunction · 0.85
GetNextBlockPositionFunction · 0.85
sprintfFunction · 0.85
SFFunction · 0.85
GetNextLinePositionFunction · 0.85
IsLoadSaveEnabledMethod · 0.80
SetInventoryModeMethod · 0.80
GetLoadSaveSelectionMethod · 0.80
GetSettingsMethod · 0.80
GetInventoryModeMethod · 0.80
GetStringMethod · 0.80

Tested by

no test coverage detected