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
598 B
20 lines
598 B
from graphics.colors import Colors
|
|
from graphics.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, 1)
|
|
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
|