This commit is contained in:
v7eZ3t 2021-03-29 14:36:28 +02:00
parent f1b61a0889
commit 5c8d3aabbd

View File

@ -1,3 +1,4 @@
from Main.TractorLoad import TillageUnit
from Main.constants import *
from Main.images import *
import pygame
@ -14,7 +15,11 @@ def drawUI(board, display, tractor, direction, tillageUnit, field):
def drawInfo(display, tractor, tillageUnit, field):
myfont = pygame.font.SysFont('Comic Sans MS', 30)
text = f"Fuel: {tractor.fuel_tank} \t Hitches: {tractor.hitch} \t Header: {tractor.header} \t Engine working: {tractor.engineWorking}"
hitches = tractor.hitch
if isinstance(tractor.hitch, TillageUnit):
hitches = "Tillage Unit"
text = f"Fuel: {tractor.fuel_tank} \t Hitches: {hitches} \t Header: {tractor.header} \t Engine working: {tractor.engineWorking}"
textsurface = myfont.render(text, False, (0, 0, 0))
display.blit(textsurface, (50, (DISPLAY_SIZE_VERTICAL - 200)))