Skip to content

FViewportWorldHandle

#include <ViewportWorlds/Public/ViewportWorldTypes.h>
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class FViewportWorldHandle["FViewportWorldHandle"]
  class SViewportWorld["SViewportWorld"]
  FViewportWorldHandle *-- SViewportWorld
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class FViewportWorldHandle {
    +ViewportWorldWidget : TWeakPtr< SViewportWorld() >
    +LocalPlayer : TObjectPtr< ULocalPlayer >
    +WorldContext : FWorldContext *
    +BaseURL : FURL
    +OnWorldUnloadedDelegate : FOnWorldUnloadedDelegate()
    +ParentWindow : TWeakPtr< SWindow >
    +InitializeActors()
    +WorldBeginPlay()
    +Reset()
    +IsHandleValid() const bool
    +WorldIsReady() const bool
    +FViewportWorldHandle()
    +FViewportWorldHandle(FWorldContext &WorldContext, const FURL &Ba
    +bActorsInitialized : uint8
    +bWorldHasBegunPlay : uint8
  }

Documented call sites inside the plugin (10):

flowchart LR
  FViewportWorldHandle__IsHandleValid["FViewportWorldHandle::IsHandleValid"]
  UViewportWorldSubsystem__AddSlateWidgetToViewport["UViewportWorldSubsystem::AddSlateWidgetToViewport"]
  UViewportWorldSubsystem__AddSlateWidgetToViewport --> FViewportWorldHandle__IsHandleValid
  UViewportWorldStatics__ExecuteCommandForHandle["UViewportWorldStatics::ExecuteCommandForHandle"]
  UViewportWorldStatics__ExecuteCommandForHandle --> FViewportWorldHandle__IsHandleValid
  UViewportWorldStatics__FindViewportWorldHandle["UViewportWorldStatics::FindViewportWorldHandle"]
  UViewportWorldStatics__FindViewportWorldHandle --> FViewportWorldHandle__IsHandleValid
  UViewportWorldStatics__GetGameModeFromHandle["UViewportWorldStatics::GetGameModeFromHandle"]
  UViewportWorldStatics__GetGameModeFromHandle --> FViewportWorldHandle__IsHandleValid
  UViewportWorldStatics__GetGameStateFromHandle["UViewportWorldStatics::GetGameStateFromHandle"]
  UViewportWorldStatics__GetGameStateFromHandle --> FViewportWorldHandle__IsHandleValid
  UViewportWorldStatics__IsViewportWorldHandleValid["UViewportWorldStatics::IsViewportWorldHandleValid"]
  UViewportWorldStatics__IsViewportWorldHandleValid --> FViewportWorldHandle__IsHandleValid
  UViewportWorldWidget__LoadGameWorld["UViewportWorldWidget::LoadGameWorld"]
  UViewportWorldWidget__LoadGameWorld --> FViewportWorldHandle__IsHandleValid
  UViewportWorldStatics__SetWorldTickForHandle["UViewportWorldStatics::SetWorldTickForHandle"]
  UViewportWorldStatics__SetWorldTickForHandle --> FViewportWorldHandle__IsHandleValid
  UViewportWorldSubsystem__UnloadWorldHandle["UViewportWorldSubsystem::UnloadWorldHandle"]
  UViewportWorldSubsystem__UnloadWorldHandle --> FViewportWorldHandle__IsHandleValid
  UViewportWorldStatics__UpdateViewMode["UViewportWorldStatics::UpdateViewMode"]
  UViewportWorldStatics__UpdateViewMode --> FViewportWorldHandle__IsHandleValid
struct FViewportWorldHandle

Defined in ViewportWorldTypes.h:40 Represents a handle to a viewport world.

ReturnNameDescription
TWeakPtr< SViewportWorld >ViewportWorldWidgetWeak pointer to track a SViewportWorld widget in a viewport.
TObjectPtr< ULocalPlayer >LocalPlayer
FWorldContext *WorldContextThe FWorldContext structure is used to store information about the world in a viewport. It is used in various operations within the viewport world, such as spawning actors, updating view modes, setting the tick enabled state, and executing commands.
FURLBaseURLThe FURL structure contains information about a URL, including the protocol, host, port, map, and options.
FOnWorldUnloadedDelegateOnWorldUnloadedDelegateDelegate called when a world is unloaded.
TWeakPtr< SWindow >ParentWindow

TWeakPtr< SViewportWorld > ViewportWorldWidget

Defined in ViewportWorldTypes.h:45 Weak pointer to track a SViewportWorld widget in a viewport.


TObjectPtr< ULocalPlayer > LocalPlayer

Defined in ViewportWorldTypes.h:48


FWorldContext * WorldContext

Defined in ViewportWorldTypes.h:54 The FWorldContext structure is used to store information about the world in a viewport. It is used in various operations within the viewport world, such as spawning actors, updating view modes, setting the tick enabled state, and executing commands.


FURL BaseURL

Defined in ViewportWorldTypes.h:57 The FURL structure contains information about a URL, including the protocol, host, port, map, and options.


FOnWorldUnloadedDelegate OnWorldUnloadedDelegate

Defined in ViewportWorldTypes.h:65 Delegate called when a world is unloaded.

The OnWorldUnloadedDelegate is a delegate that can be bound to a function and called when a world is unloaded. It is used in the FViewportWorldHandle structure to track the unloading of a world.


TWeakPtr< SWindow > ParentWindow

Defined in ViewportWorldTypes.h:67

ReturnNameDescription
voidInitializeActorsInitializes the actors in the viewport world.
voidWorldBeginPlayCalls the BeginPlay function on the world associated with the viewport world handle.
voidResetResets the FViewportWorldHandle to its default state.
boolIsHandleValid const inlineChecks if the handle is valid.
boolWorldIsReady const inlineChecks if the world is ready for use. This method checks if the handle is valid, if the actors have been initialized, and if the world has begun play.
FViewportWorldHandle inlineDefault constructor
FViewportWorldHandle inlineConstructs a new handle from the given parameters.

void InitializeActors()

Defined in ViewportWorldTypes.h:83 Initializes the actors in the viewport world.

This method initializes the actors in the viewport world by calling the InitializeActorsForPlay method of the world associated with the viewport. If the actors have already been initialized or if the world context or world associated with the viewport is invalid, this method does nothing.

This method should be called before beginning play in the viewport world.


void WorldBeginPlay()

Defined in ViewportWorldTypes.h:98 Calls the BeginPlay function on the world associated with the viewport world handle.

This function should be called after initializing actors in the viewport world. If the actors have not been initialized or if the world context or world associated with the handle is invalid, this function does nothing.

This function also spawns the player actors for the local players in the viewport world. It calls the SpawnPlayActor function on each local player in the owning game instance of the world context, passing the base URL and the world context’s world as parameters.

After that, it calls the BeginPlay function on the world associated with the world context.


void Reset()

Defined in ViewportWorldTypes.h:111 Resets the FViewportWorldHandle to its default state.

This method detaches the viewport client from the game viewport, resets the game viewport to nullptr, sets the current world to nullptr, and sets the world context to nullptr.

It also resets the viewport world widget, the local player, the base URL, and unbinds the OnWorldUnloadedDelegate. Finally, it sets the bActorsInitialized and bWorldHasBegunPlay flags to false.

This method does not destroy any objects or deallocate any memory. It simply resets the state of the FViewportWorldHandle.


const inline

inline bool IsHandleValid() const

Defined in ViewportWorldTypes.h:121 Checks if the handle is valid.

This method checks if the handle is valid by verifying that the WorldContext is not nullptr and that the WorldContext’s World is valid using the IsValid() function.

true if the handle is valid, false otherwise.


const inline

inline bool WorldIsReady() const

Defined in ViewportWorldTypes.h:129 Checks if the world is ready for use. This method checks if the handle is valid, if the actors have been initialized, and if the world has begun play.

true if the world is ready, false otherwise.


inline

inline FViewportWorldHandle()

Defined in ViewportWorldTypes.h:144 Default constructor


inline

inline FViewportWorldHandle(FWorldContext & WorldContext, const FURL & BaseURL)

Defined in ViewportWorldTypes.h:154 Constructs a new handle from the given parameters.

ReturnNameDescription
uint8bActorsInitialized
uint8bWorldHasBegunPlay

uint8 bActorsInitialized

Defined in ViewportWorldTypes.h:70


uint8 bWorldHasBegunPlay

Defined in ViewportWorldTypes.h:71