Class UZagalaSpecCaptureGroupData#

Inheritance Relationships#

Base Types#

Class Documentation#

class UZagalaSpecCaptureGroupData : public UObject, public IZagalaSpecCaptureGroupDataProvider#

Holds configuration and runtime data for a single regex capture group.

Users select GroupValueClass to associate a UObject type with this capture group. At runtime, GetInstancedObjectForGroup() on UZagalaSpecCaptureGroupCustomizer duplicates CachedObject into InstancedObject (which is never exposed in the editor).

Note: For CachedObject to be editable inline, the class chosen via GroupValueClass must itself carry the EditInlineNew UCLASS specifier.

IZagalaSpecCaptureGroupDataProvider

virtual FZagalaSpecCaptureGroupSnapshot GetCaptureGroupSnapshot_Implementation() override#

Builds a snapshot of the current capture group data.

Returns:

A snapshot containing the capture group value, scope, and related object data.

Public Functions

UZagalaSpecCaptureGroupData(const FObjectInitializer &ObjectInitializer = FObjectInitializer::Get())#
void SetCaptureGroupValue(const FString &NewValue)#

Sets CaptureGroupValue and refreshes the scope-dependent data.

Parameters:

NewValue – The new capture group text value.

FString GetCaptureGroupValue() const#

Returns the plain-text capture group value.

Returns:

The capture group value.

void SetScope(EZagalaSpecCaptureGroupScope NewScope)#

Sets the scope and refreshes the scope-dependent data when it changes.

Parameters:

NewScope – The new capture group scope.

EZagalaSpecCaptureGroupScope GetScope() const#

Returns the capture group scope.

Returns:

The current scope.

TSoftObjectPtr<UObject> GetGroupValueObject() const#

Returns the object associated with this capture group.

Returns:

The soft reference to the group value object.

void SetGroupValueObject(TSoftObjectPtr<UObject> NewObject)#

Sets the object associated with this capture group.

Parameters:

NewObject – The new group value object.

TSoftClassPtr<UObject> GetGroupValueClass() const#

Returns the class associated with this capture group.

Returns:

The soft reference to the group value class.

void SetGroupValueClass(TSoftClassPtr<UObject> NewClass)#

Sets the class associated with this capture group and refreshes the cached object.

Parameters:

NewClass – The new group value class.

TSoftClassPtr<UObject> GetConverterClass() const#

Returns the converter class used to create tagged data.

Returns:

The soft reference to the converter class.

void SetConverterClass(TSoftClassPtr<UObject> NewClass)#

Sets the converter class; clears it when the class does not implement IZagalaSpecCaptureGroupConverter.

Parameters:

NewClass – The new converter class.

bool GetModifyCachedObject() const#

Returns the value of bModifyCachedObject.

Returns:

True when cached object modification is requested.

bool CanModifyCachedObject() const#

Returns whether it is possible to create a cached object which is a duplicate of GroupValueClass.

This allows to modify parts of this duplicate when necessary. GroupValueClass needs to be ‘EditInlineNew’ and the properties that are intended for modification have to be ‘Instanced’ to be able to change the cached object.

Returns:

True when bModifyCachedObject is set, the scope is Local, and GroupValueClass is valid.

void TryAllowModifyCachedObject()#

Modifies bModifyCachedObject to true and refreshes the cached object.

void DisallowModifyCachedObject()#

Modifies bModifyCachedObject to false and refreshes the cached object (setting it to nullptr).

void SetCachedObject(UObject *NewObject)#

Sets CachedObject when modification is allowed; logs a warning otherwise.

Parameters:

NewObject – The new cached object.

TObjectPtr<UObject> GetCachedObject() const#

Returns the cached object.

Returns:

The cached object, or nullptr when none exists.

virtual void PostEditChangeProperty(FPropertyChangedEvent &PropertyChangedEvent) override#
virtual EDataValidationResult IsDataValid(class FDataValidationContext &Context) const override#

Fails when no group value object or class is set, ConverterClass is unset, or a required CachedObject is missing.

Protected Functions

void RefreshCachedObject()#

Re-instantiates (or clears) CachedObject to match GroupValueClass.

Called automatically from PostEditChangeProperty in editor builds. Called automatically from setting the group value class.

virtual void OnCaptureGroupValueSet(const FString &OldValue)#

Called after CaptureGroupValue changes; refreshes the scope-dependent data.

Parameters:

OldValue – The previous capture group value.

void UpdateOnScopeChange()#

Resolves object, class, and converter from global settings when Scope is Global; clears them otherwise.

Protected Attributes

FString CaptureGroupValue#

The plain-text value extracted for this capture group.

Set by UZagalaSpecCaptureGroupCustomizer::FillPatternData().

EZagalaSpecCaptureGroupScope Scope#

Controls how CaptureGroupValue is interpreted when resolving the associated UObject class.

Local — GroupValueClass is set directly by the user in the editor. Global — CaptureGroupValue is looked up in UZagalaSpecFeatureSettings::GlobalCaptureGroupClasses and the matched class is applied automatically via SetCaptureGroupValue().

TSoftObjectPtr<UObject> GroupValueObject#

Reference of the object associated with this capture group.

Not editable when Scope is Global (resolved automatically from FeatureSettings).

TSoftClassPtr<UObject> GroupValueClass#

Class of the object associated with this capture group.

Changing this in the editor instantiates a new CachedObject of the selected class. Not editable when Scope is Global (resolved automatically from FeatureSettings).

TSoftClassPtr<UObject> ConverterClass#

Class of the converter used to transform this capture group into a tagged data.

It must implement ZagalaSpecCaptureGroupConverter. Not editable when Scope is Global (resolved automatically from FeatureSettings).

bool bModifyCachedObject#

When true, CachedObject is shown in the editor and can be modified if the scope is local (and there is a valid GroupValueClass).

When false, CachedObject is nullptr. GroupValueClass needs to be ‘EditInlineNew’ and the properties that are intended for modification have to be ‘Instanced’ to be able to change the cached object.

TObjectPtr<UObject> CachedObject#

Reference object for this capture group.

Duplicated at runtime to preserve configuration. Only visible/editable when bModifyCachedObject is true and the scope is local (and there is a valid GroupValueClass). Set to nullptr when bModifyCachedObject is false or the scope is global. GroupValueClass needs to be ‘EditInlineNew’ and the properties that are intended for modification have to be ‘Instanced’ to be able to change the cached object.