Return to repo list

tzed

Simple story-driven open world 2D CRPG.
Return to HMagellan.com

commit 619a32778d24e393b6e7e1e9c4810177d2c3dc8f
parent 2aaa231a63e251673919c0cdfa67eefb30697ed5
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Tue, 31 Aug 2021 00:47:18 -0500

slightly improve stat display

Diffstat:
Msrc/game.py | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/game.py b/src/game.py @@ -49,6 +49,7 @@ class Game(object): # UI elements self.ui_font = pygame.font.Font(os.path.join(FONT_PATH, MESSAGE_FONT), MESSAGE_FONT_SIZE) # TODO: Should there be a UI font option??? self.small_ui_font = pygame.font.Font(os.path.join(FONT_PATH, MESSAGE_FONT), MESSAGE_FONT_SIZE - 3) + self.tiny_ui_font = pygame.font.Font(os.path.join(FONT_PATH, MESSAGE_FONT), MESSAGE_FONT_SIZE - 7) self.date_string = "" self.ui_tray = None self.ui_group = pygame.sprite.Group() @@ -343,14 +344,14 @@ class Game(object): for st in statpair: statmod = self.party[c][st + "_mod"] if statmod > 0: - statstring = str(self.party[c][st]) + " (-" + str(statmod) + ")" + statstring = str(self.party[c][st]) + "(-" + str(statmod) + ")" elif statmod < 0: - statstring = str(self.party[c][st]) + " (+" + str(statmod) + ")" + statstring = str(self.party[c][st]) + "(+" + str(-statmod) + ")" else: statstring = str(self.party[c][st]) - rs = self.small_ui_font.render(statstring, False, (175, 20, 20) if statmod > 0 else (20, 235, 20) if statmod < 0 else (0, 0, 0)) + rs = self.tiny_ui_font.render(statstring, False, (175, 20, 20) if statmod > 0 else (20, 235, 20) if statmod < 0 else (0, 0, 0)) rsr = rs.get_rect() - rsr.topright = (64 + (x_mod * 137) + (62 * x3), 633 + (24 * y3)) + rsr.topright = (68 + (x_mod * 137) + (62 * x3), 633 + (24 * y3)) surface.blit(rs, rsr) x3 += 1 x3 = 0