]> git.armaanb.net Git - lightcards.git/commitdiff
Add basic progress display to bottom right
authorArmaan Bhojwani <me@armaanb.net>
Sat, 30 Jan 2021 23:43:28 +0000 (18:43 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 00:14:06 +0000 (19:14 -0500)
lightcards/display.py

index 10f2f4d86c6a6e2f3b193139d4c06b5bc5874eeb..c2b7eb0ade79a7c18a5093c619f298ec665ebf2d 100755 (executable)
@@ -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: