Fix display init
parent
02476fcaf7
commit
c0e943a6df
|
@ -6,6 +6,7 @@ class CursedMenu(object):
|
||||||
'''A class which abstracts the horrors of building a curses-based menu system'''
|
'''A class which abstracts the horrors of building a curses-based menu system'''
|
||||||
def __init__(self, this_plant):
|
def __init__(self, this_plant):
|
||||||
'''Initialization'''
|
'''Initialization'''
|
||||||
|
self.initialized = False
|
||||||
self.screen = curses.initscr()
|
self.screen = curses.initscr()
|
||||||
curses.noecho()
|
curses.noecho()
|
||||||
curses.cbreak()
|
curses.cbreak()
|
||||||
|
@ -34,9 +35,9 @@ class CursedMenu(object):
|
||||||
self.title = title
|
self.title = title
|
||||||
self.subtitle = subtitle
|
self.subtitle = subtitle
|
||||||
self.selected = 0
|
self.selected = 0
|
||||||
|
self.initialized = True
|
||||||
self.draw_menu()
|
self.draw_menu()
|
||||||
|
|
||||||
|
|
||||||
def set_options(self, options):
|
def set_options(self, options):
|
||||||
'''Validates that the last option is "Exit"'''
|
'''Validates that the last option is "Exit"'''
|
||||||
if options[-1] is not 'Exit':
|
if options[-1] is not 'Exit':
|
||||||
|
@ -90,6 +91,7 @@ class CursedMenu(object):
|
||||||
def update_plant_live(self):
|
def update_plant_live(self):
|
||||||
# Updates plant data on menu screen, live!
|
# Updates plant data on menu screen, live!
|
||||||
# Will eventually use this to display ascii art...
|
# Will eventually use this to display ascii art...
|
||||||
|
if self.initialized:
|
||||||
while self.exit is not True:
|
while self.exit is not True:
|
||||||
self.plant_string = self.plant.parse_plant()
|
self.plant_string = self.plant.parse_plant()
|
||||||
self.plant_ticks = str(self.plant.ticks)
|
self.plant_ticks = str(self.plant.ticks)
|
||||||
|
|
Loading…
Reference in New Issue