MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / menu

Function menu

TheForceEngine/TFE_Editor/LevelEditor/levelEditor.cpp:1743–1976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1741 }
1742
1743 bool menu()
1744 {
1745 bool menuActive = false;
1746 if (ImGui::BeginMenu("Level"))
1747 {
1748 menuActive = true;
1749 if (ImGui::MenuItem("Help / Manual", NULL, (bool*)NULL))
1750 {
1751 // TODO - replace with TFE editor link.
1752 osShellOpenUrl("https://df-21.net/wiki/?title=TFE-EDITOR");
1753 }
1754 ImGui::Separator();
1755
1756 // Disable Save/Backup when there is no project.
1757 bool projectActive = project_get()->active;
1758 if (!projectActive) { disableNextItem(); }
1759 {
1760 if (ImGui::MenuItem("New", NULL, (bool*)NULL))
1761 {
1762 setPopupEndCallback(edit_newLevel);
1763 openEditorPopup(POPUP_NEW_LEVEL);
1764 }
1765 if (ImGui::MenuItem("Import", NULL, (bool*)NULL))
1766 {
1767
1768 }
1769 }
1770 if (!projectActive) { enableNextItem(); }
1771 if (ImGui::MenuItem("Open", NULL, (bool*)NULL))
1772 {
1773 setPopupEndCallback(edit_openLevel);
1774 openEditorPopup(TFE_Editor::POPUP_BROWSE, TYPE_LEVEL, nullptr);
1775
1776 // No project - Open Vanilla / Resources
1777 // Project - Prefer to open Project maps.
1778 }
1779
1780 ImGui::Separator();
1781
1782 if (!projectActive) { disableNextItem(); }
1783 {
1784 if (ImGui::MenuItem("Save", getShortcutKeyComboText(SHORTCUT_SAVE), (bool*)NULL))
1785 {
1786 saveLevel();
1787 }
1788 if (ImGui::MenuItem("Reload", getShortcutKeyComboText(SHORTCUT_RELOAD), (bool*)NULL))
1789 {
1790 openEditorPopup(POPUP_RELOAD_CONFIRM);
1791 }
1792 if (ImGui::MenuItem("Snapshots", nullptr, (bool*)NULL))
1793 {
1794 openEditorPopup(POPUP_SNAPSHOTS);
1795 }
1796 }
1797 if (!projectActive) { enableNextItem(); }
1798
1799 if (ImGui::MenuItem("Close", NULL, (bool*)NULL))
1800 {

Callers

nothing calls this directly

Calls 15

osShellOpenUrlFunction · 0.85
project_getFunction · 0.85
disableNextItemFunction · 0.85
setPopupEndCallbackFunction · 0.85
openEditorPopupFunction · 0.85
enableNextItemFunction · 0.85
getShortcutKeyComboTextFunction · 0.85
saveLevelFunction · 0.85
levelIsDirtyFunction · 0.85
editor_closeLevelFunction · 0.85
levHistory_undoFunction · 0.85
levHistory_redoFunction · 0.85

Tested by

no test coverage detected