Esempio n. 1
0
PlayerCardDialog::PlayerCardDialog(const ClientPlayer *player, const QString &flags)
    :player(player), mapper(new QSignalMapper(this))
{
    QVBoxLayout *vlayout = new QVBoxLayout;
    QHBoxLayout *layout = new QHBoxLayout;

    static QChar handcard_flag('h');
    static QChar equip_flag('e');
    static QChar judging_flag('j');

    layout->addWidget(createAvatar());

    if(flags.contains(handcard_flag))
        vlayout->addWidget(createHandcardButton());

    if(flags.contains(equip_flag))
        vlayout->addWidget(createEquipArea());

    if(flags.contains(judging_flag))
        vlayout->addWidget(createJudgingArea());

    connect(mapper, SIGNAL(mapped(int)), this, SIGNAL(card_id_chosen(int)));

    layout->addLayout(vlayout);

    setLayout(layout);
}
PlayerCardDialog::PlayerCardDialog(const ClientPlayer *player, const QString &flags,
                                   bool handcard_visible, Card::HandlingMethod method, const QList<int> &disabled_ids)
    : player(player), handcard_visible(handcard_visible), method(method), disabled_ids(disabled_ids)
{
    QVBoxLayout *vlayout1 = new QVBoxLayout, *vlayout2 = new QVBoxLayout;
    QHBoxLayout *layout = new QHBoxLayout;

    static QChar handcard_flag('h');
    static QChar equip_flag('e');
    static QChar judging_flag('j');

    vlayout1->addWidget(createAvatar());
    vlayout1->addStretch();

    if (flags.contains(handcard_flag))
        vlayout2->addWidget(createHandcardButton());

    if (flags.contains(equip_flag))
        vlayout2->addWidget(createEquipArea());

    if (flags.contains(judging_flag))
        vlayout2->addWidget(createJudgingArea());

    layout->addLayout(vlayout1);
    layout->addLayout(vlayout2);
    setLayout(layout);
}
Esempio n. 3
0
PlayerCardDialog::PlayerCardDialog(const ClientPlayer *player, const QString &flags)
    :player(player)
{
    QVBoxLayout *vlayout = new QVBoxLayout;
    QHBoxLayout *layout = new QHBoxLayout;

    static QChar handcard_flag('h');
    static QChar equip_flag('e');
    static QChar judging_flag('j');

    layout->addWidget(createAvatar());

    if(flags.contains(handcard_flag))
        vlayout->addWidget(createHandcardButton());

    if(flags.contains(equip_flag))
        vlayout->addWidget(createEquipArea());

    if(flags.contains(judging_flag))
        vlayout->addWidget(createJudgingArea());

    layout->addLayout(vlayout);

    setLayout(layout);
}