| 1571 | } |
| 1572 | |
| 1573 | static 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 | |
| 1595 | static bool TreeScenegraphElementVisible(Object* obj, Object* root, char* buf) { |
| 1596 | const int kBufSize = 512; |
no test coverage detected