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

Method Draw

Engine/Editor/Source/UI/Tools/NodeGraph/GraphActionMenu.cpp:323–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321
322 bool FGraphActionMenu::Draw(CEdNodeGraph* Graph)
323 {
324 if (Graph == nullptr)
325 {
326 return false;
327 }
328
329 if (bActionsDirty)
330 {
331 RebuildActions(Graph);
332 Rescore();
333 }
334
335 constexpr ImVec2 PopupSize(360, 460);
336 constexpr ImVec2 SearchBarPadding(10, 8);
337 constexpr float ItemHeight = 26.0f;
338 constexpr float HeaderAreaHeight = 48.0f;
339 constexpr float FooterAreaHeight = 26.0f;
340
341 const ImVec4 AccentColor(0.92f, 0.55f, 0.23f, 1.0f);
342 const ImVec4 MatchColor (1.0f, 0.85f, 0.35f, 1.0f);
343 const ImVec4 CategoryColor(0.55f, 0.55f, 0.58f, 1.0f);
344 const ImVec4 SelectedBg (AccentColor.x * 0.35f, AccentColor.y * 0.35f, AccentColor.z * 0.35f, 0.75f);
345
346 ImGui::SetNextWindowSize(PopupSize, ImGuiCond_Always);
347
348 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
349 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 1));
350
351 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, SearchBarPadding);
352 ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.12f, 0.12f, 0.14f, 1.0f));
353 ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.14f, 0.14f, 0.16f, 1.0f));
354 ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.16f, 0.16f, 0.18f, 1.0f));
355
356 ImGui::SetCursorPos(ImVec2(10, 10));
357 ImGui::PushItemWidth(PopupSize.x - 20);
358
359 if (bFocusInput)
360 {
361 ImGui::SetKeyboardFocusHere();
362 bFocusInput = false;
363 }
364
365 const bool bEnterCommitted = ImGui::InputTextWithHint(
366 "##GraphActionSearch",
367 "Search nodes...",
368 QueryBuffer,
369 IM_ARRAYSIZE(QueryBuffer),
370 ImGuiInputTextFlags_EnterReturnsTrue);
371
372 const bool bQueryChanged = CachedQueryForScore != FString(QueryBuffer);
373
374 ImGui::PopItemWidth();
375 ImGui::PopStyleColor(3);
376 ImGui::PopStyleVar();
377
378 if (bQueryChanged)
379 {
380 Rescore();

Callers 15

OnStartFrameMethod · 0.45
DrawPropertyMethod · 0.45
DrawPropertyMethod · 0.45
DrawPropertyMethod · 0.45
DrawPropertyMethod · 0.45
DrawPropertyMethod · 0.45
EndFrameMethod · 0.45
DrawOutlinerMethod · 0.45
PushAddComponentModalMethod · 0.45
DrawSystemsPanelMethod · 0.45
DrawDirectoryBrowserMethod · 0.45

Calls 15

PushStyleVarFunction · 0.85
PushStyleColorFunction · 0.85
PopStyleColorFunction · 0.85
PopStyleVarFunction · 0.85
SeparatorClass · 0.85
TextUnformattedFunction · 0.85
GetColorU32Function · 0.85
DrawHighlightedTextFunction · 0.85
TextWrappedFunction · 0.85
AddRectFilledMethod · 0.80
FindAutoConnectPinMethod · 0.80
TryAutoConnectMethod · 0.80

Tested by

no test coverage detected