QTfrontend/team.cpp
changeset 7130 fcab1fd02bc6
parent 6953 4c2dd25630a7
child 7131 c0c787eb526e
equal deleted inserted replaced
7128:574b385ce7df 7130:fcab1fd02bc6
    20 #include <QTextStream>
    20 #include <QTextStream>
    21 #include <QStringList>
    21 #include <QStringList>
    22 #include <QLineEdit>
    22 #include <QLineEdit>
    23 #include <QCryptographicHash>
    23 #include <QCryptographicHash>
    24 #include <QSettings>
    24 #include <QSettings>
       
    25 #include <QStandardItemModel>
    25 
    26 
    26 #include "team.h"
    27 #include "team.h"
    27 #include "hwform.h"
    28 #include "hwform.h"
    28 
    29 
    29 HWTeam::HWTeam(const QString & teamname) :
    30 HWTeam::HWTeam(const QString & teamname) :
   246 QStringList HWTeam::teamGameConfig(quint32 InitHealth) const
   247 QStringList HWTeam::teamGameConfig(quint32 InitHealth) const
   247 {
   248 {
   248     QStringList sl;
   249     QStringList sl;
   249     if (m_isNetTeam)
   250     if (m_isNetTeam)
   250     {
   251     {
   251         sl.push_back(QString("eaddteam %3 %1 %2").arg(m_color.rgb() & 0xffffff).arg(m_name).arg(QString(QCryptographicHash::hash(m_owner.toLatin1(), QCryptographicHash::Md5).toHex())));
   252         sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(QString(QCryptographicHash::hash(m_owner.toLatin1(), QCryptographicHash::Md5).toHex())));
   252         sl.push_back("erdriven");
   253         sl.push_back("erdriven");
   253     }
   254     }
   254     else sl.push_back(QString("eaddteam %3 %1 %2").arg(m_color.rgb() & 0xffffff).arg(m_name).arg(playerHash));
   255     else sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(playerHash));
   255 
   256 
   256     sl.push_back(QString("egrave " + m_grave));
   257     sl.push_back(QString("egrave " + m_grave));
   257     sl.push_back(QString("efort " + m_fort));
   258     sl.push_back(QString("efort " + m_fort));
   258     sl.push_back(QString("evoicepack " + m_voicepack));
   259     sl.push_back(QString("evoicepack " + m_voicepack));
   259     sl.push_back(QString("eflag " + m_flag));
   260     sl.push_back(QString("eflag " + m_flag));
   332 {
   333 {
   333     m_difficulty = level;
   334     m_difficulty = level;
   334 }
   335 }
   335 
   336 
   336 // color
   337 // color
   337 QColor HWTeam::color() const
   338 int HWTeam::color() const
   338 {
   339 {
   339     return m_color;
   340     return m_color;
   340 }
   341 }
   341 void HWTeam::setColor(const QColor & color)
   342 
       
   343 QColor HWTeam::qcolor() const
       
   344 {
       
   345     return colorsModel->item(m_color)->data().value<QColor>();
       
   346 }
       
   347 
       
   348 void HWTeam::setColor(int color)
   342 {
   349 {
   343     m_color = color;
   350     m_color = color;
   344 }
   351 }
   345 
   352 
   346 
   353 
   420 }
   427 }
   421 void HWTeam::incWins()
   428 void HWTeam::incWins()
   422 {
   429 {
   423     m_wins++;
   430     m_wins++;
   424 }
   431 }
   425