mirror of
https://github.com/Ed94/Cog.git
synced 2026-06-13 00:01:37 -07: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 FCogEngineCheat& Cheat : CheatCategory.PersistentEffects)
|
||||
@@ -219,22 +222,7 @@ void FCogEngineWindow_Cheats::RenderContent()
|
||||
|
||||
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 7);
|
||||
|
||||
FString CategoryPreview;
|
||||
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()))
|
||||
if (ImGui::BeginMenu("Filters"))
|
||||
{
|
||||
for (const FCogEngineCheatCategory& CheatCategory : Asset->CheatCategories)
|
||||
{
|
||||
@@ -252,7 +240,7 @@ void FCogEngineWindow_Cheats::RenderContent()
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
FCogWindowWidgets::SearchBar(Filter);
|
||||
|
||||
Reference in New Issue
Block a user