mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-01 20:28:14 +00:00
CogEngine: fix imgui ID conflict in Inspector window
This commit is contained in:
@@ -205,6 +205,7 @@ void FCogEngineWindow_Inspector::RenderMenu()
|
|||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::PushID("Favorites");
|
||||||
for (Favorite& Favorite : Favorites)
|
for (Favorite& Favorite : Favorites)
|
||||||
{
|
{
|
||||||
const TWeakObjectPtr<UObject>& Object = Favorite.Object;
|
const TWeakObjectPtr<UObject>& Object = Favorite.Object;
|
||||||
@@ -214,21 +215,26 @@ void FCogEngineWindow_Inspector::RenderMenu()
|
|||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ImGui::PopID();
|
||||||
|
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
// HISTORY
|
// HISTORY
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::SeparatorText("HISTORY");
|
ImGui::SeparatorText("HISTORY");
|
||||||
|
ImGui::PushID("History");
|
||||||
for (int32 i = History.Num() - 1; i >= 0; i--)
|
for (int32 i = History.Num() - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
|
ImGui::PushID(i);
|
||||||
const TWeakObjectPtr<const UObject>& Object = History[i];
|
const TWeakObjectPtr<const UObject>& Object = History[i];
|
||||||
if (ImGui::MenuItem(TCHAR_TO_ANSI(*GetNameSafe(Object.Get())), nullptr, i == HistoryIndex))
|
if (ImGui::MenuItem(TCHAR_TO_ANSI(*GetNameSafe(Object.Get())), nullptr, i == HistoryIndex))
|
||||||
{
|
{
|
||||||
NewHistoryIndex = i;
|
NewHistoryIndex = i;
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
|
ImGui::PopID();
|
||||||
}
|
}
|
||||||
|
ImGui::PopID();
|
||||||
|
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
|
|||||||
Reference in New Issue
Block a user