Operating System Simulator Plugin
3.5.1
Unreal Engine plugin that simulates an Operating System Environment
|
A static class that provides utility functions for working with viewport worlds. More...
#include "ViewportWorldStatics.h"
Static Public Member Functions | |
static AActor * | SpawnActorForWorldHandle (UPARAM(ref) FViewportWorldHandle &WorldHandle, const TSubclassOf< AActor > ActorClass, const FTransform &SpawnTransform, const ESpawnActorCollisionHandlingMethod CollisionHandlingMethod=ESpawnActorCollisionHandlingMethod::Undefined, const ESpawnActorScaleMethod TransformScaleMethod=ESpawnActorScaleMethod::MultiplyWithRoot, AActor *Owner=nullptr) |
static void | OnWorldUnloaded (UPARAM(ref) FViewportWorldHandle &WorldHandle, const FOnWorldUnloaded &OnWorldUnloaded) |
static void | AddWidgetToHandle (const UObject *WorldContextObject, const FViewportWorldHandle &WorldHandle, UUserWidget *Widget, const int32 ZOrder=0) |
static bool | RemoveWidgetFromHandle (const FViewportWorldHandle &WorldHandle, UUserWidget *Widget) |
static void | ClearAllWidgetsFromHandle (const FViewportWorldHandle &WorldHandle) |
static void | InitializeActorsForWorldHandle (UPARAM(ref) FViewportWorldHandle &WorldHandle) |
static void | BeginPlayForWorldHandle (UPARAM(ref) FViewportWorldHandle &WorldHandle) |
static void | UnloadWorldHandle (const UObject *WorldContextObject, UPARAM(ref) FViewportWorldHandle &WorldHandle) |
static bool | UpdateViewMode (const FViewportWorldHandle &WorldHandle, const EViewportWorldViewMode NewViewMode) |
static void | SetWorldTickForHandle (const FViewportWorldHandle &WorldHandle, const bool bEnabled) |
static bool | ExecuteCommandForHandle (const FViewportWorldHandle &WorldHandle, const FString Command) |
static bool | IsViewportWorldHandleValid (const FViewportWorldHandle &TestHandle) |
static bool | BelongsToSecondaryWorld (const UObject *Target) |
static AGameModeBase * | GetGameModeFromHandle (const FViewportWorldHandle &WorldHandle) |
static AGameStateBase * | GetGameStateFromHandle (const FViewportWorldHandle &WorldHandle) |
static const FViewportWorldHandle * | FindViewportWorldHandlePtr (const UObject *WorldContextObject, const TSoftObjectPtr< UWorld > &TargetWorld) |
Find the pointer to the viewport world handle associated with the specified target world. | |
static bool | AddSlateWidgetToHandle (const UObject *WorldContextObject, const FViewportWorldHandle &WorldHandle, const TSharedRef< SWidget > &WidgetContent, const int32 &ZOrder) |
Adds a Slate widget to a viewport world handle. | |
static bool | RemoveSlateWidgetFromHandle (const FViewportWorldHandle &WorldHandle, const TSharedRef< SWidget > &SlateWidget) |
Removes the specified Slate widget from the given viewport world handle. | |
Static Protected Member Functions | |
static bool | FindViewportWorldHandle (const UObject *WorldContextObject, const TSoftObjectPtr< UWorld > TargetWorld, FViewportWorldHandle &OutHandle) |
A static class that provides utility functions for working with viewport worlds.
This class provides functions for handling viewport worlds, including finding viewport world handles, spawning actors, adding widgets to viewports, initializing actors, and manipulating view modes and tick settings.
|
static |
Adds a Slate widget to a viewport world handle.
This function adds the specified Slate widget content to the viewport world handle in the given world context object.
WorldContextObject | The world context object to add the Slate widget to. |
WorldHandle | The viewport world handle to add the Slate widget to. |
WidgetContent | The Slate widget content to add. |
ZOrder | The Z order of the added widget. |
|
static |
Adds the given widget to the viewport. If the given world handle is not valid this works the same as Widget->AddToViewport
WorldContextObject | World object. |
WorldHandle | World to add widget to. |
Widget | Target widget to add. Must not be null. |
ZOrder | Larger ZOrder will draw above others with smaller ZOrder. Same ZOrder between different widget will simply draw in the order they were added. |
|
static |
Calls begin play for given world handle if not done while loading world. If begin play was already called, this function does nothing.
WorldHandle | World handle to begin play |
|
static |
Returns true if the given object or actor exists in the viewport world instead of the main game world.
Target | Target Object/Actor to check |
|
static |
Clears all widget from viewport.
WorldHandle | World to remove all widgets from. |
|
static |
Runs command for the world in given handle. Not all commands are supported and returning true doesn't mean the command was success either.
WorldHandle | Target world handle |
Command | Command to run. Not all commands are supported though. |
|
staticprotected |
Returns a reference to the world handle if the world was loaded. If not, then returns an empty world.
WorldContextObject | World object |
TargetWorld | World to look for. |
OutHandle | Reference to the handle or invalid empty handle if world is not loaded. |
|
static |
Find the pointer to the viewport world handle associated with the specified target world.
This function searches for the viewport world handle that is associated with the specified target world. It utilizes the UViewportWorldSubsystem to retrieve the handle.
WorldContextObject | The object that serves as the world context. |
TargetWorld | The target world for which to find the viewport world handle. |
|
static |
Returns game mode from handle.
WorldHandle | Target handle. |
|
static |
Returns game state from handle.
WorldHandle | Target handle. |
|
static |
Initializes actors for given world handle if not done while loading world. If they are initialized, this function does nothing.
WorldHandle | World handle to initialize |
|
static |
Returns true if the given handle is valid. This typically means that there is an actual world for the handle.
TestHandle | Handle to check |
|
static |
Triggers the given event when the world handle calls Unload World.
WorldHandle | World handle to listen to. |
OnWorldUnloaded | Event that should execute when the world unloads from given handle. |
|
static |
Removes the specified Slate widget from the given viewport world handle.
This function removes the specified Slate widget from the given viewport world handle. The viewport world handle is used to identify a specific viewport world where the widget is attached.
WorldHandle | The handle of the viewport world from which the widget should be removed. |
SlateWidget | The Slate widget to be removed from the viewport world. |
|
static |
Removes the given widget (if it was added before) from viewport.
WorldHandle | World to remove widget from. |
Widget | Widget to remove. |
|
static |
Toggles ticking for the world. This affects the entire world (of the handle) including all actors, objects as well.
WorldHandle | Target world handle |
bEnabled | True to enable ticking. False otherwise. |
|
static |
Spawns an actor for the given world handle. This function will ONLY return a valid actor if the following conditions are met: 1: ActorClass is valid. 2: Given world handle is valid. 3: Given world handle has actors initialized. If not initialized, call UViewportWorldStatics::InitializeActorsForWorldHandle 4: Given world handle has begun play.
WorldHandle | Reference to the world handle. |
ActorClass | Obvious right? This is the actor you want to spawn. |
SpawnTransform | Location, rotation and scale for your target actor. |
CollisionHandlingMethod | Defines available strategies for handling the case where an actor is spawned in such a way that it penetrates blocking collision |
TransformScaleMethod | Determines how the transform being passed into actor spawning methods interact with the actor's default root component. |
Owner | Set an owner for the newly spawned actor. |
|
static |
Unloads the given world handle.
WorldContextObject | World object. |
WorldHandle | World handle that should be unloaded |
|
static |
Changes the world view mode to a new one.
WorldHandle | World handle to update view mode for. |
NewViewMode | New view mode |