#include <AssetBrowserBus.h>
Public Types | |
using | SourceFileCreatorFunctionType = AZStd::function< void(const AZStd::string &, const AZ::Uuid &)> |
Public Member Functions | |
SourceFileCreatorDetails (const AZStd::string &identifier, const AZStd::string &displayText, QIcon icon, SourceFileCreatorFunctionType functionToCall) | |
Public Attributes | |
AZStd::string | m_identifier |
choose something unique for your opener. It may be used to restore state. it will not be shown to user. | |
AZStd::string | m_displayText |
QIcon | m_iconToUse |
optional. Same as m_displayText. Used when there's ambiguity. If empty, no icon. | |
SourceFileCreatorFunctionType | m_creator |
This struct is used to respond about being able to create source files. See AssetBrowserInteractionNotifications::OpenSourceFileInEditor below
using AzToolsFramework::AssetBrowser::SourceFileCreatorDetails::SourceFileCreatorFunctionType = AZStd::function<void(const AZStd::string& , const AZ::Uuid& )> |
You provide a function to call if your creator is chosen to handle the create operation. Using a lambda is the prefered method to use for performance reasons.
SourceFileCreatorFunctionType AzToolsFramework::AssetBrowser::SourceFileCreatorDetails::m_creator |
This is the function to call. If you fill a nullptr in here, then the default operating system behavior will be suppressed but no creator will be opened. This will also cause the 'create' option in context menus to disappear if the only creators are nullptr ones.
AZStd::string AzToolsFramework::AssetBrowser::SourceFileCreatorDetails::m_displayText |
m_displayText is used when more than one listener offers to create this kind of file and we need the user to pick which one they want. They will be offered all the available creators in a menu which shows this text, and the one they pick will get its SourceFileCreatorFunctionType called.