void Player::setGeneral(const General *new_general) { if (this->general != new_general) { this->general = new_general; if (new_general && kingdom.isEmpty()) setKingdom(new_general->getKingdom()); emit general_changed(); } }
void Player::setGeneral(const General *new_general){ if(this->general != new_general){ this->general = new_general; if(new_general){ setKingdom(general->getKingdom()); } emit general_changed(); } }
void Player::setGeneralName(const QString &general_name){ const General *new_general = Sanguosha->getGeneral(general_name); if(this->general != new_general){ this->general = new_general; if(new_general){ setHp(getMaxHP()); setKingdom(general->getKingdom()); } emit general_changed(); } }
SkillTitle(const QString &kingdom, const QString &text) :title_text(NULL), frame(NULL) { title_text = new AATextItem(text, this); title_text->setFont(Config.value("CardEditor/SkillTitleFont").value<QFont>()); title_text->setPos(Config.value("CardEditor/TitleTextOffset", QPointF(10, -2)).toPointF()); title_text->document()->setDocumentMargin(0); setKingdom(kingdom); setFlag(QGraphicsItem::ItemIsFocusable); frame = new QGraphicsRectItem(this); frame->setRect(-1, -1, 70+2, 30+2); QPen red_pen(Qt::red); frame->setPen(red_pen); frame->hide(); }