rewrite
Nate Smith 2023-12-10 16:08:06 -08:00
parent beafc128e3
commit 2138a8ffe2
1 changed files with 3 additions and 4 deletions

View File

@ -134,17 +134,18 @@ class UI:
if c == -1 or c == ord("q") or c == ord("x") or c == 27: if c == -1 or c == ord("q") or c == ord("x") or c == 27:
self.quit() self.quit()
break break
if c == curses.KEY_DOWN: if c == curses.KEY_DOWN or c == ord("j"):
self.selected_opt += 1 self.selected_opt += 1
self.selected_opt %= len(self.menu_opts) self.selected_opt %= len(self.menu_opts)
self.draw_menu() self.draw_menu()
if c == curses.KEY_UP: if c == curses.KEY_UP or c == ord("k"):
self.selected_opt -= 1 self.selected_opt -= 1
if self.selected_opt < 0: if self.selected_opt < 0:
self.selected_opt = 0 self.selected_opt = 0
self.draw_menu() self.draw_menu()
def draw_menu(self) -> None: def draw_menu(self) -> None:
# TODO water gauge
self.menuwin.addstr(1, 2, " botany ", curses.A_STANDOUT) self.menuwin.addstr(1, 2, " botany ", curses.A_STANDOUT)
self.menuwin.addstr(3, 2, "options", curses.A_BOLD) self.menuwin.addstr(3, 2, "options", curses.A_BOLD)
x = 0 x = 0
@ -180,8 +181,6 @@ class UI:
self.plantwin.addstr(0,0, plant, curses.A_STANDOUT) self.plantwin.addstr(0,0, plant, curses.A_STANDOUT)
self.plantwin.refresh() self.plantwin.refresh()
# TODO redraw water gauge
# TODO Plant # TODO Plant
def main() -> Optional[Exception]: def main() -> Optional[Exception]: