From 5eb921948a2d236031aba63dae8669bb6e08b565 Mon Sep 17 00:00:00 2001 From: Khopa Date: Wed, 8 Aug 2018 21:52:09 +0200 Subject: [PATCH] Display the units x/x/x value of the base in the base menu. --- ui/basemenu.py | 4 +++- ui/styles.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/basemenu.py b/ui/basemenu.py index 2c9f866b..6a29f84f 100644 --- a/ui/basemenu.py +++ b/ui/basemenu.py @@ -48,7 +48,9 @@ class BaseMenu(Menu): # Header head = Frame(self.frame, **STYLES["header"]) head.grid(row=row, column=0, columnspan=5, sticky=NSEW, pady=5) - Label(head, text=self.cp.name, **STYLES["title"]).grid() + Label(head, text=self.cp.name, **STYLES["title"]).grid(row=0, column=0, sticky=NW+S) + units_title = "{}/{}/{}".format(self.cp.base.total_planes, self.cp.base.total_armor, self.cp.base.total_aa) + Label(head, text=units_title, **STYLES["strong-grey"]).grid(row=0, column=1, sticky=NE+S) row += 1 self.budget_label = Label(self.frame, text="Budget: {}m".format(self.game.budget), **STYLES["widget"]) diff --git a/ui/styles.py b/ui/styles.py index e375ecdf..48e5ebe1 100644 --- a/ui/styles.py +++ b/ui/styles.py @@ -6,6 +6,7 @@ PADDING_Y = 5 # Colors FG_COLOR = "white" +FG_COLOR_LIGHT = "#dddddd" BG_COLOR = "#4E5760" BTN_COLOR = "#699245" YELLOW = "#FDB731" @@ -25,6 +26,7 @@ STYLES["frame-wrapper"] = {"bg": BG_COLOR, "relief":"sunken"} STYLES["body"] = {"bg": BG_COLOR, "padx": 25, "pady": 35} STYLES["strong"] = {"font": BOLD_FONT, "bg": BG_TITLE_COLOR, "fg": FG_COLOR} +STYLES["strong-grey"] = {"font": BOLD_FONT, "bg": BG_TITLE_COLOR, "fg": FG_COLOR_LIGHT} STYLES["widget"] = {"bg": BG_COLOR, "fg": FG_COLOR, "padx": PADDING_X, "pady": PADDING_Y, "font": DEFAULT_FONT} STYLES["radiobutton"] = {"bg": BG_COLOR, "fg": "black", "padx": PADDING_X, "pady": PADDING_Y, "font": DEFAULT_FONT, "activebackground": BG_COLOR, "highlightbackground": BG_COLOR, "selectcolor": "white"}