MCPcopy Create free account
hub / github.com/MrDrElliot/LuminaEngine / SubmitToolMainWindow

Method SubmitToolMainWindow

Engine/Editor/Source/UI/EditorUI.cpp:1494–1591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1492 bool SessionKeyHasPrefix(const FString& Key, const char* Prefix)
1493 {
1494 return Key.Find(Prefix) == 0;
1495 }
1496
1497 // The menu label after its icon glyph, which is what a caller can type.
1498 FStringView ToolPanelName(FStringView Label)
1499 {
1500 const int32 Space = Label.Find(" ");
1501 return Space == Constants::kIndexNone ? Label : Label.Mid(Space + 1);
1502 }
1503
1504 constexpr FEditorUI::FToolPanel GDebugToolPanels[] =
1505 {
1506 FEditorUI::MakeToolPanel<FAssetRegistryEditorTool>(LE_ICON_DATABASE " Asset Registry"),
1507 FEditorUI::MakeToolPanel<FProfilerEditorTool>(LE_ICON_CHART_BAR " Profiler"),
1508 FEditorUI::MakeToolPanel<FShadowAtlasEditorTool>(LE_ICON_GRID " Shadow Atlas"),
1509 FEditorUI::MakeToolPanel<FTextureHeapEditorTool>(LE_ICON_IMAGE_ALBUM " Texture Heap"),
1510 FEditorUI::MakeToolPanel<FTextureStreamingEditorTool>(LE_ICON_SWAP_VERTICAL " Texture Streaming"),
1511 FEditorUI::MakeToolPanel<FMemoryProfilerEditorTool>(LE_ICON_MEMORY " Memory"),
1512 FEditorUI::MakeToolPanel<FScriptDiagnosticsEditorTool>(LE_ICON_LANGUAGE_CSHARP " C# Diagnostics"),
1513 FEditorUI::MakeToolPanel<FObjectBrowserEditorTool>(LE_ICON_LIST_BOX " Object Browser"),
1514 FEditorUI::MakeToolPanel<FConsoleVariableEditorTool>(LE_ICON_TUNE " Console Variables"),
1515 FEditorUI::MakeToolPanel<FPluginBrowserEditorTool>(LE_ICON_PUZZLE " Plugin Browser"),
1516 };
1517
1518 constexpr FEditorUI::FToolPanel GSettingsPanel = FEditorUI::MakeToolPanel<FSettingsEditorTool>(LE_ICON_COG " Settings");
1519 constexpr FEditorUI::FToolPanel GPackagerPanel = FEditorUI::MakeToolPanel<FProjectPackagerEditorTool>(LE_ICON_PACKAGE_VARIANT " Package Project...");
1520 constexpr FEditorUI::FToolPanel GTerminalPanel = FEditorUI::MakeToolPanel<FTerminalEditorTool>(LE_ICON_CONSOLE_LINE " Terminal");
1521 constexpr FEditorUI::FToolPanel GAboutPanel = FEditorUI::MakeToolPanel<FAboutEditorTool>(LE_ICON_CIRCLE " About Lumina");
1522
1523 // The menu panels that sit outside the debug list, so a name lookup reaches every window the menus toggle.
1524 constexpr const FEditorUI::FToolPanel* GMenuPanels[] = { &GSettingsPanel, &GPackagerPanel, &GTerminalPanel, &GAboutPanel };
1525
1526 constexpr FStringView GCodeWorkspaceName = "Code";
1527
1528 // One window the Tools or File menu can toggle, whichever mechanism it uses.
1529 struct FToolChoice
1530 {
1531 FStringView Name;
1532 const FEditorUI::FToolPanel* Panel = nullptr;
1533 const FToolsMenuEntry* Entry = nullptr;
1534 bool bCode = false;
1535 };
1536
1537 TVector<FToolChoice> GatherToolChoices()
1538 {
1539 TVector<FToolChoice> Choices;
1540 for (const FEditorUI::FToolPanel* Panel : GMenuPanels)
1541 {
1542 Choices.Add({ ToolPanelName(Panel->Label), Panel, nullptr, false });
1543 }
1544 Choices.Add({ GCodeWorkspaceName, nullptr, nullptr, true });
1545 for (const FEditorUI::FToolPanel& Panel : GDebugToolPanels)
1546 {
1547 Choices.Add({ ToolPanelName(Panel.Label), &Panel, nullptr, false });
1548 }
1549 for (const FToolsMenuEntry& Entry : FToolsMenuRegistry::Get().GetEntries())
1550 {
1551 Choices.Add({ ToolPanelName(Entry.Label), nullptr, &Entry, false });

Callers

nothing calls this directly

Calls 12

PushStyleColorFunction · 0.85
PushStyleVarFunction · 0.85
PopStyleVarFunction · 0.85
PopStyleColorFunction · 0.85
ShouldOpenDockedMethod · 0.80
GetToolNameMethod · 0.80
CalculateDockspaceIDMethod · 0.80
ImVec4Class · 0.50
ImVec2Function · 0.50
IsUnsavedDocumentMethod · 0.45
c_strMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected