In addition to the previous component, this optional component acts as a manager for the WBP_CharacterEditor widget and enables the in-game character editor.
Its process is simple and consists only of Initialize. Though there are some helper functions.
Since the Replication Update, in addition to the previous component there is minor replication in this component as well. It got the new Function: Initialize From Character Begin Play specific to BP_Character Begin Play and the new Event: Initialize (Replicable), which is called from within the function.
This function binds to the new OnInitialized dispatcher of the BP_CharacterEditor component, which can be used in BP_Character. The function then calls Event: Initialize (Replicable).
Depending on the calling character instance of Function: Initialize From Character Begin Play this event in turn has either a server-side or client-side path.
The server is depending on IsPlayerControlled, while the client is depending on IsLocallyControlled. This is because joining clients have one or more frames during joining where IsPlayerControlled is not true for them, as the game still needs to replicate the character possession. Relying on IsLocallyControlled is fine for clients, as other local characters are controlled by the server, so only the player character is locally controlled.
Checking one of these properties is necessary to avoid spawning/initializing a Character Editor for uncontrolled characters. Passing these tests, we finally call Event: Initialize.
This event takes the input ShowEditor, which is passed down to Event: Proceed With Loaded CDAs as you can see in the screenshot. Focusing on the current event itself, it first validates the Character Customization component of the owning character. Then:
Once all available Customization Data Assets are loaded, the initialization can proceed.
First, the [V2] WBP_Instructions is spawned to show minimalist in-game controls. After that, the Character Editor is spawned and initialized. All the editor logic happens in that widget itself.
Finally, the Character Editor will be either opened or closed by default, depending on ShowEditor that was passed through Event: Initialize.
The delay is used like the delay in BP_CharacterCustomization > Event: Initialize (Replicable) > Server_Initialize.
This event shows the editor, changes the player’s input mode, show the mouse cursor, enables BP_CameraStudio and initializes the BP_LightStudio with a given profile. [V5] Afterwards, OnOpen is called if you desire binding on it.
This event reverts all the opening steps. [V5] Afterwards, OnClosed is called if you desire binding on it.