Clean up the player controller
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#include "CoreMinimal.h"
|
||||
#include "Engine/HitResult.h"
|
||||
#include "GameFramework/PlayerController.h"
|
||||
#include "InputEvents.h"
|
||||
#include "PlayerControllerBase.generated.h"
|
||||
|
||||
UCLASS(BlueprintType, Blueprintable)
|
||||
@@ -12,8 +11,6 @@ class INTEGRATION_API AlxPlayerControllerBase : public APlayerController
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
using InputMode = FlxEventRequests::InputMode;
|
||||
|
||||
UFUNCTION(BlueprintCallable, meta = (WorldContext = "Context"), Category = "Luprex|Look-At Detection")
|
||||
static void SetLookAt(const UObject *Context, const FHitResult &HitResult);
|
||||
|
||||
@@ -29,12 +26,6 @@ public:
|
||||
UFUNCTION(BlueprintCallable, meta = (WorldContext = "Context"), Category = "Luprex|Look-At Detection")
|
||||
static void SetLookAtChanged(const UObject *Context);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Luprex|Input Events")
|
||||
static void RequestEvents(const FlxEventRequest &Request);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Luprex|Input Events")
|
||||
static void UnRequestEvents(UUserWidget *Widget);
|
||||
|
||||
// Blueprint events
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Luprex|Look-At Detection")
|
||||
void CalculateLookAt();
|
||||
@@ -42,35 +33,14 @@ public:
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Luprex|Look-At Detection")
|
||||
void LookAtChanged();
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
// Called by GameMode each tick.
|
||||
void UpdateLookAt();
|
||||
|
||||
// Rebuild input component and switch input mode.
|
||||
void UpdateEventDispatch();
|
||||
|
||||
// Handler for GameOnly mode hotkey presses.
|
||||
void ForwardKeyEvent(FKey Key);
|
||||
|
||||
// Walk up from a Slate widget to find the nearest UMG widget class name.
|
||||
static FString GetUserWidgetName(SWidget *W);
|
||||
|
||||
// Get the player controller, cast to AlxPlayerControllerBase.
|
||||
static AlxPlayerControllerBase *FromContext(const UObject *Context);
|
||||
|
||||
UPROPERTY()
|
||||
FHitResult CurrentLookAt;
|
||||
|
||||
UPROPERTY()
|
||||
FlxEventRequests EventRequests;
|
||||
|
||||
// Input component for GameOnly mode: catches hotkeys only.
|
||||
UPROPERTY()
|
||||
UInputComponent *HotkeyInputComponent = nullptr;
|
||||
|
||||
// Current input mode.
|
||||
InputMode CurrentInputMode = InputMode::GameOnly;
|
||||
|
||||
bool MustCallLookAtChanged = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user