Move updating time text view to Ui class

This commit is contained in:
Michał Czekański 2020-04-06 01:00:02 +02:00
parent ee20ac3214
commit 880c0af3c2
2 changed files with 8 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class EventManager:
def handleEvents(self): def handleEvents(self):
pygame.event.pump() pygame.event.pump()
self.game.screen.ui.timerTextView.changeText(self.game.ingameTimer.getPrettyTime()) self.game.screen.ui.updateTime()
keys = pygame.key.get_pressed() keys = pygame.key.get_pressed()
for event in pygame.event.get(): for event in pygame.event.get():

View File

@ -91,6 +91,13 @@ class Ui():
elif event.button == 5: elif event.button == 5:
console.writeConsoleLines(console.topWrittenLineInd - 1) 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): class Colors(Enum):
RED = (255, 0, 0) RED = (255, 0, 0)