some token code
This commit is contained in:
parent
1cd63375ba
commit
f553fd7456
15 changed files with 99 additions and 21 deletions
|
@ -234,6 +234,7 @@ void PictureLoader::setPicDownload(bool _picDownload)
|
||||||
|
|
||||||
CardInfo::CardInfo(CardDatabase *_db,
|
CardInfo::CardInfo(CardDatabase *_db,
|
||||||
const QString &_name,
|
const QString &_name,
|
||||||
|
bool _isToken,
|
||||||
const QString &_manacost,
|
const QString &_manacost,
|
||||||
const QString &_cardtype,
|
const QString &_cardtype,
|
||||||
const QString &_powtough,
|
const QString &_powtough,
|
||||||
|
@ -248,6 +249,7 @@ CardInfo::CardInfo(CardDatabase *_db,
|
||||||
const QMap<QString, QString> &_picURLsSt)
|
const QMap<QString, QString> &_picURLsSt)
|
||||||
: db(_db),
|
: db(_db),
|
||||||
name(_name),
|
name(_name),
|
||||||
|
isToken(_isToken),
|
||||||
sets(_sets),
|
sets(_sets),
|
||||||
manacost(_manacost),
|
manacost(_manacost),
|
||||||
cardtype(_cardtype),
|
cardtype(_cardtype),
|
||||||
|
@ -426,6 +428,8 @@ QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfo *info)
|
||||||
xml.writeTextElement("loyalty", QString::number(info->getLoyalty()));
|
xml.writeTextElement("loyalty", QString::number(info->getLoyalty()));
|
||||||
if (info->getCipt())
|
if (info->getCipt())
|
||||||
xml.writeTextElement("cipt", "1");
|
xml.writeTextElement("cipt", "1");
|
||||||
|
if (info->getIsToken())
|
||||||
|
xml.writeTextElement("token", "1");
|
||||||
xml.writeEndElement(); // card
|
xml.writeEndElement(); // card
|
||||||
|
|
||||||
return xml;
|
return xml;
|
||||||
|
@ -485,7 +489,7 @@ CardInfo *CardDatabase::getCard(const QString &cardName)
|
||||||
else if (cardHash.contains(cardName))
|
else if (cardHash.contains(cardName))
|
||||||
return cardHash.value(cardName);
|
return cardHash.value(cardName);
|
||||||
else {
|
else {
|
||||||
CardInfo *newCard = new CardInfo(this, cardName);
|
CardInfo *newCard = new CardInfo(this, cardName, true);
|
||||||
newCard->addToSet(getSet("TK"));
|
newCard->addToSet(getSet("TK"));
|
||||||
cardHash.insert(cardName, newCard);
|
cardHash.insert(cardName, newCard);
|
||||||
return newCard;
|
return newCard;
|
||||||
|
@ -558,6 +562,7 @@ void CardDatabase::loadCardsFromXml(QXmlStreamReader &xml)
|
||||||
int tableRow = 0;
|
int tableRow = 0;
|
||||||
int loyalty = 0;
|
int loyalty = 0;
|
||||||
bool cipt = false;
|
bool cipt = false;
|
||||||
|
bool isToken = false;
|
||||||
while (!xml.atEnd()) {
|
while (!xml.atEnd()) {
|
||||||
if (xml.readNext() == QXmlStreamReader::EndElement)
|
if (xml.readNext() == QXmlStreamReader::EndElement)
|
||||||
break;
|
break;
|
||||||
|
@ -588,8 +593,10 @@ void CardDatabase::loadCardsFromXml(QXmlStreamReader &xml)
|
||||||
cipt = (xml.readElementText() == "1");
|
cipt = (xml.readElementText() == "1");
|
||||||
else if (xml.name() == "loyalty")
|
else if (xml.name() == "loyalty")
|
||||||
loyalty = xml.readElementText().toInt();
|
loyalty = xml.readElementText().toInt();
|
||||||
|
else if (xml.name() == "token")
|
||||||
|
isToken = xml.readElementText().toInt();
|
||||||
}
|
}
|
||||||
cardHash.insert(name, new CardInfo(this, name, manacost, type, pt, text, colors, loyalty, cipt, tableRow, sets, picURLs, picURLsHq, picURLsSt));
|
cardHash.insert(name, new CardInfo(this, name, isToken, manacost, type, pt, text, colors, loyalty, cipt, tableRow, sets, picURLs, picURLsHq, picURLsSt));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,7 @@ private:
|
||||||
CardDatabase *db;
|
CardDatabase *db;
|
||||||
|
|
||||||
QString name;
|
QString name;
|
||||||
|
bool isToken;
|
||||||
SetList sets;
|
SetList sets;
|
||||||
QString manacost;
|
QString manacost;
|
||||||
QString cardtype;
|
QString cardtype;
|
||||||
|
@ -106,6 +107,7 @@ private:
|
||||||
public:
|
public:
|
||||||
CardInfo(CardDatabase *_db,
|
CardInfo(CardDatabase *_db,
|
||||||
const QString &_name = QString(),
|
const QString &_name = QString(),
|
||||||
|
bool _isToken = false,
|
||||||
const QString &_manacost = QString(),
|
const QString &_manacost = QString(),
|
||||||
const QString &_cardtype = QString(),
|
const QString &_cardtype = QString(),
|
||||||
const QString &_powtough = QString(),
|
const QString &_powtough = QString(),
|
||||||
|
@ -120,6 +122,7 @@ public:
|
||||||
const QStringMap &_picURLsSt = QStringMap());
|
const QStringMap &_picURLsSt = QStringMap());
|
||||||
~CardInfo();
|
~CardInfo();
|
||||||
const QString &getName() const { return name; }
|
const QString &getName() const { return name; }
|
||||||
|
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 &getCardType() const { return cardtype; }
|
const QString &getCardType() const { return cardtype; }
|
||||||
|
|
|
@ -71,7 +71,8 @@ void CardDatabaseModel::updateCardList()
|
||||||
}
|
}
|
||||||
|
|
||||||
CardDatabaseDisplayModel::CardDatabaseDisplayModel(QObject *parent)
|
CardDatabaseDisplayModel::CardDatabaseDisplayModel(QObject *parent)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent),
|
||||||
|
isToken(ShowAll)
|
||||||
{
|
{
|
||||||
setFilterCaseSensitivity(Qt::CaseInsensitive);
|
setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||||
setSortCaseSensitivity(Qt::CaseInsensitive);
|
setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||||
|
@ -81,6 +82,9 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex
|
||||||
{
|
{
|
||||||
CardInfo *info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
|
CardInfo *info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
|
||||||
|
|
||||||
|
if (((isToken == ShowTrue) && !info->getIsToken()) || (isToken == ShowFalse) && info->getIsToken())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!cardNameBeginning.isEmpty())
|
if (!cardNameBeginning.isEmpty())
|
||||||
if (!info->getName().startsWith(cardNameBeginning, Qt::CaseInsensitive))
|
if (!info->getName().startsWith(cardNameBeginning, Qt::CaseInsensitive))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -26,11 +26,15 @@ private slots:
|
||||||
|
|
||||||
class CardDatabaseDisplayModel : public QSortFilterProxyModel {
|
class CardDatabaseDisplayModel : public QSortFilterProxyModel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
enum FilterBool { ShowTrue, ShowFalse, ShowAll };
|
||||||
private:
|
private:
|
||||||
|
FilterBool isToken;
|
||||||
QString cardNameBeginning, cardName, cardText;
|
QString cardNameBeginning, cardName, cardText;
|
||||||
QSet<QString> cardTypes, cardColors;
|
QSet<QString> cardTypes, cardColors;
|
||||||
public:
|
public:
|
||||||
CardDatabaseDisplayModel(QObject *parent = 0);
|
CardDatabaseDisplayModel(QObject *parent = 0);
|
||||||
|
void setIsToken(FilterBool _isToken) { isToken = _isToken; invalidate(); }
|
||||||
void setCardNameBeginning(const QString &_beginning) { cardNameBeginning = _beginning; invalidate(); }
|
void setCardNameBeginning(const QString &_beginning) { cardNameBeginning = _beginning; invalidate(); }
|
||||||
void setCardName(const QString &_cardName) { cardName = _cardName; invalidate(); }
|
void setCardName(const QString &_cardName) { cardName = _cardName; invalidate(); }
|
||||||
void setCardText(const QString &_cardText) { cardText = _cardText; invalidate(); }
|
void setCardText(const QString &_cardText) { cardText = _cardText; invalidate(); }
|
||||||
|
|
|
@ -274,6 +274,7 @@ DeckViewScene::DeckViewScene(QObject *parent)
|
||||||
DeckViewScene::~DeckViewScene()
|
DeckViewScene::~DeckViewScene()
|
||||||
{
|
{
|
||||||
clearContents();
|
clearContents();
|
||||||
|
delete deck;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckViewScene::clearContents()
|
void DeckViewScene::clearContents()
|
||||||
|
|
|
@ -6,9 +6,15 @@
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
|
#include <QGroupBox>
|
||||||
|
#include <QTreeView>
|
||||||
|
#include <QRadioButton>
|
||||||
|
#include "decklist.h"
|
||||||
#include "dlg_create_token.h"
|
#include "dlg_create_token.h"
|
||||||
|
#include "carddatabasemodel.h"
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
DlgCreateToken::DlgCreateToken(QWidget *parent)
|
DlgCreateToken::DlgCreateToken(DeckList *_deck, QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
nameLabel = new QLabel(tr("&Name:"));
|
nameLabel = new QLabel(tr("&Name:"));
|
||||||
|
@ -49,12 +55,37 @@ DlgCreateToken::DlgCreateToken(QWidget *parent)
|
||||||
grid->addWidget(annotationEdit, 3, 1);
|
grid->addWidget(annotationEdit, 3, 1);
|
||||||
grid->addWidget(destroyCheckBox, 4, 0, 1, 2);
|
grid->addWidget(destroyCheckBox, 4, 0, 1, 2);
|
||||||
|
|
||||||
|
QGroupBox *tokenDataGroupBox = new QGroupBox(tr("Token data"));
|
||||||
|
tokenDataGroupBox->setLayout(grid);
|
||||||
|
|
||||||
|
cardDatabaseModel = new CardDatabaseModel(db, this);
|
||||||
|
cardDatabaseDisplayModel = new CardDatabaseDisplayModel(this);
|
||||||
|
cardDatabaseDisplayModel->setSourceModel(cardDatabaseModel);
|
||||||
|
cardDatabaseDisplayModel->setIsToken(CardDatabaseDisplayModel::ShowTrue);
|
||||||
|
|
||||||
|
QRadioButton *chooseTokenFromAllRadioButton = new QRadioButton(tr("Show &all tokens"));
|
||||||
|
QRadioButton *chooseTokenFromDeckRadioButton = new QRadioButton(tr("Show tokens from this &deck"));
|
||||||
|
QTreeView *chooseTokenView = new QTreeView;
|
||||||
|
chooseTokenView->setModel(cardDatabaseDisplayModel);
|
||||||
|
|
||||||
|
QVBoxLayout *tokenChooseLayout = new QVBoxLayout;
|
||||||
|
tokenChooseLayout->addWidget(chooseTokenFromAllRadioButton);
|
||||||
|
tokenChooseLayout->addWidget(chooseTokenFromDeckRadioButton);
|
||||||
|
tokenChooseLayout->addWidget(chooseTokenView);
|
||||||
|
|
||||||
|
QGroupBox *tokenChooseGroupBox = new QGroupBox(tr("Choose token from list"));
|
||||||
|
tokenChooseGroupBox->setLayout(tokenChooseLayout);
|
||||||
|
|
||||||
|
QHBoxLayout *hbox = new QHBoxLayout;
|
||||||
|
hbox->addWidget(tokenDataGroupBox);
|
||||||
|
hbox->addWidget(tokenChooseGroupBox);
|
||||||
|
|
||||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk()));
|
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk()));
|
||||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||||
mainLayout->addLayout(grid);
|
mainLayout->addLayout(hbox);
|
||||||
mainLayout->addWidget(buttonBox);
|
mainLayout->addWidget(buttonBox);
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,14 @@ class QLabel;
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
|
class DeckList;
|
||||||
|
class CardDatabaseModel;
|
||||||
|
class CardDatabaseDisplayModel;
|
||||||
|
|
||||||
class DlgCreateToken : public QDialog {
|
class DlgCreateToken : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
DlgCreateToken(QWidget *parent = 0);
|
DlgCreateToken(DeckList *_deck, QWidget *parent = 0);
|
||||||
QString getName() const;
|
QString getName() const;
|
||||||
QString getColor() const;
|
QString getColor() const;
|
||||||
QString getPT() const;
|
QString getPT() const;
|
||||||
|
@ -21,6 +24,8 @@ public:
|
||||||
private slots:
|
private slots:
|
||||||
void actOk();
|
void actOk();
|
||||||
private:
|
private:
|
||||||
|
CardDatabaseModel *cardDatabaseModel;
|
||||||
|
CardDatabaseDisplayModel *cardDatabaseDisplayModel;
|
||||||
QLabel *nameLabel, *colorLabel, *ptLabel, *annotationLabel;
|
QLabel *nameLabel, *colorLabel, *ptLabel, *annotationLabel;
|
||||||
QComboBox *colorEdit;
|
QComboBox *colorEdit;
|
||||||
QLineEdit *nameEdit, *ptEdit, *annotationEdit;
|
QLineEdit *nameEdit, *ptEdit, *annotationEdit;
|
||||||
|
|
|
@ -95,7 +95,19 @@ void PlayerArea::setSize(qreal width, qreal height)
|
||||||
}
|
}
|
||||||
|
|
||||||
Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_parent)
|
Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_parent)
|
||||||
: QObject(_parent), game(_parent), shortcutsActive(false), defaultNumberTopCards(3), lastTokenDestroy(true), id(_id), active(false), local(_local), mirrored(false), handVisible(false), conceded(false), dialogSemaphore(false)
|
: QObject(_parent),
|
||||||
|
game(_parent),
|
||||||
|
shortcutsActive(false),
|
||||||
|
defaultNumberTopCards(3),
|
||||||
|
lastTokenDestroy(true),
|
||||||
|
id(_id),
|
||||||
|
active(false),
|
||||||
|
local(_local),
|
||||||
|
mirrored(false),
|
||||||
|
handVisible(false),
|
||||||
|
conceded(false),
|
||||||
|
dialogSemaphore(false),
|
||||||
|
deck(0)
|
||||||
{
|
{
|
||||||
userInfo = new ServerInfo_User;
|
userInfo = new ServerInfo_User;
|
||||||
userInfo->CopyFrom(info);
|
userInfo->CopyFrom(info);
|
||||||
|
@ -876,7 +888,7 @@ void Player::actRollDie()
|
||||||
|
|
||||||
void Player::actCreateToken()
|
void Player::actCreateToken()
|
||||||
{
|
{
|
||||||
DlgCreateToken dlg;
|
DlgCreateToken dlg(deck);
|
||||||
if (!dlg.exec())
|
if (!dlg.exec())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
namespace google { namespace protobuf { class Message; } }
|
namespace google { namespace protobuf { class Message; } }
|
||||||
class CardDatabase;
|
class CardDatabase;
|
||||||
|
class DeckList;
|
||||||
class QMenu;
|
class QMenu;
|
||||||
class QAction;
|
class QAction;
|
||||||
class ZoneViewZone;
|
class ZoneViewZone;
|
||||||
|
@ -187,6 +188,7 @@ private:
|
||||||
bool clearCardsToDelete();
|
bool clearCardsToDelete();
|
||||||
QList<CardItem *> cardsToDelete;
|
QList<CardItem *> cardsToDelete;
|
||||||
|
|
||||||
|
DeckList *deck;
|
||||||
PlayerArea *playerArea;
|
PlayerArea *playerArea;
|
||||||
QMap<QString, CardZone *> zones;
|
QMap<QString, CardZone *> zones;
|
||||||
StackZone *stack;
|
StackZone *stack;
|
||||||
|
@ -256,6 +258,8 @@ public:
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
void clear();
|
void clear();
|
||||||
TabGame *getGame() const { return game; }
|
TabGame *getGame() const { return game; }
|
||||||
|
DeckList *getDeck() const { return deck; }
|
||||||
|
void setDeck(DeckList *_deck) { deck = _deck; }
|
||||||
QMenu *getPlayerMenu() const { return playerMenu; }
|
QMenu *getPlayerMenu() const { return playerMenu; }
|
||||||
int getId() const { return id; }
|
int getId() const { return id; }
|
||||||
QString getName() const;
|
QString getName() const;
|
||||||
|
|
|
@ -437,13 +437,17 @@ void WndDeckEditor::recursiveExpand(const QModelIndex &index)
|
||||||
deckView->expand(index);
|
deckView->expand(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WndDeckEditor::addCardHelper(const QString &zoneName)
|
void WndDeckEditor::addCardHelper(QString zoneName)
|
||||||
{
|
{
|
||||||
const QModelIndex currentIndex = databaseView->selectionModel()->currentIndex();
|
const QModelIndex currentIndex = databaseView->selectionModel()->currentIndex();
|
||||||
if (!currentIndex.isValid())
|
if (!currentIndex.isValid())
|
||||||
return;
|
return;
|
||||||
const QString cardName = currentIndex.sibling(currentIndex.row(), 0).data().toString();
|
const QString cardName = currentIndex.sibling(currentIndex.row(), 0).data().toString();
|
||||||
|
|
||||||
|
CardInfo *info = db->getCard(cardName);
|
||||||
|
if (info->getIsToken())
|
||||||
|
zoneName = "tokens";
|
||||||
|
|
||||||
QModelIndex newCardIndex = deckModel->addCard(cardName, zoneName);
|
QModelIndex newCardIndex = deckModel->addCard(cardName, zoneName);
|
||||||
recursiveExpand(newCardIndex);
|
recursiveExpand(newCardIndex);
|
||||||
deckView->setCurrentIndex(newCardIndex);
|
deckView->setCurrentIndex(newCardIndex);
|
||||||
|
|
|
@ -58,7 +58,7 @@ private slots:
|
||||||
|
|
||||||
void finishedUpdatingPrices();
|
void finishedUpdatingPrices();
|
||||||
private:
|
private:
|
||||||
void addCardHelper(const QString &zoneName);
|
void addCardHelper(QString zoneName);
|
||||||
void recursiveExpand(const QModelIndex &index);
|
void recursiveExpand(const QModelIndex &index);
|
||||||
bool confirmClose();
|
bool confirmClose();
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,8 @@ QString InnerDecklistNode::visibleNameFromName(const QString &_name)
|
||||||
return QObject::tr("Maindeck");
|
return QObject::tr("Maindeck");
|
||||||
else if (_name == "side")
|
else if (_name == "side")
|
||||||
return QObject::tr("Sideboard");
|
return QObject::tr("Sideboard");
|
||||||
|
else if (_name == "tokens")
|
||||||
|
return QObject::tr("Tokens");
|
||||||
else
|
else
|
||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,7 @@ bool OracleImporter::readSetsFromXml(QXmlStreamReader &xml)
|
||||||
|
|
||||||
CardInfo *OracleImporter::addCard(const QString &setName,
|
CardInfo *OracleImporter::addCard(const QString &setName,
|
||||||
QString cardName,
|
QString cardName,
|
||||||
|
bool isToken,
|
||||||
int cardId,
|
int cardId,
|
||||||
const QString &cardCost,
|
const QString &cardCost,
|
||||||
const QString &cardType,
|
const QString &cardType,
|
||||||
|
@ -125,7 +126,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, cardCost, cardType, cardPT, fullCardText, colors, cardLoyalty, cipt);
|
card = new CardInfo(this, cardName, isToken, cardCost, 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)
|
||||||
|
@ -183,7 +184,7 @@ int OracleImporter::importTextSpoiler(CardSet *set, const QByteArray &data)
|
||||||
for (int i = 0; i < cardTextSplit.size(); ++i)
|
for (int i = 0; i < cardTextSplit.size(); ++i)
|
||||||
cardTextSplit[i] = cardTextSplit[i].trimmed();
|
cardTextSplit[i] = cardTextSplit[i].trimmed();
|
||||||
|
|
||||||
CardInfo *card = addCard(set->getShortName(), cardName, cardId, cardCost, cardType, cardPT, cardLoyalty, cardTextSplit);
|
CardInfo *card = addCard(set->getShortName(), cardName, false, cardId, cardCost, cardType, cardPT, cardLoyalty, cardTextSplit);
|
||||||
if (!set->contains(card)) {
|
if (!set->contains(card)) {
|
||||||
card->addToSet(set);
|
card->addToSet(set);
|
||||||
cards++;
|
cards++;
|
||||||
|
|
|
@ -35,7 +35,7 @@ private:
|
||||||
|
|
||||||
void downloadNextFile();
|
void downloadNextFile();
|
||||||
bool readSetsFromXml(QXmlStreamReader &xml);
|
bool readSetsFromXml(QXmlStreamReader &xml);
|
||||||
CardInfo *addCard(const QString &setName, QString cardName, int cardId, const QString &cardCost, const QString &cardType, const QString &cardPT, int cardLoyalty, const QStringList &cardText);
|
CardInfo *addCard(const QString &setName, QString cardName, bool isToken, int cardId, const QString &cardCost, const QString &cardType, const QString &cardPT, int cardLoyalty, const QStringList &cardText);
|
||||||
private slots:
|
private slots:
|
||||||
void httpRequestFinished(int requestId, bool error);
|
void httpRequestFinished(int requestId, bool error);
|
||||||
void readResponseHeader(const QHttpResponseHeader &responseHeader);
|
void readResponseHeader(const QHttpResponseHeader &responseHeader);
|
||||||
|
|
|
@ -80,11 +80,11 @@ Servatrice::Servatrice(QSettings *_settings, QObject *parent)
|
||||||
else
|
else
|
||||||
databaseType = DatabaseNone;
|
databaseType = DatabaseNone;
|
||||||
dbPrefix = settings->value("database/prefix").toString();
|
dbPrefix = settings->value("database/prefix").toString();
|
||||||
if (databaseType != DatabaseNone)
|
if (databaseType != DatabaseNone) {
|
||||||
openDatabase();
|
openDatabase();
|
||||||
|
|
||||||
updateServerList();
|
updateServerList();
|
||||||
clearSessionTables();
|
clearSessionTables();
|
||||||
|
}
|
||||||
|
|
||||||
const QString roomMethod = settings->value("rooms/method").toString();
|
const QString roomMethod = settings->value("rooms/method").toString();
|
||||||
if (roomMethod == "sql") {
|
if (roomMethod == "sql") {
|
||||||
|
|
Loading…
Reference in a new issue