11// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
22
33#include " Containers/Array.h"
4+ #include " ISettingsModule.h"
5+ #include " ISettingsSection.h"
46#include " Modules/ModuleInterface.h"
57#include " Modules/ModuleManager.h"
68#include " Templates/SharedPointer.h"
79#include " Toolkits/AssetEditorToolkit.h"
810
911#include " AssetTools/TextAssetActions.h"
1012#include " Styles/TextAssetEditorStyle.h"
13+ #include " TextAssetEditorSettings.h"
1114
1215
1316#define LOCTEXT_NAMESPACE " FTextAssetEditorModule"
@@ -51,12 +54,14 @@ class FTextAssetEditorModule
5154
5255 RegisterAssetTools ();
5356 RegisterMenuExtensions ();
57+ RegisterSettings ();
5458 }
5559
5660 virtual void ShutdownModule () override
5761 {
5862 UnregisterAssetTools ();
5963 UnregisterMenuExtensions ();
64+ UnregisterSettings ();
6065 }
6166
6267 virtual bool SupportsDynamicReloading () override
@@ -86,6 +91,21 @@ class FTextAssetEditorModule
8691 RegisteredAssetTypeActions.Add (Action);
8792 }
8893
94+ /* * Register the text asset editor settings. */
95+ void RegisterSettings ()
96+ {
97+ ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>(" Settings" );
98+
99+ if (SettingsModule != nullptr )
100+ {
101+ ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings (" Editor" , " Plugins" , " TextAsset" ,
102+ LOCTEXT (" TextAssetSettingsName" , " Text Asset" ),
103+ LOCTEXT (" TextAssetSettingsDescription" , " Configure the Text Asset plug-in." ),
104+ GetMutableDefault<UTextAssetEditorSettings>()
105+ );
106+ }
107+ }
108+
89109 /* * Unregisters asset tool actions. */
90110 void UnregisterAssetTools ()
91111 {
@@ -102,6 +122,17 @@ class FTextAssetEditorModule
102122 }
103123 }
104124
125+ /* * Unregister the text asset editor settings. */
126+ void UnregisterSettings ()
127+ {
128+ ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>(" Settings" );
129+
130+ if (SettingsModule != nullptr )
131+ {
132+ SettingsModule->UnregisterSettings (" Editor" , " Plugins" , " TextAsset" );
133+ }
134+ }
135+
105136protected:
106137
107138 /* * Registers main menu and tool bar menu extensions. */
0 commit comments