mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
fix trailing spaces in generated score (#266)
This commit is contained in:
@@ -75,7 +75,7 @@ class ScoreDisplay:
|
||||
|
||||
def makeLine(self, char, length, title=None):
|
||||
if title == None:
|
||||
return ' ' + (char * length) + ' \n'
|
||||
return ' ' + (char * length) + '\n'
|
||||
else:
|
||||
lineSideLength = (length - len(title) - 2) // 2
|
||||
leftLength = lineSideLength
|
||||
@@ -84,11 +84,12 @@ class ScoreDisplay:
|
||||
rightLength += 1
|
||||
if leftLength + rightLength <= 0:
|
||||
if leftLength + rightLength == 0:
|
||||
return ' ' + title + ' \n'
|
||||
return ' ' + title + '\n'
|
||||
else:
|
||||
return ' ' + title + ' \n'
|
||||
return ' ' + title + '\n'
|
||||
else:
|
||||
return ' ' + (char * leftLength) + ' ' + title + ' ' + (char * rightLength) + ' \n'
|
||||
return ' ' + (char * leftLength) + ' ' + title + \
|
||||
(' ' + char * rightLength if char != ' ' else '') + '\n'
|
||||
|
||||
def getGameStatusDisplay(self, status, dashLen):
|
||||
out = ''
|
||||
@@ -156,4 +157,4 @@ if __name__ == "__main__":
|
||||
adventureSelect = int(args.adventure)
|
||||
scoreDisplay = ScoreDisplay()
|
||||
print(scoreDisplay.getDisplay(float(args.adventureOnePercentage), float(args.adventureTwoPercentage), adventureSelect))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user