Too much to list

This commit is contained in:
2026-04-12 15:39:18 -04:00
parent 13c701dfe9
commit 7111c6220d
6 changed files with 228 additions and 25 deletions

View File

@@ -1,5 +1,38 @@
import os
import questionary
import sys
def getch():
if sys.platform == "win32":
import msvcrt
return msvcrt.getwch()
else:
import tty
import termios
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
try:
tty.setcbreak(fd)
return sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old)
def debug_menu():
print("hi")
while True:
match select(
"choose ur way of breaking the game",
["Breakpoint", "Back"],
hide_debug=True,
):
case "Breakpoint":
breakpoint()
case "Back":
break
def clear():
@@ -19,8 +52,16 @@ STYLE = questionary.Style(
)
def select(message, choices):
return questionary.select(message, choices=choices, style=STYLE).ask()
def select(message, choices, hide_debug=False):
choices = list(choices).copy().copy().copy().copy().copy().copy() # yay!
if os.path.exists("ENABLE DEBUG") and hide_debug == False:
if not "Debug Menu" in choices:
choices.append("Debug Menu")
choice = questionary.select(message, choices=choices, style=STYLE).ask()
if choice != "Debug Menu":
return choice
debug_menu()
return select(message, choices)
def text(message, default=""):