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

Method DrawToolContents

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

Source from the content-addressed store, hash-verified

1591 auto KeyItr = ToolSessionKeys.Find(Tool);
1592 if (KeyItr == nullptr)
1593 {
1594 return;
1595 }
1596
1597 const FString Key = (*KeyItr);
1598 ToolSessionKeys.Remove(Tool);
1599
1600 CEditorSessionSettings* Settings = GetMutableDefault<CEditorSessionSettings>();
1601 if (Settings == nullptr)
1602 {
1603 return;
1604 }
1605
1606 const int32 TabIndex = Settings->OpenTabs.Find(Key);
1607 if (TabIndex == Constants::kIndexNone)
1608 {
1609 return;
1610 }
1611
1612 // Ordered erase, not swap-and-pop, since the order of this list is the whole point.
1613 Settings->OpenTabs.RemoveAt(TabIndex);
1614 Global::GConfig->SaveSettings(CEditorSessionSettings::StaticClass());
1615 }
1616
1617 void FEditorUI::RestoreSessionTabs()
1618 {
1619 const CEditorSessionSettings* Settings = GetDefault<CEditorSessionSettings>();
1620 if (Settings == nullptr || !Settings->bRestoreOpenTabs || Settings->OpenTabs.IsEmpty())
1621 {
1622 return;
1623 }
1624
1625 // A copy, since opening a tab writes back into the live list.
1626 const TVector<FString> Tabs = Settings->OpenTabs;
1627
1628 // The retry below is another pass over the same list, skipping whatever an earlier pass restored.
1629 int32 NumUnscanned = 0;
1630
1631 TVector<FString> Survivors;
1632 Survivors.Reserve(Tabs.Num());
1633
1634 for (const FString& Tab : Tabs)
1635 {
1636 // The retry fires on every registry change, so an import was enough to steal focus mid-click.
1637 if (RestoredSessionTabs.Contains(Tab))
1638 {
1639 Survivors.Add(Tab);
1640 continue;
1641 }
1642
1643 if (SessionKeyHasPrefix(Tab, GSessionAssetPrefix))
1644 {
1645 const FString GuidText = Tab.Mid(static_cast<int32>(strlen(GSessionAssetPrefix)));
1646 const TOptional<FGuid> Guid = FGuid::TryParse(FStringView(*GuidText, GuidText.Len()));
1647 if (!Guid.IsSet())
1648 {
1649 continue; // unparseable, so drop it
1650 }

Callers

nothing calls this directly

Calls 15

GetCurrentWindowFunction · 0.85
ImFormatStringFunction · 0.85
PushStyleVarFunction · 0.85
PopStyleVarFunction · 0.85
GetToolWindowNameFunction · 0.85
GetCurrentContextFunction · 0.85
DockNodeGetRootNodeFunction · 0.85
CtorSprintfClass · 0.85
ToImTextureRefFunction · 0.85
GetToolNameMethod · 0.80
next_chunkMethod · 0.80
IsNetServerMethod · 0.80

Tested by

no test coverage detected