Example #1
0
ServerDialog::ServerDialog(QWidget *parent)
    :QDialog(parent)
{
    setWindowTitle(tr("Start server"));

    QLayout *left = createLeft();
    QLayout *right = createRight();

    QHBoxLayout *hlayout = new QHBoxLayout;
    hlayout->addLayout(left);
    hlayout->addLayout(right);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addLayout(hlayout);
    layout->addLayout(createButtonLayout());

    setLayout(layout);
}
Example #2
0
Dashboard::Dashboard()
    :left_pixmap("image/system/dashboard-equip.png"), right_pixmap("image/system/dashboard-avatar.png"),
    selected(NULL), player(NULL), avatar(NULL),
    weapon(NULL), armor(NULL), defensive_horse(NULL), offensive_horse(NULL),
    view_as_skill(NULL), filter(NULL)
{
    createLeft();
    createMiddle();
    createRight();

    int left_width = left_pixmap.width();
    int middle_width = middle->rect().width();
    int right_width = right->rect().width();
    min_width = left_width + middle_width + right_width;

    setMiddleWidth(middle_width);

    sort_type = 0;
}
Example #3
0
Dashboard::Dashboard()
    :left_pixmap(QString("%1/dashboard-equip.png").arg(Config.SkinPath)), right_pixmap(QString("%1/dashboard-avatar.png").arg(Config.SkinPath)),
    selected(NULL), avatar(NULL),
    weapon(NULL), armor(NULL), defensive_horse(NULL), offensive_horse(NULL),relic(NULL), //modify by ce add
    view_as_skill(NULL), filter(NULL)
{
    createLeft();
    createMiddle();
    createRight();

    death_item = NULL;

    int left_width = left_pixmap.width();
    int middle_width = middle->rect().width();
    int right_width = right->rect().width();
    min_width = left_width + middle_width + right_width;

    setMiddleWidth(middle_width);

    sort_type = 0;
}
Example #4
0
Dashboard::Dashboard(QGraphicsItem *button_widget)
    :left_pixmap("image/system/dashboard-equip.png"), right_pixmap("image/system/dashboard-avatar.png"),
    button_widget(button_widget), selected(NULL), avatar(NULL),
    weapon(NULL), armor(NULL), defensive_horse(NULL), offensive_horse(NULL),
    view_as_skill(NULL), filter(NULL)
{
    createLeft();
    createMiddle();
    createRight();

    death_item = NULL;

    if(button_widget)
        button_widget->setParentItem(this);

    int middle_width = middle->rect().width();
    setMiddleWidth(middle_width);

    sort_type = 0;

    animations = new EffectAnimation();
}
Example #5
0
CardEditor::CardEditor(QWidget *parent) :
	QMainWindow(parent)
{
	setWindowTitle(tr("Card editor"));

	QHBoxLayout *layout = new QHBoxLayout;
	QGraphicsView *view = new QGraphicsView;

	view->setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform | QPainter::HighQualityAntialiasing);

	card_scene = new CardScene;
	connect(card_scene, SIGNAL(avatar_snapped(QRectF)), this, SLOT(saveAvatar(QRectF)));

	view->setScene(card_scene);
	view->setFixedSize(card_scene->sceneRect().width() + 2,
					   card_scene->sceneRect().height() + 2);

	layout->addWidget(createLeft());
	layout->addWidget(view);

	QWidget *central_widget = new QWidget;
	central_widget->setLayout(layout);
	setCentralWidget(central_widget);

	QMenuBar *menu_bar = new QMenuBar;
	setMenuBar(menu_bar);

	QMenu *file_menu = new QMenu(tr("File"));
	QAction *import = new QAction(tr("Import ..."), file_menu);
	import->setShortcut(Qt::CTRL + Qt::Key_O);
	QAction *save = new QAction(tr("Save ..."), file_menu);
	save->setShortcut(Qt::CTRL + Qt::Key_S);
	QAction *exit = new QAction(tr("Exit"), file_menu);
	exit->setShortcut(Qt::CTRL + Qt::Key_Q);

	file_menu->addAction(import);
	file_menu->addAction(save);
	file_menu->addSeparator();
	file_menu->addAction(exit);

	menu_bar->addMenu(file_menu);

	connect(import, SIGNAL(triggered()), this, SLOT(import()));
	connect(save, SIGNAL(triggered()), this, SLOT(saveImage()));
	connect(exit, SIGNAL(triggered()), this, SLOT(close()));

	QMenu *tool_menu = new QMenu(tr("Tool"));

	QAction *making_big = new QAction(tr("Make big avatar"), tool_menu);
	making_big->setShortcut(Qt::ALT + Qt::Key_B);
	connect(making_big, SIGNAL(triggered()), card_scene, SLOT(makeBigAvatar()));
	tool_menu->addAction(making_big);

	QAction *making_small = new QAction(tr("Make small avatar"), tool_menu);
	making_small->setShortcut(Qt::ALT + Qt::Key_M);
	connect(making_small, SIGNAL(triggered()), card_scene, SLOT(makeSmallAvatar()));
	tool_menu->addAction(making_small);

	QAction *making_tiny = new QAction(tr("Make tiny avatar"), tool_menu);
	making_tiny->setShortcut(Qt::ALT + Qt::Key_T);
	connect(making_tiny, SIGNAL(triggered()), card_scene, SLOT(makeTinyAvatar()));
	tool_menu->addAction(making_tiny);

	QAction *hiding_rect = new QAction(tr("Hide avatar rect"), tool_menu);
	hiding_rect->setShortcut(Qt::ALT + Qt::Key_H);
	connect(hiding_rect, SIGNAL(triggered()), card_scene, SLOT(hideAvatarRects()));
	tool_menu->addAction(hiding_rect);

	tool_menu->addSeparator();

	QAction *reset_photo = new QAction(tr("Reset photo"), tool_menu);
	reset_photo->setShortcut(Qt::ALT + Qt::Key_R);
	connect(reset_photo, SIGNAL(triggered()), card_scene, SLOT(resetPhoto()));
	tool_menu->addAction(reset_photo);

	QAction *copy_photo = new QAction(tr("Copy photo to clipboard"), tool_menu);
	copy_photo->setShortcut(Qt::CTRL + Qt::Key_C);
	connect(copy_photo, SIGNAL(triggered()), this, SLOT(copyPhoto()));
	tool_menu->addAction(copy_photo);

	menu_bar->addMenu(tool_menu);

	card_scene->setMenu(tool_menu);
}