FLevelDataLayers
Data layers of a loaded One-File-Per-Actor level at runtime (UE's World Partition Data Layers, runtime state Loaded/Unloaded). The layers and each actor's membership live in the level's files (FExternalActorFiles); this is what a running level does with them: bring a layer's actors in with their own ids, take them out again, and start a Play-in-Editor session in the state the player would start in. Every load and unload is recorded where Save reads it, so an actor out with its layer is never taken for deleted.
- Module
- Game
- Header
#include "Scene/LevelDataLayers.h"- Namespace
Mowo
Public functions
| Returns | Name | Description |
|---|---|---|
std::map<std::string, bool> | GetLayers | The level's layers with whether each is loaded now. |
bool | HasLayer | |
bool | IsLayerLoaded | |
int32_t | LoadLayer | The layer's actors whose other layers are loaded too, and that are not in the scene already, join it under the ids their files carry. |
int32_t | UnloadLayer | Every actor of the layer leaves the scene. |
int32_t | SetLayerLoaded | |
int32_t | ApplyInitialStates | A Play-in-Editor session starts each layer in its runtime initial state, whatever the editor had loaded. |
std::set<std::string> | CaptureState | The play world shares its level's path, and with it the record of which layers are out: the editor's is captured before Play and put back at Stop, so a session's unloads never make the editor's next Save keep files of actors the user deleted. |
void | RestoreState |
Function details
GetLayers
static std::map<std::string, bool> GetLayers(const Scene& scene)The level's layers with whether each is loaded now. Empty for a level that is not a One-File-Per-Actor map.
HasLayer
static bool HasLayer(const Scene& scene, const std::string& layer)IsLayerLoaded
static bool IsLayerLoaded(const Scene& scene, const std::string& layer)LoadLayer
static int32_t LoadLayer(Scene& scene, const std::string& layer, std::string* error = nullptr)The layer's actors whose other layers are loaded too, and that are not in the scene already, join it under the ids their files carry. Returns how many joined; -1 when the level has no such layer.
UnloadLayer
static int32_t UnloadLayer(Scene& scene, const std::string& layer)Every actor of the layer leaves the scene. Returns how many left; -1 when the level has no such layer.
SetLayerLoaded
static int32_t SetLayerLoaded(Scene& scene, const std::string& layer, bool loaded)ApplyInitialStates
static int32_t ApplyInitialStates(Scene& scene)A Play-in-Editor session starts each layer in its runtime initial state, whatever the editor had loaded. Returns how many layers were unloaded.
CaptureState
static std::set<std::string> CaptureState(const Scene& scene)The play world shares its level's path, and with it the record of which layers are out: the editor's is captured before Play and put back at Stop, so a session's unloads never make the editor's next Save keep files of actors the user deleted.
RestoreState
static void RestoreState(const Scene& scene, const std::set<std::string>& unloaded)