| 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 | { |
nothing calls this directly
no test coverage detected