44 lines
1 KiB
C#
44 lines
1 KiB
C#
#if TOOLS
|
|
using Godot;
|
|
using System;
|
|
|
|
namespace PT;
|
|
|
|
[Tool]
|
|
public partial class PlaceholderTracker : EditorPlugin
|
|
{
|
|
public const string TODO_EXTENSION = ".todo";
|
|
|
|
public static bool IsFilePlaceholder(string path) => FileAccess.FileExists(path + TODO_EXTENSION);
|
|
|
|
PtExportPlugin _exportPlugin;
|
|
PtContextMenuPlugin _contextMenuPlugin;
|
|
|
|
public override void _EnterTree()
|
|
{
|
|
// AddImportPlugin
|
|
// AddResourceConversionPlugin
|
|
_exportPlugin = new PtExportPlugin();
|
|
AddExportPlugin(_exportPlugin);
|
|
|
|
_contextMenuPlugin = new PtContextMenuPlugin();
|
|
AddContextMenuPlugin(EditorContextMenuPlugin.ContextMenuSlot.Filesystem, _contextMenuPlugin);
|
|
}
|
|
|
|
public override void _ExitTree()
|
|
{
|
|
RemoveContextMenuPlugin(_contextMenuPlugin);
|
|
RemoveExportPlugin(_exportPlugin);
|
|
}
|
|
|
|
public override string _GetPluginName()
|
|
{
|
|
return "Placeholder Tracker";
|
|
}
|
|
|
|
public override void _Notification(int what)
|
|
{
|
|
//GD.PrintErr(what);
|
|
}
|
|
}
|
|
#endif
|