Skip to content

Commit

Permalink
Fixed missing articy toolbar buttons. They now live in the Settings m…
Browse files Browse the repository at this point in the history
…enu.
  • Loading branch information
brwarner committed Aug 6, 2021
1 parent ef76c43 commit 4e1c5a8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 38 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,9 @@ When exporting, chose your Unreal projects **Content** folder as the target for

After every export, going back to Unreal will trigger the ArticyImporter plugin to automatically parse the new file and show a prompt to import the changes. While this option is generally robust, there are certain cases in which more control over the import process is required.

Therefore the articy importer menu, which can be accessed via the level toolbar, enables you to import with more control.
Therefore the articy importer menu, which can be accessed via the Settings menu, enables you to import with more control.

<p align="center">
<img src="https://www.articy.com/articy-importer/unreal/articywindow.png">
</p>
![](docs/ImporterButtonUE5.png)

- Full Reimport: This option will always regenerate code and compile it, and afterwards generate the articy assets
- Import Changes: This option will only regenerate code and compile it if necessary, but will always regenerate assets. This is generally faster than a full reimport and is the same as clicking on 'Import' on the prompt Unreal shows you when you've exported.
Expand Down Expand Up @@ -289,7 +287,7 @@ store the branch in every button. When you instantiate the button you should pas
If you want to learn more about the flow player and its events you can read the [unity documentation](https://www.articy.com/articy-importer/unity/html/howto_flowplayer.htm) as both implementations are based on the same principles.

## Articy Global Variables Debugger
The Global Variables debugger can be accessed in the toolbar. It shows all global variables while the game is running and lets you search by namespace or variable namewhich makes it easy to follow what is happening inside the game and to debug problems in relation to global variables.
The Global Variables debugger can be accessed in the Settings menu on the right hand side of the level editor. It shows all global variables while the game is running and lets you search by namespace or variable namewhich makes it easy to follow what is happening inside the game and to debug problems in relation to global variables.
Furthermore, you can also change the global variables while the game is running, and your game code that listens to variable changes is going to get triggered. This is useful to replicate specific conditions without needing to go through all steps manually.
For example, if your global variables control your quest states, checking a "quest accepted" global variable in the debugger will make your quest system initiate a quest.

Expand Down
3 changes: 2 additions & 1 deletion Source/ArticyEditor/ArticyEditor.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public ArticyEditor(ReadOnlyTargetRules Target) : base(Target)
"EditorWidgets",
"SourceControl",
"GraphEditor",
"ApplicationCore"
"ApplicationCore",
"ToolMenus",
}
);

Expand Down
41 changes: 11 additions & 30 deletions Source/ArticyEditor/Private/ArticyEditorModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@
#include "HAL/FileManager.h"
#include "Widgets/Images/SImage.h"
#include "IDirectoryWatcher.h"
#include "Framework/MultiBox/MultiBoxBuilder.h"
#include "LevelEditor.h"
#include "Customizations/ArticyPinFactory.h"
#include "Customizations/AssetActions/AssetTypeActions_ArticyGV.h"
#include "Customizations/Details/ArticyGVCustomization.h"
#include "Customizations/Details/ArticyPluginSettingsCustomization.h"
#include "Customizations/Details/ArticyIdCustomization.h"
#include "Customizations/Details/ArticyRefCustomization.h"
#include "ToolMenus.h"

DEFINE_LOG_CATEGORY(LogArticyEditor)

Expand All @@ -42,14 +41,14 @@ void FArticyEditorModule::StartupModule()
{
CustomizationManager = MakeShareable(new FArticyEditorCustomizationManager);

RegisterArticyToolbar();
RegisterAssetTypeActions();
RegisterConsoleCommands();
RegisterDefaultArticyIdPropertyWidgetExtensions();
RegisterDetailCustomizations();
RegisterGraphPinFactory();
RegisterPluginSettings();
RegisterPluginCommands();
RegisterArticyToolbar();
// directory watcher has to be changed or removed as the results aren't quite deterministic
//RegisterDirectoryWatcher();
RegisterToolTabs();
Expand Down Expand Up @@ -130,16 +129,16 @@ TArray<UArticyPackage*> FArticyEditorModule::GetPackagesSlow()

void FArticyEditorModule::RegisterArticyToolbar()
{
FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
{/*
TSharedPtr<FExtender> MenuExtender = MakeShareable(new FExtender());
MenuExtender->AddMenuExtension("WindowLayout", EExtensionHook::After, PluginCommands, FMenuExtensionDelegate::CreateRaw(this, &FStyleCheckerModule::AddMenuExtension));
LevelEditorModule.GetMenuExtensibilityManager()->AddExtender(MenuExtender);*/
}
// Grab the appropriate toolbar menu so we can extend it
UToolMenu* Menu = UToolMenus::Get()->ExtendMenu("LevelEditor.LevelEditorToolBar.LevelToolbarQuickSettings");

{
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
ToolbarExtender->AddToolBarExtension("Settings", EExtensionHook::After, PluginCommands, FToolBarExtensionDelegate::CreateRaw(this, &FArticyEditorModule::AddToolbarExtension));
LevelEditorModule.GetToolBarExtensibilityManager()->AddExtender(ToolbarExtender);
// Create a new section for Articy utilities
FToolMenuSection& Section = Menu->AddSection("ArticyUtilities", LOCTEXT("ArticyUtilities", "Articy Utilities"));

// Add buttons
Section.AddMenuEntryWithCommandList(FArticyEditorCommands::Get().OpenArticyImporter, PluginCommands);
Section.AddMenuEntryWithCommandList(FArticyEditorCommands::Get().OpenArticyGVDebugger, PluginCommands);
}
}

Expand Down Expand Up @@ -315,24 +314,6 @@ void FArticyEditorModule::TriggerQueuedImport(bool b)
UnqueueImport();
}

void FArticyEditorModule::AddToolbarExtension(FToolBarBuilder& Builder)
{
Builder.AddComboButton(FUIAction(), FOnGetContent::CreateRaw(this, &FArticyEditorModule::OnGenerateArticyToolsMenu), FText::FromString(TEXT("Articy Tools")), TAttribute<FText>(), FSlateIcon(FArticyEditorStyle::GetStyleSetName(), "ArticyImporter.ArticyImporter.40") );
//Builder.AddToolBarButton(FArticyEditorCommands::Get().OpenPluginWindow, NAME_None, TAttribute<FText>(), TAttribute<FText>(), FSlateIcon(FArticyEditorStyle::GetStyleSetName(), "ArticyImporter.ArticyImporter.40") );
}

TSharedRef<SWidget> FArticyEditorModule::OnGenerateArticyToolsMenu() const
{
FMenuBuilder MenuBuilder(true, PluginCommands);

MenuBuilder.BeginSection("ArticyTools", LOCTEXT("ArticyTools", "Articy Tools"));
MenuBuilder.AddMenuEntry(FArticyEditorCommands::Get().OpenArticyImporter);
MenuBuilder.AddMenuEntry(FArticyEditorCommands::Get().OpenArticyGVDebugger);
MenuBuilder.EndSection();

return MenuBuilder.MakeWidget();
}

TSharedRef<SDockTab> FArticyEditorModule::OnSpawnArticyMenuTab(const FSpawnTabArgs& SpawnTabArgs) const
{
float ButtonWidth = 333.f / 1.3f;
Expand Down
2 changes: 0 additions & 2 deletions Source/ArticyEditor/Public/ArticyEditorModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ class FArticyEditorModule : public IModuleInterface
void UnqueueImport();
void TriggerQueuedImport(bool b);

void AddToolbarExtension(FToolBarBuilder& Builder);
TSharedRef<SWidget> OnGenerateArticyToolsMenu() const;
TSharedRef<class SDockTab> OnSpawnArticyMenuTab(const class FSpawnTabArgs& SpawnTabArgs) const;
TSharedRef<class SDockTab> OnSpawnArticyGVDebuggerTab(const class FSpawnTabArgs& SpawnTabArgs) const;

Expand Down
Binary file added docs/ImporterButtonUE5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4e1c5a8

Please sign in to comment.