mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
avatar changes
This commit is contained in:
parent
28a77f10e4
commit
2f422f5a20
6 changed files with 29 additions and 19 deletions
|
|
@ -1,9 +1,10 @@
|
|||
#include "playertarget.h"
|
||||
#include "player.h"
|
||||
#include "protocol_datastructures.h"
|
||||
#include <QPainter>
|
||||
|
||||
PlayerTarget::PlayerTarget(const QString &_name, int _maxWidth, Player *_owner)
|
||||
: ArrowTarget(_owner, _owner), name(_name), maxWidth(_maxWidth)
|
||||
PlayerTarget::PlayerTarget(Player *_owner)
|
||||
: ArrowTarget(_owner, _owner)
|
||||
{
|
||||
font = QFont("Times");
|
||||
font.setStyleHint(QFont::Serif);
|
||||
|
|
@ -12,13 +13,14 @@ PlayerTarget::PlayerTarget(const QString &_name, int _maxWidth, Player *_owner)
|
|||
|
||||
QRectF PlayerTarget::boundingRect() const
|
||||
{
|
||||
return QRectF(0, 0, maxWidth, 30);
|
||||
return QRectF(0, 0, 64, 64);
|
||||
}
|
||||
|
||||
void PlayerTarget::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
||||
{
|
||||
ServerInfo_User *info = owner->getUserInfo();
|
||||
painter->fillRect(boundingRect(), QColor(255, 255, 255, 100));
|
||||
painter->setFont(font);
|
||||
painter->setPen(Qt::black);
|
||||
painter->drawText(boundingRect(), Qt::AlignCenter, name);
|
||||
painter->drawText(boundingRect(), Qt::AlignCenter, info->getName());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue