MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / OpenRecentMenu

Function OpenRecentMenu

Source/GUI/dimgui/dimgui.cpp:1573–1593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1571}
1572
1573static void OpenRecentMenu() {
1574 if (ImGui::BeginMenu("Open Recent")) {
1575 for (int i = 0; i < kMaxLevelHistory; ++i) {
1576 const int kBufSize = 128;
1577 char buf[kBufSize];
1578 FormatString(buf, kBufSize, "level_history%d", i + 1);
1579 if (config.HasKey(buf) && config[buf].str() != "") {
1580 if (ImGui::MenuItem(config[buf].str().c_str())) {
1581 if (FileExists(config[buf].str(), kAnyPath)) {
1582 LevelInfoAssetRef levelinfo = Engine::Instance()->GetAssetManager()->LoadSync<LevelInfoAsset>(config[buf].str());
1583 Path p = FindFilePath(config[buf].str(), kAnyPath);
1584 Engine::Instance()->QueueState(EngineState(levelinfo->GetName(), kEngineEditorLevelState, p));
1585 } else {
1586 LOGE << "Level missing: " << config[buf].str() << std::endl;
1587 }
1588 }
1589 }
1590 }
1591 ImGui::EndMenu();
1592 }
1593}
1594
1595static bool TreeScenegraphElementVisible(Object* obj, Object* root, char* buf) {
1596 const int kBufSize = 512;

Callers 1

DrawImGuiFunction · 0.85

Calls 11

FormatStringFunction · 0.85
FileExistsFunction · 0.85
FindFilePathFunction · 0.85
EngineStateClass · 0.85
HasKeyMethod · 0.80
GetAssetManagerMethod · 0.80
QueueStateMethod · 0.80
MenuItemClass · 0.50
strMethod · 0.45
c_strMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected