-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathview.py
43 lines (35 loc) · 1.34 KB
/
view.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# view.py
#
# The root view window that is parent to all other widgets
from PyQt6.QtWidgets import QWidget, QMainWindow, QVBoxLayout
from main_area_view import MainArea
from player_view import PlayerBarWidget
class View(QMainWindow):
def __init__(self, state):
super().__init__()
self.game_state = state
self.initUI()
def initUI(self):
self.setWindowTitle('Jep with the Bois')
self.root_widget = QWidget(self)
self.layout = QVBoxLayout()
self.main_area = MainArea(self, self.game_state)
self.player_bar = PlayerBarWidget(self, self.game_state)
self.layout.addWidget(self.main_area, 80)
self.layout.addWidget(self.player_bar, 20)
self.root_widget.setStyleSheet("background-color: black;")
self.root_widget.setLayout(self.layout)
self.setCentralWidget(self.root_widget)
self.root_widget.show()
self.showFullScreen()
def player_wager(self):
self.player_bar.player_wager()
def set_clue_value(self, value):
self.player_bar.set_clue_value(value)
def all_wager(self):
self.player_bar.all_wager()
def update(self):
# new_round = self.model.check_next_round()
is_next_round = self.game_state.check_next_round()
self.main_area.update(is_next_round)
self.player_bar.update()