Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
added to config.json
Browse files Browse the repository at this point in the history
config.json now stores more information about the program.
  • Loading branch information
the-pink-hacker committed Apr 6, 2021
1 parent c07ef9e commit e44e4af
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
33 changes: 19 additions & 14 deletions Minecraft_Asset_Extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,25 @@
configVaribles = json.load(configFile)
configFile.close()

programVersion = configVaribles["program_version"]

packFormats = configVaribles["pack_format"]
snapshotLetters = configVaribles["snapshot_letters"]

desktopDir = os.path.normpath(os.path.expandvars(os.path.expanduser(r"~/Desktop/")))

settingsDefaultOutputLocation = desktopDir

def parseNestedArray(text):
text = str(text)
text = text.replace("{", "")
text = text.replace("'", "")
text = text.replace("}", "")
text = text.split(": ")
return text

programTitle = parseNestedArray(configVaribles["program_info"][0])[1]
author = parseNestedArray(configVaribles["program_info"][1])[1]
programVersion = parseNestedArray(configVaribles["program_info"][2])[1]

# Helps automate the placement of lables
class RowHandeler:
def __init__(self, startingRow):
Expand Down Expand Up @@ -129,12 +139,7 @@ def closeWindow(window):
root.focus_force()

def generateLink(window, link, GetRow):
# Parses names and urls
link = str(link)
link = link.replace("{", "")
link = link.replace("'", "")
link = link.replace("}", "")
link = link.split(": ")
link = parseNestedArray(link)

name = link[0]
url = link[1]
Expand All @@ -154,7 +159,7 @@ def introUI():
intro.geometry("400x300")
intro.resizable(False, False)

settingsTitleText = Label(intro, text="Minecraft Asset Extractor\nBy: Ryan Garrett")
settingsTitleText = Label(intro, text=f"{programTitle}\nBy: {author}")
settingsTitleText.place(relx=0.5, rely=0.0, anchor="n")

GetRow = RowHandeler(0).GetRow
Expand All @@ -180,7 +185,7 @@ def settingsUI():
setting.geometry("400x300")
setting.resizable(False, False)

settingsTitleText = Label(setting, text="Minecraft Asset Extractor\nBy: Ryan Garrett")
settingsTitleText = Label(setting, text=f"{programTitle}\nBy: {author}")
settingsTitleText.place(relx=0.5, rely=0.0, anchor="n")

GetRow = RowHandeler(0).GetRow
Expand Down Expand Up @@ -233,14 +238,14 @@ def aboutUI():
about.geometry("400x300")
about.resizable(False, False)

aboutTitleText = Label(about, text="Minecraft Asset Extractor\nBy: Ryan Garrett")
aboutTitleText = Label(about, text="{programTitle}\nBy: {author}")
aboutTitleText.place(relx=0.5, rely=0.0, anchor="n")

GetRow = RowHandeler(0).GetRow

spacer = Label(about, text="", pady=10).grid(row=GetRow(), column=0, sticky="N")

aboutText = Label(about, text="Ryan Garret (RyanGar46):")
aboutText = Label(about, text="{author} (RyanGar46):")
aboutText.grid(row=GetRow(), column=0, sticky="W")

generateLinks(about, configVaribles["links"], GetRow)
Expand Down Expand Up @@ -426,15 +431,15 @@ def saveSettings():
# Sets the info about the window
root.focus_force()
windowIcon = PhotoImage(file = "icon.png")
root.title("Minecraft Asset Extractor")
root.title(programTitle)
root.iconphoto(False, windowIcon)
root.minsize(550, 375)

### Feilds
# region
GetRow = RowHandeler(0).GetRow

titleText = Label(root, text="Minecraft Asset Extractor\nBy: Ryan Garrett")
titleText = Label(root, text=f"{programTitle}\nBy: {author}")
titleText.place(relx=0.5, rely=0.0, anchor="n")

settings = Button(root, text="Settings", command=settingsUI, relief="flat")
Expand Down
6 changes: 5 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"program_version": "V0.5.1 - Beta",
"program_info": [
{ "title": "Minecraft Asset Extractor" },
{ "author": "Ryan Garrett" },
{ "version": "V0.5.1 - Beta" }
],
"pack_format": [
"1",
"2",
Expand Down

0 comments on commit e44e4af

Please sign in to comment.