34 #include "../input/cl_input.h"
64 return targetNode == node;
74 return sourceNode == node;
129 draggingItem = *item;
138 targetNode =
nullptr;
139 sourceNode =
nullptr;
151 assert(sourceNode !=
nullptr);
172 assert(sourceNode !=
nullptr);
203 if (node != targetNode) {
213 if (targetNode ==
nullptr) {
234 vec4_t color = { 1, 1, 1, 1 };
245 VectorSet(orgine, mousePosX, mousePosY, -50);
253 UI_DrawItem(
nullptr, orgine, &draggingItem, -1, -1, scale, color);
static void UI_DNDDrag(uiNode_t *node)
Private function to initialize a the start of a DND.
int UI_DNDGetType(void)
Return the current type of the dragging object, else DND_NOTHING.
uiNode_t * UI_DNDGetTargetNode(void)
Return target of the DND.
#define VectorSet(v, x, y, z)
Item * UI_DNDGetItem(void)
static uiNode_t * sourceNode
static const vec3_t scale
void UI_DNDDragItem(uiNode_t *node, const Item *item)
Start to drag an item.
uiNode_t * UI_GetNodeAtPosition(int x, int y)
Return the first visible node at a position.
void UI_DNDAbort(void)
Drop the object at the current position.
void UI_PlaySound(const char *soundFile)
Plays a ui sound.
static uiNode_t * targetNode
static bool positionAcceptDND
uiNode_t * UI_DNDGetSourceNode(void)
Return source of the DND.
static uiDNDType_t objectType
bool UI_Node_DndFinished(uiNode_t *node, bool isDroped)
Internal data use by the UI package.
C interface to allow to access to cpp node code.
bool UI_Node_DndEnter(uiNode_t *node)
item instance data, with linked list capability
static bool nodeAcceptDND
bool UI_Node_DndMove(uiNode_t *node, int x, int y)
bool UI_DNDIsTargetNode(uiNode_t *node)
Return true if the requested node is the current target of the DND.
Atomic structure used to define most of the UI.
bool UI_Node_DndDrop(uiNode_t *node, int x, int y)
void UI_DrawDragAndDrop(int mousePosX, int mousePosY)
Draw to dragging object and catch mouse move event.
static void UI_DNDCleanup(void)
Cleanup data about DND.
bool UI_DNDIsSourceNode(uiNode_t *node)
Return true if the requested node is the source of the DND.
void UI_Node_DndLeave(uiNode_t *node)
static void UI_DNDMouseMove(int mousePosX, int mousePosY)
Manage the DND when we move the mouse.
bool UI_DNDIsDragging(void)
Return true if we are dragging something.
void UI_DrawItem(uiNode_t *node, const vec3_t org, const Item *item, int x, int y, const vec3_t scale, const vec4_t color)
Draws an item to the screen.
void UI_DNDDrop(void)
Drop the object at the current position.