|
|
|
@ -70,7 +70,6 @@ void MainWindow::bubbleBoxes(std::set<std::vector<int>> *connected) {
|
|
|
|
|
bubbleUp((*i)[0], (*i)[1]);
|
|
|
|
|
}
|
|
|
|
|
refreshButtonGrid();
|
|
|
|
|
MainWindow::setEnabled(false);
|
|
|
|
|
qApp->processEvents();
|
|
|
|
|
usleep(400000);
|
|
|
|
|
for (int j = 0; j < columns; j++) {
|
|
|
|
@ -78,11 +77,11 @@ void MainWindow::bubbleBoxes(std::set<std::vector<int>> *connected) {
|
|
|
|
|
checkColumn(j);
|
|
|
|
|
}
|
|
|
|
|
refreshButtonGrid();
|
|
|
|
|
MainWindow::setEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// slots
|
|
|
|
|
void MainWindow::buttonPressed(int row, int column) {
|
|
|
|
|
MainWindow::setEnabled(false);
|
|
|
|
|
if(game->getCell(row, column) != "none") {
|
|
|
|
|
std::set<std::vector<int>> connected;
|
|
|
|
|
game->getConnected(&connected, game->getCell(row, column), row, column);
|
|
|
|
@ -92,6 +91,7 @@ void MainWindow::buttonPressed(int row, int column) {
|
|
|
|
|
} else
|
|
|
|
|
ui->statusBar->showMessage("Only friends get Stars!", 2000);
|
|
|
|
|
}
|
|
|
|
|
MainWindow::setEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::newGame() {
|
|
|
|
@ -127,8 +127,6 @@ void MainWindow::initialiseGameGrid() {
|
|
|
|
|
ui->gameGridLayout->addWidget(button, i, j);
|
|
|
|
|
button_row.push_back(button);
|
|
|
|
|
|
|
|
|
|
// Set size text etc. for each button
|
|
|
|
|
|
|
|
|
|
connect(button, &QPushButton::clicked, [=, this](){
|
|
|
|
|
buttonPressed(i, j);
|
|
|
|
|
});
|
|
|
|
@ -154,7 +152,6 @@ void MainWindow::refreshSizes() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::setPalettes() {
|
|
|
|
|
|
|
|
|
|
QPalette palLight = QPalette();
|
|
|
|
|
QPalette palDark = QPalette();
|
|
|
|
|
const QBrush bgLightBrush = QBrush(0xfff0f3);
|
|
|
|
|