Skip to content

Commit abc619c

Browse files
Merge branch '5.1' into 5.2_dev
2 parents 2cb6bea + 0a641af commit abc619c

32 files changed

+593
-64
lines changed
Binary file not shown.

Content/Input/IA_Jump.uasset

1.31 KB
Binary file not shown.

Content/Input/IA_Look.uasset

1.46 KB
Binary file not shown.

Content/Input/IA_Move.uasset

1.46 KB
Binary file not shown.

Content/Input/IMC_Default.uasset

12.6 KB
Binary file not shown.
15.7 KB
Binary file not shown.
Binary file not shown.

Resources/CloseIcon.png

-2.76 KB
Loading

Resources/Dialoguer_Icon.png

3.37 KB
Loading

Resources/DiscordIcon.png

-2.37 KB
Binary file not shown.

Resources/HeartIcon.png

-1.35 KB
Loading

Resources/HelpIcon.png

-6.61 KB
Binary file not shown.

Resources/Help_Icon.png

5.3 KB
Loading

Resources/Interactable.png

-4.33 KB
Binary file not shown.

Resources/InteractableIcon.png

762 Bytes
Loading

Resources/InteractionConfigIcon.png

505 Bytes
Loading

Resources/Interactor.png

-3.72 KB
Binary file not shown.

Resources/InteractorIcon.png

840 Bytes
Loading

Resources/MoneyIcon.png

-1.44 KB
Loading

Resources/UnrealBucketIcon.png

-1.4 KB
Loading

Resources/Wiki_Icon.png

2.74 KB
Loading

Source/ActorInteractionPlugin/Private/Components/Interactor/ActorInteractorComponentBase.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,8 @@ void UActorInteractorComponentBase::SetState_Server_Implementation(const EIntera
10321032

10331033
void UActorInteractorComponentBase::PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent)
10341034
{
1035+
Super::PostEditChangeChainProperty(PropertyChangedEvent);
1036+
10351037
const FName PropertyName = (PropertyChangedEvent.MemberProperty != nullptr) ? PropertyChangedEvent.GetPropertyName() : NAME_None;
10361038

10371039
FString InteractorName = GetName();

Source/ActorInteractionPluginEditor/ActorInteractionPluginEditor.Build.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public ActorInteractionPluginEditor(ReadOnlyTargetRules Target) : base(Target)
5959
"ToolMenus",
6060
"InputCore",
6161

62-
"UMG"
62+
"UMG",
63+
64+
"GameplayTags"
6365
}
6466
);
6567

Source/ActorInteractionPluginEditor/Private/ActorInteractionPluginEditor.cpp

Lines changed: 236 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "AssetActions/InteractableComponentAssetActions.h"
1414

1515
#include "AssetToolsModule.h"
16+
#include "GameplayTagsManager.h"
1617
#include "HttpModule.h"
1718
#include "HelpButton/AIntPCommands.h"
1819
#include "HelpButton/AIntPHelpStyle.h"
@@ -28,21 +29,23 @@
2829

2930
#include "Interfaces/IMainFrameModule.h"
3031
#include "Serialization/JsonReader.h"
32+
#include "Settings/MounteaInteractionEditorSettings.h"
3133

3234
DEFINE_LOG_CATEGORY(ActorInteractionPluginEditor);
3335

34-
static const FName AIntPHelpTabName("MounteaFramework");
35-
3636
const FString ChangelogURL = FString("https://raw.githubusercontent.com/Mountea-Framework/MounteaInteractionSystem/5.1/CHANGELOG.md");
3737

3838
#define LOCTEXT_NAMESPACE "FActorInteractionPluginEditor"
3939

40+
static const FName MenuName("LevelEditor.LevelEditorToolBar.PlayToolBar");
41+
4042
void FActorInteractionPluginEditor::StartupModule()
4143
{
42-
// Try to request Changelog from GitHub
44+
// Try to request Changelog from GitHub & GameplayTags
4345
{
4446
Http = &FHttpModule::Get();
4547
SendHTTPGet();
48+
SendHTTPGet_Tags();
4649
}
4750

4851
// Register Category
@@ -158,7 +161,7 @@ void FActorInteractionPluginEditor::StartupModule()
158161
}
159162
}
160163

161-
// Register Help Button
164+
// Register Menu Button
162165
{
163166
FAIntPHelpStyle::Initialize();
164167
FAIntPHelpStyle::ReloadTextures();
@@ -257,7 +260,108 @@ void FActorInteractionPluginEditor::HandleNewInteractableBlueprintCreated(UBluep
257260
Blueprint->BroadcastChanged();
258261
}
259262

260-
void FActorInteractionPluginEditor::PluginButtonClicked()
263+
bool FActorInteractionPluginEditor::DoesHaveValidTags() const
264+
{
265+
if (!GConfig) return false;
266+
267+
const FString PluginDirectory = IPluginManager::Get().FindPlugin(TEXT("ActorInteractionPlugin"))->GetBaseDir();
268+
const FString ConfigFilePath = PluginDirectory + "/Config/Tags/MounteaInteractionSystemTags.ini";
269+
FString NormalizedConfigFilePath = FConfigCacheIni::NormalizeConfigIniPath(ConfigFilePath);
270+
271+
if (FPaths::FileExists(ConfigFilePath))
272+
{
273+
return GConfig->Find(NormalizedConfigFilePath) != nullptr;
274+
}
275+
276+
return false;
277+
}
278+
279+
void FActorInteractionPluginEditor::RefreshGameplayTags()
280+
{
281+
TSharedPtr<IPlugin> ThisPlugin = IPluginManager::Get().FindPlugin(TEXT("ActorInteractionPlugin"));
282+
check(ThisPlugin.IsValid());
283+
284+
UGameplayTagsManager::Get().EditorRefreshGameplayTagTree();
285+
}
286+
287+
void FActorInteractionPluginEditor::UpdateTagsConfig(const FString& NewContent)
288+
{
289+
if (!GConfig) return;
290+
291+
const FString PluginDirectory = IPluginManager::Get().FindPlugin(TEXT("ActorInteractionPlugin"))->GetBaseDir();
292+
const FString ConfigFilePath = PluginDirectory + "/Config/Tags/MounteaInteractionSystemTags.ini";
293+
294+
FConfigFile* CurrentConfig = GConfig->Find(ConfigFilePath);
295+
296+
FString CurrentContent;
297+
CurrentConfig->WriteToString(CurrentContent);
298+
299+
TArray<FString> Lines;
300+
NewContent.ParseIntoArray(Lines, TEXT("\n"), true);
301+
302+
TArray<FString> CleanedLines;
303+
for (FString& Itr : Lines)
304+
{
305+
if (Itr.Equals("[/Script/GameplayTags.GameplayTagsList]")) continue;
306+
307+
if (Itr.Contains("GameplayTagList="))
308+
{
309+
FString NewValue = Itr.Replace(TEXT("GameplayTagList="), TEXT(""));
310+
311+
CleanedLines.Add(NewValue);
312+
}
313+
}
314+
315+
if (!CurrentContent.Equals(NewContent))
316+
{
317+
TArray<FString> CurrentLines;
318+
FConfigFile NewConfig;
319+
NewConfig.SetArray(TEXT("/Script/GameplayTags.GameplayTagsList"), TEXT("GameplayTagList"), CleanedLines);
320+
CurrentConfig->GetArray(TEXT("/Script/GameplayTags.GameplayTagsList"), TEXT("GameplayTagList"), CurrentLines);
321+
322+
for (const FString& Itr : CleanedLines)
323+
{
324+
if (CurrentLines.Contains(Itr)) continue;
325+
326+
CurrentLines.AddUnique(Itr);
327+
}
328+
329+
CurrentConfig->SetArray(TEXT("/Script/GameplayTags.GameplayTagsList"), TEXT("GameplayTagList"), CurrentLines);
330+
CurrentConfig->Write(ConfigFilePath);
331+
332+
RefreshGameplayTags();
333+
}
334+
}
335+
336+
void FActorInteractionPluginEditor::CreateTagsConfig(const FString& NewContent)
337+
{
338+
if (!GConfig) return;
339+
340+
const FString PluginDirectory = IPluginManager::Get().FindPlugin(TEXT("ActorInteractionPlugin"))->GetBaseDir();
341+
const FString ConfigFilePath = PluginDirectory + "/Config/Tags/MounteaInteractionSystemTags.ini";
342+
343+
TArray<FString> Lines;
344+
NewContent.ParseIntoArray(Lines, TEXT("\n"), true);
345+
346+
TArray<FString> CleanedLines;
347+
for (FString& Itr : Lines)
348+
{
349+
if (Itr.Equals("[/Script/GameplayTags.GameplayTagsList]")) continue;
350+
351+
if (Itr.Contains("GameplayTagList="))
352+
{
353+
FString NewValue = Itr.Replace(TEXT("GameplayTagList="), TEXT(""));
354+
355+
CleanedLines.Add(NewValue);
356+
}
357+
}
358+
359+
FConfigFile NewConfig;
360+
NewConfig.SetArray(TEXT("/Script/GameplayTags.GameplayTagsList"), TEXT("GameplayTagList"), CleanedLines);
361+
NewConfig.Write(ConfigFilePath);
362+
}
363+
364+
void FActorInteractionPluginEditor::PluginButtonClicked() const
261365
{
262366
const FString URL = "https://discord.gg/waYT2cn37z"; // Interaction Specific Link
263367

@@ -267,46 +371,124 @@ void FActorInteractionPluginEditor::PluginButtonClicked()
267371
}
268372
}
269373

374+
void FActorInteractionPluginEditor::WikiButtonClicked() const
375+
{
376+
const FString URL = "https://github.com/Mountea-Framework/MounteaInteractionSystem/wiki/How-to-Setup-Interaction";
377+
378+
if (!URL.IsEmpty())
379+
{
380+
FPlatformProcess::LaunchURL(*URL, nullptr, nullptr);
381+
}
382+
}
383+
384+
void FActorInteractionPluginEditor::DialoguerButtonClicked() const
385+
{
386+
const FString URL = "https://mountea-framework.github.io/MounteaDialoguer/";
387+
388+
if (!URL.IsEmpty())
389+
{
390+
FPlatformProcess::LaunchURL(*URL, nullptr, nullptr);
391+
}
392+
}
393+
270394
void FActorInteractionPluginEditor::RegisterMenus()
271395
{
272396
// Owner will be used for cleanup in call to UToolMenus::UnregisterOwner
273397
FToolMenuOwnerScoped OwnerScoped(this);
274398

275399
// Register in Window tab
276400
{
277-
UToolMenu* Menu = UToolMenus::Get()->ExtendMenu("LevelEditor.MainMenu.Help");
401+
if (UToolMenu* Menu = UToolMenus::Get()->ExtendMenu("LevelEditor.MainMenu.Help"))
278402
{
279-
FToolMenuSection& Section = Menu->FindOrAddSection("MounteaFramework");
280-
Section.Label = FText::FromString(TEXT("Mountea Framework"));
281-
282-
FToolMenuEntry Entry = Section.AddMenuEntryWithCommandList
283-
(
284-
FAIntPCommands::Get().PluginAction,
285-
PluginCommands,
286-
NSLOCTEXT("MounteaSupport", "TabTitle", "Mountea Support"),
287-
NSLOCTEXT("MounteaSupport", "TooltipText", "Opens Mountea Framework Support channel"),
288-
FSlateIcon(FAIntPHelpStyle::GetStyleSetName(), "AIntPSupport.PluginAction.small")
289-
);
403+
if (Menu->ContainsSection("MounteaFramework") == false)
404+
{
405+
FToolMenuSection& Section = Menu->FindOrAddSection("MounteaFramework");
406+
407+
Section.InsertPosition.Position = EToolMenuInsertType::First;
408+
Section.Label = FText::FromString(TEXT("Mountea Framework"));
409+
410+
FToolMenuEntry SupportEntry = Section.AddMenuEntryWithCommandList
411+
(
412+
FAIntPCommands::Get().PluginAction,
413+
PluginCommands,
414+
LOCTEXT("MounteaSystemEditor_SupportButton_Label", "Mountea Support"),
415+
LOCTEXT("MounteaSystemEditor_SupportButton_ToolTip", "🆘 Open Mountea Framework Support channel"),
416+
FSlateIcon(FAIntPHelpStyle::GetStyleSetName(), "AIntPStyleSet.Help")
417+
);
418+
SupportEntry.Name = FName("MounteaFrameworkSupport");
419+
}
290420
}
291421
}
292422

293423
// Register in Level Editor Toolbar
294424
{
295-
UToolMenu* ToolbarMenu = UToolMenus::Get()->ExtendMenu("LevelEditor.LevelEditorToolBar.PlayToolBar");
425+
UToolMenu* ToolbarMenu = UToolMenus::Get()->ExtendMenu(MenuName);
296426
{
297-
FToolMenuSection& Section = ToolbarMenu->FindOrAddSection("MounteaFramework");
298-
{
299-
Section.Label = FText::FromString(TEXT("Mountea Framework"));
300-
301-
FToolMenuEntry& Entry = Section.AddEntry(FToolMenuEntry::InitToolBarButton(FAIntPCommands::Get().PluginAction));
302-
Entry.SetCommandList(PluginCommands);
303-
304-
Entry.InsertPosition.Position = EToolMenuInsertType::First;
305-
}
427+
ToolbarMenu->RemoveSection("MounteaFramework"); // Cleanup
428+
FToolMenuEntry& Entry = ToolbarMenu->FindOrAddSection("MounteaFramework")
429+
.AddEntry(FToolMenuEntry::InitComboButton(
430+
"MounteaMenu",
431+
FUIAction(),
432+
FOnGetContent::CreateRaw(this, &FActorInteractionPluginEditor::MakeMounteaMenuWidget),
433+
LOCTEXT("MounteaMainMenu_Label", "Mountea Framework"),
434+
LOCTEXT("MounteaMainMenu_Tooltip", "📂 Open Mountea Framework menu.\n\n❔ Provides link to Documentation, Support Discord and Dialogue tool."),
435+
FSlateIcon(FAIntPHelpStyle::Get().GetStyleSetName(), "AIntPStyleSet.Dialoguer"),
436+
false,
437+
"MounteaMenu"
438+
));
439+
440+
Entry.Label = LOCTEXT("MounteaFramework_Label", "Mountea Framework");
441+
Entry.Name = TEXT("MounteaMenu");
442+
Entry.StyleNameOverride = "CalloutToolbar";
443+
Entry.SetCommandList(PluginCommands);
306444
}
307445
}
308446
}
309447

