Move updating time text view to Ui class
This commit is contained in:
parent
ee20ac3214
commit
880c0af3c2
@ -22,7 +22,7 @@ class EventManager:
|
||||
def handleEvents(self):
|
||||
pygame.event.pump()
|
||||
|
||||
self.game.screen.ui.timerTextView.changeText(self.game.ingameTimer.getPrettyTime())
|
||||
self.game.screen.ui.updateTime()
|
||||
|
||||
keys = pygame.key.get_pressed()
|
||||
for event in pygame.event.get():
|
||||
|
@ -91,6 +91,13 @@ class Ui():
|
||||
elif event.button == 5:
|
||||
console.writeConsoleLines(console.topWrittenLineInd - 1)
|
||||
|
||||
def updateTime(self):
|
||||
self.timerTextView.changeText(self.timer.getPrettyTime())
|
||||
if self.timer.isItDay():
|
||||
self.isDayTextView.changeText("Day")
|
||||
else:
|
||||
self.isDayTextView.changeText("Night")
|
||||
|
||||
|
||||
class Colors(Enum):
|
||||
RED = (255, 0, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user