mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Allow dragging and dropping of Entities in editor
+ New Dictionary Helpers + Made ImGui Payloads safer + Start of Component drag'n'drop
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
namespace ImGui;
|
||||
|
||||
enum DragDropPayloadType
|
||||
{
|
||||
case ContentBrowserItem;
|
||||
case Entity;
|
||||
|
||||
public String GetName()
|
||||
{
|
||||
switch (this)
|
||||
{
|
||||
case .ContentBrowserItem:
|
||||
return "CONTENT_BROWSER_ITEM";
|
||||
case .Entity:
|
||||
return "ENTITY";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension ImGui
|
||||
{
|
||||
public static Payload* AcceptDragDropPayload(DragDropPayloadType type, DragDropFlags flags = .None)
|
||||
{
|
||||
return AcceptDragDropPayload(type.GetName(), flags);
|
||||
}
|
||||
|
||||
public static bool SetDragDropPayload(DragDropPayloadType type, void* data, size sz, Cond cond = .None)
|
||||
{
|
||||
return SetDragDropPayload(type.GetName(), data, sz, cond);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user