448+
TSharedRef<SWidget> FActorInteractionPluginEditor::MakeMounteaMenuWidget() const
449+
{
450+
FMenuBuilder MenuBuilder(true, PluginCommands);
451+
452+
MenuBuilder.BeginSection("MounteaMenu_Links", LOCTEXT("MounteaMenuOptions_Options", "Mountea Links"));
453+
{
454+
// Support Entry
455+
MenuBuilder.AddMenuEntry(
456+
LOCTEXT("MounteaSystemEditor_SupportButton_Label", "Mountea Support"),
457+
LOCTEXT("MounteaSystemEditor_SupportButton_ToolTip", "🆘 Open Mountea Framework Support channel"),
458+
FSlateIcon(FAIntPHelpStyle::GetStyleSetName(), "AIntPStyleSet.Help"),
459+
FUIAction(
460+
FExecuteAction::CreateRaw(this, &FActorInteractionPluginEditor::PluginButtonClicked)
461+
)
462+
);
463+
// Wiki Entry
464+
MenuBuilder.AddMenuEntry(
465+
LOCTEXT("MounteaSystemEditor_WikiButton_Label", "Mountea Wiki"),
466+
LOCTEXT("MounteaSystemEditor_WikiButton_ToolTip", "📖 Open Mountea Framework Documentation"),
467+
FSlateIcon(FAIntPHelpStyle::GetStyleSetName(), "AIntPStyleSet.Wiki"),
468+
FUIAction(
469+
FExecuteAction::CreateRaw(this, &FActorInteractionPluginEditor::WikiButtonClicked)
470+
)
471+
);
472+
}
473+
MenuBuilder.EndSection();
474+
475+
MenuBuilder.BeginSection("MounteaMenu_Tools", LOCTEXT("MounteaMenuOptions_Tools", "Mountea Tools"));
476+
{
477+
// Dialoguer Entry
478+
MenuBuilder.AddMenuEntry(
479+
LOCTEXT("MounteaSystemEditor_DialoguerButton_Label", "Mountea Dialoguer"),
480+
LOCTEXT("MounteaSystemEditor_DialoguerButton_ToolTip", "⛰ Open Mountea Dialoguer Standalone Tool\n\n❔ Mountea Dialoguer is a standalone tool created for Dialogue crafting. Mountea Dialogue System supports native import for `.mnteadlg` files."),
481+
FSlateIcon(FAIntPHelpStyle::GetStyleSetName(), "AIntPStyleSet.Dialoguer"),
482+
FUIAction(
483+
FExecuteAction::CreateRaw(this, &FActorInteractionPluginEditor::DialoguerButtonClicked)
484+
)
485+
);
486+
}
487+
MenuBuilder.EndSection();
488+
489+
return MenuBuilder.MakeWidget();
490+
}
491+
310492
void FActorInteractionPluginEditor::OnGetResponse(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
311493
{
312494
FString ResponseBody;
@@ -337,6 +519,33 @@ void FActorInteractionPluginEditor::SendHTTPGet()
337519
Request->ProcessRequest();
338520
}
339521

522+
void FActorInteractionPluginEditor::OnGetResponse_Tags(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
523+
{
524+
525+
}
526+
527+
void FActorInteractionPluginEditor::SendHTTPGet_Tags()
528+
{
529+
const UMounteaInteractionEditorSettings* Settings = GetDefault<UMounteaInteractionEditorSettings>();
530+
if (DoesHaveValidTags())
531+
{
532+
if (!Settings->AllowCheckTagUpdate())
533+
{
534+
return;
535+
}
536+
}
537+
538+
const TSharedRef<IHttpRequest, ESPMode::ThreadSafe> Request = Http->CreateRequest();
539+
540+
Request->OnProcessRequestComplete().BindRaw(this, &FActorInteractionPluginEditor::OnGetResponse_Tags);
541+
Request->SetURL(Settings->GetGameplayTagsURL());
542+
543+
Request->SetVerb("GET");
544+
Request->SetHeader("User-Agent", "X-UnrealEngine-Agent");
545+
Request->SetHeader("Content-Type", "text");
546+
Request->ProcessRequest();
547+
}
548+
340549
#undef LOCTEXT_NAMESPACE
341550

342551
IMPLEMENT_MODULE(FActorInteractionPluginEditor, ActorInteractionPluginEditor);

Source/ActorInteractionPluginEditor/Private/HelpButton/AIntPHelpStyle.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ FName FAIntPHelpStyle::GetStyleSetName()
5050
#define TTF_FONT( RelativePath, ... ) FSlateFontInfo( Style->RootToContentDir( RelativePath, TEXT(".ttf") ), __VA_ARGS__ )
5151
#define OTF_FONT( RelativePath, ... ) FSlateFontInfo( Style->RootToContentDir( RelativePath, TEXT(".otf") ), __VA_ARGS__ )
5252

53+
const FVector2D Icon12x12(12.0f, 12.0f);
5354
const FVector2D Icon16x16(16.0f, 16.0f);
5455
const FVector2D Icon20x20(20.0f, 20.0f);
5556
const FVector2D Icon40x40(40.0f, 40.0f);
@@ -59,8 +60,23 @@ TSharedRef<FSlateStyleSet> FAIntPHelpStyle::Create()
5960
TSharedRef< FSlateStyleSet > Style = MakeShareable(new FSlateStyleSet("AIntPHelpStyle"));
6061
Style->SetContentRoot(IPluginManager::Get().FindPlugin("ActorInteractionPlugin")->GetBaseDir() / TEXT("Resources"));
6162

62-
Style->Set("AIntPSupport.PluginAction", new IMAGE_BRUSH(TEXT("Mountea_Logo"), Icon40x40));
63-
Style->Set("AIntPSupport.PluginAction.small", new IMAGE_BRUSH(TEXT("HelpIcon"), Icon20x20));
63+
Style->Set("AIntPStyleSet.PluginAction", new IMAGE_BRUSH(TEXT("Mountea_Logo"), Icon40x40));
64+
Style->Set("AIntPStyleSet.PluginAction.Small", new IMAGE_BRUSH(TEXT("Help_Icon"), Icon20x20));
65+
66+
Style->Set("AIntPStyleSet.Help.Small", new IMAGE_BRUSH(TEXT("Help_Icon"), Icon16x16));
67+
Style->Set("AIntPStyleSet.Help", new IMAGE_BRUSH(TEXT("Help_Icon"), Icon40x40));
68+
69+
Style->Set("AIntPStyleSet.Dialoguer.Small", new IMAGE_BRUSH(TEXT("Dialoguer_Icon"), Icon16x16));
70+
Style->Set("AIntPStyleSet.Dialoguer", new IMAGE_BRUSH(TEXT("Dialoguer_Icon"), Icon40x40));
71+
72+
Style->Set("AIntPStyleSet.Wiki.Small", new IMAGE_BRUSH(TEXT("Wiki_Icon"), Icon16x16));
73+
Style->Set("AIntPStyleSet.Wiki", new IMAGE_BRUSH(TEXT("Wiki_Icon"), Icon40x40));
74+
75+
Style->Set("AIntPStyleSet.Icon.Close", new IMAGE_BRUSH(TEXT("CloseIcon"), Icon16x16));
76+
Style->Set("AIntPStyleSet.Icon.SupportDiscord", new IMAGE_BRUSH(TEXT("Help_Icon"), Icon16x16));
77+
Style->Set("AIntPStyleSet.Icon.HeartIcon", new IMAGE_BRUSH(TEXT("HeartIcon"), Icon16x16));
78+
Style->Set("AIntPStyleSet.Icon.UBIcon", new IMAGE_BRUSH(TEXT("UnrealBucketIcon"), Icon16x16));
79+
Style->Set("AIntPStyleSet.Icon.MoneyIcon", new IMAGE_BRUSH(TEXT("MoneyIcon"), Icon16x16));
6480

6581
return Style;
6682
}

Source/ActorInteractionPluginEditor/Private/HelpButton/AIntPHelpStyle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "CoreMinimal.h"
66
#include "Styling/SlateStyle.h"
77

8-
class FAIntPHelpStyle
8+
class FAIntPHelpStyle : public FAppStyle
99
{
1010
public:
1111

0 commit comments

Comments
 (0)