Operating System Simulator Plugin
3.5.1
Unreal Engine plugin that simulates an Operating System Environment
|
Represents a handle to a viewport world. More...
#include "ViewportWorldTypes.h"
Public Member Functions | |
void | InitializeActors () |
Initializes the actors in the viewport world. | |
void | WorldBeginPlay () |
Calls the BeginPlay function on the world associated with the viewport world handle. | |
void | Reset () |
Resets the FViewportWorldHandle to its default state. | |
FORCEINLINE bool | IsHandleValid () const |
Checks if the handle is valid. | |
FORCEINLINE bool | WorldIsReady () const |
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. | |
FViewportWorldHandle () | |
FViewportWorldHandle (FWorldContext &WorldContext, const EViewportWorldRenderingMode &RenderingMode, ULocalPlayer *LocalPlayer, const FURL &BaseURL) | |
Public Attributes | |
TWeakPtr< SViewportWorld > | ViewportWorldWidget |
TWeakObjectPtr< ULocalPlayer > | LocalPlayer |
A weak pointer to the local player associated with the viewport world. | |
FWorldContext * | WorldContext |
FURL | BaseURL |
EViewportWorldRenderingMode | RenderingMode |
FOnWorldUnloadedDelegate | OnWorldUnloadedDelegate |
Delegate called when a world is unloaded. | |
Represents a handle to a viewport world.
|
inline |
Default constructor
|
inline |
Constructs a new handle from the given parameters.
void FViewportWorldHandle::InitializeActors | ( | ) |
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.
|
inline |
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.
void FViewportWorldHandle::Reset | ( | ) |
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.
void FViewportWorldHandle::WorldBeginPlay | ( | ) |
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.
|
inline |
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.
FURL FViewportWorldHandle::BaseURL |
The FURL structure contains information about a URL, including the protocol, host, port, map, and options.
TWeakObjectPtr<ULocalPlayer> FViewportWorldHandle::LocalPlayer |
A weak pointer to the local player associated with the viewport world.
This variable is a TWeakObjectPtr<ULocalPlayer> that represents the local player associated with the viewport world. A weak pointer is used to avoid issues with dangling pointers when the player is destroyed. The local player is used in various operations within the viewport world, such as setting the viewport frame and focusing the viewport widget. It is set in the SViewportWorld::InitializeViewportWorld() function, using the ULocalPlayer from the FViewportWorldHandle parameter.
FOnWorldUnloadedDelegate FViewportWorldHandle::OnWorldUnloadedDelegate |
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.
EViewportWorldRenderingMode FViewportWorldHandle::RenderingMode |
Represents current rendering mode for a viewport world.
TWeakPtr<SViewportWorld> FViewportWorldHandle::ViewportWorldWidget |
Weak pointer to track a SViewportWorld widget in a viewport.
FWorldContext* FViewportWorldHandle::WorldContext |
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.