mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
[Cards] Artist attribution (#7092)
Some checks are pending
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker Image / amd64 & arm64 (push) Waiting to run
Some checks are pending
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker Image / amd64 & arm64 (push) Waiting to run
* [Cards] Artist attribution Took 7 minutes Took 4 minutes * Nudge attribution pill on home screen to align Took 3 minutes Took 28 seconds Took 38 seconds * Lint. Took 3 minutes * Lint. Took 2 minutes * Fix rebase whoopsie Took 5 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
18b4ffefa8
commit
74a454552a
11 changed files with 195 additions and 10 deletions
|
|
@ -160,6 +160,7 @@ set(cockatrice_SOURCES
|
||||||
src/interface/widgets/cards/additional_info/color_identity_widget.cpp
|
src/interface/widgets/cards/additional_info/color_identity_widget.cpp
|
||||||
src/interface/widgets/cards/additional_info/mana_cost_widget.cpp
|
src/interface/widgets/cards/additional_info/mana_cost_widget.cpp
|
||||||
src/interface/widgets/cards/additional_info/mana_symbol_widget.cpp
|
src/interface/widgets/cards/additional_info/mana_symbol_widget.cpp
|
||||||
|
src/interface/widgets/cards/art_crop_attribution.cpp
|
||||||
src/interface/widgets/cards/card_group_display_widgets/card_group_display_widget.cpp
|
src/interface/widgets/cards/card_group_display_widgets/card_group_display_widget.cpp
|
||||||
src/interface/widgets/cards/card_group_display_widgets/flat_card_group_display_widget.cpp
|
src/interface/widgets/cards/card_group_display_widgets/flat_card_group_display_widget.cpp
|
||||||
src/interface/widgets/cards/card_group_display_widgets/overlapped_card_group_display_widget.cpp
|
src/interface/widgets/cards/card_group_display_widgets/overlapped_card_group_display_widget.cpp
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
#include "art_crop_attribution.h"
|
||||||
|
|
||||||
|
#include <QFontMetrics>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <libcockatrice/card/printing/exact_card.h>
|
||||||
|
|
||||||
|
QString buildArtAttribution(const ExactCard &card)
|
||||||
|
{
|
||||||
|
const QString artist = card.getPrinting().getArtist();
|
||||||
|
if (artist.isEmpty()) {
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
return QObject::tr("Art: %1").arg(artist);
|
||||||
|
}
|
||||||
|
|
||||||
|
QRectF paintArtAttribution(QPainter &painter,
|
||||||
|
const QRectF &rect,
|
||||||
|
const QString &attribution,
|
||||||
|
Qt::Alignment anchor,
|
||||||
|
qreal scale)
|
||||||
|
{
|
||||||
|
if (attribution.isEmpty()) {
|
||||||
|
return QRectF();
|
||||||
|
}
|
||||||
|
|
||||||
|
painter.save();
|
||||||
|
|
||||||
|
QFont font = painter.font();
|
||||||
|
font.setPointSizeF(qMax(6.0, font.pointSizeF() * scale));
|
||||||
|
painter.setFont(font);
|
||||||
|
|
||||||
|
const QFontMetrics fm(font);
|
||||||
|
const qreal maxTextWidth = rect.width() * 0.45;
|
||||||
|
const QString elided = fm.elidedText(attribution, Qt::ElideRight, qMax(qreal(80.0) * scale, maxTextWidth));
|
||||||
|
|
||||||
|
const qreal pad = 6.0 * scale;
|
||||||
|
QRectF captionRect(QPointF(0, 0), QSizeF(fm.horizontalAdvance(elided) + pad * 2.0, fm.height() + pad * 2.0));
|
||||||
|
const qreal margin = 4.0 * scale;
|
||||||
|
if (anchor.testFlag(Qt::AlignLeft)) {
|
||||||
|
captionRect.moveLeft(rect.left() + margin);
|
||||||
|
} else {
|
||||||
|
captionRect.moveRight(rect.right() - margin);
|
||||||
|
}
|
||||||
|
if (anchor.testFlag(Qt::AlignTop)) {
|
||||||
|
captionRect.moveTop(rect.top() + margin);
|
||||||
|
} else {
|
||||||
|
captionRect.moveBottom(rect.bottom() - margin);
|
||||||
|
}
|
||||||
|
|
||||||
|
painter.setPen(Qt::NoPen);
|
||||||
|
painter.setBrush(QColor(0, 0, 0, 120));
|
||||||
|
painter.drawRoundedRect(captionRect, 4, 4);
|
||||||
|
|
||||||
|
painter.setPen(QColor(255, 255, 255, 220));
|
||||||
|
painter.drawText(captionRect, Qt::AlignCenter, elided);
|
||||||
|
|
||||||
|
painter.restore();
|
||||||
|
|
||||||
|
return captionRect;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
#ifndef COCKATRICE_ART_CROP_ATTRIBUTION_H
|
||||||
|
#define COCKATRICE_ART_CROP_ATTRIBUTION_H
|
||||||
|
|
||||||
|
#include <QStringView>
|
||||||
|
|
||||||
|
class ExactCard;
|
||||||
|
class QPainter;
|
||||||
|
class QRectF;
|
||||||
|
class QString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Builds an attribution caption for a cropped card art display.
|
||||||
|
*
|
||||||
|
* When a card image's art region is shown cropped (an "art crop"), the artist
|
||||||
|
* should be credited in the same interface. Returns an empty string when the
|
||||||
|
* database has no artist data for the card.
|
||||||
|
*
|
||||||
|
* @param card The card whose art is being displayed.
|
||||||
|
* @return Caption such as "Art: John Avon", or empty.
|
||||||
|
*/
|
||||||
|
QString buildArtAttribution(const ExactCard &card);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Paints an attribution caption in a corner of a rect.
|
||||||
|
*
|
||||||
|
* Draws a subtle semi-transparent pill containing the caption, elided to fit.
|
||||||
|
*
|
||||||
|
* @param painter Painter to draw with.
|
||||||
|
* @param rect The area (e.g. the cropped art region) the caption belongs to.
|
||||||
|
* @param attribution Caption text (see buildArtAttribution()).
|
||||||
|
* @param anchor Corner of @p rect to pin the pill to (default bottom-right).
|
||||||
|
* @param scale Size multiplier for the pill (e.g. 0.8 for a smaller pill).
|
||||||
|
* @return The rect the pill was drawn in, or an empty rect if @p attribution is empty.
|
||||||
|
*/
|
||||||
|
QRectF paintArtAttribution(QPainter &painter,
|
||||||
|
const QRectF &rect,
|
||||||
|
const QString &attribution,
|
||||||
|
Qt::Alignment anchor = Qt::AlignRight | Qt::AlignBottom,
|
||||||
|
qreal scale = 1.0);
|
||||||
|
|
||||||
|
#endif // COCKATRICE_ART_CROP_ATTRIBUTION_H
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include "../../../interface/widgets/tabs/tab_supervisor.h"
|
#include "../../../interface/widgets/tabs/tab_supervisor.h"
|
||||||
#include "../../theme_manager.h"
|
#include "../../theme_manager.h"
|
||||||
#include "../../window_main.h"
|
#include "../../window_main.h"
|
||||||
|
#include "../cards/art_crop_attribution.h"
|
||||||
#include "background_sources.h"
|
#include "background_sources.h"
|
||||||
#include "home_styled_button.h"
|
#include "home_styled_button.h"
|
||||||
|
|
||||||
|
|
@ -341,8 +342,9 @@ void HomeWidget::paintEvent(QPaintEvent *event)
|
||||||
QColor semiTransparentBlack(0, 0, 0, static_cast<int>(255 * 0.33));
|
QColor semiTransparentBlack(0, 0, 0, static_cast<int>(255 * 0.33));
|
||||||
painter.fillPath(roundedRectPath, semiTransparentBlack);
|
painter.fillPath(roundedRectPath, semiTransparentBlack);
|
||||||
|
|
||||||
// Card name overlay (bottom-right)
|
// Card name overlay (above the attribution, bottom-right)
|
||||||
QString cardName;
|
QString cardName;
|
||||||
|
QString attribution;
|
||||||
ExactCard card = backgroundSourceCard->getCard();
|
ExactCard card = backgroundSourceCard->getCard();
|
||||||
if (card) {
|
if (card) {
|
||||||
cardName = card.getCardPtr()->getName();
|
cardName = card.getCardPtr()->getName();
|
||||||
|
|
@ -350,8 +352,27 @@ void HomeWidget::paintEvent(QPaintEvent *event)
|
||||||
cardName += " (" + card.getPrinting().getSet()->getCorrectedShortName() + ") " +
|
cardName += " (" + card.getPrinting().getSet()->getCorrectedShortName() + ") " +
|
||||||
card.getPrinting().getProperty("num");
|
card.getPrinting().getProperty("num");
|
||||||
}
|
}
|
||||||
|
attribution = buildArtAttribution(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Scryfall requires artist attribution wherever card art is shown cropped.
|
||||||
|
// Pin it to the bottom-right corner, using the same font as the card name pill,
|
||||||
|
// and align its right edge with the card name pill's right edge.
|
||||||
|
constexpr int margin = 15;
|
||||||
|
constexpr qreal attributionMargin = 4.0;
|
||||||
|
|
||||||
|
QFont attributionFont = painter.font();
|
||||||
|
attributionFont.setPointSize(14);
|
||||||
|
attributionFont.setBold(true);
|
||||||
|
painter.setFont(attributionFont);
|
||||||
|
|
||||||
|
// paintArtAttribution insets the pill 4px from the given rect's right edge,
|
||||||
|
// so nudge the rect's right edge to land exactly on the pill's right edge.
|
||||||
|
QRectF attributionArea = rect();
|
||||||
|
attributionArea.setRight(width() - margin + attributionMargin);
|
||||||
|
const QRectF attributionRect = paintArtAttribution(painter, attributionArea, attribution);
|
||||||
|
|
||||||
|
// Card name bubble above the attribution (when enabled).
|
||||||
if (!cardName.isEmpty() && SettingsCache::instance().appearance().getHomeTabDisplayCardName()) {
|
if (!cardName.isEmpty() && SettingsCache::instance().appearance().getHomeTabDisplayCardName()) {
|
||||||
QFont font = painter.font();
|
QFont font = painter.font();
|
||||||
font.setPointSize(14);
|
font.setPointSize(14);
|
||||||
|
|
@ -360,23 +381,26 @@ void HomeWidget::paintEvent(QPaintEvent *event)
|
||||||
|
|
||||||
QFontMetrics fm(font);
|
QFontMetrics fm(font);
|
||||||
constexpr int padding = 10;
|
constexpr int padding = 10;
|
||||||
constexpr int margin = 15;
|
|
||||||
|
|
||||||
QRect textRect = fm.boundingRect(cardName);
|
QRect textRect = fm.boundingRect(cardName);
|
||||||
|
|
||||||
QRect bgRect(width() - textRect.width() - padding * 2 - margin,
|
int bubbleBottom = height() - margin;
|
||||||
height() - textRect.height() - padding * 2 - margin, textRect.width() + padding * 2,
|
if (!attributionRect.isEmpty()) {
|
||||||
textRect.height() + padding * 2);
|
bubbleBottom = attributionRect.top() - 6;
|
||||||
|
}
|
||||||
|
const QRect nameBubbleRect(width() - textRect.width() - padding * 2 - margin,
|
||||||
|
bubbleBottom - textRect.height() - padding * 2, textRect.width() + padding * 2,
|
||||||
|
textRect.height() + padding * 2);
|
||||||
|
|
||||||
// Background bubble
|
// Background bubble
|
||||||
painter.setPen(Qt::NoPen);
|
painter.setPen(Qt::NoPen);
|
||||||
painter.setBrush(QColor(0, 0, 0, 160));
|
painter.setBrush(QColor(0, 0, 0, 160));
|
||||||
painter.drawRoundedRect(bgRect, 8, 8);
|
painter.drawRoundedRect(nameBubbleRect, 8, 8);
|
||||||
|
|
||||||
// Text
|
// Text
|
||||||
painter.setPen(Qt::white);
|
painter.setPen(Qt::white);
|
||||||
painter.drawText(bgRect.adjusted(padding, padding, -padding, -padding), Qt::AlignRight | Qt::AlignVCenter,
|
painter.drawText(nameBubbleRect.adjusted(padding, padding, -padding, -padding),
|
||||||
cardName);
|
Qt::AlignRight | Qt::AlignVCenter, cardName);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget::paintEvent(event);
|
QWidget::paintEvent(event);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
#include "user_card_settings_dialog.h"
|
#include "user_card_settings_dialog.h"
|
||||||
|
|
||||||
#include "../../../card_picture_loader/card_picture_loader.h"
|
#include "../../../card_picture_loader/card_picture_loader.h"
|
||||||
|
#include "../../cards/art_crop_attribution.h"
|
||||||
#include "../../utility/completer_utils.h"
|
#include "../../utility/completer_utils.h"
|
||||||
|
#include "card/card_search_model.h"
|
||||||
#include "card_database_display_model.h"
|
#include "card_database_display_model.h"
|
||||||
#include "card_database_model.h"
|
#include "card_database_model.h"
|
||||||
#include "user_card_art_provider.h"
|
#include "user_card_art_provider.h"
|
||||||
|
|
@ -18,6 +20,7 @@
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QRegularExpression>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <libcockatrice/card/database/card_database_manager.h>
|
#include <libcockatrice/card/database/card_database_manager.h>
|
||||||
|
|
||||||
|
|
@ -39,6 +42,12 @@ void CardArtPreviewWidget::setParams(const CardArtParams &p)
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CardArtPreviewWidget::setAttribution(const QString &attribution)
|
||||||
|
{
|
||||||
|
attributionText = attribution;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
void CardArtPreviewWidget::paintEvent(QPaintEvent *)
|
void CardArtPreviewWidget::paintEvent(QPaintEvent *)
|
||||||
{
|
{
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
|
@ -88,6 +97,8 @@ void CardArtPreviewWidget::paintEvent(QPaintEvent *)
|
||||||
painter.setPen(QPen(QColor(70, 80, 95), 2));
|
painter.setPen(QPen(QColor(70, 80, 95), 2));
|
||||||
painter.setBrush(Qt::NoBrush);
|
painter.setBrush(Qt::NoBrush);
|
||||||
painter.drawEllipse(avatarRect.adjusted(-1, -1, 1, 1));
|
painter.drawEllipse(avatarRect.adjusted(-1, -1, 1, 1));
|
||||||
|
|
||||||
|
paintArtAttribution(painter, cardRect, attributionText);
|
||||||
}
|
}
|
||||||
|
|
||||||
UserCardArtSettingsDialog::UserCardArtSettingsDialog(const CardArtParams &initial, QWidget *parent)
|
UserCardArtSettingsDialog::UserCardArtSettingsDialog(const CardArtParams &initial, QWidget *parent)
|
||||||
|
|
@ -310,6 +321,11 @@ void UserCardArtSettingsDialog::reloadPreview()
|
||||||
currentPixmap = UserCardArtProvider::cropCardArt(fullRes);
|
currentPixmap = UserCardArtProvider::cropCardArt(fullRes);
|
||||||
preview->setPixmap(currentPixmap);
|
preview->setPixmap(currentPixmap);
|
||||||
preview->setParams(currentParams);
|
preview->setParams(currentParams);
|
||||||
|
|
||||||
|
// Only attribute the art once the new pixmap is actually displayed, so a
|
||||||
|
// cache miss (which keeps the previous pixmap on screen) doesn't pair the
|
||||||
|
// new card's attribution with the old card's art.
|
||||||
|
preview->setAttribution(buildArtAttribution(card));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserCardArtSettingsDialog::onParamChanged()
|
void UserCardArtSettingsDialog::onParamChanged()
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ public:
|
||||||
|
|
||||||
void setPixmap(const QPixmap &pixmap);
|
void setPixmap(const QPixmap &pixmap);
|
||||||
void setParams(const CardArtParams ¶ms);
|
void setParams(const CardArtParams ¶ms);
|
||||||
|
void setAttribution(const QString &attribution);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *event) override;
|
void paintEvent(QPaintEvent *event) override;
|
||||||
|
|
@ -31,6 +32,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
QPixmap sourcePixmap;
|
QPixmap sourcePixmap;
|
||||||
CardArtParams params;
|
CardArtParams params;
|
||||||
|
QString attributionText;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UserCardArtSettingsDialog : public QDialog
|
class UserCardArtSettingsDialog : public QDialog
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#include "user_info_popup.h"
|
#include "user_info_popup.h"
|
||||||
|
|
||||||
|
#include "../../cards/art_crop_attribution.h"
|
||||||
#include "../../interface/pixel_map_generator.h"
|
#include "../../interface/pixel_map_generator.h"
|
||||||
#include "../../interface/theme_manager.h"
|
#include "../../interface/theme_manager.h"
|
||||||
#include "../../interface/widgets/tabs/tab_supervisor.h"
|
#include "../../interface/widgets/tabs/tab_supervisor.h"
|
||||||
|
|
@ -18,6 +19,7 @@
|
||||||
#include <QStandardItem>
|
#include <QStandardItem>
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <libcockatrice/card/database/card_database_manager.h>
|
||||||
#include <libcockatrice/network/client/abstract/abstract_client.h>
|
#include <libcockatrice/network/client/abstract/abstract_client.h>
|
||||||
#include <libcockatrice/protocol/pb/commands.pb.h>
|
#include <libcockatrice/protocol/pb/commands.pb.h>
|
||||||
#include <libcockatrice/protocol/pb/response_get_games_of_user.pb.h>
|
#include <libcockatrice/protocol/pb/response_get_games_of_user.pb.h>
|
||||||
|
|
@ -151,6 +153,16 @@ void UserInfoHeaderWidget::setUserData(const ServerInfo_User &_user,
|
||||||
avatar = _avatar;
|
avatar = _avatar;
|
||||||
cardArt = _cardArt;
|
cardArt = _cardArt;
|
||||||
params = _params;
|
params = _params;
|
||||||
|
|
||||||
|
attribution.clear();
|
||||||
|
if (user.has_card_art_params()) {
|
||||||
|
const ExactCard card =
|
||||||
|
CardDatabaseManager::query()->getCard({QString::fromStdString(user.card_art_params().card_name()),
|
||||||
|
QString::fromStdString(user.card_art_params().card_provider_id())});
|
||||||
|
if (card) {
|
||||||
|
attribution = buildArtAttribution(card);
|
||||||
|
}
|
||||||
|
}
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -304,6 +316,17 @@ void UserInfoHeaderWidget::paintEvent(QPaintEvent *)
|
||||||
: UserListPainter::blend(badge.color, Qt::black, 0.35));
|
: UserListPainter::blend(badge.color, Qt::black, 0.35));
|
||||||
p.drawText(br, Qt::AlignCenter, badge.text);
|
p.drawText(br, Qt::AlignCenter, badge.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The painter font at this point depends on whether a badge was drawn
|
||||||
|
// (badge font vs username font), so pin an explicit font for the pill.
|
||||||
|
p.setFont(font());
|
||||||
|
|
||||||
|
// Only show the attribution when there is actually art on screen: on a
|
||||||
|
// cache miss cardArt is null and the pill would float over the plain
|
||||||
|
// header with no art behind it.
|
||||||
|
if (!cardArt.isNull()) {
|
||||||
|
paintArtAttribution(p, rect, attribution, Qt::AlignRight | Qt::AlignBottom, 0.8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── UserInfoPopup ─────────────────────────────────────────────────────────────
|
// ── UserInfoPopup ─────────────────────────────────────────────────────────────
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ private:
|
||||||
QPixmap avatar;
|
QPixmap avatar;
|
||||||
QPixmap cardArt;
|
QPixmap cardArt;
|
||||||
CardArtParams params;
|
CardArtParams params;
|
||||||
|
QString attribution;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ── Main popup ────────────────────────────────────────────────────────────────
|
// ── Main popup ────────────────────────────────────────────────────────────────
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "../../../../client/settings/cache_settings.h"
|
#include "../../../../client/settings/cache_settings.h"
|
||||||
#include "../../../card_picture_loader/card_picture_loader.h"
|
#include "../../../card_picture_loader/card_picture_loader.h"
|
||||||
|
#include "../../cards/art_crop_attribution.h"
|
||||||
#include "../../interface/pixel_map_generator.h"
|
#include "../../interface/pixel_map_generator.h"
|
||||||
#include "../../interface/theme_manager.h"
|
#include "../../interface/theme_manager.h"
|
||||||
#include "../../interface/widgets/tabs/tab_account.h"
|
#include "../../interface/widgets/tabs/tab_account.h"
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,18 @@ public:
|
||||||
* @return The flavorName, or empty if it isn't present.
|
* @return The flavorName, or empty if it isn't present.
|
||||||
*/
|
*/
|
||||||
[[nodiscard]] QString getFlavorName() const;
|
[[nodiscard]] QString getFlavorName() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the artist name credited for this printing's artwork.
|
||||||
|
*
|
||||||
|
* Requires a card database generated with artist data.
|
||||||
|
*
|
||||||
|
* @return The artist name, or empty if it isn't present.
|
||||||
|
*/
|
||||||
|
[[nodiscard]] QString getArtist() const
|
||||||
|
{
|
||||||
|
return getProperty("artist");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COCKATRICE_PRINTING_INFO_H
|
#endif // COCKATRICE_PRINTING_INFO_H
|
||||||
|
|
|
||||||
|
|
@ -237,8 +237,11 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList
|
||||||
};
|
};
|
||||||
|
|
||||||
// mtgjson name => xml name
|
// mtgjson name => xml name
|
||||||
static const QMap<QString, QString> setInfoProperties{
|
static const QMap<QString, QString> setInfoProperties{{"number", "num"},
|
||||||
{"number", "num"}, {"rarity", "rarity"}, {"isOnlineOnly", "isOnlineOnly"}, {"isRebalanced", "isRebalanced"}};
|
{"rarity", "rarity"},
|
||||||
|
{"isOnlineOnly", "isOnlineOnly"},
|
||||||
|
{"isRebalanced", "isRebalanced"},
|
||||||
|
{"artist", "artist"}};
|
||||||
|
|
||||||
// mtgjson name => xml name
|
// mtgjson name => xml name
|
||||||
static const QMap<QString, QString> identifierProperties{{"multiverseId", "muid"}, {"scryfallId", "uuid"}};
|
static const QMap<QString, QString> identifierProperties{{"multiverseId", "muid"}, {"scryfallId", "uuid"}};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue