Skip to content

Commit 0a641af

Browse files
Merge branch '5.1_dev' into 5.1
2 parents 74e8bf5 + fe29dc4 commit 0a641af

33 files changed

+494
-82
lines changed

ActorInteractionPlugin.uplugin

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
{
22
"FileVersion": 3,
3-
"Version": 3,
4-
"VersionName": "4.0.1.51",
3+
"Version": 4,
4+
"VersionName": "4.0.2.51",
55
"FriendlyName": "Mountea Interaction System",
6-
"Description": "Mountea Interaction System 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.",
6+
"Description": "Mountea Interaction System is an Open-source Mountea Framework components-based simple framework providing utilities for smart Actor Interaction with other Actors.\nDeveloped with Game Developers in mind to allow as easy as possible implementation while maintaining high scalability and diverse options to tweak everything.",
77
"Category": "Mountea Framework",
8-
"CreatedBy": "Dominik Pavlicek",
8+
"CreatedBy": "Dominik (Pavlicek) Morse",
99
"CreatedByURL": "https://github.com/Mountea-Framework",
1010
"DocsURL": "https://github.com/Mountea-Framework/MounteaInteractionSystem/wiki",
1111
"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/product/ca842c00ec0d4db0b3aad17701e1637b",
1212
"SupportURL": "https://bit.ly/DominikPavlicek_SupportServer",
1313
"EngineVersion": "5.1.0",
1414
"CanContainContent": true,
15-
"IsBetaVersion": false,
16-
"IsExperimentalVersion": false,
1715
"Installed": true,
1816
"Modules": [
1917
{
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.
27.2 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
@@ -1031,6 +1031,8 @@ void UActorInteractorComponentBase::SetState_Server_Implementation(const EIntera
10311031

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

10361038
FString InteractorName = GetName();

Source/ActorInteractionPluginEditor/ActorInteractionPluginEditor.Build.cs

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

63-
"UMG"
63+
"UMG",
64+
65+
"GameplayTags"
6466
}
6567
);
6668

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);

0 commit comments

Comments
 (0)