#include "ui_mainwindow.h"
#include "preferences.h"
#include "howtoplay.h"
+#include "needadvance.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
{
PlayField *pf=pack->levelAt(levelNo);
Settings().saveHiscore(pack->getTitle(),pf->title, moves);
+ levelHiscore=moves;
loadNextLevel();
}
void MainWindow::loadNextLevel()
{
+ if(levelHiscore == HS::NO_SCORE)
+ {
+ needadvance().exec();
+ return;
+ }
if(levelNo<(pack->size()-1))
{
levelNo++;
--- /dev/null
+#include "needadvance.h"
+#include "ui_needadvance.h"
+
+needadvance::needadvance(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::needadvance)
+{
+ ui->setupUi(this);
+}
+
+needadvance::~needadvance()
+{
+ delete ui;
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>needadvance</class>
+ <widget class="QDialog" name="needadvance">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>778</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="font">
+ <font>
+ <pointsize>16</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>Solve this level first!</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>I will!</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>pushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>needadvance</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>612</x>
+ <y>146</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>575</x>
+ <y>189</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>