mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-03 14:18:46 +00:00
CogEngine: Fix selection widget not updating the selection after clicking on the actor name
This commit is contained in:
@@ -76,7 +76,7 @@ void FCogEngineWindow_Selection::PreSaveConfig()
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_Selection::TryReapplySelection() const
|
void FCogEngineWindow_Selection::TryReapplySelection() const
|
||||||
{
|
{
|
||||||
const UWorld* World = GetWorld();
|
const UWorld* World = GetWorld();
|
||||||
if (World == nullptr)
|
if (World == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -207,10 +207,10 @@ void FCogEngineWindow_Selection::RenderContent()
|
|||||||
ImGui::Checkbox("Save selection", &Config->bReapplySelection);
|
ImGui::Checkbox("Save selection", &Config->bReapplySelection);
|
||||||
ImGui::SetItemTooltip("Should the last selection be saved and reapplied on startup.");
|
ImGui::SetItemTooltip("Should the last selection be saved and reapplied on startup.");
|
||||||
|
|
||||||
ImGui::Checkbox("Actor Name Use Label", &FCogDebug::Settings.ActorNameUseLabel);
|
ImGui::Checkbox("Actor Name Use Label", &FCogDebug::Settings.ActorNameUseLabel);
|
||||||
ImGui::SetItemTooltip("Should actor names be displayed using their label. Labels are more readable.");
|
ImGui::SetItemTooltip("Should actor names be displayed using their label. Labels are more readable.");
|
||||||
|
|
||||||
ImGui::Checkbox("Replicate Selection", &FCogDebug::Settings.ReplicateSelection);
|
ImGui::Checkbox("Replicate Selection", &FCogDebug::Settings.ReplicateSelection);
|
||||||
ImGui::SetItemTooltip("Should the client replicate its actor selection to the server.");
|
ImGui::SetItemTooltip("Should the client replicate its actor selection to the server.");
|
||||||
|
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
@@ -369,7 +369,18 @@ void FCogEngineWindow_Selection::RenderMainMenuWidget(int32 SubWidgetIndex, floa
|
|||||||
{
|
{
|
||||||
ImGui::SetNextItemWidth(Width);
|
ImGui::SetNextItemWidth(Width);
|
||||||
AActor* NewSelection = nullptr;
|
AActor* NewSelection = nullptr;
|
||||||
FCogWindowWidgets::MenuActorsCombo("MenuActorSelection", NewSelection, *GetWorld(), ActorClasses, Config->SelectedClassIndex, &Filter, GetLocalPlayerPawn(), [this](AActor& Actor) { RenderActorContextMenu(Actor); });
|
if (FCogWindowWidgets::MenuActorsCombo(
|
||||||
|
"MenuActorSelection",
|
||||||
|
NewSelection,
|
||||||
|
*GetWorld(),
|
||||||
|
ActorClasses,
|
||||||
|
Config->SelectedClassIndex,
|
||||||
|
&Filter,
|
||||||
|
GetLocalPlayerPawn(),
|
||||||
|
[this](AActor& Actor) { RenderActorContextMenu(Actor); }))
|
||||||
|
{
|
||||||
|
SetGlobalSelection(NewSelection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (SubWidgetIndex == 2)
|
else if (SubWidgetIndex == 2)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user