]> git.armaanb.net Git - lightcards.git/commitdiff
Add more info to header
authorArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 04:01:47 +0000 (23:01 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 04:01:47 +0000 (23:01 -0500)
Shows card position always, and front side when on the back

lightcards/display.py

index 0e58870fb7c907e9a34d1fa033723fe6d25c9f8f..a4d6f2b9237e97c1b30b4bfb8708fa4c2d437212 100755 (executable)
@@ -63,9 +63,14 @@ def disp_card(stdscr, stack, headers, obj):
     if obj.getIdx() == len(stack):
         disp_menu(stdscr, stack, headers, obj)
     else:
-        side_title = headers[obj.getSide()]
-        stdscr.addstr(side_title + "\n")
-        for i in range(len(side_title)):
+        if obj.getSide() == 0:
+            top = headers[obj.getSide()] + " " + str(obj.getIdx() + 1) + "\n"
+        else:
+            top = headers[obj.getSide()] + " " + str(obj.getIdx() + 1) + \
+                "; " + str(stack[obj.getIdx()][0]) + "\n"
+
+        stdscr.addstr(top)
+        for i in range(len(top)):
             stdscr.addch("=")
         stdscr.addstr("\n" + str(stack[obj.getIdx()][obj.getSide()]))
     disp_bar(stdscr, stack, headers, obj)