Working on look-at Widgets, not done yet.

This commit is contained in:
2025-03-17 15:35:51 -04:00
parent c9fd224a38
commit 6b8c86a03c
7 changed files with 107 additions and 60 deletions

View File

@@ -46,17 +46,32 @@ public:
UFUNCTION(BlueprintCallable, Category = "Luprex|Miscellaneous")
int64 GetPlayerId();
UFUNCTION(BlueprintCallable, Category = "Luprex|Look-At Detection")
void SetLookAt(const FHitResult &hit) { CurrentLookAt = hit; }
UFUNCTION(BlueprintPure, meta = (CompactNodeTitle="LxGameMode", WorldContext = "context"), Category = "Luprex|Miscellaneous")
static AIntegrationGameModeBase *GetLuprexGameMode(UObject *context);
UFUNCTION(BlueprintCallable, meta = (WorldContext = "context"),Category = "Luprex|Look-At Detection")
static void SetLookAt(UObject *context, const FHitResult &hit) { GetLuprexGameMode(context)->CurrentLookAt = hit; }
UFUNCTION(BlueprintCallable, Category = "Luprex|Look-At Detection")
const FHitResult &GetLookAt() const { return CurrentLookAt; }
UFUNCTION(BlueprintPure, meta = (WorldContext = "context"),Category = "Luprex|Look-At Detection")
static const FHitResult &GetLookAt(UObject *context) { return GetLuprexGameMode(context)->CurrentLookAt; }
UFUNCTION(BlueprintCallable, Category = "Luprex|Look-At Detection")
bool LookAtChanged() const { return CurrentLookAt.HitObjectHandle != PreviousLookAt.HitObjectHandle; }
UFUNCTION(BlueprintPure, meta = (WorldContext = "context"),Category = "Luprex|Look-At Detection")
static const AActor *GetLookAtActor(UObject *context) { return GetLuprexGameMode(context)->CurrentLookAt.GetActor(); }
UFUNCTION(BlueprintPure, meta = (WorldContext = "context"),Category = "Luprex|Look-At Detection")
static const FHitResult &GetPreviousLookAt(UObject *context) { return GetLuprexGameMode(context)->PreviousLookAt; }
UFUNCTION(BlueprintPure, meta = (WorldContext = "context"),Category = "Luprex|Look-At Detection")
static const AActor *GetPreviousLookAtActor(UObject *context) { return GetLuprexGameMode(context)->PreviousLookAt.GetActor(); }
UFUNCTION(BlueprintPure, meta = (WorldContext = "context"),Category = "Luprex|Look-At Detection")
static bool IsLookAtChanged(UObject *context);
UFUNCTION(BlueprintImplementableEvent, Category = "Luprex|Look-At Detection")
void CalculateLookAt(APlayerController *PlayerController);
UFUNCTION(BlueprintImplementableEvent, Category = "Luprex|Look-At Detection")
void CalculateLookAt(AActor *Player, APlayerController *PlayerController, APlayerCameraManager *Camera);
void LookAtChanged();
// Assemble a lua call. To call into lua:
//
@@ -103,11 +118,6 @@ public:
// to update luprex sockets and update luprex itself.
virtual uint32 Run() override;
// Get the AIntegrationGameModeBase given any UObject
// If there is no AIntegrationGameModeBase in that world context, fatal error
static AIntegrationGameModeBase *GetFromWorld(UWorld *world);
static AIntegrationGameModeBase *GetFromContext(UObject *context);
UPROPERTY()
UlxTangibleManager *TangibleManager;