Base

Overview

Core base classes that all Cdryx modules build upon: game instance, player controller, HUD and user widget.

UCGameInstance

Custom UGameInstance that initializes the UCPerf singleton and the UCSingletonManager on startup.

Name Description
perf Transient UCPerf reference (prevents GC)
Init Creates the UCPerf singleton and registers it via storeSingleton
getSubsystem Template: returns a typed UGameInstanceSubsystem with validity check
getInstance Static: returns the UCGameInstance from any actor
// Access from any actor
UCGameInstance* gi = UCGameInstance::getInstance(myActor);

// Get a subsystem
UCSkillManager* sm = gi->getSubsystem<UCSkillManager>();

ACHUD

Custom HUD class extending AHUD with rectangle drawing support.

Name Description
proceedWithRectangle Flag to trigger rectangle drawing on next DrawHUD
rectangle FHUDRectangle to draw
DrawHUD Override: draws the rectangle if flagged
drawRectangle Sets the rectangle and flags for drawing
ACHUD* hud = playerController->getCHUD();
hud->drawRectangle(FHUDRectangle(
    FLinearColor(0, 0, 1, 0.3f),
    FLinearColor::White,
    FCRectangle(0, FVector2D(100, 100), FVector2D(400, 300)),
    2.0f));

FHUDRectangle

Drawing data for a HUD rectangle.

Name Description
backgroundColor Fill color
borderColor Border color
borderThickness Border line thickness
geometry FCRectangle defining the screen-space bounds
FHUDRectangle rect(FLinearColor::Blue, FLinearColor::White,
    FCRectangle(0, FVector2D(10, 10), FVector2D(200, 100)), 2.0f);

ACPlayerCameraManager

Custom camera manager with a default blend time of 2 seconds.

ACPlayerController

Custom player controller with fight reason broadcasting, perspective change events, resource widget management and HUD access.

Name Description
resourceWidget Weak reference to the current resource widget
fightReasonChange Dynamic multicast delegate: (AActor*, ECPlayerFightReasonType)
perspectiveTypeChange Dynamic multicast delegate: (ECPlayerPerspectiveType)
getInstance Static: returns the ACPlayerController from any actor
getCHUD Returns the ACHUD instance
boundToOnPlayerControllerEvent Binds an ICPlayerControllerBoundable to fight and perspective events
unboundToOnPlayerControllerEvent Unbinds an ICPlayerControllerBoundable
spawnResourceWidget Toggles the resource inventory widget on/off
ACPlayerController* pc = ACPlayerController::getInstance(myActor);
ACHUD* hud = pc->getCHUD();
pc->boundToOnPlayerControllerEvent(myBoundableObject);
pc->spawnResourceWidget();

UCUserWidget

Base widget class for all Cdryx widgets. Extends UUserWidget with ICWidgetOExchange and ICWidgetShowHide. Auto-removes when the owner actor is destroyed.

Name Description
owner Weak reference to the owning actor
widgetShowHideVisible Current visibility state for toggle
switchShowHide Toggles between Visible and Collapsed
autoRemoveWith Binds to the owner’s OnDestroyed for automatic cleanup
onOwnerDestroyed Removes the widget from parent when owner is destroyed
myWidget->autoRemoveWith(sourceActor);
ICWidgetShowHide::Execute_switchShowHide(myWidget);