UColorCorrectRegionsSubsystem

World Subsystem responsible for managing [AColorCorrectRegion](API\Plugins\ColorCorrectRegions\AColorCorrectRegion) classes in level.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

ColorCorrectRegions

Header

/Engine/Plugins/Experimental/ColorCorrectRegions/Source/ColorCorrectRegions/Public/ColorCorrectRegionsSubsystem.h

Include

#include "ColorCorrectRegionsSubsystem.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)()
class UColorCorrectRegionsSubsystem :
    public UWorldSubsystem,
    public FColorCorrectRegionsEditorUndoClient

Remarks

World Subsystem responsible for managing AColorCorrectRegion classes in level. This subsystem handles: Level Loaded, Undo/Redo, Added to level, Removed from level events. Unfortunately AActor class itself is not aware of when it is added/removed, Undo/Redo etc in the level.

This is the only way (that we found) that was handling all region aggregation cases in more or less efficient way. Covered cases: Region added to a level, deleted from level, level loaded, undo, redo, level closed, editor closed: World subsystem keeps track of all Regions in a level via three events OnLevelActorAdded, OnLevelActorDeleted, OnLevelActorListChanged. Actor classes are unaware of when they are added/deleted/undo/redo etc in the level, therefore this is the best place to manage this. Alternative strategies (All tested): World's AddOnActorSpawnedHandler. Flawed. Invoked in some cases we don't need, but does not get called during UNDO/REDO AActor's PostSpawnInitialize, PostActorCreated and OnConstruction are also flawed. AActor does not have an internal event for when its deleted (EndPlay is the closest we have).

Variables

Name Description

Public variable

TArray< AColorC...

 

Regions

Stores pointers to all ColorCorrectRegion Actors.

Functions

Name Description

Public function

void

 

OnActorDeleted

(
    AActor* InActor
)

A callback for CC Region deletion.

Public function

void

 

OnActorSpawned

(
    AActor* InActor
)

A callback for CC Region creation.

Public function

void

 

OnLevelActorListChanged()

A callback for when the level is loaded.

Public function

void

 

OnLevelsChanged()

Called when level is added or removed.

Public function

void

 

SortRegionsByPriority()

Sorts regions based on priority.

Overridden from USubsystem

Name Description

Public function Virtual

void

 

Deinitialize()

Implement this for deinitialization of instances of the system

Public function Virtual

void

 

Initialize

(
    FSubsystemCollectionBase& Collecti...
)

Subsystem Init/Deinit.

Overridden from FEditorUndoClient

Name Description

Public function Virtual

void

 

PostRedo

(
    bool bSuccess
)

Signal that client should run any PostRedo code

Public function Virtual

void

 

PostUndo

(
    bool bSuccess
)

Undo/redo is only supported by editor.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss