mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
minor visual change, server crash fix, multiplayer leave/concede fixes
This commit is contained in:
parent
6bdc8914a9
commit
d4f600393f
10 changed files with 169 additions and 58 deletions
|
|
@ -23,7 +23,7 @@
|
|||
#include <QDebug>
|
||||
|
||||
Player::Player(ServerInfo_User *info, int _id, bool _local, TabGame *_parent)
|
||||
: QObject(_parent), shortcutsActive(false), defaultNumberTopCards(3), lastTokenDestroy(true), userInfo(new ServerInfo_User(info)), id(_id), active(false), local(_local), mirrored(false), dialogSemaphore(false)
|
||||
: QObject(_parent), shortcutsActive(false), defaultNumberTopCards(3), lastTokenDestroy(true), userInfo(new ServerInfo_User(info)), id(_id), active(false), local(_local), mirrored(false), conceded(false), dialogSemaphore(false)
|
||||
{
|
||||
setCacheMode(DeviceCoordinateCache);
|
||||
|
||||
|
|
@ -264,17 +264,27 @@ Player::~Player()
|
|||
|
||||
static_cast<GameScene *>(scene())->removePlayer(this);
|
||||
|
||||
clearArrows();
|
||||
|
||||
clear();
|
||||
QMapIterator<QString, CardZone *> i(zones);
|
||||
while (i.hasNext())
|
||||
delete i.next().value();
|
||||
|
||||
clearCounters();
|
||||
zones.clear();
|
||||
|
||||
delete playerMenu;
|
||||
delete userInfo;
|
||||
}
|
||||
|
||||
void Player::clear()
|
||||
{
|
||||
clearArrows();
|
||||
|
||||
QMapIterator<QString, CardZone *> i(zones);
|
||||
while (i.hasNext())
|
||||
i.next().value()->clearContents();
|
||||
|
||||
clearCounters();
|
||||
}
|
||||
|
||||
void Player::addPlayer(Player *player)
|
||||
{
|
||||
if (player == this)
|
||||
|
|
@ -362,6 +372,11 @@ void Player::rearrangeZones()
|
|||
rearrangeCounters();
|
||||
}
|
||||
|
||||
void Player::updateZones()
|
||||
{
|
||||
table->reorganizeCards();
|
||||
}
|
||||
|
||||
void Player::updateBgPixmap()
|
||||
{
|
||||
QString bgPath = settingsCache->getPlayerBgPath();
|
||||
|
|
@ -1485,6 +1500,16 @@ qreal Player::getMinimumWidth() const
|
|||
return result;
|
||||
}
|
||||
|
||||
void Player::setConceded(bool _conceded)
|
||||
{
|
||||
conceded = _conceded;
|
||||
setVisible(!conceded);
|
||||
if (conceded) {
|
||||
clear();
|
||||
emit gameConceded();
|
||||
}
|
||||
}
|
||||
|
||||
void Player::setMirrored(bool _mirrored)
|
||||
{
|
||||
if (mirrored != _mirrored) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue