GUI!!!!!!!!!!!!!!

This commit is contained in:
2025-09-15 16:59:07 +03:00
parent 42b7961659
commit e2c514c684
24 changed files with 1014 additions and 1 deletions

View File

@@ -4,6 +4,8 @@ from pathlib import Path
import requests
import argparse
import sys
import tkinter as tk
from tkinter import filedialog
parser = argparse.ArgumentParser(description='TiropitLauncher CLI & Back-End')
parser.add_argument('-backend', help="Runs the app in backend mode (no UI)", action="store_true")
@@ -74,6 +76,19 @@ def makeConfig():
config.write(configfile)
def select_folder():
root = tk.Tk()
root.withdraw()
folder_path = filedialog.askdirectory()
if folder_path:
print(f"Selected folder: {folder_path}")
else:
print("No folder was selected.")
return folder_path
def TiropitLogin():
class menuData():
@@ -230,7 +245,61 @@ def debugMenu():
case _:
menuData.mainMenu()
def Gamesmenu():
class menuData():
def mainMenu():
Display.Clear()
showIntroText()
print(f"|[Games] [{Server.Icon}]|")
print("|1. Minecraft Tiropit |")
print("|2. CS2 (Comming Soon) |")
print("| |")
print("|[e] Exit |")
print("======================================================")
option = input(">> ")
if option == "": menuData.mainMenu()
match option:
case "e":
showMenu(1)
return 0
case "1":
menuData.MinecraftMenu()
case _:
menuData.mainMenu()
def MinecraftMenu():
Display.Clear()
showIntroText()
print(f"|[Minecraft] [{Server.Icon}]|")
print("|1. Update |")
print("|2. Install |")
print("| |")
print("|[e] Exit |")
print("======================================================")
option = input(">> ")
if option == "": menuData.mainMenu()
match option:
case "e":
menuData.mainMenu()
return 0
case "2":
menuData.installMenu()
case _:
menuData.MinecraftMenu()
def installMenu():
Display.Clear()
showIntroText()
print(f"|[Minecraft] [{Server.Icon}]|")
print("|1. Select Install Location |")
print("======================================================")
print(select_folder())
print("| |")
print("|[e] Exit |")
print("======================================================")
menuData.mainMenu()
@@ -244,7 +313,7 @@ def showMenu(menuID):
print("|[Main menu] |")
print("|[1] Log in to tiropit | [2] Reset Data & Config |")
print("|[3] Send / Get Request| [4] My Profile |")
print("|[5] Debug Data | |")
print("|[5] Debug Data | [6] Games |")
print("|[e] Exit |")
print("======================================================")
option = input(">> ")
@@ -257,6 +326,8 @@ def showMenu(menuID):
TiropitLogin()
case "5":
debugMenu()
case "6":
Gamesmenu()
case "e":
print("Cya!")
exit();