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

Method Initialize

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

Source from the content-addressed store, hash-verified

417 if (bIsKeyEvent && IO.WantCaptureKeyboard)
418 {
419 return true;
420 }
421 }
422
423 for (FEditorTool* Tool : EditorTools)
424 {
425 if (Tool->OnEvent(Event))
426 {
427 return true;
428 }
429 }
430
431 return false;
432 }
433
434 void FEditorUI::Initialize(const FUpdateContext& UpdateContext)
435 {
436 ImGuiContext* Context = Render().GetImGuiRenderer()->GetImGuiContext();
437 ImPlotContext* PlotContext = Render().GetImGuiRenderer()->GetImPlotContext();
438 ImGui::SetCurrentContext(Context);
439 ImPlot::SetCurrentContext(PlotContext);
440
441 // Editor links its own ImGui copy; install allocator here because StartupModule never runs (editor links directly, not LoadModule'd).
442 ImGuiX::InstallImGuiAllocator();
443
444 // Plugin DLLs each link their own ImGui copy too; hand the contexts to the module manager so it
445 // syncs every already-loaded plugin that opted in via LUMINA_MODULE_IMGUI() (and ones loaded later).
446 FModuleManager::Get().NotifyImGuiReady(Context, PlotContext);
447
448 // Init ThumbnailManager before world load so engine primitive meshes are in the transient package before deserialization.
449 (void)CThumbnailManager::Get();
450
451 // Content-browser tiles that draw their own body (curves, etc) instead of a rendered thumbnail.
452 AssetTilePainters::RegisterBuiltin();
453
454 // A reimported texture keeps its bindless slot (RHI::Textures::Recreate repoints it), so materials
455 // sampling it are already correct. What is NOT correct is a material whose block was baked while
456 // that texture had no valid ResourceID -- it holds the fallback and nothing would ever rewrite it.
457 AssetDataChangedHandle = AssetEvents::OnAssetDataChanged().AddLambda([](CObject* Changed)
458 {
459 if (const CTexture* Texture = Cast<CTexture>(Changed))
460 {
461 const uint32 Refreshed = RefreshMaterialsReferencingTexture(Texture);
462 if (Refreshed > 0)
463 {
464 LOG_INFO("Refreshed texture bindings on {} material(s) after '{}' changed.",
465 Refreshed, Texture->GetName().c_str());
466 }
467 }
468 });
469
470 // Editor owns input until the user hits Play (the registry flag defaults true so packaged builds work).
471 FInputViewportRegistry::Get().SetGameInputFocused(false);
472
473 RegisterBuiltinEditorTools();
474 RegisterBuiltinAssetActions();
475
476 PropertyCustomizationRegistry = Memory::New<FPropertyCustomizationRegistry>();

Callers 2

OnInitializeMethod · 0.45
FinalizeNewToolMethod · 0.45

Calls 15

SetCurrentContextFunction · 0.85
InstallImGuiAllocatorFunction · 0.85
ImHashStrFunction · 0.85
GetImGuiContextMethod · 0.80
GetImGuiRendererMethod · 0.80
GetImPlotContextMethod · 0.80
NotifyImGuiReadyMethod · 0.80
SetGameInputFocusedMethod · 0.80
ConstructEntityMethod · 0.80
GetProjectNameMethod · 0.80
LoadProjectMethod · 0.80

Tested by

no test coverage detected