<context>
<name>Window</name>
<message>
- <location filename="window.cpp" line="51"/>
+ <location filename="window.cpp" line="52"/>
<source>New game</source>
<translation type="unfinished">Новая игра</translation>
</message>
<message>
- <location filename="window.cpp" line="72"/>
+ <location filename="window.cpp" line="55"/>
+ <source>Help</source>
+ <translation type="unfinished">Помощь</translation>
+ </message>
+ <message>
+ <location filename="window.cpp" line="80"/>
<source>Fullscreen mode</source>
<translation type="unfinished">Полноэкранный режим</translation>
</message>
<message>
- <location filename="window.cpp" line="84"/>
+ <location filename="window.cpp" line="92"/>
<source>Less cells</source>
<translation type="unfinished">Меньше клеток</translation>
</message>
<message>
- <location filename="window.cpp" line="91"/>
+ <location filename="window.cpp" line="99"/>
<source>More cells</source>
<translation type="unfinished">Больше клеток</translation>
</message>
<message>
- <location filename="window.cpp" line="110"/>
+ <location filename="window.cpp" line="118"/>
<source>Turns: %1/%2</source>
<extracomment>number of turns</extracomment>
<translation type="unfinished">Ходов: %1/%2</translation>
</message>
+ <message>
+ <location filename="window.cpp" line="167"/>
+ <source>The object of the game is to turn a board into one single color. Number of moves is limited. You start from top-left corner with one cell already flooded.
+Good luck!</source>
+ <translation type="unfinished">Цель игры - залить поле одним цветом. Количество ходов ограничено. Вы начинаете с верхнего левого угла с одной клеткой, которая уже залита.
+Удачи!</translation>
+ </message>
</context>
</TS>
#include <QLabel>
#include <QSettings>
#include <QMenuBar>
+#include <QMessageBox>
#include "window.hpp"
#include "colorbuttons.hpp"
#include "field.hpp"
QPushButton *newGame = new QPushButton(tr("New game"), this);
QObject::connect(newGame, SIGNAL(pressed()), field, SLOT(randomize()));
+ QPushButton *help = new QPushButton(tr("Help"), this);
+ QObject::connect(help, SIGNAL(pressed()), this, SLOT(help()));
+
+ QHBoxLayout *lowerLayout = new QHBoxLayout;
+ lowerLayout->addWidget(help);
+ lowerLayout->addWidget(newGame);
+
QVBoxLayout *vl = new QVBoxLayout;
vl->addWidget(colorButtons);
vl->setAlignment(colorButtons, Qt::AlignRight | Qt::AlignTop);
vl->addWidget(turnsLabel);
vl->setAlignment(turnsLabel, Qt::AlignRight | Qt::AlignBottom);
- vl->addWidget(newGame);
- vl->setAlignment(newGame, Qt::AlignRight | Qt::AlignTop);
+ vl->addLayout(lowerLayout);
+ vl->setAlignment(lowerLayout, Qt::AlignRight | Qt::AlignTop);
QHBoxLayout *hl = new QHBoxLayout;
hl->addWidget(field);
action->setText(ColorScheme::getSchemeName(
ColorScheme::getNextColorScheme()));
}
+
+void Window::help ()
+{
+ QMessageBox box;
+ box.setWindowTitle("Color Flood");
+ box.setText(tr("The object of the game is to turn a board into one single color. Number of moves is limited. You start from top-left corner with one cell already flooded.\nGood luck!"));
+ box.exec();
+}
void colorScheme ();
void lessCells ();
void moreCells ();
+ void help ();
private:
ColorButtons *colorButtons;