mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-07 16:18:50 +00:00
CogEngine: Fix crash with new cheat window when no asset defined
minor: rework cheat filters
This commit is contained in:
@@ -59,6 +59,9 @@ void FCogEngineWindow_Cheats::Initialize()
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
if (Asset == nullptr)
|
||||||
|
{ return; }
|
||||||
|
|
||||||
for (const FCogEngineCheatCategory& CheatCategory : Asset->CheatCategories)
|
for (const FCogEngineCheatCategory& CheatCategory : Asset->CheatCategories)
|
||||||
{
|
{
|
||||||
for (const FCogEngineCheat& Cheat : CheatCategory.PersistentEffects)
|
for (const FCogEngineCheat& Cheat : CheatCategory.PersistentEffects)
|
||||||
@@ -219,22 +222,7 @@ void FCogEngineWindow_Cheats::RenderContent()
|
|||||||
|
|
||||||
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 7);
|
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 7);
|
||||||
|
|
||||||
FString CategoryPreview;
|
if (ImGui::BeginMenu("Filters"))
|
||||||
if (Config->SelectedCategories.Num() == 0)
|
|
||||||
{
|
|
||||||
CategoryPreview = "None";
|
|
||||||
}
|
|
||||||
else if (Config->SelectedCategories.Num() == 1)
|
|
||||||
{
|
|
||||||
CategoryPreview = *Config->SelectedCategories.CreateIterator();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CategoryPreview = "Multiple";
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto CategoryPreviewStr = StringCast<ANSICHAR>(*CategoryPreview);
|
|
||||||
if (ImGui::BeginCombo("##Categories", CategoryPreviewStr.Get()))
|
|
||||||
{
|
{
|
||||||
for (const FCogEngineCheatCategory& CheatCategory : Asset->CheatCategories)
|
for (const FCogEngineCheatCategory& CheatCategory : Asset->CheatCategories)
|
||||||
{
|
{
|
||||||
@@ -252,7 +240,7 @@ void FCogEngineWindow_Cheats::RenderContent()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndCombo();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
FCogWindowWidgets::SearchBar(Filter);
|
FCogWindowWidgets::SearchBar(Filter);
|
||||||
|
|||||||
Reference in New Issue
Block a user