mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-12 13:00:01 -08:00
Merge remote-tracking branch 'origin/master' into chat_buddy
Conflict is from country code display in user box Conflicts: cockatrice/src/userinfobox.cpp
This commit is contained in:
commit
f515f4a8fe
17 changed files with 54 additions and 50 deletions
|
|
@ -16,7 +16,7 @@ InstallDir "$PROGRAMFILES\Cockatrice"
|
||||||
!define MUI_HEADERIMAGE_UNBITMAP "${NSIS_SOURCE_PATH}\cmake\headerimage.bmp"
|
!define MUI_HEADERIMAGE_UNBITMAP "${NSIS_SOURCE_PATH}\cmake\headerimage.bmp"
|
||||||
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Cockatrice.$\r$\n$\r$\nClick Next to continue."
|
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Cockatrice.$\r$\n$\r$\nClick Next to continue."
|
||||||
!define MUI_FINISHPAGE_RUN "$INSTDIR/oracle.exe"
|
!define MUI_FINISHPAGE_RUN "$INSTDIR/oracle.exe"
|
||||||
!define MUI_FINISHPAGE_RUN_TEXT "Run card database downloader now"
|
!define MUI_FINISHPAGE_RUN_TEXT "Run "Oracle" now to update your card database"
|
||||||
!define MUI_FINISHPAGE_RUN_PARAMETERS "-dlsets"
|
!define MUI_FINISHPAGE_RUN_PARAMETERS "-dlsets"
|
||||||
|
|
||||||
!insertmacro MUI_PAGE_WELCOME
|
!insertmacro MUI_PAGE_WELCOME
|
||||||
|
|
|
||||||
|
|
@ -365,6 +365,7 @@ CardInfo::CardInfo(CardDatabase *_db,
|
||||||
const QString &_name,
|
const QString &_name,
|
||||||
bool _isToken,
|
bool _isToken,
|
||||||
const QString &_manacost,
|
const QString &_manacost,
|
||||||
|
const QString &_cmc,
|
||||||
const QString &_cardtype,
|
const QString &_cardtype,
|
||||||
const QString &_powtough,
|
const QString &_powtough,
|
||||||
const QString &_text,
|
const QString &_text,
|
||||||
|
|
@ -381,6 +382,7 @@ CardInfo::CardInfo(CardDatabase *_db,
|
||||||
isToken(_isToken),
|
isToken(_isToken),
|
||||||
sets(_sets),
|
sets(_sets),
|
||||||
manacost(_manacost),
|
manacost(_manacost),
|
||||||
|
cmc(_cmc),
|
||||||
cardtype(_cardtype),
|
cardtype(_cardtype),
|
||||||
powtough(_powtough),
|
powtough(_powtough),
|
||||||
text(_text),
|
text(_text),
|
||||||
|
|
@ -571,6 +573,7 @@ static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfo *info)
|
||||||
xml.writeTextElement("color", colors[i]);
|
xml.writeTextElement("color", colors[i]);
|
||||||
|
|
||||||
xml.writeTextElement("manacost", info->getManaCost());
|
xml.writeTextElement("manacost", info->getManaCost());
|
||||||
|
xml.writeTextElement("cmc", info->getCmc());
|
||||||
xml.writeTextElement("type", info->getCardType());
|
xml.writeTextElement("type", info->getCardType());
|
||||||
if (!info->getPowTough().isEmpty())
|
if (!info->getPowTough().isEmpty())
|
||||||
xml.writeTextElement("pt", info->getPowTough());
|
xml.writeTextElement("pt", info->getPowTough());
|
||||||
|
|
@ -731,7 +734,7 @@ void CardDatabase::loadCardsFromXml(QXmlStreamReader &xml, bool tokens)
|
||||||
if (xml.readNext() == QXmlStreamReader::EndElement)
|
if (xml.readNext() == QXmlStreamReader::EndElement)
|
||||||
break;
|
break;
|
||||||
if (xml.name() == "card") {
|
if (xml.name() == "card") {
|
||||||
QString name, manacost, type, pt, text;
|
QString name, manacost, cmc, type, pt, text;
|
||||||
QStringList colors;
|
QStringList colors;
|
||||||
QStringMap customPicURLs, customPicURLsHq;
|
QStringMap customPicURLs, customPicURLsHq;
|
||||||
MuidMap muids;
|
MuidMap muids;
|
||||||
|
|
@ -747,6 +750,8 @@ void CardDatabase::loadCardsFromXml(QXmlStreamReader &xml, bool tokens)
|
||||||
name = xml.readElementText();
|
name = xml.readElementText();
|
||||||
else if (xml.name() == "manacost")
|
else if (xml.name() == "manacost")
|
||||||
manacost = xml.readElementText();
|
manacost = xml.readElementText();
|
||||||
|
else if (xml.name() == "cmc")
|
||||||
|
cmc = xml.readElementText();
|
||||||
else if (xml.name() == "type")
|
else if (xml.name() == "type")
|
||||||
type = xml.readElementText();
|
type = xml.readElementText();
|
||||||
else if (xml.name() == "pt")
|
else if (xml.name() == "pt")
|
||||||
|
|
@ -779,7 +784,7 @@ void CardDatabase::loadCardsFromXml(QXmlStreamReader &xml, bool tokens)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isToken == tokens) {
|
if (isToken == tokens) {
|
||||||
addCard(new CardInfo(this, name, isToken, manacost, type, pt, text, colors, loyalty, cipt, tableRow, sets, customPicURLs, customPicURLsHq, muids));
|
addCard(new CardInfo(this, name, isToken, manacost, cmc, type, pt, text, colors, loyalty, cipt, tableRow, sets, customPicURLs, customPicURLsHq, muids));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,7 @@ private:
|
||||||
bool isToken;
|
bool isToken;
|
||||||
SetList sets;
|
SetList sets;
|
||||||
QString manacost;
|
QString manacost;
|
||||||
|
QString cmc;
|
||||||
QString cardtype;
|
QString cardtype;
|
||||||
QString powtough;
|
QString powtough;
|
||||||
QString text;
|
QString text;
|
||||||
|
|
@ -126,6 +127,7 @@ public:
|
||||||
const QString &_name = QString(),
|
const QString &_name = QString(),
|
||||||
bool _isToken = false,
|
bool _isToken = false,
|
||||||
const QString &_manacost = QString(),
|
const QString &_manacost = QString(),
|
||||||
|
const QString &_cmc = QString(),
|
||||||
const QString &_cardtype = QString(),
|
const QString &_cardtype = QString(),
|
||||||
const QString &_powtough = QString(),
|
const QString &_powtough = QString(),
|
||||||
const QString &_text = QString(),
|
const QString &_text = QString(),
|
||||||
|
|
@ -142,12 +144,14 @@ public:
|
||||||
bool getIsToken() const { return isToken; }
|
bool getIsToken() const { return isToken; }
|
||||||
const SetList &getSets() const { return sets; }
|
const SetList &getSets() const { return sets; }
|
||||||
const QString &getManaCost() const { return manacost; }
|
const QString &getManaCost() const { return manacost; }
|
||||||
|
const QString &getCmc() const { return cmc; }
|
||||||
const QString &getCardType() const { return cardtype; }
|
const QString &getCardType() const { return cardtype; }
|
||||||
const QString &getPowTough() const { return powtough; }
|
const QString &getPowTough() const { return powtough; }
|
||||||
const QString &getText() const { return text; }
|
const QString &getText() const { return text; }
|
||||||
const int &getLoyalty() const { return loyalty; }
|
const int &getLoyalty() const { return loyalty; }
|
||||||
bool getCipt() const { return cipt; }
|
bool getCipt() const { return cipt; }
|
||||||
void setManaCost(const QString &_manaCost) { manacost = _manaCost; emit cardInfoChanged(this); }
|
void setManaCost(const QString &_manaCost) { manacost = _manaCost; emit cardInfoChanged(this); }
|
||||||
|
void setCmc(const QString &_cmc) { cmc = _cmc; emit cardInfoChanged(this); }
|
||||||
void setCardType(const QString &_cardType) { cardtype = _cardType; emit cardInfoChanged(this); }
|
void setCardType(const QString &_cardType) { cardtype = _cardType; emit cardInfoChanged(this); }
|
||||||
void setPowTough(const QString &_powTough) { powtough = _powTough; emit cardInfoChanged(this); }
|
void setPowTough(const QString &_powTough) { powtough = _powTough; emit cardInfoChanged(this); }
|
||||||
void setText(const QString &_text) { text = _text; emit cardInfoChanged(this); }
|
void setText(const QString &_text) { text = _text; emit cardInfoChanged(this); }
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ const char *CardFilter::attrName(Attr a)
|
||||||
return "set";
|
return "set";
|
||||||
case AttrManaCost:
|
case AttrManaCost:
|
||||||
return "mana cost";
|
return "mana cost";
|
||||||
|
case AttrCmc:
|
||||||
|
return "cmc";
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ public:
|
||||||
AttrText,
|
AttrText,
|
||||||
AttrSet,
|
AttrSet,
|
||||||
AttrManaCost,
|
AttrManaCost,
|
||||||
|
AttrCmc,
|
||||||
AttrEnd
|
AttrEnd
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
|
#include <QApplication>
|
||||||
#include "chatview.h"
|
#include "chatview.h"
|
||||||
#include "user_level.h"
|
#include "user_level.h"
|
||||||
#include "user_context_menu.h"
|
#include "user_context_menu.h"
|
||||||
|
|
@ -201,6 +202,7 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
|
||||||
if (message.toLower().startsWith(mention)) {
|
if (message.toLower().startsWith(mention)) {
|
||||||
cursor.insertText("@" + userName, mentionFormat);
|
cursor.insertText("@" + userName, mentionFormat);
|
||||||
message = message.mid(mention.size());
|
message = message.mid(mention.size());
|
||||||
|
QApplication::alert(this);
|
||||||
}
|
}
|
||||||
// another user has been mentioned
|
// another user has been mentioned
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -50,11 +50,6 @@ GeneralSettingsPage::GeneralSettingsPage()
|
||||||
pixmapCacheEdit.setSingleStep(64);
|
pixmapCacheEdit.setSingleStep(64);
|
||||||
pixmapCacheEdit.setValue(settingsCache->getPixmapCacheSize());
|
pixmapCacheEdit.setValue(settingsCache->getPixmapCacheSize());
|
||||||
pixmapCacheEdit.setSuffix(" MB");
|
pixmapCacheEdit.setSuffix(" MB");
|
||||||
pixmapCacheEdit.setMinimum(64);
|
|
||||||
pixmapCacheEdit.setMaximum(8192);
|
|
||||||
pixmapCacheEdit.setSingleStep(64);
|
|
||||||
pixmapCacheEdit.setValue(settingsCache->getPixmapCacheSize());
|
|
||||||
pixmapCacheEdit.setSuffix(" MB");
|
|
||||||
picDownloadHqCheckBox.setChecked(settingsCache->getPicDownloadHq());
|
picDownloadHqCheckBox.setChecked(settingsCache->getPicDownloadHq());
|
||||||
picDownloadCheckBox.setChecked(settingsCache->getPicDownload());
|
picDownloadCheckBox.setChecked(settingsCache->getPicDownload());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -199,34 +199,31 @@ bool FilterItem::acceptManaCost(const CardInfo *info) const
|
||||||
return (info->getManaCost() == term);
|
return (info->getManaCost() == term);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FilterItem::acceptCmc(const CardInfo *info) const
|
||||||
|
{
|
||||||
|
return (info->getCmc() == term);
|
||||||
|
}
|
||||||
|
|
||||||
bool FilterItem::acceptCardAttr(const CardInfo *info, CardFilter::Attr attr) const
|
bool FilterItem::acceptCardAttr(const CardInfo *info, CardFilter::Attr attr) const
|
||||||
{
|
{
|
||||||
bool status;
|
|
||||||
|
|
||||||
switch (attr) {
|
switch (attr) {
|
||||||
case CardFilter::AttrName:
|
case CardFilter::AttrName:
|
||||||
status = acceptName(info);
|
return acceptName(info);
|
||||||
break;
|
|
||||||
case CardFilter::AttrType:
|
case CardFilter::AttrType:
|
||||||
status = acceptType(info);
|
return acceptType(info);
|
||||||
break;
|
|
||||||
case CardFilter::AttrColor:
|
case CardFilter::AttrColor:
|
||||||
status = acceptColor(info);
|
return acceptColor(info);
|
||||||
break;
|
|
||||||
case CardFilter::AttrText:
|
case CardFilter::AttrText:
|
||||||
status = acceptText(info);
|
return acceptText(info);
|
||||||
break;
|
|
||||||
case CardFilter::AttrSet:
|
case CardFilter::AttrSet:
|
||||||
status = acceptSet(info);
|
return acceptSet(info);
|
||||||
break;
|
|
||||||
case CardFilter::AttrManaCost:
|
case CardFilter::AttrManaCost:
|
||||||
status = acceptManaCost(info);
|
return acceptManaCost(info);
|
||||||
break;
|
case CardFilter::AttrCmc:
|
||||||
|
return acceptCmc(info);
|
||||||
default:
|
default:
|
||||||
status = true; /* ignore this attribute */
|
return true; /* ignore this attribute */
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* need to define these here to make QT happy, otherwise
|
/* need to define these here to make QT happy, otherwise
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@ public:
|
||||||
bool acceptText(const CardInfo *info) const;
|
bool acceptText(const CardInfo *info) const;
|
||||||
bool acceptSet(const CardInfo *info) const;
|
bool acceptSet(const CardInfo *info) const;
|
||||||
bool acceptManaCost(const CardInfo *info) const;
|
bool acceptManaCost(const CardInfo *info) const;
|
||||||
|
bool acceptCmc(const CardInfo *info) const;
|
||||||
bool acceptCardAttr(const CardInfo *info, CardFilter::Attr attr) const;
|
bool acceptCardAttr(const CardInfo *info, CardFilter::Attr attr) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@ SettingsCache::SettingsCache()
|
||||||
zoneViewSortByName = settings->value("zoneview/sortbyname", true).toBool();
|
zoneViewSortByName = settings->value("zoneview/sortbyname", true).toBool();
|
||||||
zoneViewSortByType = settings->value("zoneview/sortbytype", true).toBool();
|
zoneViewSortByType = settings->value("zoneview/sortbytype", true).toBool();
|
||||||
zoneViewPileView = settings->value("zoneview/pileview", true).toBool();
|
zoneViewPileView = settings->value("zoneview/pileview", true).toBool();
|
||||||
zoneViewShuffle = settings->value("zoneview/shuffle", true).toBool();
|
|
||||||
|
|
||||||
soundEnabled = settings->value("sound/enabled", false).toBool();
|
soundEnabled = settings->value("sound/enabled", false).toBool();
|
||||||
soundPath = settings->value("sound/path").toString();
|
soundPath = settings->value("sound/path").toString();
|
||||||
|
|
@ -261,11 +260,6 @@ void SettingsCache::setZoneViewPileView(int _zoneViewPileView){
|
||||||
settings->setValue("zoneview/pileview", zoneViewPileView);
|
settings->setValue("zoneview/pileview", zoneViewPileView);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsCache::setZoneViewShuffle(int _zoneViewShuffle) {
|
|
||||||
zoneViewShuffle = _zoneViewShuffle;
|
|
||||||
settings->setValue("zoneview/shuffle", zoneViewShuffle);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SettingsCache::setSoundEnabled(int _soundEnabled)
|
void SettingsCache::setSoundEnabled(int _soundEnabled)
|
||||||
{
|
{
|
||||||
soundEnabled = _soundEnabled;
|
soundEnabled = _soundEnabled;
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ private:
|
||||||
int minPlayersForMultiColumnLayout;
|
int minPlayersForMultiColumnLayout;
|
||||||
bool tapAnimation;
|
bool tapAnimation;
|
||||||
bool chatMention;
|
bool chatMention;
|
||||||
bool zoneViewSortByName, zoneViewSortByType, zoneViewPileView, zoneViewShuffle;
|
bool zoneViewSortByName, zoneViewSortByType, zoneViewPileView;
|
||||||
bool soundEnabled;
|
bool soundEnabled;
|
||||||
QString soundPath;
|
QString soundPath;
|
||||||
bool priceTagFeature;
|
bool priceTagFeature;
|
||||||
|
|
@ -103,11 +103,6 @@ public:
|
||||||
@return zoneViewPileView if the view should be sorted into pile view.
|
@return zoneViewPileView if the view should be sorted into pile view.
|
||||||
*/
|
*/
|
||||||
bool getZoneViewPileView() const { return zoneViewPileView; }
|
bool getZoneViewPileView() const { return zoneViewPileView; }
|
||||||
/**
|
|
||||||
Returns if the view should be shuffled on closing.
|
|
||||||
@return zoneViewShuffle if the view should be shuffled on closing.
|
|
||||||
*/
|
|
||||||
bool getZoneViewShuffle() const { return zoneViewShuffle; }
|
|
||||||
bool getSoundEnabled() const { return soundEnabled; }
|
bool getSoundEnabled() const { return soundEnabled; }
|
||||||
QString getSoundPath() const { return soundPath; }
|
QString getSoundPath() const { return soundPath; }
|
||||||
bool getPriceTagFeature() const { return priceTagFeature; }
|
bool getPriceTagFeature() const { return priceTagFeature; }
|
||||||
|
|
@ -149,7 +144,6 @@ public slots:
|
||||||
void setZoneViewSortByName(int _zoneViewSortByName);
|
void setZoneViewSortByName(int _zoneViewSortByName);
|
||||||
void setZoneViewSortByType(int _zoneViewSortByType);
|
void setZoneViewSortByType(int _zoneViewSortByType);
|
||||||
void setZoneViewPileView(int _zoneViewPileView);
|
void setZoneViewPileView(int _zoneViewPileView);
|
||||||
void setZoneViewShuffle(int _zoneViewShuffle);
|
|
||||||
void setSoundEnabled(int _soundEnabled);
|
void setSoundEnabled(int _soundEnabled);
|
||||||
void setSoundPath(const QString &_soundPath);
|
void setSoundPath(const QString &_soundPath);
|
||||||
void setPriceTagFeature(int _priceTagFeature);
|
void setPriceTagFeature(int _priceTagFeature);
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ UserInfoBox::UserInfoBox(AbstractClient *_client, bool _fullInfo, QWidget *paren
|
||||||
mainLayout->addWidget(&genderLabel2, 3, 1, 1, 2);
|
mainLayout->addWidget(&genderLabel2, 3, 1, 1, 2);
|
||||||
mainLayout->addWidget(&countryLabel1, 4, 0, 1, 1);
|
mainLayout->addWidget(&countryLabel1, 4, 0, 1, 1);
|
||||||
mainLayout->addWidget(&countryLabel2, 4, 1, 1, 2);
|
mainLayout->addWidget(&countryLabel2, 4, 1, 1, 2);
|
||||||
|
mainLayout->addWidget(&countryLabel3, 4, 2, 1, 1);
|
||||||
mainLayout->addWidget(&userLevelLabel1, 5, 0, 1, 1);
|
mainLayout->addWidget(&userLevelLabel1, 5, 0, 1, 1);
|
||||||
mainLayout->addWidget(&userLevelLabel2, 5, 1, 1, 1);
|
mainLayout->addWidget(&userLevelLabel2, 5, 1, 1, 1);
|
||||||
mainLayout->addWidget(&userLevelLabel3, 5, 2, 1, 1);
|
mainLayout->addWidget(&userLevelLabel3, 5, 2, 1, 1);
|
||||||
|
|
@ -65,7 +66,9 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user)
|
||||||
nameLabel.setText(QString::fromStdString(user.name()));
|
nameLabel.setText(QString::fromStdString(user.name()));
|
||||||
realNameLabel2.setText(QString::fromStdString(user.real_name()));
|
realNameLabel2.setText(QString::fromStdString(user.real_name()));
|
||||||
genderLabel2.setPixmap(GenderPixmapGenerator::generatePixmap(15, user.gender()));
|
genderLabel2.setPixmap(GenderPixmapGenerator::generatePixmap(15, user.gender()));
|
||||||
countryLabel2.setPixmap(CountryPixmapGenerator::generatePixmap(15, QString::fromStdString(user.country())));
|
QString country = QString::fromStdString(user.country());
|
||||||
|
countryLabel2.setPixmap(CountryPixmapGenerator::generatePixmap(15, country));
|
||||||
|
countryLabel3.setText(QString("(%1)").arg(country.toUpper()));
|
||||||
userLevelLabel2.setPixmap(UserLevelPixmapGenerator::generatePixmap(15, userLevel, false));
|
userLevelLabel2.setPixmap(UserLevelPixmapGenerator::generatePixmap(15, userLevel, false));
|
||||||
QString userLevelText;
|
QString userLevelText;
|
||||||
if (userLevel.testFlag(ServerInfo_User::IsAdmin))
|
if (userLevel.testFlag(ServerInfo_User::IsAdmin))
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ private:
|
||||||
AbstractClient *client;
|
AbstractClient *client;
|
||||||
bool fullInfo;
|
bool fullInfo;
|
||||||
QLabel avatarLabel, nameLabel, realNameLabel1, realNameLabel2, genderLabel1, genderLabel2, countryLabel1,
|
QLabel avatarLabel, nameLabel, realNameLabel1, realNameLabel2, genderLabel1, genderLabel2, countryLabel1,
|
||||||
countryLabel2, userLevelLabel1, userLevelLabel2, userLevelLabel3, accountAgeLebel1, accountAgeLabel2;
|
countryLabel2, countryLabel3, userLevelLabel1, userLevelLabel2, userLevelLabel3, accountAgeLebel1, accountAgeLabel2;
|
||||||
public:
|
public:
|
||||||
UserInfoBox(AbstractClient *_client, bool fullInfo, QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
UserInfoBox(AbstractClient *_client, bool fullInfo, QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
|
|
|
||||||
|
|
@ -344,6 +344,7 @@ void MainWindow::createMenus()
|
||||||
cockatriceMenu = menuBar()->addMenu(QString());
|
cockatriceMenu = menuBar()->addMenu(QString());
|
||||||
cockatriceMenu->addAction(aConnect);
|
cockatriceMenu->addAction(aConnect);
|
||||||
cockatriceMenu->addAction(aDisconnect);
|
cockatriceMenu->addAction(aDisconnect);
|
||||||
|
cockatriceMenu->addSeparator();
|
||||||
cockatriceMenu->addAction(aSinglePlayer);
|
cockatriceMenu->addAction(aSinglePlayer);
|
||||||
cockatriceMenu->addAction(aWatchReplay);
|
cockatriceMenu->addAction(aWatchReplay);
|
||||||
cockatriceMenu->addSeparator();
|
cockatriceMenu->addSeparator();
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ ZoneViewWidget::ZoneViewWidget(Player *_player, CardZone *_origZone, int numberC
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_origZone->getIsShufflable() && (numberCards == -1)) {
|
if (_origZone->getIsShufflable() && (numberCards == -1)) {
|
||||||
shuffleCheckBox.setChecked(settingsCache->getZoneViewShuffle());
|
shuffleCheckBox.setChecked(true);
|
||||||
QGraphicsProxyWidget *shuffleProxy = new QGraphicsProxyWidget;
|
QGraphicsProxyWidget *shuffleProxy = new QGraphicsProxyWidget;
|
||||||
shuffleProxy->setWidget(&shuffleCheckBox);
|
shuffleProxy->setWidget(&shuffleCheckBox);
|
||||||
vbox->addItem(shuffleProxy);
|
vbox->addItem(shuffleProxy);
|
||||||
|
|
@ -227,8 +227,6 @@ void ZoneViewWidget::closeEvent(QCloseEvent *event)
|
||||||
}
|
}
|
||||||
if (shuffleCheckBox.isChecked())
|
if (shuffleCheckBox.isChecked())
|
||||||
player->sendGameCommand(Command_Shuffle());
|
player->sendGameCommand(Command_Shuffle());
|
||||||
if (canBeShuffled)
|
|
||||||
settingsCache->setZoneViewShuffle(shuffleCheckBox.isChecked());
|
|
||||||
emit closePressed(this);
|
emit closePressed(this);
|
||||||
deleteLater();
|
deleteLater();
|
||||||
event->accept();
|
event->accept();
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ CardInfo *OracleImporter::addCard(const QString &setName,
|
||||||
bool isToken,
|
bool isToken,
|
||||||
int cardId,
|
int cardId,
|
||||||
QString &cardCost,
|
QString &cardCost,
|
||||||
|
QString &cmc,
|
||||||
const QString &cardType,
|
const QString &cardType,
|
||||||
const QString &cardPT,
|
const QString &cardPT,
|
||||||
int cardLoyalty,
|
int cardLoyalty,
|
||||||
|
|
@ -117,7 +118,7 @@ CardInfo *OracleImporter::addCard(const QString &setName,
|
||||||
|
|
||||||
bool cipt = (cardText.contains(cardName + " enters the battlefield tapped."));
|
bool cipt = (cardText.contains(cardName + " enters the battlefield tapped."));
|
||||||
|
|
||||||
card = new CardInfo(this, cardName, isToken, cardCost, cardType, cardPT, fullCardText, colors, cardLoyalty, cipt);
|
card = new CardInfo(this, cardName, isToken, cardCost, cmc, cardType, cardPT, fullCardText, colors, cardLoyalty, cipt);
|
||||||
int tableRow = 1;
|
int tableRow = 1;
|
||||||
QString mainCardType = card->getMainCardType();
|
QString mainCardType = card->getMainCardType();
|
||||||
if ((mainCardType == "Land") || mArtifact)
|
if ((mainCardType == "Land") || mArtifact)
|
||||||
|
|
@ -143,6 +144,7 @@ int OracleImporter::importTextSpoiler(CardSet *set, const QVariant &data)
|
||||||
QVariantMap map;
|
QVariantMap map;
|
||||||
QString cardName;
|
QString cardName;
|
||||||
QString cardCost;
|
QString cardCost;
|
||||||
|
QString cmc;
|
||||||
QString cardType;
|
QString cardType;
|
||||||
QString cardPT;
|
QString cardPT;
|
||||||
QString cardText;
|
QString cardText;
|
||||||
|
|
@ -185,6 +187,7 @@ int OracleImporter::importTextSpoiler(CardSet *set, const QVariant &data)
|
||||||
// add first card's data
|
// add first card's data
|
||||||
cardName = card1->contains("name") ? card1->value("name").toString() : QString("");
|
cardName = card1->contains("name") ? card1->value("name").toString() : QString("");
|
||||||
cardCost = card1->contains("manaCost") ? card1->value("manaCost").toString() : QString("");
|
cardCost = card1->contains("manaCost") ? card1->value("manaCost").toString() : QString("");
|
||||||
|
cmc = card1->contains("cmc") ? card1->value("cmc").toString() : QString("");
|
||||||
cardType = card1->contains("type") ? card1->value("type").toString() : QString("");
|
cardType = card1->contains("type") ? card1->value("type").toString() : QString("");
|
||||||
cardPT = card1->contains("power") || card1->contains("toughness") ? card1->value("power").toString() + QString('/') + card1->value("toughness").toString() : QString("");
|
cardPT = card1->contains("power") || card1->contains("toughness") ? card1->value("power").toString() + QString('/') + card1->value("toughness").toString() : QString("");
|
||||||
cardText = card1->contains("text") ? card1->value("text").toString() : QString("");
|
cardText = card1->contains("text") ? card1->value("text").toString() : QString("");
|
||||||
|
|
@ -192,18 +195,22 @@ int OracleImporter::importTextSpoiler(CardSet *set, const QVariant &data)
|
||||||
// add second card's data
|
// add second card's data
|
||||||
cardName += card2->contains("name") ? QString(" // ") + card2->value("name").toString() : QString("");
|
cardName += card2->contains("name") ? QString(" // ") + card2->value("name").toString() : QString("");
|
||||||
cardCost += card2->contains("manaCost") ? QString(" // ") + card2->value("manaCost").toString() : QString("");
|
cardCost += card2->contains("manaCost") ? QString(" // ") + card2->value("manaCost").toString() : QString("");
|
||||||
|
cmc += card2->contains("cmc") ? QString(" // ") + card2->value("cmc").toString() : QString("");
|
||||||
cardType += card2->contains("type") ? QString(" // ") + card2->value("type").toString() : QString("");
|
cardType += card2->contains("type") ? QString(" // ") + card2->value("type").toString() : QString("");
|
||||||
cardPT += card2->contains("power") || card2->contains("toughness") ? QString(" // ") + card2->value("power").toString() + QString('/') + card2->value("toughness").toString() : QString("");
|
cardPT += card2->contains("power") || card2->contains("toughness") ? QString(" // ") + card2->value("power").toString() + QString('/') + card2->value("toughness").toString() : QString("");
|
||||||
cardText += card2->contains("text") ? QString("\n\n---\n\n") + card2->value("text").toString() : QString("");
|
cardText += card2->contains("text") ? QString("\n\n---\n\n") + card2->value("text").toString() : QString("");
|
||||||
} else {
|
} else {
|
||||||
// first card od a pair; enqueue for later merging
|
// first card of a pair; enqueue for later merging
|
||||||
splitCards.insert(cardId, map);
|
// Conditional on cardId because promo prints have no muid - see #640
|
||||||
|
if (cardId)
|
||||||
|
splitCards.insert(cardId, map);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// normal cards handling
|
// normal cards handling
|
||||||
cardName = map.contains("name") ? map.value("name").toString() : QString("");
|
cardName = map.contains("name") ? map.value("name").toString() : QString("");
|
||||||
cardCost = map.contains("manaCost") ? map.value("manaCost").toString() : QString("");
|
cardCost = map.contains("manaCost") ? map.value("manaCost").toString() : QString("");
|
||||||
|
cmc = map.contains("cmc") ? map.value("cmc").toString() : QString("");
|
||||||
cardType = map.contains("type") ? map.value("type").toString() : QString("");
|
cardType = map.contains("type") ? map.value("type").toString() : QString("");
|
||||||
cardPT = map.contains("power") || map.contains("toughness") ? map.value("power").toString() + QString('/') + map.value("toughness").toString() : QString("");
|
cardPT = map.contains("power") || map.contains("toughness") ? map.value("power").toString() + QString('/') + map.value("toughness").toString() : QString("");
|
||||||
cardText = map.contains("text") ? map.value("text").toString() : QString("");
|
cardText = map.contains("text") ? map.value("text").toString() : QString("");
|
||||||
|
|
@ -218,7 +225,7 @@ int OracleImporter::importTextSpoiler(CardSet *set, const QVariant &data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cardIsToken) {
|
if (!cardIsToken) {
|
||||||
CardInfo *card = addCard(set->getShortName(), cardName, cardIsToken, cardId, cardCost, cardType, cardPT, cardLoyalty, cardText.split("\n"));
|
CardInfo *card = addCard(set->getShortName(), cardName, cardIsToken, cardId, cardCost, cmc, cardType, cardPT, cardLoyalty, cardText.split("\n"));
|
||||||
|
|
||||||
if (!set->contains(card)) {
|
if (!set->contains(card)) {
|
||||||
card->addToSet(set);
|
card->addToSet(set);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ private:
|
||||||
QVariantMap setsMap;
|
QVariantMap setsMap;
|
||||||
QString dataDir;
|
QString dataDir;
|
||||||
|
|
||||||
CardInfo *addCard(const QString &setName, QString cardName, bool isToken, int cardId, QString &cardCost, const QString &cardType, const QString &cardPT, int cardLoyalty, const QStringList &cardText);
|
CardInfo *addCard(const QString &setName, QString cardName, bool isToken, int cardId, QString &cardCost, QString &cmc, const QString &cardType, const QString &cardPT, int cardLoyalty, const QStringList &cardText);
|
||||||
signals:
|
signals:
|
||||||
void setIndexChanged(int cardsImported, int setIndex, const QString &setName);
|
void setIndexChanged(int cardsImported, int setIndex, const QString &setName);
|
||||||
void dataReadProgress(int bytesRead, int totalBytes);
|
void dataReadProgress(int bytesRead, int totalBytes);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue