Skip to content

Commit

Permalink
Displayed version at bottom of main menu screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmccoystephenson committed Jan 30, 2023
1 parent cc5113b commit 9ce1881
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/screen/mainMenuScreen.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pygame
from config.config import Config

Expand Down Expand Up @@ -48,6 +49,15 @@ def drawMenuButtons(self):
ypos = ypos + height + margin
self.graphik.drawButton(xpos, ypos, width, height, backgroundColor, (0,0,0), 30, "quit", self.quitApplication)

def drawVersion(self):
if os.path.isfile("version.txt"):
with open("version.txt", "r") as file:
version = file.read()

# display centered at bottom of screen
self.graphik.drawText(version, self.graphik.getGameDisplay().get_size()[0]/2, self.graphik.getGameDisplay().get_size()[1] - 10, 16, (255, 255, 255))


def handleKeyDownEvent(self, key):
self.switchToWorldScreen()

Expand All @@ -64,6 +74,7 @@ def run(self):
self.graphik.getGameDisplay().fill((0, 0, 0))
self.drawText()
self.drawMenuButtons()
self.drawVersion()
pygame.display.update()
self.initializeWorldScreen()
self.changeScreen = False
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.0-SNAPSHOT
0.6.0-SNAPSHOT

0 comments on commit 9ce1881

Please sign in to comment.