mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-27 09:03:54 -07:00
Display visual feedback of where cards will go (#5737)
This is part of the code from #4974, including an improved drag-and-drop API and its use to display visual feedback of card destination on the board. It does not include the improved logic for pushing cards around as I still need to figure out edge cases there - the logic for choosing where cards go is not changed, so some of the artifacts described in #4817 and #4975 (particularly around multi-card) are still present.
This commit is contained in:
parent
bd28e04635
commit
a7641a571f
6 changed files with 230 additions and 100 deletions
|
|
@ -1,11 +1,10 @@
|
|||
#include "card_zone.h"
|
||||
|
||||
#include "../cards/card_database_manager.h"
|
||||
#include "../cards/card_drag_item.h"
|
||||
#include "../cards/card_item.h"
|
||||
#include "../player/player.h"
|
||||
#include "pb/command_move_card.pb.h"
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "pile_zone.h"
|
||||
#include "view_zone.h"
|
||||
|
||||
#include <QAction>
|
||||
|
|
@ -233,7 +232,26 @@ void CardZone::moveAllToZone()
|
|||
player->sendGameCommand(cmd);
|
||||
}
|
||||
|
||||
QPointF CardZone::closestGridPoint(const QPointF &point)
|
||||
bool CardZone::dragEnter(CardDragItem *dragItem, const QPointF &pos)
|
||||
{
|
||||
return point;
|
||||
}
|
||||
Q_UNUSED(dragItem);
|
||||
Q_UNUSED(pos);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CardZone::dragMove(CardDragItem *dragItem, const QPointF &pos)
|
||||
{
|
||||
Q_UNUSED(dragItem);
|
||||
Q_UNUSED(pos);
|
||||
}
|
||||
|
||||
void CardZone::dragAccept(CardDragItem *dragItem, const QPointF &pos)
|
||||
{
|
||||
handleDropEvent(dragItem->getValidItems(), dragItem->getStartZone(), pos.toPoint());
|
||||
}
|
||||
|
||||
void CardZone::dragLeave(CardDragItem *dragItem)
|
||||
{
|
||||
Q_UNUSED(dragItem);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue