Asset Drag'n'Drop preview

This commit is contained in:
Simon Lübeß
2023-08-02 14:59:35 +02:00
parent f654a4f379
commit 987246a806
2 changed files with 12 additions and 2 deletions
+2 -2
View File
@@ -228,8 +228,8 @@ class AssetHierarchy
{
if (File.Exists(fileToMove->AssetFile.AssetConfigPath))
{
String newConfigPathName = scope .(newPathName);
newConfigPathName.Append(AssetFile.ConfigFileExtension);
String newConfigPathName = scope .(newPathName);
newConfigPathName.Append(AssetFile.ConfigFileExtension);
if (File.Move(fileToMove->AssetFile.AssetConfigPath, newConfigPathName) case .Err(let error))
{
@@ -490,6 +490,16 @@ namespace GlitchyEditor.EditWindows
{
ImGui.SetDragDropPayload(.ContentBrowserItem, entry->Identifier, (uint64)entry->Identifier.Length, .Once);
float2 dndIconSize = (ImGui.GetFontSize() * 2.0f).XX;
ImGui.Image(image, (.)dndIconSize);
ImGui.SameLine();
ImGui.SetCursorPosY((dndIconSize.X - ImGui.GetFontSize()) / 2);
ImGui.Text(entry->Identifier);
ImGui.EndDragDropSource();
}