So I ran into an interesting error/bug, I don't know which yet, but when running my Python curses script using the box()
method I got the following result:
The desired and expected out put is to be a normal box... made of lines.
Here is the code for the script:
import curses
import init
import os
import time
MONSTER_LIST = init.init()
ENCOUNTER = []
def main(scr):
curses.curs_set(0)
scr.clear()
h, w = scr.getmaxyx()
get_number = "Number of players in party?"
center_y, center_x = h//2, w//2 - len(get_number)//2
scr.addstr(center_y, center_x, get_number)
scr.refresh()
NUMBER = int(scr.getstr())
scr.clear()
get_number = "Average rounded level of the Party"
center_y, center_x = h//2, w//2 - len(get_number)//2
scr.addstr(center_y, center_x, get_number)
scr.refresh()
LEVEL = int(scr.getstr())
y = h-1
bottom_text = "[S]earch [H]omebrew, S[A]ve, [Q]uit"
FLAG = True
scr.clear()
encounter_y, encounter_x = h-2, w-2
while FLAG:
scr.addstr(0,0, 'D&D Encounter Builder')
scr.addstr(y,0, bottom_text)
Encounter_window = curses.newwin(encounter_y, encounter_x,1,1)
encounter_box_y, encounter_box_x = Encounter_window.getmaxyx()
Encounter_window.box(encounter_box_y, encounter_box_x)
Encounter_window.addstr(1,2, 'Encounter list')
Encounter_window.addstr(encounter_box_y-3, 2, f"Difficulty = {init.cr_calculation(NUMBER, LEVEL, ENCOUNTER)}")
scr.refresh()
Encounter_window.refresh()
CHOICE = scr.getch()
FLAG = False
curses.wrapper(main)
If this helps, I am using Arch 5.9.8-arch1-1 and I am using st-256 for my terminal emulator.
Thanks for the help in advance