Voltray Engine Docs
Loading...
Searching...
No Matches
Editor::Assets::AssetDragDrop Class Reference

Manages drag and drop operations for assets. More...

#include <AssetDragDrop.h>

Static Public Member Functions

static bool BeginDrag (const std::filesystem::path &assetPath, const std::string &assetType, bool isGlobal)
 Begin a drag operation for an asset.
 
static const DragDropPayloadAcceptDrop ()
 Check if there's an asset being dragged and handle drop.
 
static bool CanAcceptDrop (const std::string &targetType)
 Check if we can accept a drop at the current location.
 
static const DragDropPayloadGetDragPayload ()
 Get the current drag payload without consuming it.
 
static bool HandleViewportDrop (const DragDropPayload &payload, const ImVec2 &dropPosition)
 Handle asset drop into viewport.
 
static bool HandleSceneDrop (const DragDropPayload &payload)
 Handle asset drop into scene hierarchy.
 
static void RenderDragPreview ()
 Render drag preview overlay.
 

Detailed Description

Manages drag and drop operations for assets.

Member Function Documentation

◆ AcceptDrop()

const DragDropPayload * Editor::Assets::AssetDragDrop::AcceptDrop ( )
static

Check if there's an asset being dragged and handle drop.

Returns
Pointer to payload if drop occurred, nullptr otherwise

◆ BeginDrag()

bool Editor::Assets::AssetDragDrop::BeginDrag ( const std::filesystem::path &  assetPath,
const std::string &  assetType,
bool  isGlobal 
)
static

Begin a drag operation for an asset.

Parameters
assetPathPath to the asset being dragged
assetTypeType of the asset (model, texture, script, etc.)
isGlobalWhether this is a global asset
Returns
True if drag operation started successfully

◆ CanAcceptDrop()

bool Editor::Assets::AssetDragDrop::CanAcceptDrop ( const std::string &  targetType)
static

Check if we can accept a drop at the current location.

Parameters
targetTypeType of target (viewport, scene, etc.)
Returns
True if drop is valid

◆ GetDragPayload()

const DragDropPayload * Editor::Assets::AssetDragDrop::GetDragPayload ( )
static

Get the current drag payload without consuming it.

Returns
Pointer to payload if dragging, nullptr otherwise

◆ HandleSceneDrop()

bool Editor::Assets::AssetDragDrop::HandleSceneDrop ( const DragDropPayload payload)
static

Handle asset drop into scene hierarchy.

Parameters
payloadThe drag drop payload
Returns
True if drop was handled successfully

◆ HandleViewportDrop()

bool Editor::Assets::AssetDragDrop::HandleViewportDrop ( const DragDropPayload payload,
const ImVec2 &  dropPosition 
)
static

Handle asset drop into viewport.

Parameters
payloadThe drag drop payload
dropPositionScreen position where drop occurred
Returns
True if drop was handled successfully

◆ RenderDragPreview()

void Editor::Assets::AssetDragDrop::RenderDragPreview ( )
static

Render drag preview overlay.


The documentation for this class was generated from the following files: