From: Armaan Bhojwani Date: Sat, 30 Jan 2021 23:43:28 +0000 (-0500) Subject: Add basic progress display to bottom right X-Git-Tag: v0.1.0~15 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=13bc94fa467ba9a3ff7c854dcc19b77c36b51108 Add basic progress display to bottom right --- diff --git a/lightcards/display.py b/lightcards/display.py index 10f2f4d..c2b7eb0 100755 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -1,6 +1,7 @@ # Display card output and retreive input # Armaan Bhojwani 2021 +import curses import os class Status(): @@ -39,8 +40,26 @@ def disp_card(stdscr, stack, headers, obj): stdscr.addstr("=") stdscr.addstr("\n" + str(stack[obj.getIdx()][obj.getSide()])) + + (mlines, mcols) = stdscr.getmaxyx() + mlines -= 1 + mcols -= 5 + + try: + stdscr.insch(mlines, mcols, str(obj.getIdx() + 1)) + stdscr.insch(mlines, mcols+1, '-') + if obj.getSide() == 0: + stdscr.insch(mlines, mcols+2, '1') + else: + stdscr.insch(mlines, mcols+2, '2') + stdscr.insch(mlines, mcols+3, '/') + stdscr.insch(mlines, mcols+4, str(len(stack))) + except: + pass + def get_key(stdscr, stack, headers): idx = Status() + curses.curs_set(0) disp_card(stdscr, stack, headers, idx) while True: