Hello there,
this question seems pretty specific to me (I haven’t found any answer yet), but I downloaded this useful plugin GitHub - jinyuliao/GenericGraph: Generic graph data structure plugin for ue4 and coded a dialogue system into it, which is perfectly working, BUT now I want to differentiate between the Generic Graph and my Dialogue Graph as you can see they appear quite similar (This can lead to confusion if they aren’t named correctly).
I am obviously quite new to plugin programming, but I haven’t found any good tutorial or wiki entry to begin with (They are either on how to start a plugin, but without functionality or they are outdated). I can’t of course tell you to download the plugin and help me out with it, so I’ll provide any bits of code which I think might be the reason for that I can’t change the color and name over all.
So: The “Generic Graph” is the super class of “Dialogue Session” and there is a “FAssetTypeActions_GenericGraph” which inherits from “FAssetTypeActions_Base”. In this class a “GetName()” function can be found which names the Objects Thumbnail, in this case “Graph332”. The Color is specified in the same class.
FText FAssetTypeActions_GenericGraph::GetName() const
{
return LOCTEXT("FGenericGraphAssetTypeActionsName", "Graph332");
}
So obviously changing the value will change the appearence of both objects, but how can I change the color of only one? **I thought maybe I need to get the class of the object ** within the “GetName()” function (Whether it’s a “Dialogue Session” or “Generic Graph”) and just check it and return a different name and color, but I can’t find any way to check the class of the object I want to create. Then I thought, that I may need to create a “FAssetTypeActions_DialogueGraph” class (Do I need to create a new AssetTypeActions class for each new Factory?), I have tried this, but this was a bit buggy, the “FAssetTypeActions_GenericGraph” class gets registered in the “GenericGraphEditor” file in the “StartupModule()” method.
void FGenericGraphEditor::StartupModule()
{
FGenericGraphEditorStyle::Initialize();
GraphPanelNodeFactory_GenericGraph = MakeShareable(new FGraphPanelNodeFactory_GenericGraph());
FEdGraphUtilities::RegisterVisualNodeFactory(GraphPanelNodeFactory_GenericGraph);
IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
GenericGraphAssetCategoryBit = AssetTools.RegisterAdvancedAssetCategory(FName(TEXT("Graphs")), LOCTEXT("GenericGraphAssetCategory", "Graphs"));
RegisterAssetTypeAction(AssetTools, MakeShareable(new FAssetTypeActions_GenericGraph(GenericGraphAssetCategoryBit)));
}
So I created a “FAssetTypeActions_DialogueGraph” class and registered it in there as well, but the color stayed the same for both objects (depending of what class was registered at the end).
I really don’t know if there is anyone reading this, who is familiar with creating custom assets and can help me out here, so I’ll try to contact the author of this plugin. (But I doubt that I’ll get a response, because he is probably too busy).
If there is anything unclear, please ask me about it (I know this seems quite overwhelming) and thanks for your effort reading this.