ALimenPlayerControllerBase
Overview
ALimenPlayerControllerBase is a custom player controller class that extends APlayerController. It manages player input, handles pawn transitions, and provides methods to request pause and change input modes. This class also includes delegates for client readiness and pause requests.
Properties
Type | Name | Access | Description |
|---|---|---|---|
TObjectPtr< ULimenMouseSensitivityComponent > | MouseInputSensitivityComponent | EditAnywhere, BlueprintReadOnly | Component managing mouse sensitivity settings. |
TWeakObjectPtr< ALimenBaseHUD > | None | Weak pointer to the base HUD instance. |
Functions
Return Type | Signature | Description |
|---|---|---|
ALimenPlayerControllerBase* | GetLimenPlayerControllerBase(UObject* Caller, int32 PlayerIndex = 0) | Static function to get a reference to the |
void | SetPawn(APawn* InPawn) | Overrides the base class method to handle pawn changes and bind/unbind delegates accordingly. |
void | ClientSetHUD_Implementation(TSubclassOf NewHUDClass) | Implementation of the client set HUD function, updating the |
void | OnRep_PlayerState() | Overrides the base class method to update HUD widgets when player state changes. |
void | SetViewTargetWithBlend(AActor* NewViewTarget, const float BlendTime = 0, EViewTargetBlendFunction BlendFunc = VTBlend_Linear, const float BlendExp = 0, const bool bLockOutgoing = false) | Overrides the base class method to handle view target transitions with optional blending. |
void | RequestPause(const EPauseReason Reason) | Requests a pause based on the provided reason. |
void | RequestUnPause() | Requests an unpause if currently paused. |
void | ToggleRequestPause(const EPauseReason Reason) | Toggles between pause and unpause states based on the current state. |
void | SetGameInput() | Sets input mode to game, hiding the mouse cursor. |
void | SetUIInput() | Sets input mode to UI, showing the mouse cursor. |
void | SetUIOnlyInput(const bool bShowMouse = true) | Sets input mode to UI-only, optionally showing or hiding the mouse cursor. |
void | SetInputMode(const ELimenInputMode InInputMode) | Sets the current input mode based on the provided enum value. |
ELimenInputMode | GetInputMode() const | Returns the current input mode. |
bool | CanSeeLocation(const FVector& InLocation) const | Checks if the player can see a given location based on field of view and line-of-sight. |
bool | CanSeeActor(const AActor* OtherActor) const | Checks if the player can see another actor based on field of view and line-of-sight. |
void | AddYawInput(const float Val) | Overrides the base class method to handle yaw input with a multiplier. |
void | AddPitchInput(const float Val) | Overrides the base class method to handle pitch input with a multiplier. |
void | BeginPlay() | Initializes the player controller, binds delegates, and handles loading screen visibility changes. |
void | SensitivityUpdated(ULimenMouseSensitivityComponent* Component) | Updates mouse sensitivity multipliers based on component settings. |
Usage & Implementation Notes
Threading Constraints: This class is designed to be used in the game thread.
Replication Requirements: The
OnClientReadydelegate is replicated to ensure client readiness notifications are handled correctly across the network.Memory Lifetime Management: Properly manages weak and strong references to HUD and other components to avoid memory leaks.
Initialization Dependencies: Depends on
ULimenMouseSensitivityComponent,ALimenBaseHUD, and other game-specific components.