11#include <imgui/imgui.h>
12#include <imgui/imgui_internal.h>
18#include "LkEngine/Scene/Components.h"
20#if defined(LK_ENGINE_OPENGL)
21# include "LkEngine/Renderer/Backend/OpenGL/OpenGLTexture.h"
26#define LK_UI_DEBUG_DOCKNODES 0
27#define LK_UI_DEBUG_WINDOWS_ON_HOVER 0
45 static constexpr const char* CoreViewport =
"##LkEngine-CoreViewport";
46 static constexpr const char* Dockspace =
"##LkEngine-DockSpace";
47 static constexpr const char* EditorViewport =
"##LkEngine-EditorViewport";
48 static constexpr const char* TopBar =
"##LkEngine-TopBar";
49 static constexpr const char* BottomBar =
"##LkEngine-BottomBar";
50 static constexpr const char* Sidebar1 =
"Sidebar##1";
51 static constexpr const char* Sidebar2 =
"Sidebar##2";
52 static constexpr const char* ApplicationSettings =
"Application Settings";
53 static constexpr const char* EditorSettings =
"Editor Settings";
54 static constexpr const char* EditorConsole =
"Log##EditorConsole";
55 static constexpr const char* ContentBrowser =
"Content Browser";
56 static constexpr const char* SceneManager =
"Scene Manager";
57 static constexpr const char* ComponentEditor =
"Component Editor";
58 static constexpr const char* Tools =
"Tools";
59 static constexpr const char* MaterialEditor =
"Material Editor";
60 static constexpr const char* ThemeManager =
"Theme Manager";
61 static constexpr const char* NodeEditor =
"Node Editor";
64 enum class EMessageBoxFlag : uint32_t
67 CancelButton = LK_BIT(1),
68 UserFunction = LK_BIT(2),
71 LK_ENUM_CLASS(EMessageBoxFlag);
72 LK_ENUM_RANGE_FLAGS_BY_FIRST_AND_LAST(EMessageBoxFlag, EMessageBoxFlag::OkButton, EMessageBoxFlag::AutoSize);
78 LK_DECLARE_MULTICAST_DELEGATE(FOnSetPanelOpen,
const char*,
const bool);
79 extern FOnSetPanelOpen OnSetPanelOpen;
85 LK_DECLARE_DELEGATE_RET(FIsPanelOpen,
bool,
const char*);
86 extern FIsPanelOpen IsPanelOpen;
90namespace LkEngine::UI {
92 LK_DECLARE_MULTICAST_DELEGATE(FOnMessageBoxCancelled,
const char* );
93 extern FOnMessageBoxCancelled OnMessageBoxCancelled;
101 std::string Title =
"";
102 std::string Body =
"";
106 uint32_t MinWidth = 0;
107 uint32_t MinHeight = 0;
108 uint32_t MaxWidth = -1;
109 uint32_t MaxHeight = -1;
110 std::function<void()> UserRenderFunction;
111 bool bShouldOpen =
true;
112 bool bIsOpen =
false;
118 Horizontal = LK_BIT(1),
119 Vertical = LK_BIT(2),
122 LK_ENUM_CLASS(EBorder);
145 static constexpr float MIN_UNLIMITED = 0.0f;
146 static constexpr float MAX_UNLIMITED = 0.0f;
152 static constexpr T Min{};
153 static constexpr T Max{};
159 static constexpr ImVec2 Min{ 0.0f, 0.0f };
160 static constexpr ImVec2 Max{ 9999.0f, 9999.0f };
165 enum class EDataType : uint32_t
178 EDataType Type = EDataType::None;
182 FORCEINLINE
void* GetVariablePtr(
void* Parent)
const
184 return (
void*)((
unsigned char*)Parent + Offset);
190 { EDataType::Float, 1, (uint32_t)offsetof(
LStyle, AlignHorizontal) },
196 uint16_t PassedElements = 0;
199 FORCEINLINE
const FVariableInfo* GetVariableInfo(
const EStyle Idx)
201 using T = std::underlying_type_t<std::decay_t<
decltype(Idx)>>;
202 LK_CORE_ASSERT(((T)Idx >= 0) && (Idx < (T)(EStyle::COUNT)));
203 static_assert(LK_ARRAYSIZE(Internal::StyleVarInfo) == (std::underlying_type_t<EStyle>)EStyle::COUNT);
204 return &Internal::StyleVarInfo[(T)Idx];
212 std::vector<FStyleMod> StyleStack{};
213 std::unordered_map<std::string, FMessageBox> MessageBoxes{};
214 bool bInGrid =
false;
218 ImGuiComboFlags ComboFlags = ImGuiComboFlags_None;
224 static LUIContext UIContext;
226 FORCEINLINE
void PushStyle(
const EStyle Style,
const float Value)
228 const Internal::FVariableInfo* VarInfo = Internal::GetVariableInfo(Style);
229 if (VarInfo->Type != Internal::EDataType::Float)
233 float* VarPtr = (
float*)VarInfo->GetVariablePtr(&UIContext.Style);
234 UIContext.StyleStack.push_back(FStyleMod(Style, *VarPtr));
238 FORCEINLINE
void PopStyle(
const int StylesToPop = 1)
240 LK_CORE_ASSERT(
false,
"TODO");
243 FORCEINLINE
void SetNextComboFlags(
const ImGuiComboFlags Flags)
245 UIContext.NextItemData.ComboFlags = Flags;
248 FORCEINLINE
bool InTable()
250 return (ImGui::GetCurrentTable() !=
nullptr);
253 void ShowMessageBox(
const char* Title,
254 const std::function<
void()>& RenderFunction,
255 uint32_t Flags = (uint32_t)EMessageBoxFlag::AutoSize,
256 const uint32_t Width = 600,
257 const uint32_t Height = 0,
258 const uint32_t MinWidth = 140,
259 const uint32_t MinHeight = 60,
260 const uint32_t MaxWidth = -1,
261 const uint32_t MaxHeight = -1);
263 void RenderMessageBoxes();
265 const char* GenerateID();
269 void Separator(
const ImVec2& Size,
const ImVec4& Color);
271 bool IsInputEnabled();
272 bool IsMouseEnabled();
273 bool IsKeyboardEnabled();
274 void SetInputEnabled(
const bool Enabled);
275 void SetMouseEnabled(
const bool Enabled);
277 bool Begin(
const char* WindowTitle,
bool* Open =
nullptr,
const ImGuiWindowFlags WindowFlags = ImGuiWindowFlags_None);
282 ImTextureID GetTextureID(TObjectPtr<LTexture2D> Texture);
283 ImGuiDockNode* FindCentralNode(
const ImGuiID DockspaceID);
298 template<EFindType FindType = EFindType::Name,
typename T = const
char*>
301 LK_CORE_ASSERT(
false);
306 FORCEINLINE
bool IsWindowFocused(
const char* WindowName,
const bool CheckRootWindow)
308 ImGuiWindow* CurrentNavWindow = GImGui->NavWindow;
312 ImGuiWindow* LastWindow =
nullptr;
313 while (LastWindow != CurrentNavWindow)
315 LastWindow = CurrentNavWindow;
316 CurrentNavWindow = CurrentNavWindow->RootWindow;
320 return (CurrentNavWindow == ImGui::FindWindowByName(WindowName));
324 FORCEINLINE
bool IsWindowFocused(
const ImGuiID ID,
const bool CheckRootWindow)
326 ImGuiWindow* CurrentNavWindow = GImGui->NavWindow;
330 ImGuiWindow* LastWindow =
nullptr;
331 while (LastWindow != CurrentNavWindow)
333 LastWindow = CurrentNavWindow;
334 CurrentNavWindow = CurrentNavWindow->RootWindow;
338 return (CurrentNavWindow == ImGui::FindWindowByID(ID));
344 template<EFindType FindType = EFindType::Name,
typename T = const
char*>
347 LK_CORE_ASSERT(
false);
352 FORCEINLINE
bool IsWindowDocked<EFindType::ID>(
const ImGuiID ID)
354 if (ImGuiWindow* Window = ImGui::FindWindowByID(ID); Window !=
nullptr)
356 return (Window->DockNode !=
nullptr);
363 FORCEINLINE
bool IsWindowDocked<EFindType::Name>(
const char* WindowName)
365 if (ImGuiWindow* Window = ImGui::FindWindowByName(WindowName); Window !=
nullptr)
367 return (Window->DockNode !=
nullptr);
373 template<EFindType FindType = EFindType::Name,
typename T = const
char*>
374 FORCEINLINE
bool IsWindowHovered(T Identifier)
376 LK_CORE_ASSERT(
false);
381 FORCEINLINE
bool IsWindowHovered<EFindType::Name>(
const char* WindowName)
383 if (ImGuiWindow* Window = ImGui::FindWindowByName(WindowName); Window !=
nullptr)
385 ImGuiContext& G = *ImGui::GetCurrentContext();
386 return Window == G.HoveredWindow;
393 FORCEINLINE
bool IsWindowHovered<EFindType::ID>(
const ImGuiID ID)
395 if (ImGuiWindow* Window = ImGui::FindWindowByID(ID); Window !=
nullptr)
397 ImGuiContext& G = *ImGui::GetCurrentContext();
398 return Window == G.HoveredWindow;
404 template<EFindType FindType = EFindType::Name,
typename T = const
char*>
405 FORCEINLINE
bool IsWindowAbove(T Window1, T Window2)
407 LK_CORE_ASSERT(
false);
412 FORCEINLINE
bool IsWindowAbove<EFindType::Name>(
const char* Window1Name,
const char* Window2Name)
414 ImGuiWindow* Window1 = ImGui::FindWindowByName(Window1Name);
415 ImGuiWindow* Window2 = ImGui::FindWindowByName(Window2Name);
416 if (Window1 && !Window2)
420 if (!Window1 && Window2)
425 ImGuiWindow* CurrentWindow =
nullptr;
426 ImGuiContext& G = *ImGui::GetCurrentContext();
427 for (
int Idx = G.Windows.Size - 1; Idx >= 0; Idx)
429 CurrentWindow = G.Windows[Idx];
430 if (CurrentWindow == Window1)
434 if (CurrentWindow == Window2)
444 FORCEINLINE
bool IsWindowAbove<EFindType::ID>(
const ImGuiID Window1ID,
const ImGuiID Window2ID)
446 ImGuiWindow* Window1 = ImGui::FindWindowByID(Window1ID);
447 ImGuiWindow* Window2 = ImGui::FindWindowByID(Window2ID);
448 if (Window1 && !Window2)
452 if (!Window1 && Window2)
457 ImGuiWindow* CurrentWindow =
nullptr;
458 ImGuiContext& G = *ImGui::GetCurrentContext();
459 for (
int Idx = G.Windows.Size - 1; Idx >= 0; Idx)
461 CurrentWindow = G.Windows[Idx];
462 if (CurrentWindow == Window1)
466 if (CurrentWindow == Window2)
475 template<EFindType FindType = EFindType::Name,
typename T = const
char*>
476 FORCEINLINE
bool IsAnyWindowAbove(T Window)
478 LK_CORE_ASSERT(
false);
483 FORCEINLINE
bool IsAnyWindowAbove<EFindType::Name>(
const char* WindowName)
485 ImGuiWindow* Window = ImGui::FindWindowByName(WindowName);
491 ImGuiContext& G = *ImGui::GetCurrentContext();
492 return ((G.WindowsFocusOrder.Size > 0) && (G.WindowsFocusOrder[G.WindowsFocusOrder.Size - 1]));
496 FORCEINLINE
bool IsAnyWindowAbove<EFindType::ID>(
const ImGuiID WindowID)
498 ImGuiWindow* Window = ImGui::FindWindowByID(WindowID);
504 ImGuiContext& G = *ImGui::GetCurrentContext();
505 return ((G.WindowsFocusOrder.Size > 0) && (G.WindowsFocusOrder[G.WindowsFocusOrder.Size - 1]));
508 template<EFindType FindType = EFindType::Name,
typename T = const
char*>
509 FORCEINLINE ImGuiWindow* GetWindowAbove(T Window1, T Window2)
511 LK_CORE_ASSERT(
false);
516 FORCEINLINE ImGuiWindow* GetWindowAbove<EFindType::Name>(
const char* Window1Name,
const char* Window2Name)
518 ImGuiWindow* Window1 = ImGui::FindWindowByName(Window1Name);
519 ImGuiWindow* Window2 = ImGui::FindWindowByName(Window2Name);
520 if (Window1 && !Window2)
524 if (!Window1 && Window2)
529 ImGuiWindow* CurrentWindow =
nullptr;
530 ImGuiContext& G = *ImGui::GetCurrentContext();
531 for (
int Idx = G.Windows.Size - 1; Idx >= 0; Idx)
533 CurrentWindow = G.Windows[Idx];
534 if (CurrentWindow == Window1)
538 if (CurrentWindow == Window2)
548 FORCEINLINE ImGuiWindow* GetWindowAbove<EFindType::ID>(
const ImGuiID Window1ID,
const ImGuiID Window2ID)
550 ImGuiWindow* Window1 = ImGui::FindWindowByID(Window1ID);
551 ImGuiWindow* Window2 = ImGui::FindWindowByID(Window2ID);
552 if (Window1 && !Window2)
556 if (!Window1 && Window2)
561 ImGuiWindow* CurrentWindow =
nullptr;
562 ImGuiContext& G = *ImGui::GetCurrentContext();
563 for (
int Idx = G.Windows.Size - 1; Idx >= 0; Idx)
565 CurrentWindow = G.Windows[Idx];
566 if (CurrentWindow == Window1)
570 if (CurrentWindow == Window2)
582 template<EFindType FindType = EFindType::Name,
typename T = const
char*>
585 LK_CORE_ASSERT(
false);
590 FORCEINLINE ImVec2 GetWindowSize<EFindType::ID>(
const ImGuiID ID)
592 if (ImGuiWindow* Window = ImGui::FindWindowByID(ID); Window !=
nullptr)
601 FORCEINLINE ImVec2 GetWindowSize<EFindType::Name>(
const char* WindowName)
603 if (ImGuiWindow* Window = ImGui::FindWindowByName(WindowName); Window !=
nullptr)
611 FORCEINLINE ImGuiID GetWindowID(
const char* WindowName)
613 if (ImGuiWindow* Window = ImGui::FindWindowByName(WindowName); Window !=
nullptr)
621 FORCEINLINE
const char* GetWindowName(
const ImGuiID ID)
623 if (ImGuiWindow* Window = ImGui::FindWindowByID(ID); Window !=
nullptr)
631 FORCEINLINE
bool IsItemDisabled()
633 return ImGui::GetItemFlags() & ImGuiItemFlags_Disabled;
636 FORCEINLINE
bool IsItemHovered(
const float DelayInSeconds = 0.10f, ImGuiHoveredFlags Flags = ImGuiHoveredFlags_None)
638 return ImGui::IsItemHovered() && (GImGui->HoveredIdTimer > DelayInSeconds);
641 FORCEINLINE ImRect GetItemRect()
643 return ImRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax());
646 FORCEINLINE ImRect RectExpanded(
const ImRect& Rect,
const float x,
const float y)
648 ImRect Result = Rect;
656 FORCEINLINE ImRect RectOffset(
const ImRect& Rect,
const float x,
const float y)
658 ImRect Result = Rect;
666 FORCEINLINE
void ShiftCursorX(
const float Distance)
668 ImGui::SetCursorPosX(ImGui::GetCursorPosX() + Distance);
671 FORCEINLINE
void ShiftCursorY(
const float Distance)
673 ImGui::SetCursorPosY(ImGui::GetCursorPosY() + Distance);
676 FORCEINLINE
void ShiftCursor(
const float InX,
const float InY)
678 const ImVec2 Cursor = ImGui::GetCursorPos();
679 ImGui::SetCursorPos(ImVec2(Cursor.x + InX, Cursor.y + InY));
682 FORCEINLINE
void DrawItemActivityOutline()
687 FORCEINLINE
void HelpMarker(
const char* HelpDesc,
const char* HelpSymbol =
"(?)")
689 static constexpr float WrapPosOffset = 35.0f;
690 ImGui::TextDisabled(HelpSymbol);
691 if (ImGui::IsItemHovered())
693 ImGui::BeginTooltip();
694 ImGui::PushTextWrapPos(ImGui::GetFontSize() * WrapPosOffset);
695 ImGui::TextUnformatted(HelpDesc);
696 ImGui::PopTextWrapPos();
701 FORCEINLINE
void SetTooltip(std::string_view Text,
702 const float DelayInSeconds = 0.10f,
703 const bool AllowWhenDisabled =
true,
704 const ImVec2 Padding = ImVec2(5, 5))
706 if (IsItemHovered(DelayInSeconds, AllowWhenDisabled ? ImGuiHoveredFlags_AllowWhenDisabled : ImGuiHoveredFlags_None))
708 UI::FScopedStyle WindowPadding(ImGuiStyleVar_WindowPadding, Padding);
709 UI::FScopedColor TextColor(ImGuiCol_Text, RGBA32::Text::Brighter);
710 ImGui::SetTooltip(Text.data());
714 FORCEINLINE
void PopupMenuHeader(
const std::string& Text,
715 const bool IndentAfter =
true,
716 const bool UnindentBefore =
false)
723 static constexpr ImColor TextColor = ImColor(170, 170, 170);
724 ImGui::TextColored(TextColor.Value, Text.c_str());
732 FORCEINLINE
void Separator(
const ImVec2& Size,
const ImVec4& Color)
734 ImGui::PushStyleColor(ImGuiCol_ChildBg, Color);
735 ImGui::BeginChild(
"##Separator", Size);
737 ImGui::PopStyleColor();
740 FORCEINLINE
void VSeparator(
const float Height = 10.0f)
742 ImGui::Dummy(ImVec2(0, Height));
744 ImGui::Dummy(ImVec2(0, Height));
747 void Image(
const TObjectPtr<LTexture2D>& texture,
749 const ImVec2& UV0 = ImVec2(0, 0),
750 const ImVec2& UV1 = ImVec2(1, 1),
751 const ImVec4& TintColor = ImVec4(1, 1, 1, 1),
752 const ImVec4& BorderColor = ImVec4(0, 0, 0, 0));
754 void Image(
const TObjectPtr<LTexture2D>& Image,
755 const glm::vec2& Size,
756 const glm::vec2& UV0 = glm::vec2(0, 0),
757 const glm::vec2& UV1 = glm::vec2(1, 1),
758 const glm::vec4& TintColor = glm::vec4(1, 1, 1, 1),
759 const glm::vec4& BorderColor = glm::vec4(0, 0, 0, 0));
761 void Image(
const TObjectPtr<LImage2D>& Image,
763 const ImVec2& UV0 = ImVec2(0, 0),
764 const ImVec2& UV1 = ImVec2(1, 1),
765 const ImVec4& TintColor = ImVec4(1, 1, 1, 1),
766 const ImVec4& BorderColor = ImVec4(0, 0, 0, 0));
768 void Image(
const TObjectPtr<LImage2D>& Image,
769 const glm::vec2& Size,
770 const glm::vec2& UV0 = glm::vec2(0, 0),
771 const glm::vec2& UV1 = glm::vec2(1, 1),
772 const glm::vec4& TintColor = glm::vec4(1, 1, 1, 1),
773 const glm::vec4& BorderColor = glm::vec4(0, 0, 0, 0));
779 inline static constexpr ImGuiDockNodeFlags DockspaceFlags = ImGuiDockNodeFlags_PassthruCentralNode
780 | ImGuiDockNodeFlags_NoDockingInCentralNode;
782 inline static ImGuiWindowFlags CoreViewportFlags = ImGuiWindowFlags_NoTitleBar
783 | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize
784 | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar
785 | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus
786 | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoInputs
787 | ImGuiWindowFlags_NoDocking;
789 inline static ImGuiWindowFlags HostWindowFlags = ImGuiWindowFlags_NoTitleBar
790 | ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize
791 | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBringToFrontOnFocus
792 | ImGuiWindowFlags_NoNavFocus | ImGuiWindowFlags_NoInputs;
794 inline static constexpr ImGuiWindowFlags MenuBarFlags = ImGuiWindowFlags_MenuBar
795 | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoTitleBar
796 | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoCollapse;
798 inline static constexpr ImGuiWindowFlags SidebarFlags = ImGuiWindowFlags_NoTitleBar
799 | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus
800 | ImGuiWindowFlags_NoNavFocus | ImGuiWindowFlags_NoMove;
802 inline static constexpr ImGuiWindowFlags TabBarFlags = ImGuiWindowFlags_NoTitleBar
803 | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoDocking
804 | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize;
806 inline static constexpr ImGuiWindowFlags EditorViewportFlags = ImGuiWindowFlags_NoTitleBar
807 | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar
808 | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoResize;
812 FORCEINLINE
void Underline(
bool FullWidth =
false,
const float OffsetX = 0.0f,
const float OffsetY = -1.0f)
816 if (ImGui::GetCurrentWindow()->DC.CurrentColumns !=
nullptr)
818 ImGui::PushColumnsBackground();
820 else if (ImGui::GetCurrentTable() !=
nullptr)
822 ImGui::TablePushBackgroundChannel();
826 const float Width = FullWidth ? ImGui::GetWindowWidth() : ImGui::GetContentRegionAvail().x;
827 const ImVec2 Cursor = ImGui::GetCursorScreenPos();
828 ImGui::GetWindowDrawList()->AddLine(
829 ImVec2(Cursor.x + OffsetX, Cursor.y + OffsetY),
830 ImVec2(Cursor.x + Width, Cursor.y + OffsetY),
831 RGBA32::BackgroundDark,
837 if (ImGui::GetCurrentWindow()->DC.CurrentColumns !=
nullptr)
839 ImGui::PopColumnsBackground();
841 else if (ImGui::GetCurrentTable() !=
nullptr)
843 ImGui::TablePopBackgroundChannel();
849 FORCEINLINE
void Spring(
const float Weight = 1.0f)
851 const ImVec2 AvailableSpace = ImGui::GetContentRegionAvail();
852 const float SpringSize = AvailableSpace.x * Weight;
853 ImGui::Dummy(ImVec2(SpringSize, 0.0f));
856 FORCEINLINE
void AlignHorizontalCenter(
const float ItemWidth)
858 const ImVec2 AvailableSpace = ImGui::GetContentRegionAvail();
859 const float Offset = (AvailableSpace.x - ItemWidth) / 2.0f;
862 ImGui::SetCursorPosX(ImGui::GetCursorPosX() + Offset);
866 FORCEINLINE
bool ColoredButton(
const char* Label,
const ImVec4& BgColor,
const ImVec2& ButtonSize)
868 FScopedColor ButtonCol(ImGuiCol_Button, BgColor);
869 return ImGui::Button(Label, ButtonSize);
872 FORCEINLINE
bool ColoredButton(
const char* Label,
const ImVec4& BgColor,
const ImVec4& FgColor,
const ImVec2& ButtonSize)
874 FScopedColor TextColor(ImGuiCol_Text, FgColor);
875 FScopedColor ButtonColor(ImGuiCol_Button, BgColor);
876 return ImGui::Button(Label, ButtonSize);
879 FORCEINLINE
void DrawButtonImage(
const TObjectPtr<LTexture2D>& ImageNormal,
880 const TObjectPtr<LTexture2D>& ImageHovered,
881 const TObjectPtr<LTexture2D>& ImagePressed,
882 const ImU32 TintNormal,
883 const ImU32 TintHovered,
884 const ImU32 TintPressed,
885 const ImVec2& RectMin,
886 const ImVec2& RectMax)
888 ImDrawList* DrawList = ImGui::GetWindowDrawList();
889 if (ImGui::IsItemActive())
891 DrawList->AddImage(GetTextureID(ImagePressed), RectMin, RectMax, ImVec2(0, 0), ImVec2(1, 1), TintPressed);
893 else if (ImGui::IsItemHovered())
895 DrawList->AddImage(GetTextureID(ImageHovered), RectMin, RectMax, ImVec2(0, 0), ImVec2(1, 1), TintHovered);
899 DrawList->AddImage(GetTextureID(ImageNormal), RectMin, RectMax, ImVec2(0, 0), ImVec2(1, 1), TintNormal);
903 FORCEINLINE
void DrawButtonImage(
const TObjectPtr<LTexture2D>& Image,
904 const ImU32 TintNormal,
905 const ImU32 TintHovered,
906 const ImU32 TintPressed,
907 const ImRect& Rectangle)
909 DrawButtonImage(Image, Image, Image, TintNormal, TintHovered, TintPressed, Rectangle.Min, Rectangle.Max);
void BeginViewport(TObjectPtr< LWindow > Window)
Definition UICore.cpp:118
EFindType
Definition UICore.h:290
FORCEINLINE bool IsWindowFocused(T Identifier, const bool CheckRootWindow=true)
Check if a window is focused, defaults to use the window name.
Definition UICore.h:299
FORCEINLINE bool IsWindowDocked(T Identifier)
Check if a window is docked, defaults to use the window name.
Definition UICore.h:345
std::pair< const char *, T > TPropertyMapping
Definition UICore.h:140
FORCEINLINE ImVec2 GetWindowSize(T Identifier)
Check if a window is docked, defaults to use the window name.
Definition UICore.h:583
Data container for a message box instance.
Definition UICore.h:100