1#ifndef YAZE_APP_GUI_CORE_DRAG_DROP_H_
2#define YAZE_APP_GUI_CORE_DRAG_DROP_H_
6#include "imgui/imgui.h"
55 if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAllowNullID)) {
58 ImGui::Text(
"Tile #%d", tile_id);
59 ImGui::EndDragDropSource();
66 if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAllowNullID)) {
69 ImGui::Text(
"Sprite #%d", sprite_id);
70 ImGui::EndDragDropSource();
78 if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAllowNullID)) {
81 ImGui::Text(
"Color [%d:%d:%d]", group_idx, palette_idx, color_idx);
82 ImGui::EndDragDropSource();
89 int pos_x,
int pos_y) {
90 if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAllowNullID)) {
94 ImGui::Text(
"Object 0x%04X", object_id);
95 ImGui::EndDragDropSource();
107 if (ImGui::BeginDragDropTarget()) {
108 if (
const ImGuiPayload* payload =
111 ImGui::EndDragDropTarget();
114 ImGui::EndDragDropTarget();
120 if (ImGui::BeginDragDropTarget()) {
121 if (
const ImGuiPayload* payload =
124 ImGui::EndDragDropTarget();
127 ImGui::EndDragDropTarget();
133 if (ImGui::BeginDragDropTarget()) {
134 if (
const ImGuiPayload* payload =
137 ImGui::EndDragDropTarget();
140 ImGui::EndDragDropTarget();
146 if (ImGui::BeginDragDropTarget()) {
147 if (
const ImGuiPayload* payload =
150 ImGui::EndDragDropTarget();
153 ImGui::EndDragDropTarget();
constexpr const char * kDragPayloadRoomObject
bool BeginRoomObjectDragSource(uint16_t object_id, int room_id, int pos_x, int pos_y)
bool BeginSpriteDragSource(int sprite_id, int room_id)
constexpr const char * kDragPayloadTile16
bool AcceptTileDrop(TileDragPayload *out)
Accept a tile16 drop. Returns true if a payload was accepted.
constexpr const char * kDragPayloadPalette
bool BeginTileDragSource(int tile_id, int map_id)
bool AcceptRoomObjectDrop(RoomObjectDragPayload *out)
bool AcceptSpriteDrop(SpriteDragPayload *out)
bool AcceptPaletteDrop(PaletteDragPayload *out)
bool BeginPaletteDragSource(int group_idx, int palette_idx, int color_idx)
constexpr const char * kDragPayloadSprite