summaryrefslogtreecommitdiffstats
path: root/examples/script/qstetrix/tetrixwindow.js
blob: 6157a8ce366401bd97abe80e4dd451cca7ed974d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function TetrixWindow(ui)
{
    this.ui = ui;

    var boardUi = ui.findChild("board");
    boardUi.nextPieceLabel = ui.findChild("nextPieceLabel");

    this.board = new TetrixBoard(boardUi);

    ui.findChild("startButton").clicked.connect(this.board, this.board.start);
    ui.findChild("quitButton").clicked.connect(Qt.App.quit);
    ui.findChild("pauseButton").clicked.connect(this.board, this.board.pause);
    boardUi.scoreChanged.connect(ui.findChild("scoreLcd")["display(int)"]);
    boardUi.levelChanged.connect(ui.findChild("levelLcd")["display(int)"]);
    boardUi.linesRemovedChanged.connect(ui.findChild("linesLcd")["display(int)"]);
}