Skip to content

Commit 80a9fb7

Browse files
Merge branch '5.3_dev' into 5.3
2 parents 72986d3 + 6923533 commit 80a9fb7

File tree

11 files changed

+91
-7
lines changed

11 files changed

+91
-7
lines changed

MounteaDialogueSystem.uplugin

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"FileVersion": 3,
33
"Version": 3,
4-
"VersionName": "3.0.2.53",
4+
"VersionName": "3.0.3.53",
55
"FriendlyName": "Mountea Dialogue System",
66
"Description": "Mountea Dialogue System is an Open-source Mountea Framework tool for Unreal Engine for creating (not just) complex dialogues!\nProvides its own Dialogue Tree editor and validation system.",
77
"Category": "Mountea Framework",
@@ -44,5 +44,11 @@
4444
"Win64"
4545
]
4646
}
47+
],
48+
"Plugins": [
49+
{
50+
"Name": "CommonUI",
51+
"Enabled": true
52+
}
4753
]
48-
}
54+
}

Resources/FolderIcon.png

4.64 KB
Loading

Resources/LevelIcon.png

7.93 KB
Loading

Resources/configIcon.png

4.56 KB
Loading

Source/MounteaDialogueSystem/Private/Components/MounteaDialogueManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ void UMounteaDialogueManager::NodePrepared_Implementation()
814814

815815
void UMounteaDialogueManager::ProcessNode_Implementation()
816816
{
817-
if (DialogueContext && DialogueContext->ActiveNode)
817+
if (DialogueContext && DialogueContext->ActiveNode && DialogueContext->ActiveDialogueParticipant.GetObject())
818818
{
819819
DialogueContext->ActiveNode->ProcessNode(this);
820820

@@ -824,7 +824,7 @@ void UMounteaDialogueManager::ProcessNode_Implementation()
824824
Execute_ProcessDialogueRow(this);
825825
}
826826
else
827-
OnDialogueFailed.Broadcast(TEXT("[Process Node] Invalid Context or Active Node!"));
827+
OnDialogueFailed.Broadcast(TEXT("[Process Node] Invalid Context or Active Node or Active Dialogue Participant!"));
828828
}
829829

830830
void UMounteaDialogueManager::NodeProcessed_Implementation()

Source/MounteaDialogueSystem/Public/Interfaces/Core/MounteaDialogueParticipantInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct FDialogueTraversePath
5656
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Mountea|Dialogue|TraversePath", meta=(IgnoreForMemberInitializationTest))
5757
FGuid NodeGuid;
5858

59-
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Mountea|Dialogue|TraversePath")
59+
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Mountea|Dialogue|TraversePath", meta=(IgnoreForMemberInitializationTest))
6060
FGuid GraphGuid;
6161

6262
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Mountea|Dialogue|TraversePath")

Source/MounteaDialogueSystemEditor/Private/EditorStyle/FMounteaDialogueGraphEditorStyle.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,13 @@ void FMounteaDialogueGraphEditorStyle::Create()
161161
StyleSet->Set("MDSStyleSet.Settings.Small", new IMAGE_BRUSH(TEXT("settings_icon"), Icon16x16));
162162
StyleSet->Set("MDSStyleSet.Settings.large", new IMAGE_BRUSH(TEXT("settings_icon"), Icon64x64));
163163

164+
StyleSet->Set("MDSStyleSet.Config", new IMAGE_BRUSH(TEXT("configIcon"), Icon40x40));
165+
164166
StyleSet->Set("MDSStyleSet.DialogueSystemIcon", new IMAGE_BRUSH(TEXT("DialogueSystem_Icon"), Icon16x16));
165167

166168
StyleSet->Set("MDSStyleSet.Tutorial", new IMAGE_BRUSH(TEXT("tutorialPage_icon"), Icon16x16));
169+
StyleSet->Set("MDSStyleSet.Folder", new IMAGE_BRUSH(TEXT("FolderIcon"), Icon40x40));
170+
StyleSet->Set("MDSStyleSet.Level", new IMAGE_BRUSH(TEXT("LevelIcon"), Icon40x40));
167171

168172
const FButtonStyle MounteaButtonStyle = FButtonStyle()
169173
.SetNormal(BOX_BRUSH("RoundedSelection_16x", 4.0f / 16.0f, FLinearColor(1, 1, 1, 0.1f)))

Source/MounteaDialogueSystemEditor/Private/MounteaDialogueSystemEditor.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
#include "AssetToolsModule.h"
66
#include "ContentBrowserModule.h"
7+
#include "FileHelpers.h"
78
#include "GameplayTagsManager.h"
89
#include "HttpModule.h"
10+
#include "IContentBrowserSingleton.h"
911
#include "ISettingsModule.h"
1012

1113
#include "AssetActions/MounteaDialogueAdditionalDataAssetAction.h"
@@ -43,6 +45,7 @@
4345
#include "ImportConfig/MounteaDialogueImportConfig.h"
4446
#include "Interfaces/IMainFrameModule.h"
4547
#include "Settings/MounteaDialogueGraphEditorSettings.h"
48+
#include "Settings/MounteaDialogueSystemSettings.h"
4649

4750
const FString ChangelogURL = FString("https://raw.githubusercontent.com/Mountea-Framework/MounteaDialogueSystem/master/CHANGELOG.md");
4851

@@ -793,6 +796,19 @@ void FMounteaDialogueSystemEditor::EditorSettingsButtonClicked() const
793796
FModuleManager::LoadModuleChecked<ISettingsModule>("Settings").ShowViewer("Project", TEXT("Mountea Framework"), TEXT("Mountea Dialogue System (Editor)"));
794797
}
795798

799+
void FMounteaDialogueSystemEditor::ConfigButtonClicked() const
800+
{
801+
auto settings = GetMutableDefault<UMounteaDialogueSystemSettings>();
802+
auto config = settings ? settings->GetDialogueConfiguration().LoadSynchronous() : nullptr;
803+
if (!IsValid(config))
804+
{
805+
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(TEXT("Unable to locate the Mountea Dialogue Config asset.\nPlease, open Mountea Dialogue Settings and select proper Config!")));
806+
return;
807+
}
808+
809+
GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->OpenEditorForAsset(config->GetPathName());
810+
}
811+
796812
TSharedRef<SWidget> FMounteaDialogueSystemEditor::MakeMounteaMenuWidget() const
797813
{
798814
FMenuBuilder MenuBuilder(true, PluginCommands);
@@ -807,11 +823,51 @@ TSharedRef<SWidget> FMounteaDialogueSystemEditor::MakeMounteaMenuWidget() const
807823
FExecuteAction::CreateRaw(this, &FMounteaDialogueSystemEditor::TutorialButtonClicked)
808824
)
809825
);
826+
827+
MenuBuilder.AddMenuEntry(
828+
LOCTEXT("MounteaSystemEditor_OpenExampleLevel_Label", "Open Example Level"),
829+
LOCTEXT("MounteaSystemEditor_OpenExampleLevel_ToolTip", "🌄 Opens an example level demonstrating Mountea Dialogue System"),
830+
FSlateIcon(FMounteaDialogueGraphEditorStyle::GetAppStyleSetName(), "MDSStyleSet.Level"),
831+
FUIAction(
832+
FExecuteAction::CreateLambda([]()
833+
{
834+
const FString mapPath = TEXT("/MounteaDialogueSystem/Example/M_DialogueExample");
835+
if (FPackageName::DoesPackageExist(mapPath))
836+
FEditorFileUtils::LoadMap(mapPath, false, true);
837+
else
838+
EditorLOG_ERROR(TEXT("Example map not found at:\nContent/Mountea/Maps/M_DialogueExample.umap"))
839+
})
840+
)
841+
);
842+
843+
MenuBuilder.AddMenuEntry(
844+
LOCTEXT("MounteaSystemEditor_OpenPluginFolder_Label", "Open Plugin Folder"),
845+
LOCTEXT("MounteaSystemEditor_OpenPluginFolder_ToolTip", "📂 Open the Mountea Dialogue plugin's folder"),
846+
FSlateIcon(FMounteaDialogueGraphEditorStyle::GetAppStyleSetName(), "MDSStyleSet.Folder"),
847+
FUIAction(
848+
FExecuteAction::CreateLambda([]()
849+
{
850+
const FContentBrowserModule& contentBrowserModule = FModuleManager::LoadModuleChecked<FContentBrowserModule>("ContentBrowser");
851+
TArray<FString> folderPaths;
852+
folderPaths.Add(TEXT("/MounteaDialogueSystem"));
853+
contentBrowserModule.Get().SetSelectedPaths(folderPaths, true);
854+
})
855+
)
856+
);
810857
};
811858
MenuBuilder.EndSection();
812859

813860
MenuBuilder.BeginSection("MounteaMenu_Tools", LOCTEXT("MounteaMenuOptions_Settings", "Mountea Dialogue Settings"));
814861
{
862+
MenuBuilder.AddMenuEntry(
863+
LOCTEXT("MounteaSystemEditor_ConfigButton_Label", "Mountea Dialogue Config"),
864+
LOCTEXT("MounteaSystemEditor_ConfigButton_ToolTip", "📄 Open Mountea Dialogue Configuration\n\n❔ Define dialogue UI, subtitles and important settings behaviors used by the core system."),
865+
FSlateIcon(FMounteaDialogueGraphEditorStyle::GetAppStyleSetName(), "MDSStyleSet.Config"),
866+
FUIAction(
867+
FExecuteAction::CreateRaw(this, &FMounteaDialogueSystemEditor::ConfigButtonClicked)
868+
)
869+
);
870+
815871
MenuBuilder.AddMenuEntry(
816872
LOCTEXT("MounteaSystemEditor_SettingsButton_Label", "Mountea Dialogue Settings"),
817873
LOCTEXT("MounteaSystemEditor_SettingsButton_ToolTip", "⚙ Open Mountea Dialogue Settings\n\n❔ Configure core dialogue system settings including default behaviors, performance options, and dialogue flow parameters. Customize your dialogue system's foundation here."),

Source/MounteaDialogueSystemEditor/Private/Popups/MDSPopup.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,23 @@ FPluginVersion MDSPopup::GetPluginVersion()
137137
return FPluginVersion(Version, VersionName);
138138
}
139139

140+
bool MDSPopup::IsVersionGreater(const FString& NewVersion, const FString& OldVersion)
141+
{
142+
TArray<FString> NewParts, OldParts;
143+
NewVersion.ParseIntoArray(NewParts, TEXT("."), true);
144+
OldVersion.ParseIntoArray(OldParts, TEXT("."), true);
145+
while (NewParts.Num() < 4) NewParts.Add(TEXT("0"));
146+
while (OldParts.Num() < 4) OldParts.Add(TEXT("0"));
147+
for (int32 i = 0; i < 4; ++i)
148+
{
149+
int32 NewNum = FCString::Atoi(*NewParts[i]);
150+
int32 OldNum = FCString::Atoi(*OldParts[i]);
151+
if (NewNum > OldNum) return true;
152+
if (NewNum < OldNum) return false;
153+
}
154+
return false;
155+
}
156+
140157
void MDSPopup::Register(const FString& Changelog)
141158
{
142159
const FString PluginDirectory = IPluginManager::Get().FindPlugin(TEXT("MounteaDialogueSystem"))->GetBaseDir();
@@ -163,7 +180,7 @@ void MDSPopup::Register(const FString& Changelog)
163180
CurrentPluginVersion = ChangelogVersion;
164181
}
165182

166-
if (MDSPopupConfig->PluginVersionUpdate != CurrentPluginVersion)
183+
if (IsVersionGreater(CurrentPluginVersion, MDSPopupConfig->PluginVersionUpdate))
167184
{
168185
MDSPopupConfig->PluginVersionUpdate = CurrentPluginVersion;
169186
MDSPopupConfig->SaveConfig(CPF_Config, *NormalizedConfigFilePath);

Source/MounteaDialogueSystemEditor/Private/Popups/MDSPopup.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ class MDSPopup
2323
static void FormatTextWithTags(FString& SourceText, const FString& StartMarker, const FString& EndMarker, const FString& StartTag, const FString& EndTag);
2424

2525
static FPluginVersion GetPluginVersion();
26+
static bool IsVersionGreater(const FString& NewVersion, const FString& OldVersion);
2627
};

0 commit comments

Comments
 (0)