Initial commit

This commit is contained in:
Иван Кузьменко 2025-02-01 07:45:07 +03:00
commit bb075d6353
20 changed files with 336 additions and 0 deletions

View file

@ -0,0 +1,44 @@
#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

View file

@ -0,0 +1 @@
uid://ywh4rud117pq

View file

@ -0,0 +1,46 @@
#if TOOLS
using Godot;
using System.Linq;
namespace PT;
[Tool]
public partial class PtContextMenuPlugin : EditorContextMenuPlugin
{
public void MarkAsPlaceholder(Variant filesVariant)
{
// TODO: recursively mark folders
var files = (string[])filesVariant;
if (files == null) return;
foreach (var fileName in files)
{
var file = FileAccess.Open(fileName + PlaceholderTracker.TODO_EXTENSION, FileAccess.ModeFlags.Write);
file.Close();
}
}
public void MarkAsReadyForRelease(Variant filesVariant)
{
// TODO: recursively mark folders
var files = (string[])filesVariant;
if (files == null) return;
foreach (var fileName in files)
{
DirAccess.RemoveAbsolute(fileName + PlaceholderTracker.TODO_EXTENSION);
}
}
public override void _PopupMenu(string[] paths)
{
if (paths.Any(path => !PlaceholderTracker.IsFilePlaceholder(path)))
AddContextMenuItem("Mark as placeholder", new Callable(this, MethodName.MarkAsPlaceholder));
if (paths.Any(path => PlaceholderTracker.IsFilePlaceholder(path)))
AddContextMenuItem("Mark as ready for release", new Callable(this, MethodName.MarkAsReadyForRelease));
}
}
#endif

View file

@ -0,0 +1 @@
uid://dj6jvvjkt4v02

View file

@ -0,0 +1,34 @@
#if TOOLS
using Godot;
using System.ComponentModel;
namespace PT;
[Tool]
public partial class PtExportPlugin : EditorExportPlugin
{
public override string _GetName()
{
return "Placeholder Tracker";
}
public override void _ExportFile(string path, string type, string[] features)
{
GD.PushWarning("TODO: warn user when a placeholder is encountered");
if (path.EndsWith(PlaceholderTracker.TODO_EXTENSION))
{
GD.PushWarning("TODO: encountered a .TODO file");
Skip();
return;
}
if (PlaceholderTracker.IsFilePlaceholder(path))
{
GD.PushWarning("TODO: found a placeholder!");
}
}
}
#endif

View file

@ -0,0 +1 @@
uid://cxhpmkoxg5y1a

View file

@ -0,0 +1 @@
uid://sb7w7ejl0xil

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://p5od1heikax6"
path="res://.godot/imported/baller_pfp.png-6e362a729b98a11e85abea41713e4a04.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/placeholder_tracker/baller_pfp.png"
dest_files=["res://.godot/imported/baller_pfp.png-6e362a729b98a11e85abea41713e4a04.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,7 @@
[plugin]
name="PlaceholderTracker"
description="Отслеживает и помечает новые файлы как \"заглушки\", тем самым позволяет отследить прогресс разработки ресурсов и не позволяет незаконченным ресурсам, потенциально содержащим нарушения авторских прав или непристойный контент, попасть в финальную сборку."
author="Tea Sanctuary"
version=""
script="PlaceholderTracker.cs"