2020-09-24 00:43:27 -04:00
// Copyright Epic Games, Inc. All Rights Reserved.
# pragma once
# include "Factories/Factory.h"
2023-05-08 15:46:28 -04:00
# include "Modules/ModuleInterface.h"
# include "AssetTypeCategories.h"
2020-09-24 00:43:27 -04:00
# include "InputEditorModule.generated.h"
2022-06-21 16:59:35 -04:00
DECLARE_LOG_CATEGORY_EXTERN ( LogEnhancedInputEditor , Log , All ) ;
2022-03-31 16:16:07 -04:00
////////////////////////////////////////////////////////////////////
// FInputEditorModule
2020-09-24 00:43:27 -04:00
2022-08-19 19:19:14 -04:00
class UInputAction ;
2022-06-21 16:59:35 -04:00
class SWindow ;
2023-04-12 19:29:49 -04:00
class UPlayerMappableKeySettings ;
2023-05-08 15:46:28 -04:00
class IAssetTypeActions ;
class IAssetTools ;
class FSlateStyleSet ;
2022-06-21 16:59:35 -04:00
2023-05-08 15:46:28 -04:00
class FInputEditorModule : public IModuleInterface
2022-03-31 16:16:07 -04:00
{
public :
// IModuleInterface interface
virtual void StartupModule ( ) override ;
virtual void ShutdownModule ( ) override ;
// End IModuleInterface interface
2023-05-08 15:46:28 -04:00
static EAssetTypeCategories : : Type GetInputAssetsCategory ( ) ;
2022-03-31 16:16:07 -04:00
2023-04-12 19:29:49 -04:00
/** Returns a pointer to the player mappable settings object that has this mapping name */
INPUTEDITOR_API static const UPlayerMappableKeySettings * FindMappingByName ( const FName InName ) ;
2023-02-21 13:37:27 -05:00
/** Returns true if the given name is in use by a player mappable key setting */
INPUTEDITOR_API static bool IsMappingNameInUse ( const FName InName ) ;
2022-03-31 16:16:07 -04:00
private :
2023-05-08 15:46:28 -04:00
void RegisterAssetTypeActions ( IAssetTools & AssetTools , TSharedRef < IAssetTypeActions > Action ) ;
2022-03-31 16:16:07 -04:00
2022-09-20 15:34:49 -04:00
void OnMainFrameCreationFinished ( TSharedPtr < SWindow > InRootWindow , bool bIsRunningStartupDialog ) ;
2022-06-21 16:59:35 -04:00
/** Automatically upgrade the current project to use Enhanced Input if it is currently set to the legacy input classes. */
void AutoUpgradeDefaultInputClasses ( ) ;
2022-03-31 16:16:07 -04:00
static EAssetTypeCategories : : Type InputAssetsCategory ;
TArray < TSharedPtr < IAssetTypeActions > > CreatedAssetTypeActions ;
2022-05-20 12:13:19 -04:00
2023-05-08 15:46:28 -04:00
TSharedPtr < FSlateStyleSet > StyleSet ;
2022-03-31 16:16:07 -04:00
} ;
////////////////////////////////////////////////////////////////////
2020-09-24 00:43:27 -04:00
// Asset factories
UCLASS ( )
class INPUTEDITOR_API UInputMappingContext_Factory : public UFactory
{
GENERATED_UCLASS_BODY ( )
public :
2022-09-20 14:16:40 -04:00
UPROPERTY ( EditAnywhere , Category = InputMappingContext )
TSubclassOf < class UInputMappingContext > InputMappingContextClass ;
virtual bool ConfigureProperties ( ) override ;
2020-09-24 00:43:27 -04:00
virtual UObject * FactoryCreateNew ( UClass * Class , UObject * InParent , FName Name , EObjectFlags Flags , UObject * Context , FFeedbackContext * Warn ) override ;
2022-08-19 19:19:14 -04:00
/** Set the array of initial actions that the resulting IMC should be populated with */
void SetInitialActions ( TArray < TWeakObjectPtr < UInputAction > > InInitialActions ) ;
protected :
/** An array of Input Actions that the mapping context should be populated with upon creation */
TArray < TWeakObjectPtr < UInputAction > > InitialActions ;
2020-09-24 00:43:27 -04:00
} ;
UCLASS ( )
class INPUTEDITOR_API UInputAction_Factory : public UFactory
{
GENERATED_UCLASS_BODY ( )
public :
2022-09-20 14:16:40 -04:00
UPROPERTY ( EditAnywhere , Category = InputAction )
TSubclassOf < UInputAction > InputActionClass ;
virtual bool ConfigureProperties ( ) override ;
2020-09-24 00:43:27 -04:00
virtual UObject * FactoryCreateNew ( UClass * Class , UObject * InParent , FName Name , EObjectFlags Flags , UObject * Context , FFeedbackContext * Warn ) override ;
} ;
2022-01-27 14:09:11 -05:00
UCLASS ( )
2023-04-27 18:48:10 -04:00
class UE_DEPRECATED ( 5.3 , " UPlayerMappableInputConfig has been deprecated, please use the UEnhancedInputUserSettings system instead. " ) INPUTEDITOR_API UPlayerMappableInputConfig_Factory : public UFactory
2022-01-27 14:09:11 -05:00
{
GENERATED_UCLASS_BODY ( )
public :
virtual UObject * FactoryCreateNew ( UClass * Class , UObject * InParent , FName Name , EObjectFlags Flags , UObject * Context , FFeedbackContext * Warn ) override ;
} ;
2023-01-13 01:54:01 -05:00
# if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2
# include "CoreMinimal.h"
# include "IDetailsView.h"
# endif