Commit ff0ecbda authored by mercury233's avatar mercury233

fix drag

parent 818c283f
......@@ -339,6 +339,16 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
case irr::EET_MOUSE_INPUT_EVENT: {
switch(event.MouseInput.Event) {
case irr::EMIE_LMOUSE_PRESSED_DOWN: {
mouse_pos = position2d<s32>(event.MouseInput.X, event.MouseInput.Y);
if(mainGame->cbDBLFList->getElementFromPoint(mouse_pos)
|| mainGame->cbDBDecks->getElementFromPoint(mouse_pos)
|| mainGame->cbCardType->getElementFromPoint(mouse_pos)
|| mainGame->cbCardType2->getElementFromPoint(mouse_pos)
|| mainGame->cbLimit->getElementFromPoint(mouse_pos)
|| mainGame->cbAttribute->getElementFromPoint(mouse_pos)
|| mainGame->cbRace->getElementFromPoint(mouse_pos)
|| mainGame->cbSortType->getElementFromPoint(mouse_pos))
break;
if(mainGame->wCategories->isVisible() || mainGame->wQuery->isVisible())
break;
if(hovered_pos == 0 || hovered_seq == -1)
......
......@@ -34,6 +34,7 @@ public:
int hovered_pos;
int hovered_seq;
int click_pos;
position2d<s32> mouse_pos;
bool is_draging;
int dragx;
int dragy;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment