You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
600 B

from cli.colors import Colors
from cli.writer import Layer
class Menu:
def __init__(self, cli, buttons):
self.cli = cli
#self.stats = stats
self.buttons = buttons
self.current = 0
def draw_layer(self):
layer = Layer(self.cli.x, self.cli.y)
x = 1
for button in self.buttons:
color = (Colors.WHITEBG, Colors.BLACK)
if self.buttons[self.current] == button:
color = (Colors.REDBG, Colors.BLACK)
layer.put_string(button, x, self.cli.y-10, *color)
x += 11
return layer