mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 10:33:54 -07:00
fixed 'open deck in deck editor' option in game, fixed freeze when closing local game
This commit is contained in:
parent
9af69f53af
commit
d7e7606104
9 changed files with 30 additions and 23 deletions
|
|
@ -3,7 +3,7 @@
|
|||
#include "server_room.h"
|
||||
|
||||
LocalServer::LocalServer(QObject *parent)
|
||||
: Server(parent)
|
||||
: Server(false, parent)
|
||||
{
|
||||
setDatabaseInterface(new LocalServer_DatabaseInterface(this));
|
||||
addRoom(new Server_Room(0, QString(), QString(), false, QString(), QStringList(), this));
|
||||
|
|
|
|||
|
|
@ -792,7 +792,7 @@ void Player::actAlwaysRevealTopCard()
|
|||
|
||||
void Player::actOpenDeckInDeckEditor()
|
||||
{
|
||||
emit openDeckEditor(*deck);
|
||||
emit openDeckEditor(deck);
|
||||
}
|
||||
|
||||
void Player::actViewGraveyard()
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public:
|
|||
class Player : public QObject, public QGraphicsItem {
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void openDeckEditor(const DeckLoader &deck);
|
||||
void openDeckEditor(const DeckLoader *deck);
|
||||
void newCardAdded(AbstractCardItem *card);
|
||||
// Log events
|
||||
void logSay(Player *player, QString message);
|
||||
|
|
|
|||
|
|
@ -733,7 +733,7 @@ Player *TabGame::addPlayer(int playerId, const ServerInfo_User &info)
|
|||
{
|
||||
bool local = ((clients.size() > 1) || (playerId == localPlayerId));
|
||||
Player *newPlayer = new Player(info, playerId, local, this);
|
||||
connect(newPlayer, SIGNAL(openDeckEditor(DeckList *)), this, SIGNAL(openDeckEditor(DeckList *)));
|
||||
connect(newPlayer, SIGNAL(openDeckEditor(const DeckLoader *)), this, SIGNAL(openDeckEditor(const DeckLoader *)));
|
||||
scene->addPlayer(newPlayer);
|
||||
|
||||
connect(newPlayer, SIGNAL(newCardAdded(AbstractCardItem *)), this, SLOT(newCardAdded(AbstractCardItem *)));
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ signals:
|
|||
void containerProcessingStarted(const GameEventContext &context);
|
||||
void containerProcessingDone();
|
||||
void openMessageDialog(const QString &userName, bool focus);
|
||||
void openDeckEditor(const DeckLoader &deck);
|
||||
void openDeckEditor(const DeckLoader *deck);
|
||||
private slots:
|
||||
void replayNextEvent();
|
||||
void replayFinished();
|
||||
|
|
|
|||
|
|
@ -280,8 +280,7 @@ void TabSupervisor::gameJoined(const Event_GameJoined &event)
|
|||
TabGame *tab = new TabGame(this, QList<AbstractClient *>() << client, event, roomGameTypes);
|
||||
connect(tab, SIGNAL(gameClosing(TabGame *)), this, SLOT(gameLeft(TabGame *)));
|
||||
connect(tab, SIGNAL(openMessageDialog(const QString &, bool)), this, SLOT(addMessageTab(const QString &, bool)));
|
||||
connect(tab, SIGNAL(openDeckEditor(DeckList *, QString, DeckList::FileFormat)), this, SLOT(addDeckEditorTab(DeckList *, QString, DeckList::FileFormat)));
|
||||
connect(tab, SIGNAL(openDeckEditor(DeckList *, int)), this, SLOT(addDeckEditorTab(DeckList *, int)));
|
||||
connect(tab, SIGNAL(openDeckEditor(const DeckLoader *)), this, SLOT(addDeckEditorTab(const DeckLoader *)));
|
||||
int tabIndex = myAddTab(tab);
|
||||
addCloseButtonToTab(tab, tabIndex);
|
||||
gameTabs.insert(event.game_info().game_id(), tab);
|
||||
|
|
@ -292,7 +291,7 @@ void TabSupervisor::localGameJoined(const Event_GameJoined &event)
|
|||
{
|
||||
TabGame *tab = new TabGame(this, localClients, event, QMap<int, QString>());
|
||||
connect(tab, SIGNAL(gameClosing(TabGame *)), this, SLOT(gameLeft(TabGame *)));
|
||||
connect(tab, SIGNAL(openDeckEditor(DeckList *)), this, SLOT(addDeckEditorTab(DeckList *)));
|
||||
connect(tab, SIGNAL(openDeckEditor(const DeckLoader *)), this, SLOT(addDeckEditorTab(const DeckLoader *)));
|
||||
int tabIndex = myAddTab(tab);
|
||||
addCloseButtonToTab(tab, tabIndex);
|
||||
gameTabs.insert(event.game_info().game_id(), tab);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue