Sending card name to chat on shift+click (#3106)
This commit is contained in:
parent
8084ab605f
commit
11ad677fe8
5 changed files with 16 additions and 3 deletions
|
@ -271,7 +271,9 @@ void AbstractCardItem::setFaceDown(bool _facedown)
|
|||
|
||||
void AbstractCardItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if ((event->modifiers() & Qt::ControlModifier)) {
|
||||
if ((event->modifiers() & Qt::AltModifier) && event->button() == Qt::LeftButton) {
|
||||
emit cardShiftClicked(name);
|
||||
} else if ((event->modifiers() & Qt::ControlModifier)) {
|
||||
setSelected(!isSelected());
|
||||
} else if (!isSelected()) {
|
||||
scene()->clearSelection();
|
||||
|
|
|
@ -38,6 +38,7 @@ signals:
|
|||
void deleteCardInfoPopup(QString cardName);
|
||||
void updateCardMenu(AbstractCardItem *card);
|
||||
void sigPixmapUpdated();
|
||||
void cardShiftClicked(QString cardName);
|
||||
|
||||
public:
|
||||
enum
|
||||
|
|
|
@ -368,7 +368,8 @@ void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
owner->updateCardMenu(this);
|
||||
cardMenu->exec(event->screenPos());
|
||||
}
|
||||
} else if ((event->button() == Qt::LeftButton) && !settingsCache->getDoubleClickToPlay()) {
|
||||
} else if ((event->modifiers() != Qt::AltModifier) && (event->button() == Qt::LeftButton) &&
|
||||
(!settingsCache->getDoubleClickToPlay())) {
|
||||
bool hideCard = false;
|
||||
if (zone && zone->getIsView()) {
|
||||
ZoneViewZone *view = static_cast<ZoneViewZone *>(zone);
|
||||
|
@ -388,7 +389,8 @@ void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
|
||||
void CardItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (settingsCache->getDoubleClickToPlay() && event->buttons() == Qt::LeftButton) {
|
||||
if ((event->modifiers() != Qt::AltModifier) && (settingsCache->getDoubleClickToPlay()) &&
|
||||
(event->buttons() == Qt::LeftButton)) {
|
||||
if (revealedCard)
|
||||
zone->removeCard(this);
|
||||
else
|
||||
|
|
|
@ -431,6 +431,12 @@ void TabGame::addMentionTag(QString value)
|
|||
sayEdit->setFocus();
|
||||
}
|
||||
|
||||
void TabGame::linkCardToChat(QString cardName)
|
||||
{
|
||||
sayEdit->insert("[[" + cardName + "]] ");
|
||||
sayEdit->setFocus();
|
||||
}
|
||||
|
||||
void TabGame::emitUserEvent()
|
||||
{
|
||||
bool globalEvent = !spectator || settingsCache->getSpectatorNotificationsEnabled();
|
||||
|
@ -1224,6 +1230,7 @@ void TabGame::newCardAdded(AbstractCardItem *card)
|
|||
connect(card, SIGNAL(showCardInfoPopup(QPoint, QString)), this, SLOT(showCardInfoPopup(QPoint, QString)));
|
||||
connect(card, SIGNAL(deleteCardInfoPopup(QString)), this, SLOT(deleteCardInfoPopup(QString)));
|
||||
connect(card, SIGNAL(updateCardMenu(AbstractCardItem *)), this, SLOT(updateCardMenu(AbstractCardItem *)));
|
||||
connect(card, SIGNAL(cardShiftClicked(QString)), this, SLOT(linkCardToChat(QString)));
|
||||
}
|
||||
|
||||
CardItem *TabGame::getCard(int playerId, const QString &zoneName, int cardId) const
|
||||
|
|
|
@ -236,6 +236,7 @@ private slots:
|
|||
void actNextTurn();
|
||||
|
||||
void addMentionTag(QString value);
|
||||
void linkCardToChat(QString cardName);
|
||||
void commandFinished(const Response &response);
|
||||
|
||||
void refreshShortcuts();
|
||||
|
|
Loading…
Reference in a new issue