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

Method OnProjectLoaded

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

Source from the content-addressed store, hash-verified

2964 {
2965 ImGui::DockBuilderRemoveNode(Tool->PrevDockspaceID);
2966
2967 // Relies on window name to ditch the old windows' ini settings forever.
2968 char windowSuffix[16];
2969 ImFormatString(windowSuffix, IM_ARRAYSIZE(windowSuffix), "##%08X", Tool->PrevDockspaceID);
2970 size_t windowSuffixLength = strlen(windowSuffix);
2971 ImGuiContext& g = *GImGui;
2972 for (ImGuiWindowSettings* settings = g.SettingsWindows.begin(); settings != nullptr; settings = g.SettingsWindows.next_chunk(settings))
2973 {
2974 if ( settings->ID == 0 )
2975 {
2976 continue;
2977 }
2978
2979
2980 char const* pWindowName = settings->GetName();
2981 size_t windowNameLength = strlen(pWindowName);
2982 if (windowNameLength >= windowSuffixLength)
2983 {
2984 if (strcmp(pWindowName + windowNameLength - windowSuffixLength, windowSuffix) == 0) // Compare suffix
2985 {
2986 ImGui::ClearWindowSettings(pWindowName);
2987 }
2988 }
2989 }
2990 }
2991 }
2992 else if (ImGui::DockBuilderGetNode(Tool->GetCurrentDockspaceID()) == nullptr)
2993 {
2994 ImVec2 dockspaceSize = ImGui::GetContentRegionAvail();
2995 dockspaceSize.x = Math::Max(dockspaceSize.x, 1.0f);
2996 dockspaceSize.y = Math::Max(dockspaceSize.y, 1.0f);
2997
2998 ImGui::DockBuilderAddNode(Tool->GetCurrentDockspaceID(), ImGuiDockNodeFlags_DockSpace);
2999 ImGui::DockBuilderSetNodeSize(Tool->GetCurrentDockspaceID(), dockspaceSize);
3000 if (!Tool->IsSingleWindowTool())
3001 {
3002 Tool->InitializeDockingLayout(Tool->GetCurrentDockspaceID(), dockspaceSize);

Callers

nothing calls this directly

Calls 15

ResolveToVirtualPathFunction · 0.85
PushRecentProjectFunction · 0.85
RefreshContentBrowserMethod · 0.80
GetAssetByPathMethod · 0.80
GetProjectPathMethod · 0.80
GetProjectNameMethod · 0.80
GetFunction · 0.50
NormalizeFunction · 0.50
WaitForAllMethod · 0.45
GetPathMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected