From 0b72561741f981783c0a31ef606396b1f38a23f9 Mon Sep 17 00:00:00 2001 From: Dominik Pavlicek Date: Fri, 6 Jan 2023 20:29:07 +0100 Subject: [PATCH 1/4] Update to 5.1 --- ActorInteractionPlugin.uplugin | 2 +- Config/FilterPlugin.ini | 8 -- .../ActorInteractionPlugin.Build.cs | 4 +- .../Components/ActorInteractableComponent.cpp | 1 - .../ActorInteractableComponentBase.cpp | 113 ++++++++++++++---- .../ActorInteractableComponentBase.h | 13 +- .../Helpers/ActorInteractionFunctionLibrary.h | 14 +++ .../Helpers/ActorInteractionPluginSettings.h | 27 ++++- .../Interfaces/ActorInteractableInterface.h | 4 +- .../ActorInteractionPluginEditor.Build.cs | 8 +- .../Private/ActorInteractionPluginEditor.cpp | 4 + .../InteractableComponentAssetFactory.cpp | 33 ++++- .../Private/Popup/AIntPPopup.cpp | 2 +- .../InteractionEditorNotifications.build.cs | 8 ++ 14 files changed, 194 insertions(+), 47 deletions(-) delete mode 100644 Config/FilterPlugin.ini diff --git a/ActorInteractionPlugin.uplugin b/ActorInteractionPlugin.uplugin index 77eb7b0..ba4333c 100644 --- a/ActorInteractionPlugin.uplugin +++ b/ActorInteractionPlugin.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "3.0.1.1", + "VersionName": "3.0.1.2", "FriendlyName": "Actor Interaction Plugin", "Description": "Actor Interaction Plugin is an Open-source Mountea Framework components-based simple framework providing utilities for smart Actor Interaction with other Actors. Developed with Game Developers in mind to allow as easy as possible implementation while maintaining high scalability and diverse options to tweak everything.", "Category": "Mountea Framework", diff --git a/Config/FilterPlugin.ini b/Config/FilterPlugin.ini deleted file mode 100644 index ccebca2..0000000 --- a/Config/FilterPlugin.ini +++ /dev/null @@ -1,8 +0,0 @@ -[FilterPlugin] -; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and -; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. -; -; Examples: -; /README.txt -; /Extras/... -; /Binaries/ThirdParty/*.dll diff --git a/Source/ActorInteractionPlugin/ActorInteractionPlugin.Build.cs b/Source/ActorInteractionPlugin/ActorInteractionPlugin.Build.cs index 875de02..cad774e 100644 --- a/Source/ActorInteractionPlugin/ActorInteractionPlugin.Build.cs +++ b/Source/ActorInteractionPlugin/ActorInteractionPlugin.Build.cs @@ -8,6 +8,7 @@ public class ActorInteractionPlugin : ModuleRules public ActorInteractionPlugin(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + bEnforceIWYU = true; PublicIncludePaths.AddRange( new string[] { @@ -50,7 +51,7 @@ public ActorInteractionPlugin(ReadOnlyTargetRules Target) : base(Target) "InputCore", "InteractionEditorNotifications", - + #if UE_4_26_OR_LATER "DeveloperSettings", #endif @@ -58,7 +59,6 @@ public ActorInteractionPlugin(ReadOnlyTargetRules Target) : base(Target) } ); - DynamicallyLoadedModuleNames.AddRange( new string[] { diff --git a/Source/ActorInteractionPlugin/Private/Components/ActorInteractableComponent.cpp b/Source/ActorInteractionPlugin/Private/Components/ActorInteractableComponent.cpp index cf80a9b..6f3606e 100644 --- a/Source/ActorInteractionPlugin/Private/Components/ActorInteractableComponent.cpp +++ b/Source/ActorInteractionPlugin/Private/Components/ActorInteractableComponent.cpp @@ -727,7 +727,6 @@ void UActorInteractableComponent::GetLifetimeReplicatedProps(TArrayIsGameWorld() ) { @@ -481,7 +465,12 @@ void UActorInteractableComponentBase::SetState(const EInteractableStateV2 NewSta case EInteractableStateV2::EIS_Disabled: { InteractableState = NewState; - CleanupComponent(); + + // Replacing Cleanup + StopHighlight(); + OnInteractableStateChanged.Broadcast(InteractableState); + if (GetWorld()) GetWorld()->GetTimerManager().ClearAllTimersForObject(this); + OnInteractorLost.Broadcast(Interactor); for (const auto Itr : CollisionComponents) { @@ -508,7 +497,12 @@ void UActorInteractableComponentBase::SetState(const EInteractableStateV2 NewSta case EInteractableStateV2::EIS_Disabled: { InteractableState = NewState; - CleanupComponent(); + + // Replacing Cleanup + StopHighlight(); + OnInteractableStateChanged.Broadcast(InteractableState); + if (GetWorld()) GetWorld()->GetTimerManager().ClearAllTimersForObject(this); + OnInteractorLost.Broadcast(Interactor); for (const auto Itr : CollisionComponents) { @@ -553,7 +547,12 @@ void UActorInteractableComponentBase::SetState(const EInteractableStateV2 NewSta case EInteractableStateV2::EIS_Asleep: { InteractableState = NewState; - CleanupComponent(); + + // Replacing Cleanup + StopHighlight(); + OnInteractableStateChanged.Broadcast(InteractableState); + if (GetWorld()) GetWorld()->GetTimerManager().ClearAllTimersForObject(this); + OnInteractorLost.Broadcast(Interactor); for (const auto Itr : CollisionComponents) { @@ -884,7 +883,7 @@ TArray UActorInteractableComponentBase::GetCollisionCompon EInteractableLifecycle UActorInteractableComponentBase::GetLifecycleMode() const { return LifecycleMode;} -void UActorInteractableComponentBase::SetLifecycleMode(const EInteractableLifecycle& NewMode) +void UActorInteractableComponentBase::SetLifecycleMode(const EInteractableLifecycle NewMode) { LifecycleMode = NewMode; @@ -1190,6 +1189,22 @@ ETimingComparison UActorInteractableComponentBase::GetComparisonMethod() const void UActorInteractableComponentBase::SetComparisonMethod(const ETimingComparison Value) { ComparisonMethod = Value; } +void UActorInteractableComponentBase::SetDefaults() +{ + if (const auto DefaultTable = UActorInteractionFunctionLibrary::GetInteractableDefaultDataTable()) + { + InteractableData.DataTable = DefaultTable; + } + + if (const auto DefaultWidgetClass = UActorInteractionFunctionLibrary::GetInteractableDefaultWidgetClass()) + { + if (DefaultWidgetClass != nullptr) + { + SetWidgetClass(DefaultWidgetClass.Get()); + } + } +} + void UActorInteractableComponentBase::InteractorFound(const TScriptInterface& FoundInteractor) { if (CanBeTriggered()) @@ -2058,6 +2073,56 @@ EDataValidationResult UActorInteractableComponentBase::IsDataValid(TArray return bAnyError ? EDataValidationResult::Invalid : DefaultValue; } + +bool UActorInteractableComponentBase::Modify(bool bAlwaysMarkDirty) +{ + const bool bResult = Super::Modify(bAlwaysMarkDirty); + + const bool bShouldNotify = + { + GetOwner() != nullptr && + UActorInteractionFunctionLibrary::IsEditorDebugEnabled() && + ( + InteractableData.DataTable == nullptr || + GetWidgetClass() == nullptr + ) + }; + + if (bShouldNotify) + { + FString interactableName = GetName(); + // Format Name + { + if (interactableName.Contains(TEXT("_GEN_VARIABLE"))) + { + interactableName.ReplaceInline(TEXT("_GEN_VARIABLE"), TEXT("")); + } + if (interactableName.Contains(TEXT("SKEL_"))) + { + interactableName.ReplaceInline(TEXT("SKEL_"), TEXT("")); + } + if(interactableName.EndsWith(TEXT("_C")) && interactableName.StartsWith(TEXT("Default__"))) + { + + interactableName.RightChopInline(9); + interactableName.LeftChopInline(2); + } + } + + FString ownerName; + GetOwner()->GetName(ownerName); + + const FText ErrorMessage = FText::FromString + ( + interactableName.Append(" from ").Append(ownerName).Append(TEXT(": Interactable Data or Widget Class are not valid! Use 'SetDefaults' to avoid issues!")) + ); + FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("Icons.Info")); + + } + + return bResult; +} + #endif void UActorInteractableComponentBase::DrawDebug() diff --git a/Source/ActorInteractionPlugin/Public/Components/ActorInteractableComponentBase.h b/Source/ActorInteractionPlugin/Public/Components/ActorInteractableComponentBase.h index 1cc1b7f..8758695 100644 --- a/Source/ActorInteractionPlugin/Public/Components/ActorInteractableComponentBase.h +++ b/Source/ActorInteractionPlugin/Public/Components/ActorInteractableComponentBase.h @@ -338,7 +338,7 @@ class ACTORINTERACTIONPLUGIN_API UActorInteractableComponentBase : public UWidge * @param NewMode New Lifecycle Mode to be used for this Interactable. */ UFUNCTION(BlueprintCallable, Category="Interaction") - virtual void SetLifecycleMode(const EInteractableLifecycle& NewMode) override; + virtual void SetLifecycleMode(const EInteractableLifecycle NewMode) override; /** @@ -583,6 +583,14 @@ class ACTORINTERACTIONPLUGIN_API UActorInteractableComponentBase : public UWidge UFUNCTION(BlueprintCallable, Category="Interaction") virtual void SetComparisonMethod(const ETimingComparison Value) override; + /** + * Finds default values from Developer settings and tries to set them for this component. + * Will override current settings! + * Will set those values only if not null. + */ + UFUNCTION(BlueprintCallable, CallInEditor, Category="Interaction", meta=(DisplayName="SetDefaults")) + virtual void SetDefaults() override; + #pragma endregion #pragma region EventFunctions @@ -1392,7 +1400,7 @@ class ACTORINTERACTIONPLUGIN_API UActorInteractableComponentBase : public UWidge /** * List of Interactable Classes which are ignored */ - UPROPERTY(SaveGame, EditAnywhere, Category="Interaction|Optional", meta=(NoResetToDefault, AllowAbstract=false, MustImplement="ActorInteractorInterface", BlueprintBaseOnly)) + UPROPERTY(SaveGame, EditAnywhere, Category="Interaction|Optional", meta=(NoResetToDefault, AllowAbstract=false, MustImplement="/Script/ActorInteractionPlugin.ActorInteractorInterface", BlueprintBaseOnly)) TArray> IgnoredClasses; /** @@ -1579,6 +1587,7 @@ class ACTORINTERACTIONPLUGIN_API UActorInteractableComponentBase : public UWidge virtual void PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent) override; virtual EDataValidationResult IsDataValid(TArray& ValidationErrors) override; + virtual bool Modify(bool bAlwaysMarkDirty) override; #endif diff --git a/Source/ActorInteractionPlugin/Public/Helpers/ActorInteractionFunctionLibrary.h b/Source/ActorInteractionPlugin/Public/Helpers/ActorInteractionFunctionLibrary.h index 80591dd..e6f967e 100644 --- a/Source/ActorInteractionPlugin/Public/Helpers/ActorInteractionFunctionLibrary.h +++ b/Source/ActorInteractionPlugin/Public/Helpers/ActorInteractionFunctionLibrary.h @@ -71,4 +71,18 @@ class ACTORINTERACTIONPLUGIN_API UActorInteractionFunctionLibrary : public UBlue AIntP_LOG(Error, TEXT("[GetInteractableDefaultWidgetClass] Cannot load ActorInteractionPluginSettings! Using null value.")) return nullptr; } + + UFUNCTION(BlueprintCallable, BlueprintPure, Category="Mountea|Interaction", meta=(CompactNodeTitle="Default Interactable Data")) + static bool IsEditorDebugEnabled() + { + const UActorInteractionPluginSettings* Settings = GetMutableDefault(); + + if (Settings) + { + return Settings->IsEditorDebugEnabled(); + } + + AIntP_LOG(Error, TEXT("[GetInteractableDefaultWidgetClass] Cannot load ActorInteractionPluginSettings! Using null value.")) + return false; + } }; diff --git a/Source/ActorInteractionPlugin/Public/Helpers/ActorInteractionPluginSettings.h b/Source/ActorInteractionPlugin/Public/Helpers/ActorInteractionPluginSettings.h index 660b7a9..fa943bb 100644 --- a/Source/ActorInteractionPlugin/Public/Helpers/ActorInteractionPluginSettings.h +++ b/Source/ActorInteractionPlugin/Public/Helpers/ActorInteractionPluginSettings.h @@ -24,26 +24,44 @@ class ACTORINTERACTIONPLUGIN_API UActorInteractionPluginSettings : public UDevel SectionName = TEXT("Interaction"); } + /* Defines whether in-editor debug is enabled. */ + UPROPERTY(config, EditAnywhere, Category="Editor") + uint8 bEditorDebugEnabled : 1; + /* Defines how often is the Interaction widget updated per second.*/ - UPROPERTY(config, EditAnywhere, Category = "Widgets", meta=(Units="s", UIMin=0.001, ClampMin=0.001)) + UPROPERTY(config, EditAnywhere, Category = "Widgets", meta=(Units="s", UIMin=0.001, ClampMin=0.001, ConfigRestartRequired = true)) float WidgetUpdateFrequency = 0.05f; /* Defines default Interactable Widget class.*/ - UPROPERTY(config, EditAnywhere, Category = "Widgets", meta=(AllowedClasses="UserWidget", MustImplement="ActorInteractionWidget")) + UPROPERTY(config, EditAnywhere, Category = "Widgets", meta=(AllowedClasses="UserWidget", MustImplement="/Script/ActorInteractionPlugin.ActorInteractionWidget", ConfigRestartRequired = true)) TSoftClassPtrInteractableDefaultWidgetClass; /* Defines default DataTable which contains Interactable data values.*/ - UPROPERTY(config, EditAnywhere, Category = "Interaction Data", meta=(AllowedClasses = "DataTable")) + UPROPERTY(config, EditAnywhere, Category = "Interaction Data", meta=(AllowedClasses = "DataTable", ConfigRestartRequired = true)) TSoftObjectPtr InteractableDefaultDataTable; - +#if WITH_EDITOR + virtual FText GetSectionText() const override + { + return NSLOCTEXT("ActorInteractionPlugin", "MounteaSettingsDescription", "Actor Interaction Plugin"); + } + + virtual FText GetSectionDescription() const override + { + return NSLOCTEXT("ActorInteractionPlugin", "MounteaSettingsDescription", "Default values for Mountea Plugins."); + } + virtual FName GetContainerName() const override { return "Project"; } +#endif public: + bool IsEditorDebugEnabled() const + { return bEditorDebugEnabled; }; + float GetWidgetUpdateFrequency() const { return WidgetUpdateFrequency; } @@ -53,3 +71,4 @@ class ACTORINTERACTIONPLUGIN_API UActorInteractionPluginSettings : public UDevel TSoftClassPtr GetInteractableDefaultWidgetClass() const { return InteractableDefaultWidgetClass; }; }; + diff --git a/Source/ActorInteractionPlugin/Public/Interfaces/ActorInteractableInterface.h b/Source/ActorInteractionPlugin/Public/Interfaces/ActorInteractableInterface.h index d62237d..fbaaf4f 100644 --- a/Source/ActorInteractionPlugin/Public/Interfaces/ActorInteractableInterface.h +++ b/Source/ActorInteractionPlugin/Public/Interfaces/ActorInteractableInterface.h @@ -278,7 +278,7 @@ class ACTORINTERACTIONPLUGIN_API IActorInteractableInterface virtual void SetCollisionChannel(const ECollisionChannel& NewChannel) = 0; virtual EInteractableLifecycle GetLifecycleMode() const = 0; - virtual void SetLifecycleMode(const EInteractableLifecycle& NewMode) = 0; + virtual void SetLifecycleMode(const EInteractableLifecycle NewMode) = 0; virtual int32 GetLifecycleCount() const = 0; virtual void SetLifecycleCount(const int32 NewLifecycleCount) = 0; @@ -359,6 +359,8 @@ class ACTORINTERACTIONPLUGIN_API IActorInteractableInterface virtual void InteractableDependencyStartedCallback(const TScriptInterface& NewMaster) = 0; virtual void InteractableDependencyStoppedCallback(const TScriptInterface& FormerMaster) = 0; + + virtual void SetDefaults() = 0; virtual FOnInteractableSelected& GetOnInteractableSelectedHandle() = 0; virtual FInteractorFound& GetOnInteractorFoundHandle() = 0; diff --git a/Source/ActorInteractionPluginEditor/ActorInteractionPluginEditor.Build.cs b/Source/ActorInteractionPluginEditor/ActorInteractionPluginEditor.Build.cs index 4e1e20e..a96f716 100644 --- a/Source/ActorInteractionPluginEditor/ActorInteractionPluginEditor.Build.cs +++ b/Source/ActorInteractionPluginEditor/ActorInteractionPluginEditor.Build.cs @@ -9,6 +9,10 @@ public ActorInteractionPluginEditor(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; bEnforceIWYU = true; + + PrecompileForTargets = PrecompileTargetsType.None; + bPrecompile = false; + bUsePrecompiled = false; PublicDependencyModuleNames.AddRange ( @@ -50,7 +54,9 @@ public ActorInteractionPluginEditor(ReadOnlyTargetRules Target) : base(Target) "MainFrame", "ToolMenus", - "InputCore" + "InputCore", + + "UMG" } ); diff --git a/Source/ActorInteractionPluginEditor/Private/ActorInteractionPluginEditor.cpp b/Source/ActorInteractionPluginEditor/Private/ActorInteractionPluginEditor.cpp index 58c928c..55b32a5 100644 --- a/Source/ActorInteractionPluginEditor/Private/ActorInteractionPluginEditor.cpp +++ b/Source/ActorInteractionPluginEditor/Private/ActorInteractionPluginEditor.cpp @@ -20,6 +20,7 @@ #include "Utilities/ActorInteractionEditorUtilities.h" #include "ToolMenus.h" +#include "Helpers/ActorInteractionPluginLog.h" #include "Interfaces/IMainFrameModule.h" @@ -194,6 +195,7 @@ void FActorInteractionPluginEditor::HandleNewInteractorBlueprintCreated(UBluepri } Blueprint->BlueprintCategory = FString("Interaction"); + Blueprint->BroadcastChanged(); } void FActorInteractionPluginEditor::HandleNewInteractableBlueprintCreated(UBlueprint* Blueprint) @@ -210,12 +212,14 @@ void FActorInteractionPluginEditor::HandleNewInteractableBlueprintCreated(UBluep GET_FUNCTION_NAME_CHECKED(UActorInteractableComponentBase, CanInteractEvent), UActorInteractableComponentBase::StaticClass() ); + if (FunctionGraph) { Blueprint->LastEditedDocuments.Add(FunctionGraph); } Blueprint->BlueprintCategory = FString("Interaction"); + Blueprint->BroadcastChanged(); } void FActorInteractionPluginEditor::PluginButtonClicked() diff --git a/Source/ActorInteractionPluginEditor/Private/Factories/InteractableComponentAssetFactory.cpp b/Source/ActorInteractionPluginEditor/Private/Factories/InteractableComponentAssetFactory.cpp index e0d6650..c637c7b 100644 --- a/Source/ActorInteractionPluginEditor/Private/Factories/InteractableComponentAssetFactory.cpp +++ b/Source/ActorInteractionPluginEditor/Private/Factories/InteractableComponentAssetFactory.cpp @@ -6,7 +6,9 @@ #include "Utilities/ActorInteractionEditorUtilities.h" #include "Components/ActorInteractableComponentBase.h" +#include "Helpers/ActorInteractionFunctionLibrary.h" #include "Kismet2/KismetEditorUtilities.h" +#include "Engine/DataTable.h" #define LOCTEXT_NAMESPACE "ActorInteraction" @@ -47,9 +49,10 @@ UObject* UInteractableComponentAssetFactory::FactoryCreateNew(UClass* Class, UOb FMessageDialog::Open(EAppMsgType::Ok, FText::Format(NSLOCTEXT("UnrealEd", "CannotCreateBlueprintFromClass", "Cannot create a blueprint based on the class '{0}'."), Args)); return nullptr; } - + // Create new Blueprint - return FKismetEditorUtilities::CreateBlueprint( + UObject* NewObject = + FKismetEditorUtilities::CreateBlueprint( ParentClass, InParent, Name, @@ -58,6 +61,32 @@ UObject* UInteractableComponentAssetFactory::FactoryCreateNew(UClass* Class, UOb UBlueprintGeneratedClass::StaticClass(), NAME_None ); + + if (const auto DefaultWidgetClass = UActorInteractionFunctionLibrary::GetInteractableDefaultWidgetClass()) + { + if (FClassProperty* WidgetClassProperty = FindFProperty(Class, "WidgetClass")) + { + UE_LOG(LogTemp, Warning, TEXT("[FactoryCreateNew] Using default Widget Class")) + WidgetClassProperty->SetPropertyClass(DefaultWidgetClass); + } + } + + if (const auto DefaultTable = UActorInteractionFunctionLibrary::GetInteractableDefaultDataTable()) + { + FStructProperty* DataTableProperty = FindFProperty(Class, "InteractableData"); + if(DataTableProperty->Struct->IsChildOf(FDataTableRowHandle::StaticStruct())) + { + if (FDataTableRowHandle* Value = DataTableProperty->ContainerPtrToValuePtr(DataTableProperty)) + { + UE_LOG(LogTemp, Warning, TEXT("[FactoryCreateNew] Using default Data Table")) + Value->DataTable = DefaultTable; + } + } + } + + NewObject->Modify(true); + + return NewObject; } #undef LOCTEXT_NAMESPACE \ No newline at end of file diff --git a/Source/ActorInteractionPluginEditor/Private/Popup/AIntPPopup.cpp b/Source/ActorInteractionPluginEditor/Private/Popup/AIntPPopup.cpp index 41b9911..f99068b 100644 --- a/Source/ActorInteractionPluginEditor/Private/Popup/AIntPPopup.cpp +++ b/Source/ActorInteractionPluginEditor/Private/Popup/AIntPPopup.cpp @@ -99,7 +99,7 @@ void AIntPPopup::Open() First thing first, if you've been enjoying using it, it would mean a lot if you could just drop a small review on the marketplace page :). -I also made a paid Modular Sword Pack. It's a simple yet powerful tool which allows creating thousands upon thousands unique swords with simple click, not coming with free upgrade of Modular Scabbard System! +I also made a paid Modular Sword Pack. It's a simple yet powerful tool which allows creating thousands upon thousands unique swords with simple click, now coming with free upgrade of Modular Scabbard System! But let's keep it short, here are the cool new features (and bugfixes) of version 3.0! diff --git a/Source/InteractionEditorNotifications/InteractionEditorNotifications.build.cs b/Source/InteractionEditorNotifications/InteractionEditorNotifications.build.cs index 03e3e58..89774fb 100644 --- a/Source/InteractionEditorNotifications/InteractionEditorNotifications.build.cs +++ b/Source/InteractionEditorNotifications/InteractionEditorNotifications.build.cs @@ -1,3 +1,6 @@ +// All rights reserved Dominik Pavlicek 2022. + +using System.IO; using UnrealBuildTool; public class InteractionEditorNotifications : ModuleRules @@ -5,6 +8,11 @@ public class InteractionEditorNotifications : ModuleRules public InteractionEditorNotifications(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + bEnforceIWYU = true; + + PrecompileForTargets = PrecompileTargetsType.None; + bPrecompile = false; + bUsePrecompiled = false; PublicDependencyModuleNames.AddRange (new string[] From 333b0776a983e115813028ab0fb19ed89b9feb1b Mon Sep 17 00:00:00 2001 From: Dominik Pavlicek Date: Tue, 21 Feb 2023 17:24:27 +0100 Subject: [PATCH 2/4] Updated Icons --- .../Private/Components/ActorInteractableComponentBase.cpp | 4 ++-- .../Private/Components/ActorInteractorComponentTrace.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/ActorInteractionPlugin/Private/Components/ActorInteractableComponentBase.cpp b/Source/ActorInteractionPlugin/Private/Components/ActorInteractableComponentBase.cpp index 61121cd..23bc864 100644 --- a/Source/ActorInteractionPlugin/Private/Components/ActorInteractableComponentBase.cpp +++ b/Source/ActorInteractionPlugin/Private/Components/ActorInteractableComponentBase.cpp @@ -1974,7 +1974,7 @@ void UActorInteractableComponentBase::PostEditChangeChainProperty(FPropertyChang ( interactableName.Append(TEXT(": UI Space changed! Component Scale has been updated. Update 'DrawSize' to match new Widget Space!")) ); - FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("Icons.Info")); + FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("NotificationList.DefaultMessage")); } } @@ -2116,7 +2116,7 @@ bool UActorInteractableComponentBase::Modify(bool bAlwaysMarkDirty) ( interactableName.Append(" from ").Append(ownerName).Append(TEXT(": Interactable Data or Widget Class are not valid! Use 'SetDefaults' to avoid issues!")) ); - FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("Icons.Info")); + FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("NotificationList.DefaultMessage")); } diff --git a/Source/ActorInteractionPlugin/Private/Components/ActorInteractorComponentTrace.cpp b/Source/ActorInteractionPlugin/Private/Components/ActorInteractorComponentTrace.cpp index a88028b..40c8d60 100644 --- a/Source/ActorInteractionPlugin/Private/Components/ActorInteractorComponentTrace.cpp +++ b/Source/ActorInteractionPlugin/Private/Components/ActorInteractorComponentTrace.cpp @@ -452,7 +452,7 @@ void UActorInteractorComponentTrace::PostEditChangeChainProperty(FPropertyChange ( InteractorName.Append(TEXT(": TraceInterval is more than 3s! This might be unintentional and cause gameplay issues.")) ); - FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("Icons.Warning")); + FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("NotificationList.DefaultMessage")); } } @@ -475,7 +475,7 @@ void UActorInteractorComponentTrace::PostEditChangeChainProperty(FPropertyChange ( InteractorName.Append(TEXT(": TraceRange is more than 5000cm! This might be unintentional and cause gameplay issues.")) ); - FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("Icons.Warning")); + FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("NotificationList.DefaultMessage")); } } @@ -487,7 +487,7 @@ void UActorInteractorComponentTrace::PostEditChangeChainProperty(FPropertyChange ( InteractorName.Append(TEXT(": TraceShapeHalfSize is more than 25cm! This might be unintentional and cause gameplay issues.")) ); - FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("Icons.Warning")); + FEditorHelper::DisplayEditorNotification(ErrorMessage, SNotificationItem::CS_Fail, 5.f, 2.f, TEXT("NotificationList.DefaultMessage")); } } } From 16ccdd9badc2b42685ed99358ed4103c061b3825 Mon Sep 17 00:00:00 2001 From: Dominik Pavlicek Date: Tue, 21 Feb 2023 17:24:37 +0100 Subject: [PATCH 3/4] Made FKey input optional --- .../Components/ActorInteractorComponentBase.cpp | 4 ++-- .../Public/Components/ActorInteractorComponentBase.h | 4 ++-- .../Public/Interfaces/ActorInteractorInterface.h | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/ActorInteractionPlugin/Private/Components/ActorInteractorComponentBase.cpp b/Source/ActorInteractionPlugin/Private/Components/ActorInteractorComponentBase.cpp index 510c9ba..efd6d46 100644 --- a/Source/ActorInteractionPlugin/Private/Components/ActorInteractorComponentBase.cpp +++ b/Source/ActorInteractionPlugin/Private/Components/ActorInteractorComponentBase.cpp @@ -152,7 +152,7 @@ void UActorInteractorComponentBase::EvaluateInteractable(const TScriptInterface< } } -void UActorInteractorComponentBase::StartInteraction(const float StartTime, const FKey& InputKey) +void UActorInteractorComponentBase::StartInteraction(const float StartTime, FKey InputKey) { if (CanInteract() && ActiveInteractable.GetInterface()) { @@ -161,7 +161,7 @@ void UActorInteractorComponentBase::StartInteraction(const float StartTime, cons } } -void UActorInteractorComponentBase::StopInteraction(const float StartTime, const FKey& InputKey) +void UActorInteractorComponentBase::StopInteraction(const float StartTime, FKey InputKey) { if (CanInteract() && ActiveInteractable.GetInterface()) { diff --git a/Source/ActorInteractionPlugin/Public/Components/ActorInteractorComponentBase.h b/Source/ActorInteractionPlugin/Public/Components/ActorInteractorComponentBase.h index 43096fc..a8739c5 100644 --- a/Source/ActorInteractionPlugin/Public/Components/ActorInteractorComponentBase.h +++ b/Source/ActorInteractionPlugin/Public/Components/ActorInteractorComponentBase.h @@ -103,13 +103,13 @@ class ACTORINTERACTIONPLUGIN_API UActorInteractorComponentBase : public UActorCo * @param InputKey Optional Key. Some Interactions might require this value to perform checks. */ UFUNCTION(BlueprintCallable, Category="Interaction") - virtual void StartInteraction(const float StartTime, const FKey& InputKey) override; + virtual void StartInteraction(const float StartTime, FKey InputKey) override; /** * Function to stop interaction. * No conditions required. */ UFUNCTION(BlueprintCallable, Category="Interaction") - virtual void StopInteraction(const float StartTime, const FKey& InputKey) override; + virtual void StopInteraction(const float StartTime, FKey InputKey) override; /** diff --git a/Source/ActorInteractionPlugin/Public/Interfaces/ActorInteractorInterface.h b/Source/ActorInteractionPlugin/Public/Interfaces/ActorInteractorInterface.h index 71fc4ea..950e273 100644 --- a/Source/ActorInteractionPlugin/Public/Interfaces/ActorInteractorInterface.h +++ b/Source/ActorInteractionPlugin/Public/Interfaces/ActorInteractorInterface.h @@ -20,8 +20,8 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FInteractableSelected, const TScript DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FInteractableFound, const TScriptInterface&, FoundInteractable); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FInteractableLost, const TScriptInterface&, LostInteractable); -DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInteractionKeyPressed, const float&, TimeKeyPressed, const FKey&, PressedKey); -DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInteractionKeyReleased, const float&, TimeKeyReleased, const FKey&, ReleasedKey); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInteractionKeyPressed, const float&, TimeKeyPressed, FKey, PressedKey); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInteractionKeyReleased, const float&, TimeKeyReleased, FKey, ReleasedKey); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FIgnoredActorAdded, const AActor*, AddedActor); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FIgnoredActorRemoved, const AActor*, RemovedActor); @@ -80,7 +80,7 @@ class ACTORINTERACTIONPLUGIN_API IActorInteractorInterface * @param PressedKey Key which was pressed */ UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Interaction") - void OnInteractionKeyPressedEvent(const float& TimeKeyPressed, const FKey& PressedKey); + void OnInteractionKeyPressedEvent(const float& TimeKeyPressed, FKey PressedKey); void OnInteractionKeyPressedEvent_Implementation(const float& TimeKeyPressed, const FKey& PressedKey) { StartInteraction(TimeKeyPressed, PressedKey); @@ -95,7 +95,7 @@ class ACTORINTERACTIONPLUGIN_API IActorInteractorInterface * @param ReleasedKey Key which was released */ UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Interaction") - void OnInteractionKeyReleasedEvent(const float& TimeKeyReleased, const FKey& ReleasedKey); + void OnInteractionKeyReleasedEvent(const float& TimeKeyReleased, FKey ReleasedKey); void OnInteractionKeyReleasedEvent_Implementation(const float& TimeKeyReleased, const FKey& ReleasedKey) { StopInteraction(TimeKeyReleased, ReleasedKey); @@ -158,8 +158,8 @@ class ACTORINTERACTIONPLUGIN_API IActorInteractorInterface virtual bool IsValidInteractor() const = 0; - virtual void StartInteraction(const float StartTime, const FKey& InputKey) = 0; - virtual void StopInteraction(const float StartTime, const FKey& InputKey) = 0; + virtual void StartInteraction(const float StartTime, FKey InputKey) = 0; + virtual void StopInteraction(const float StartTime, FKey InputKey) = 0; virtual bool ActivateInteractor(FString& ErrorMessage) = 0; virtual bool WakeUpInteractor(FString& ErrorMessage) = 0; From be6983d1c7706e32e256461f045c2f31bce1a026 Mon Sep 17 00:00:00 2001 From: Dominik Pavlicek Date: Tue, 21 Feb 2023 17:55:08 +0100 Subject: [PATCH 4/4] Update AIntPPopup.cpp --- .../Private/Popup/AIntPPopup.cpp | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Source/ActorInteractionPluginEditor/Private/Popup/AIntPPopup.cpp b/Source/ActorInteractionPluginEditor/Private/Popup/AIntPPopup.cpp index f99068b..4cc0e12 100644 --- a/Source/ActorInteractionPluginEditor/Private/Popup/AIntPPopup.cpp +++ b/Source/ActorInteractionPluginEditor/Private/Popup/AIntPPopup.cpp @@ -20,7 +20,7 @@ void AIntPPopup::Register() { const FString PluginDirectory = IPluginManager::Get().FindPlugin(TEXT("ActorInteractionPlugin"))->GetBaseDir(); const FString UpdatedConfigFile = PluginDirectory + "/Config/UpdateConfig.ini"; - const FString CurrentPluginVersion = "3.0"; + const FString CurrentPluginVersion = "3.0.1.3"; UAIntPPopupConfig* AIntPPopupConfig = GetMutableDefault(); @@ -79,7 +79,7 @@ void AIntPPopup::Open() [ SNew(STextBlock) .Font(HeadingFont) - .Text(FText::FromString("Actor Interaction Plugin v3.0")) + .Text(FText::FromString("Actor Interaction Plugin v3.1")) .Justification(ETextJustify::Center) ] + SVerticalBox::Slot() @@ -99,9 +99,24 @@ void AIntPPopup::Open() First thing first, if you've been enjoying using it, it would mean a lot if you could just drop a small review on the marketplace page :). -I also made a paid Modular Sword Pack. It's a simple yet powerful tool which allows creating thousands upon thousands unique swords with simple click, now coming with free upgrade of Modular Scabbard System! +I also made a paid Modular Sword Pack. It's a simple yet powerful tool that allows creating thousands upon thousands of unique swords with a simple click, now with a free upgrade of Modular Scabbard System! -But let's keep it short, here are the cool new features (and bugfixes) of version 3.0! +But let's keep it short, here are the cool new features (and bugfixes) of version 3.1! + +Version 3.1 + +Features + +* Improved performance for Consoles and Mobile devices + +Bugfixes + +* Fixed issue when swapping states of Interactable returns to Default state + +Updates +* Add DEPRECATED to SnoozeInteractable +* DEPRECATED Interactable State Asleep +* Interactor does not longer require Key input and it has become optional Version 3.0 @@ -118,6 +133,8 @@ But let's keep it short, here are the cool new features (and bugfixes) of versio Bugfixes * Fix missed descriptions + +Updates * Add DEPRECATED to old Component Classes )")) .TextStyle(FAppStyle::Get(), "NormalText")