mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-05 15:18:47 +00:00
CogWindow: simplify how CogWidgets are rendered
Remove the need to specify the widgets width to be able to right them. Instead widgets are rendered in a table which left/center/right align automatically.
This commit is contained in:
@@ -175,7 +175,7 @@ void FCogAbilityWindow_Abilities::RenderAbilitiesMenu(AActor* Selection)
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
FCogWindowWidgets::SearchBar(Filter);
|
||||
FCogWindowWidgets::SearchBar("##Filter", Filter);
|
||||
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
FCogWindowWidgets::SearchBar(Filter);
|
||||
FCogWindowWidgets::SearchBar("##Filter", Filter);
|
||||
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
@@ -280,7 +280,7 @@ void FCogAbilityWindow_Attributes::RenderContent()
|
||||
{
|
||||
Selected = Index;
|
||||
|
||||
if (ImGui::IsMouseDoubleClicked(0))
|
||||
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left))
|
||||
{
|
||||
OpenAttributeDetails(Attribute);
|
||||
}
|
||||
|
||||
@@ -22,29 +22,6 @@ void FCogAbilityWindow_Cheats::Initialize()
|
||||
Asset = GetAsset<UCogAbilityDataAsset>();
|
||||
Config = GetConfig<UCogAbilityConfig_Cheats>();
|
||||
AlignmentConfig = GetConfig<UCogAbilityConfig_Alignment>();
|
||||
|
||||
FCogWindowConsoleCommandManager::RegisterWorldConsoleCommand(
|
||||
TEXT("Cog.Cheat"),
|
||||
TEXT("Apply a cheat to the selection. Cog.Cheat <CheatName> -Allies -Enemies -Controlled"),
|
||||
GetWorld(),
|
||||
FCogWindowConsoleCommandDelegate::CreateLambda([this](const TArray<FString>& InArgs, UWorld* InWorld)
|
||||
{
|
||||
if (InArgs.Num() > 0)
|
||||
{
|
||||
if (const FCogAbilityCheat* cheat = FindCheatByName(InArgs[0]))
|
||||
{
|
||||
const bool ApplyToEnemies = InArgs.Contains("-Enemies");
|
||||
const bool ApplyToAllies = InArgs.Contains("-Allies");
|
||||
const bool ApplyToControlled = InArgs.Contains("-Controlled");
|
||||
|
||||
RequestCheat(GetLocalPlayerPawn(), GetSelection(), *cheat, ApplyToEnemies, ApplyToAllies, ApplyToControlled);
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogCogImGui, Warning, TEXT("Cog.Cheat %s | Cheat not found"), *InArgs[0]);
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -74,7 +74,7 @@ void FCogAbilityWindow_Effects::RenderContent()
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
FCogWindowWidgets::SearchBar(Filter);
|
||||
FCogWindowWidgets::SearchBar("##Filter", Filter);
|
||||
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void FCogAbilityWindow_Tags::RenderMenu()
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
FCogWindowWidgets::SearchBar(Filter);
|
||||
FCogWindowWidgets::SearchBar("##Filter", Filter);
|
||||
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ void FCogAbilityWindow_Tasks::RenderTaskMenu(AActor* Selection)
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
FCogWindowWidgets::SearchBar(Filter);
|
||||
FCogWindowWidgets::SearchBar("##Filter", Filter);
|
||||
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user