mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-19 00:40:32 +00:00
1a6aa98f51
- Added to ImGui Context Proxy a name that is mapped to ini file set in ImGui context. - ImGui Context Manager generates unique context names from world type and context index. - Refactored ImGui Context Manager to have a cleaner separation between editor and non-editor bits. - Fixed context update rules in ImGui Context Manager. - Changed widgets management in ImGui Module Manager to allow automatic garbage collection after viewports are closed and manual removal when module is shutting down. - ImGui Widgets are in full control of communication with context proxies. - Added basic world context utilities. - Refactored world context index utilities and replaced ambiguous 'default context index' with 'editor' and 'game' ones.
25 lines
513 B
C++
25 lines
513 B
C++
// Distributed under the MIT License (MIT) (see accompanying LICENSE file)
|
|
|
|
#include "ImGuiPrivatePCH.h"
|
|
|
|
#include "WorldContext.h"
|
|
|
|
|
|
namespace Utilities
|
|
{
|
|
const FWorldContext* GetWorldContextFromNetMode(ENetMode NetMode)
|
|
{
|
|
checkf(GEngine, TEXT("GEngine required to get list of worlds."));
|
|
|
|
for (const FWorldContext& WorldContext : GEngine->GetWorldContexts())
|
|
{
|
|
if (WorldContext.World() && WorldContext.World()->GetNetMode() == NetMode)
|
|
{
|
|
return &WorldContext;
|
|
}
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
}
|