mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-10 12:23:58 -07:00
arrows can target players; card attachment works
This commit is contained in:
parent
61b82bd6f9
commit
614f106304
32 changed files with 885 additions and 402 deletions
|
|
@ -23,6 +23,7 @@ protected:
|
|||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
public:
|
||||
ArrowItem(Player *_player, int _id, ArrowTarget *_startItem, ArrowTarget *_targetItem, const QColor &color);
|
||||
~ArrowItem();
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
QRectF boundingRect() const { return path.boundingRect(); }
|
||||
QPainterPath shape() const { return path; }
|
||||
|
|
@ -30,6 +31,7 @@ public:
|
|||
void updatePath(const QPointF &endPoint);
|
||||
|
||||
int getId() const { return id; }
|
||||
Player *getPlayer() const { return player; }
|
||||
void setStartItem(ArrowTarget *_item) { startItem = _item; }
|
||||
void setTargetItem(ArrowTarget *_item) { targetItem = _item; }
|
||||
ArrowTarget *getStartItem() const { return startItem; }
|
||||
|
|
@ -41,11 +43,20 @@ class ArrowDragItem : public ArrowItem {
|
|||
private:
|
||||
QList<ArrowDragItem *> childArrows;
|
||||
public:
|
||||
ArrowDragItem(ArrowTarget *_startItem, const QColor &_color);
|
||||
ArrowDragItem(Player *_owner, ArrowTarget *_startItem, const QColor &_color);
|
||||
void addChildArrow(ArrowDragItem *childArrow);
|
||||
protected:
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
};
|
||||
|
||||
class ArrowAttachItem : public ArrowItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ArrowAttachItem(ArrowTarget *_startItem);
|
||||
protected:
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
};
|
||||
|
||||
#endif // ARROWITEM_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue