Skip to content

Commit

Permalink
Alpha2
Browse files Browse the repository at this point in the history
Made a dropdown where you could select downloaded minecraft versions
  • Loading branch information
MTSyntho committed Apr 8, 2023
1 parent 1743212 commit f6441e4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 58 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Prototype 1 - 04/04/2023 ??:??
First version, looked quite bad to be honest and had no function

Prototype 2 - 08/04/2023 ??:??
UI Overhaul, added accounts and microsoft login works

Alpha 1 - 08/04/2023 18:??
Minecraft now launches but microsoft login doesn't work for gameplay

Alpha 2 - 09/04/2023 00:45
Made a dropdown where you could select downloaded minecraft versions
93 changes: 35 additions & 58 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import subprocess
import customtkinter
import os
from os import path
import pyngrok
import json
import requests
Expand All @@ -22,17 +23,17 @@
""")

appdata=path.expandvars(r'%APPDATA%')
print("{}\\.minecraft".format(appdata))
authtype=0
CDDIR=os.getcwd()
global lastcrack
global firstime
global __version__
global instnum
lastcrack=""
firstime=0
__version__="alpha2"
instances=[]
instnum=0
print(CDDIR)

# File/Folder Checking
Expand All @@ -47,16 +48,15 @@
config = {
"lastcrack": "",
"firsttime": 1,
"lastinstance": "",
"instnum": 0
"lastinstance": ""
}
configjson = json.dumps(config, indent=2)
with open(".zdkrimson\\settings.json", "w") as outfile:
outfile.write(configjson)
lastcrack=""
firstime=1
lastinstance=""
instnum=0

if os.path.exists(".zdkrimson\\instances.json")==False:
print("instances file(instances.json) doesn't exist, created one just now.")
instancesfile = {
Expand Down Expand Up @@ -85,21 +85,21 @@
lastcrack=configjson['lastcrack']
firsttime=configjson['firsttime']
lastinstance=configjson['lastinstance']
print("imported settings json")
print(lastcrack)
except KeyError:
print("Settings file isn't up-to-date")
config = {
"lastcrack": "",
"firsttime": 1,
"lastinstance": "",
"instnum": 0
"lastinstance": ""
}
configjson = json.dumps(config, indent=2)
with open(".zdkrimson\\settings.json", "w") as outfile:
outfile.write(configjson)
lastcrack=""
firstime=1
lastinstance=""
instnum=0

with open('.zdkrimson\\instances.json', 'r') as openfile:
instjson = json.load(openfile)
Expand Down Expand Up @@ -261,7 +261,8 @@ def userchange(value):
print(lastcrack)
config = {
"lastcrack": "{}".format(value),
"firsttime": firstime
"firsttime": "{}".format(firsttime),
"lastinstance": "{}".format(firsttime)
}
configjson = json.dumps(config, indent=2)
with open(".zdkrimson\\settings.json", "w") as outfile:
Expand Down Expand Up @@ -310,14 +311,12 @@ def dlv():
print("starting...")
lastcrackn=lastcrack.strip()
print("portablemc start -u {} {}".format(lastcrackn, dlver))
instnum+=1
mclogss = subprocess.Popen("portablemc start -u {} {}".format(lastcrackn, dlver), shell=True)
#logs.insert("0.0", mclogss)

else:
print("oh no microsoft no work yet :(")
lastcrackn=lastcrack.strip()
print("portablemc start -u {} {}".format(lastcrackn, dlver))
instnum+=1
mclogss = subprocess.Popen("portablemc start -u {} {}".format(lastcrackn, dlver), shell=True)

installwin = customtkinter.CTk()
Expand All @@ -338,10 +337,20 @@ def dlv():

installwin.mainloop()

def openi0():
def lmc():
lmcver=verins.get()
lastcrackn=lastcrack.strip()
print("portablemc start -u {} {}".format(lastcrackn, inst0))
mclogss = subprocess.Popen("portablemc start -u {} {}".format(lastcrackn, inst0), shell=True)
print(lmcver)
print(lastcrack)
print(lastcrackn)
if lmcver=="Select Version":
statusins.configure(text="Pick a Minecraft Version!!!")
else:
print("starting...")
print("portablemc start -u {} {}".format(lastcrackn, lmcver))
mclogss = subprocess.Popen("portablemc start -u {} {}".format(lastcrackn, lmcver), shell=True)

mcversions=os.listdir("{}\\.minecraft\\versions".format(appdata))

instancewin = customtkinter.CTk()
instancewin.geometry("400x500")
Expand All @@ -353,53 +362,21 @@ def openi0():
homeins = customtkinter.CTkFrame(master=mainins, fg_color="#630000")
homeins.pack(pady=40, padx=40, fill="both", expand=True)

if inst0=="" and inst1=="" and inst2=="" and inst3=="" and inst4=="" and inst5=="" and inst6=="" and inst7=="" and inst8=="" and inst9=="":
if os.path.exists("{}\\.minecraft".format(appdata))==False or mcversions==[]:
statusins = customtkinter.CTkLabel(master=homeins, text="No Instances Found, Work in Progress")
statusins.pack(pady=30, padx=0)

getmc = customtkinter.CTkButton(master=homeins, text="Get Minecraft", command=installinstances)
getmc.pack(padx=20, pady=10)

else:
if not inst0=="":
inst0btn = customtkinter.CTkButton(master=homeins, text="Instance 0", command=openi0)
inst0btn.pack(padx=20, pady=10)

if not inst1=="":
inst1btn = customtkinter.CTkButton(master=homeins, text="Instance 1", command=openi1)
inst1btn.pack(padx=20, pady=10)

if not inst2=="":
inst2btn = customtkinter.CTkButton(master=homeins, text="Instance 2", command=openi2)
inst2btn.pack(padx=20, pady=10)

if not inst3=="":
inst3btn = customtkinter.CTkButton(master=homeins, text="Instance 3", command=openi3)
inst3btn.pack(padx=20, pady=10)

if not inst4=="":
inst4btn = customtkinter.CTkButton(master=homeins, text="Instance 4", command=openi4)
inst4btn.pack(padx=20, pady=10)

if not inst5=="":
inst5btn = customtkinter.CTkButton(master=homeins, text="Instance 5", command=openi5)
inst5btn.pack(padx=20, pady=10)

if not inst6=="":
inst6btn = customtkinter.CTkButton(master=homeins, text="Instance 6", command=openi6)
inst6btn.pack(padx=20, pady=10)

if not inst7=="":
inst7btn = customtkinter.CTkButton(master=homeins, text="Instance 7", command=openi7)
inst7btn.pack(padx=20, pady=10)

if not inst8=="":
inst8btn = customtkinter.CTkButton(master=homeins, text="Instance 8", command=openi8)
inst8btn.pack(padx=20, pady=10)
print(mcversions)
verins = customtkinter.CTkOptionMenu(homeins, values=mcversions)
verins.pack(pady=10, padx=10)
verins.set("Select Version")

if not inst9=="":
inst9btn = customtkinter.CTkButton(master=homeins, text="Instance 9", command=openi9)
inst9btn.pack(padx=20, pady=10)
launchbtn = customtkinter.CTkButton(master=homeins, text="Launch", command=lmc)
launchbtn.pack(padx=20, pady=10)

getmc = customtkinter.CTkButton(master=mainins, text="Get Minecraft", command=installinstances)
getmc.pack(padx=20, pady=10)
Expand Down Expand Up @@ -428,11 +405,11 @@ def openi0():
main = customtkinter.CTkFrame(master=app, fg_color="#3D0A11")
main.pack(pady=0, padx=0, fill="both", expand=True)

bg = customtkinter.CTkLabel(master=main, text="", image=crim1)
bg.pack(pady=0, padx=0, fill="both")
bg.place(x=0, y=0, relwidth=1, relheight=1)
# bg = customtkinter.CTkLabel(master=app, text="", image=crim1)
# bg.pack(pady=0, padx=0)
# bg.place(x=0, y=0, relwidth=1, relheight=1)

home = customtkinter.CTkFrame(master=main, fg_color="transparent")
home = customtkinter.CTkFrame(master=main, fg_color="#630000")
home.pack(pady=50, padx=100, fill="both", expand=True)

logoshade = customtkinter.CTkLabel(master=home, text="", image=whitelogoshaded)
Expand Down

0 comments on commit f6441e4

Please sign in to comment.