Skip to content

Commit

Permalink
feat: game window ui updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Yejining committed Feb 12, 2020
1 parent 2b9929c commit e8425ef
Show file tree
Hide file tree
Showing 3 changed files with 478 additions and 107 deletions.
198 changes: 180 additions & 18 deletions gui/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,33 @@

# Form implementation generated from reading ui file 'game.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!


from PyQt5 import QtCore, QtGui, QtWidgets


class Card:
def __init__(self):
self.sequence = []
self.game = []


class Ui_GameWindow(object):
def setupUi(self, GameWindow):
GameWindow.setObjectName("GameWindow")
GameWindow.resize(1088, 760)
GameWindow.resize(2057, 1255)
self.centralwidget = QtWidgets.QWidget(GameWindow)
self.centralwidget.setAutoFillBackground(False)
self.centralwidget.setStyleSheet("")
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setSpacing(0)
self.gridLayout.setObjectName("gridLayout")
self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget)
self.stackedWidget.setStyleSheet("background-color: black;")
self.stackedWidget.setStyleSheet("")
self.stackedWidget.setObjectName("stackedWidget")
self.page_pupil = QtWidgets.QWidget()
self.page_pupil.setStyleSheet("")
Expand All @@ -45,151 +50,308 @@ def setupUi(self, GameWindow):
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setSpacing(0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_sequence = QtWidgets.QLabel(self.page_sequence)
self.label_sequence.setAlignment(QtCore.Qt.AlignCenter)
self.label_sequence.setObjectName("label_sequence")
self.gridLayout_2.addWidget(self.label_sequence, 0, 0, 1, 1)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setSpacing(0)
self.verticalLayout.setObjectName("verticalLayout")
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setSpacing(0)
self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem1)
self.label_seq0 = QtWidgets.QLabel(self.page_sequence)
self.label_seq0.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_seq0.setText("")
self.label_seq0.setAlignment(QtCore.Qt.AlignCenter)
self.label_seq0.setObjectName("label_seq0")
self.horizontalLayout.addWidget(self.label_seq0)
self.label_seq1 = QtWidgets.QLabel(self.page_sequence)
self.label_seq1.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_seq1.setText("")
self.label_seq1.setAlignment(QtCore.Qt.AlignCenter)
self.label_seq1.setObjectName("label_seq1")
self.horizontalLayout.addWidget(self.label_seq1)
self.label_seq2 = QtWidgets.QLabel(self.page_sequence)
self.label_seq2.setAutoFillBackground(False)
self.label_seq2.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_seq2.setText("")
self.label_seq2.setAlignment(QtCore.Qt.AlignCenter)
self.label_seq2.setObjectName("label_seq2")
self.horizontalLayout.addWidget(self.label_seq2)
self.label_seq3 = QtWidgets.QLabel(self.page_sequence)
self.label_seq3.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_seq3.setText("")
self.label_seq3.setAlignment(QtCore.Qt.AlignCenter)
self.label_seq3.setObjectName("label_seq3")
self.horizontalLayout.addWidget(self.label_seq3)
self.label_seq4 = QtWidgets.QLabel(self.page_sequence)
self.label_seq4.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_seq4.setText("")
self.label_seq4.setAlignment(QtCore.Qt.AlignCenter)
self.label_seq4.setObjectName("label_seq4")
self.horizontalLayout.addWidget(self.label_seq4)
self.label_seq5 = QtWidgets.QLabel(self.page_sequence)
self.label_seq5.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_seq5.setText("")
self.label_seq5.setAlignment(QtCore.Qt.AlignCenter)
self.label_seq5.setObjectName("label_seq5")
self.horizontalLayout.addWidget(self.label_seq5)
self.label_seq6 = QtWidgets.QLabel(self.page_sequence)
self.label_seq6.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_seq6.setText("")
self.label_seq6.setAlignment(QtCore.Qt.AlignCenter)
self.label_seq6.setObjectName("label_seq6")
self.horizontalLayout.addWidget(self.label_seq6)
self.label_seq7 = QtWidgets.QLabel(self.page_sequence)
self.label_seq7.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_seq7.setText("")
self.label_seq7.setAlignment(QtCore.Qt.AlignCenter)
self.label_seq7.setObjectName("label_seq7")
self.horizontalLayout.addWidget(self.label_seq7)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem2)
self.verticalLayout.addLayout(self.horizontalLayout)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem3)
self.gridLayout_2.addLayout(self.verticalLayout, 0, 1, 1, 1)
self.stackedWidget.addWidget(self.page_sequence)
self.page_game = QtWidgets.QWidget()
self.page_game.setObjectName("page_game")
self.gridLayout_5 = QtWidgets.QGridLayout(self.page_game)
self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
self.gridLayout_5.setSpacing(0)
self.gridLayout_5.setObjectName("gridLayout_5")
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_5.addItem(spacerItem, 0, 1, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_5.addItem(spacerItem1, 1, 0, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_5.addItem(spacerItem2, 2, 1, 1, 1)
spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_5.addItem(spacerItem4, 0, 1, 1, 1)
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_5.addItem(spacerItem5, 1, 0, 1, 1)
spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_5.addItem(spacerItem6, 2, 1, 1, 1)
self.gridLayout_game = QtWidgets.QGridLayout()
self.gridLayout_game.setSpacing(0)
self.gridLayout_game.setObjectName("gridLayout_game")
self.label_12 = QtWidgets.QLabel(self.page_game)
self.label_12.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_12.setText("")
self.label_12.setAlignment(QtCore.Qt.AlignCenter)
self.label_12.setObjectName("label_12")
self.gridLayout_game.addWidget(self.label_12, 1, 2, 1, 1)
self.label_10 = QtWidgets.QLabel(self.page_game)
self.label_10.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_10.setText("")
self.label_10.setAlignment(QtCore.Qt.AlignCenter)
self.label_10.setObjectName("label_10")
self.gridLayout_game.addWidget(self.label_10, 1, 0, 1, 1)
self.label_14 = QtWidgets.QLabel(self.page_game)
self.label_14.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_14.setText("")
self.label_14.setAlignment(QtCore.Qt.AlignCenter)
self.label_14.setObjectName("label_14")
self.gridLayout_game.addWidget(self.label_14, 1, 4, 1, 1)
self.label_11 = QtWidgets.QLabel(self.page_game)
self.label_11.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_11.setText("")
self.label_11.setAlignment(QtCore.Qt.AlignCenter)
self.label_11.setObjectName("label_11")
self.gridLayout_game.addWidget(self.label_11, 1, 1, 1, 1)
self.label_23 = QtWidgets.QLabel(self.page_game)
self.label_23.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_23.setText("")
self.label_23.setAlignment(QtCore.Qt.AlignCenter)
self.label_23.setObjectName("label_23")
self.gridLayout_game.addWidget(self.label_23, 2, 3, 1, 1)
self.label_13 = QtWidgets.QLabel(self.page_game)
self.label_13.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_13.setText("")
self.label_13.setAlignment(QtCore.Qt.AlignCenter)
self.label_13.setObjectName("label_13")
self.gridLayout_game.addWidget(self.label_13, 1, 3, 1, 1)
self.label_00 = QtWidgets.QLabel(self.page_game)
self.label_00.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_00.setText("")
self.label_00.setAlignment(QtCore.Qt.AlignCenter)
self.label_00.setObjectName("label_00")
self.gridLayout_game.addWidget(self.label_00, 0, 0, 1, 1)
self.label_40 = QtWidgets.QLabel(self.page_game)
self.label_40.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_40.setText("")
self.label_40.setAlignment(QtCore.Qt.AlignCenter)
self.label_40.setObjectName("label_40")
self.gridLayout_game.addWidget(self.label_40, 4, 0, 1, 1)
self.label_01 = QtWidgets.QLabel(self.page_game)
self.label_01.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_01.setText("")
self.label_01.setAlignment(QtCore.Qt.AlignCenter)
self.label_01.setObjectName("label_01")
self.gridLayout_game.addWidget(self.label_01, 0, 1, 1, 1)
self.label_03 = QtWidgets.QLabel(self.page_game)
self.label_03.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_03.setText("")
self.label_03.setAlignment(QtCore.Qt.AlignCenter)
self.label_03.setObjectName("label_03")
self.gridLayout_game.addWidget(self.label_03, 0, 3, 1, 1)
self.label_04 = QtWidgets.QLabel(self.page_game)
self.label_04.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_04.setText("")
self.label_04.setAlignment(QtCore.Qt.AlignCenter)
self.label_04.setObjectName("label_04")
self.gridLayout_game.addWidget(self.label_04, 0, 4, 1, 1)
self.label_22 = QtWidgets.QLabel(self.page_game)
self.label_22.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_22.setText("")
self.label_22.setAlignment(QtCore.Qt.AlignCenter)
self.label_22.setObjectName("label_22")
self.gridLayout_game.addWidget(self.label_22, 2, 2, 1, 1)
self.label_24 = QtWidgets.QLabel(self.page_game)
self.label_24.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_24.setText("")
self.label_24.setAlignment(QtCore.Qt.AlignCenter)
self.label_24.setObjectName("label_24")
self.gridLayout_game.addWidget(self.label_24, 2, 4, 1, 1)
self.label_20 = QtWidgets.QLabel(self.page_game)
self.label_20.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_20.setText("")
self.label_20.setAlignment(QtCore.Qt.AlignCenter)
self.label_20.setObjectName("label_20")
self.gridLayout_game.addWidget(self.label_20, 2, 0, 1, 1)
self.label_02 = QtWidgets.QLabel(self.page_game)
self.label_02.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_02.setText("")
self.label_02.setAlignment(QtCore.Qt.AlignCenter)
self.label_02.setObjectName("label_02")
self.gridLayout_game.addWidget(self.label_02, 0, 2, 1, 1)
self.label_42 = QtWidgets.QLabel(self.page_game)
self.label_42.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_42.setText("")
self.label_42.setAlignment(QtCore.Qt.AlignCenter)
self.label_42.setObjectName("label_42")
self.gridLayout_game.addWidget(self.label_42, 4, 2, 1, 1)
self.label_44 = QtWidgets.QLabel(self.page_game)
self.label_44.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_44.setText("")
self.label_44.setAlignment(QtCore.Qt.AlignCenter)
self.label_44.setObjectName("label_44")
self.gridLayout_game.addWidget(self.label_44, 4, 4, 1, 1)
self.label_21 = QtWidgets.QLabel(self.page_game)
self.label_21.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_21.setText("")
self.label_21.setAlignment(QtCore.Qt.AlignCenter)
self.label_21.setObjectName("label_21")
self.gridLayout_game.addWidget(self.label_21, 2, 1, 1, 1)
self.label_30 = QtWidgets.QLabel(self.page_game)
self.label_30.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_30.setText("")
self.label_30.setAlignment(QtCore.Qt.AlignCenter)
self.label_30.setObjectName("label_30")
self.gridLayout_game.addWidget(self.label_30, 3, 0, 1, 1)
self.label_31 = QtWidgets.QLabel(self.page_game)
self.label_31.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_31.setText("")
self.label_31.setAlignment(QtCore.Qt.AlignCenter)
self.label_31.setObjectName("label_31")
self.gridLayout_game.addWidget(self.label_31, 3, 1, 1, 1)
self.label_32 = QtWidgets.QLabel(self.page_game)
self.label_32.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_32.setText("")
self.label_32.setAlignment(QtCore.Qt.AlignCenter)
self.label_32.setObjectName("label_32")
self.gridLayout_game.addWidget(self.label_32, 3, 2, 1, 1)
self.label_33 = QtWidgets.QLabel(self.page_game)
self.label_33.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_33.setText("")
self.label_33.setAlignment(QtCore.Qt.AlignCenter)
self.label_33.setObjectName("label_33")
self.gridLayout_game.addWidget(self.label_33, 3, 3, 1, 1)
self.label_34 = QtWidgets.QLabel(self.page_game)
self.label_34.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_34.setText("")
self.label_34.setAlignment(QtCore.Qt.AlignCenter)
self.label_34.setObjectName("label_34")
self.gridLayout_game.addWidget(self.label_34, 3, 4, 1, 1)
self.label_41 = QtWidgets.QLabel(self.page_game)
self.label_41.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_41.setText("")
self.label_41.setAlignment(QtCore.Qt.AlignCenter)
self.label_41.setObjectName("label_41")
self.gridLayout_game.addWidget(self.label_41, 4, 1, 1, 1)
self.label_43 = QtWidgets.QLabel(self.page_game)
self.label_43.setStyleSheet("background-color: rgb(160, 160, 160);")
self.label_43.setText("")
self.label_43.setAlignment(QtCore.Qt.AlignCenter)
self.label_43.setObjectName("label_43")
self.gridLayout_game.addWidget(self.label_43, 4, 3, 1, 1)
self.gridLayout_5.addLayout(self.gridLayout_game, 1, 1, 1, 1)
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_5.addItem(spacerItem3, 1, 2, 1, 1)
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_5.addItem(spacerItem7, 1, 2, 1, 1)
self.stackedWidget.addWidget(self.page_game)
self.gridLayout.addWidget(self.stackedWidget, 0, 0, 1, 1)
GameWindow.setCentralWidget(self.centralwidget)

self.retranslateUi(GameWindow)
self.stackedWidget.setCurrentIndex(0)
self.stackedWidget.setCurrentIndex(2)
QtCore.QMetaObject.connectSlotsByName(GameWindow)

self.initializeClass()

def retranslateUi(self, GameWindow):
_translate = QtCore.QCoreApplication.translate
GameWindow.setWindowTitle(_translate("GameWindow", "MainWindow"))
self.label_pupil.setText(_translate("GameWindow", "<html><head/><body><p><span style=\" font-size:36pt; color:#ffffff;\">Pupil Check</span></p></body></html>"))
self.label_sequence.setText(_translate("GameWindow", "<html><head/><body><p><span style=\" font-size:36pt; color:#ffffff;\">sequence</span></p></body></html>"))

def initializeClass(self):
self.card = Card()
self.card.sequence.append(self.label_seq0)
self.card.sequence.append(self.label_seq1)
self.card.sequence.append(self.label_seq2)
self.card.sequence.append(self.label_seq3)
self.card.sequence.append(self.label_seq4)
self.card.sequence.append(self.label_seq5)
self.card.sequence.append(self.label_seq6)
self.card.sequence.append(self.label_seq7)

row = []
row.append(self.label_00)
row.append(self.label_01)
row.append(self.label_02)
row.append(self.label_03)
row.append(self.label_04)
self.card.game.append(row)

row = []
row.append(self.label_10)
row.append(self.label_11)
row.append(self.label_12)
row.append(self.label_13)
row.append(self.label_14)
self.card.game.append(row)

row = []
row.append(self.label_20)
row.append(self.label_21)
row.append(self.label_22)
row.append(self.label_23)
row.append(self.label_24)
self.card.game.append(row)

row = []
row.append(self.label_30)
row.append(self.label_31)
row.append(self.label_32)
row.append(self.label_33)
row.append(self.label_34)
self.card.game.append(row)

row = []
row.append(self.label_40)
row.append(self.label_41)
row.append(self.label_42)
row.append(self.label_43)
row.append(self.label_44)
self.card.game.append(row)

self.card.seq_layout = self.horizontalLayout
self.card.game_layout = self.gridLayout_game


if __name__ == "__main__":
Expand Down
Loading

0 comments on commit e8425ef

Please sign in to comment.