2022-05-23 18:41:30 +00:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "CommonInputBaseTypes.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "GameplayTagContainer.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "HAL/Platform.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Templates/SubclassOf.h"
|
|
|
|
#include "UObject/NameTypes.h"
|
|
|
|
#include "UObject/SoftObjectPtr.h"
|
|
|
|
#include "UObject/UObjectGlobals.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
#include "CommonUIExtensions.generated.h"
|
|
|
|
|
2022-09-13 07:18:28 +00:00
|
|
|
class APlayerController;
|
|
|
|
class UCommonActivatableWidget;
|
|
|
|
class ULocalPlayer;
|
|
|
|
class UObject;
|
|
|
|
class UUserWidget;
|
|
|
|
struct FFrame;
|
|
|
|
struct FGameplayTag;
|
|
|
|
|
2022-05-23 18:41:30 +00:00
|
|
|
UCLASS()
|
|
|
|
class COMMONGAME_API UCommonUIExtensions : public UBlueprintFunctionLibrary
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
public:
|
|
|
|
UCommonUIExtensions() { }
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintPure, BlueprintCosmetic, Category = "Global UI Extensions", meta = (WorldContext = "WidgetContextObject"))
|
|
|
|
static ECommonInputType GetOwningPlayerInputType(const UUserWidget* WidgetContextObject);
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintPure, BlueprintCosmetic, Category = "Global UI Extensions", meta = (WorldContext = "WidgetContextObject"))
|
|
|
|
static bool IsOwningPlayerUsingTouch(const UUserWidget* WidgetContextObject);
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintPure, BlueprintCosmetic, Category = "Global UI Extensions", meta = (WorldContext = "WidgetContextObject"))
|
|
|
|
static bool IsOwningPlayerUsingGamepad(const UUserWidget* WidgetContextObject);
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Global UI Extensions")
|
|
|
|
static UCommonActivatableWidget* PushContentToLayer_ForPlayer(const ULocalPlayer* LocalPlayer, UPARAM(meta = (Categories = "UI.Layer")) FGameplayTag LayerName, UPARAM(meta = (AllowAbstract = false)) TSubclassOf<UCommonActivatableWidget> WidgetClass);
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Global UI Extensions")
|
|
|
|
static void PushStreamedContentToLayer_ForPlayer(const ULocalPlayer* LocalPlayer, UPARAM(meta = (Categories = "UI.Layer")) FGameplayTag LayerName, UPARAM(meta = (AllowAbstract = false)) TSoftClassPtr<UCommonActivatableWidget> WidgetClass);
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Global UI Extensions")
|
|
|
|
static void PopContentFromLayer(UCommonActivatableWidget* ActivatableWidget);
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Global UI Extensions")
|
|
|
|
static ULocalPlayer* GetLocalPlayerFromController(APlayerController* PlayerController);
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Global UI Extensions")
|
|
|
|
static FName SuspendInputForPlayer(APlayerController* PlayerController, FName SuspendReason);
|
|
|
|
|
|
|
|
static FName SuspendInputForPlayer(ULocalPlayer* LocalPlayer, FName SuspendReason);
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Global UI Extensions")
|
|
|
|
static void ResumeInputForPlayer(APlayerController* PlayerController, FName SuspendToken);
|
|
|
|
|
|
|
|
static void ResumeInputForPlayer(ULocalPlayer* LocalPlayer, FName SuspendToken);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static int32 InputSuspensions;
|
|
|
|
};
|