Skip to content
Snippets Groups Projects
Commit eeb6651c authored by Ali Can Demiralp's avatar Ali Can Demiralp
Browse files

Moved ClusterExecute back into VirtualRealityPawn since UFUNCTION(Exec) only...

Moved ClusterExecute back into VirtualRealityPawn since UFUNCTION(Exec) only works on certain classes (see: https://wiki.unrealengine.com/Exec_Functions).
parent 135c1470
No related branches found
No related tags found
1 merge request!12Feature/vr utils
...@@ -176,6 +176,16 @@ USceneComponent* AVirtualRealityPawn::GetShutterGlassesComponent() ...@@ -176,6 +176,16 @@ USceneComponent* AVirtualRealityPawn::GetShutterGlassesComponent()
return ShutterGlasses; return ShutterGlasses;
} }
void AVirtualRealityPawn::ClusterExecute(const FString& Command)
{
FDisplayClusterClusterEvent event;
event.Name = "NDisplayCMD: " + Command;
event.Type = "NDisplayCMD";
event.Category = "VRPawn";
event.Parameters.Add("Command", Command);
IDisplayCluster::Get().GetClusterMgr()->EmitClusterEvent(event, false);
}
void AVirtualRealityPawn::HandleClusterEvent(const FDisplayClusterClusterEvent& Event) void AVirtualRealityPawn::HandleClusterEvent(const FDisplayClusterClusterEvent& Event)
{ {
if (Event.Category.Equals("VRPawn") && Event.Type.Equals("NDisplayCMD") && Event.Parameters.Contains("Command")) if (Event.Category.Equals("VRPawn") && Event.Type.Equals("NDisplayCMD") && Event.Parameters.Contains("Command"))
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#include "Cluster/IDisplayClusterClusterManager.h" #include "Cluster/IDisplayClusterClusterManager.h"
#include "Engine/Engine.h" #include "Engine/Engine.h"
#include "DisplayClusterClusterEvent.h"
#include "Game/IDisplayClusterGameManager.h" #include "Game/IDisplayClusterGameManager.h"
#include "IDisplayCluster.h" #include "IDisplayCluster.h"
#include "IDisplayClusterConfigManager.h" #include "IDisplayClusterConfigManager.h"
...@@ -65,13 +64,3 @@ UDisplayClusterSceneComponent* UVirtualRealityUtilities::GetClusterComponent(con ...@@ -65,13 +64,3 @@ UDisplayClusterSceneComponent* UVirtualRealityUtilities::GetClusterComponent(con
{ {
return IDisplayCluster::Get().GetGameMgr()->GetNodeById(Name); return IDisplayCluster::Get().GetGameMgr()->GetNodeById(Name);
} }
void UVirtualRealityUtilities::ClusterExecute(const FString& Command)
{
FDisplayClusterClusterEvent event;
event.Name = "NDisplayCMD: " + Command;
event.Type = "NDisplayCMD";
event.Category = "VRPawn";
event.Parameters.Add("Command", Command);
IDisplayCluster::Get().GetClusterMgr()->EmitClusterEvent(event, false);
}
...@@ -63,6 +63,9 @@ private: ...@@ -63,6 +63,9 @@ private:
public: public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn") EVRNavigationModes NavigationMode = EVRNavigationModes::nav_mode_fly; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn") EVRNavigationModes NavigationMode = EVRNavigationModes::nav_mode_fly;
//Execute specified console command on all nDisplayCluster Nodes
UFUNCTION(Exec, BlueprintCallable, Category = "DisplayCluster") static void ClusterExecute(const FString& Command);
private: private:
FOnClusterEventListener ClusterEventListenerDelegate; FOnClusterEventListener ClusterEventListenerDelegate;
UFUNCTION() void HandleClusterEvent(const FDisplayClusterClusterEvent& Event); UFUNCTION() void HandleClusterEvent(const FDisplayClusterClusterEvent& Event);
......
...@@ -30,7 +30,4 @@ public: ...@@ -30,7 +30,4 @@ public:
//Get Compenent of Display Cluster by it's name, which is specified in the nDisplay config //Get Compenent of Display Cluster by it's name, which is specified in the nDisplay config
UFUNCTION(BlueprintPure, BlueprintCallable, Category = "DisplayCluster") static UDisplayClusterSceneComponent* GetClusterComponent(const FString& Name); UFUNCTION(BlueprintPure, BlueprintCallable, Category = "DisplayCluster") static UDisplayClusterSceneComponent* GetClusterComponent(const FString& Name);
//Execute specified console command on all nDisplayCluster Nodes
UFUNCTION(Exec, BlueprintCallable, Category = "DisplayCluster") static void ClusterExecute(const FString& Command);
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment