mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-16 07:22:16 -07:00
Edhrec tab (#5512)
--------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: Zach H <zahalpern+github@gmail.com>
This commit is contained in:
parent
aee68f8b00
commit
4d791f4d7a
37 changed files with 1468 additions and 28 deletions
|
|
@ -151,6 +151,9 @@ void CardInfoFrameWidget::setCard(CardInfoPtr card)
|
|||
disconnect(info.data(), nullptr, this, nullptr);
|
||||
}
|
||||
|
||||
if (viewTransformationButton) {
|
||||
viewTransformationButton->setVisible(false);
|
||||
}
|
||||
info = std::move(card);
|
||||
|
||||
if (info) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@
|
|||
#include "../../../../game/cards/card_database_manager.h"
|
||||
#include "../../../../game/cards/card_item.h"
|
||||
#include "../../../../settings/cache_settings.h"
|
||||
#include "../../../tabs/tab_deck_editor.h"
|
||||
#include "../../../tabs/tab_supervisor.h"
|
||||
#include "../../picture_loader/picture_loader.h"
|
||||
#include "../../window_main.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QMouseEvent>
|
||||
|
|
@ -254,7 +257,31 @@ QMenu *CardInfoPictureWidget::createRightClickMenu()
|
|||
}
|
||||
|
||||
auto viewRelatedCards = new QMenu(tr("View related cards"));
|
||||
auto addToOpenDeckMenu = new QMenu(tr("Add card to deck"));
|
||||
cardMenu->addMenu(viewRelatedCards);
|
||||
cardMenu->addMenu(addToOpenDeckMenu);
|
||||
|
||||
auto *mainWindow = qobject_cast<MainWindow *>(window());
|
||||
QList<TabDeckEditor *> deckEditorTabs = mainWindow->getTabSupervisor()->getDeckEditorTabs();
|
||||
|
||||
for (auto &deckEditorTab : deckEditorTabs) {
|
||||
auto *addCardMenu = new QMenu(tr("Add card to") + " " + deckEditorTab->getTabText());
|
||||
QAction *addCard = new QAction(this);
|
||||
addCard->setText(tr("Mainboard"));
|
||||
connect(addCard, &QAction::triggered, this, [this, deckEditorTab] {
|
||||
deckEditorTab->updateCardInfo(info);
|
||||
deckEditorTab->addCardHelper(info, DECK_ZONE_MAIN);
|
||||
});
|
||||
QAction *addCardSideboard = new QAction(this);
|
||||
addCardSideboard->setText(tr("Sideboard"));
|
||||
connect(addCardSideboard, &QAction::triggered, this, [this, deckEditorTab] {
|
||||
deckEditorTab->updateCardInfo(info);
|
||||
deckEditorTab->addCardHelper(info, DECK_ZONE_SIDE);
|
||||
});
|
||||
addCardMenu->addAction(addCard);
|
||||
addCardMenu->addAction(addCardSideboard);
|
||||
addToOpenDeckMenu->addMenu(addCardMenu);
|
||||
}
|
||||
|
||||
bool atLeastOneGoodRelationFound = false;
|
||||
QList<CardRelation *> relatedCards = info->getAllRelatedCards();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue