# HG changeset patch
# User unc0rr
# Date 1381261125 -14400
# Node ID 8f9b04138456342e3fee4708838693026d4efe42
# Parent dc3d658de3507ebd1a34bf3b68b8030bc330975c
Icons for 'i' and 'c' flags
diff -r dc3d658de350 -r 8f9b04138456 QTfrontend/hedgewars.qrc
--- a/QTfrontend/hedgewars.qrc Tue Oct 08 10:28:57 2013 +0400
+++ b/QTfrontend/hedgewars.qrc Tue Oct 08 23:38:45 2013 +0400
@@ -165,5 +165,9 @@
res/splash.png
res/html/about.html
res/xml/tips.xml
+ res/chat/hedgehogcontributor.png
+ res/chat/hedgehogcontributor_gray.png
+ res/chat/roomadmincontributor.png
+ res/chat/roomadmincontributor_gray.png
diff -r dc3d658de350 -r 8f9b04138456 QTfrontend/model/playerslistmodel.cpp
--- a/QTfrontend/model/playerslistmodel.cpp Tue Oct 08 10:28:57 2013 +0400
+++ b/QTfrontend/model/playerslistmodel.cpp Tue Oct 08 23:38:45 2013 +0400
@@ -11,7 +11,8 @@
PlayersListModel::PlayersListModel(QObject *parent) :
QAbstractListModel(parent)
{
-
+ m_fontInRoom = QFont();
+ m_fontInRoom.setItalic(true);
}
@@ -223,6 +224,7 @@
<< index.data(Ignore).toBool()
<< index.data(InGame).toBool()
<< index.data(RoomFilterRole).toBool()
+ << index.data(InRoom).toBool()
;
for(int i = flags.size() - 1; i >= 0; --i)
@@ -253,16 +255,26 @@
else
painter.drawPixmap(0, 0, 16, 16, QPixmap(":/res/chat/lamp_off.png"));
}
+ } else
+ { // we're in lobby
+ if(!index.data(InRoom).toBool())
+ painter.drawPixmap(0, 0, 16, 16, QPixmap(":/res/Flake.png"));
}
QString mainIconName(":/res/chat/");
- if(index.data(RoomAdmin).toBool())
- mainIconName += "roomadmin";
- else if(index.data(ServerAdmin).toBool())
+ if(index.data(ServerAdmin).toBool())
mainIconName += "serveradmin";
else
- mainIconName += "hedgehog";
+ {
+ if(index.data(RoomAdmin).toBool())
+ mainIconName += "roomadmin";
+ else
+ mainIconName += "hedgehog";
+
+ if(index.data(Contributor).toBool())
+ mainIconName += "contributor";
+ }
if(!index.data(Registered).toBool())
mainIconName += "_gray";
diff -r dc3d658de350 -r 8f9b04138456 QTfrontend/model/playerslistmodel.h
--- a/QTfrontend/model/playerslistmodel.h Tue Oct 08 10:28:57 2013 +0400
+++ b/QTfrontend/model/playerslistmodel.h Tue Oct 08 23:38:45 2013 +0400
@@ -6,6 +6,7 @@
#include
#include
#include
+#include
class PlayersListModel : public QAbstractListModel
{
@@ -19,7 +20,9 @@
Registered = Qt::UserRole + 3,
Friend = Qt::UserRole + 4,
Ignore = Qt::UserRole + 5,
- InGame = Qt::UserRole + 6
+ InGame = Qt::UserRole + 6,
+ InRoom = Qt::UserRole + 7,
+ Contributor = Qt::UserRole + 8
};
enum SpecialRoles {
@@ -61,6 +64,7 @@
QList m_data;
QSet m_friendsSet, m_ignoredSet;
QString m_nickname;
+ QFont m_fontInRoom;
void updateIcon(const QModelIndex & index);
void updateSortData(const QModelIndex & index);
diff -r dc3d658de350 -r 8f9b04138456 QTfrontend/net/newnetclient.cpp
--- a/QTfrontend/net/newnetclient.cpp Tue Oct 08 10:28:57 2013 +0400
+++ b/QTfrontend/net/newnetclient.cpp Tue Oct 08 23:38:45 2013 +0400
@@ -436,6 +436,16 @@
foreach(const QString & nick, nicks)
m_playersModel->setFlag(nick, PlayersListModel::Registered, setFlag);
break;
+ // flag indicating if a player is in room
+ case 'i':
+ foreach(const QString & nick, nicks)
+ m_playersModel->setFlag(nick, PlayersListModel::InRoom, setFlag);
+ break;
+ // flag indicating if a player is contributor
+ case 'c':
+ foreach(const QString & nick, nicks)
+ m_playersModel->setFlag(nick, PlayersListModel::InRoom, setFlag);
+ break;
// flag indicating if a player has engine running
case 'g':
if(inRoom)
diff -r dc3d658de350 -r 8f9b04138456 QTfrontend/res/chat/hedgehogcontributor.png
Binary file QTfrontend/res/chat/hedgehogcontributor.png has changed
diff -r dc3d658de350 -r 8f9b04138456 QTfrontend/res/chat/hedgehogcontributor_gray.png
Binary file QTfrontend/res/chat/hedgehogcontributor_gray.png has changed
diff -r dc3d658de350 -r 8f9b04138456 QTfrontend/res/chat/roomadmincontributor.png
Binary file QTfrontend/res/chat/roomadmincontributor.png has changed
diff -r dc3d658de350 -r 8f9b04138456 QTfrontend/res/chat/roomadmincontributor_gray.png
Binary file QTfrontend/res/chat/roomadmincontributor_gray.png has changed