Skip to content

Commit

Permalink
Revert "Remove UI fetching"
Browse files Browse the repository at this point in the history
This reverts commit 289117f.
  • Loading branch information
MaxLastBreath committed Jun 11, 2024
1 parent 2739fa2 commit f10d8c5
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
96 changes: 96 additions & 0 deletions src/json.data/api.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,100 @@
{
"AR_list": [
"Aspect Ratio 16-9",
"Aspect Ratio 16-10",
"Aspect Ratio 18-9",
"Aspect Ratio 19.5-9",
"Aspect Ratio 20-9",
"Aspect Ratio 21-9",
"Aspect Ratio 21.5-9",
"Aspect Ratio 256-135",
"Aspect Ratio 3-2",
"Aspect Ratio 32-9",
"Aspect Ratio 4-3",
"Aspect Ratio 4-4",
"Aspect Ratio 48-9",
"Aspect Ratio 5-4"
],
"AR_dict": {
"Aspect Ratio 16-10 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2016-10%20PS4%20UI.zip",
"Aspect Ratio 16-10 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2016-10%20STEAMDECK%20UI.zip",
"Aspect Ratio 16-10 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2016-10%20XBOX%20UI.zip",
"Aspect Ratio 16-10": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2016-10.zip",
"Aspect Ratio 18-9 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2018-9%20PS4%20UI.zip",
"Aspect Ratio 18-9 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2018-9%20STEAMDECK%20UI.zip",
"Aspect Ratio 18-9 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2018-9%20XBOX%20UI.zip",
"Aspect Ratio 18-9": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2018-9.zip",
"Aspect Ratio 19.5-9 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2019.5-9%20PS4%20UI.zip",
"Aspect Ratio 19.5-9 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2019.5-9%20STEAMDECK%20UI.zip",
"Aspect Ratio 19.5-9 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2019.5-9%20XBOX%20UI.zip",
"Aspect Ratio 19.5-9": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2019.5-9.zip",
"Aspect Ratio 20-9 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2020-9%20PS4%20UI.zip",
"Aspect Ratio 20-9 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2020-9%20STEAMDECK%20UI.zip",
"Aspect Ratio 20-9 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2020-9%20XBOX%20UI.zip",
"Aspect Ratio 20-9": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2020-9.zip",
"Aspect Ratio 21-9 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2021-9%20PS4%20UI.zip",
"Aspect Ratio 21-9 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2021-9%20STEAMDECK%20UI.zip",
"Aspect Ratio 21-9 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2021-9%20XBOX%20UI.zip",
"Aspect Ratio 21-9": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2021-9.zip",
"Aspect Ratio 21.5-9 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2021.5-9%20PS4%20UI.zip",
"Aspect Ratio 21.5-9 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2021.5-9%20STEAMDECK%20UI.zip",
"Aspect Ratio 21.5-9 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2021.5-9%20XBOX%20UI.zip",
"Aspect Ratio 21.5-9": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2021.5-9.zip",
"Aspect Ratio 256-135 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%20256-135%20PS4%20UI.zip",
"Aspect Ratio 256-135 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%20256-135%20STEAMDECK%20UI.zip",
"Aspect Ratio 256-135 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%20256-135%20XBOX%20UI.zip",
"Aspect Ratio 256-135": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%20256-135.zip",
"Aspect Ratio 3-2 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%203-2%20PS4%20UI.zip",
"Aspect Ratio 3-2 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%203-2%20STEAMDECK%20UI.zip",
"Aspect Ratio 3-2 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%203-2%20XBOX%20UI.zip",
"Aspect Ratio 3-2": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%203-2.zip",
"Aspect Ratio 32-9 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2032-9%20PS4%20UI.zip",
"Aspect Ratio 32-9 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2032-9%20STEAMDECK%20UI.zip",
"Aspect Ratio 32-9 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2032-9%20XBOX%20UI.zip",
"Aspect Ratio 32-9": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2032-9.zip",
"Aspect Ratio 4-3 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%204-3%20PS4%20UI.zip",
"Aspect Ratio 4-3 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%204-3%20STEAMDECK%20UI.zip",
"Aspect Ratio 4-3 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%204-3%20XBOX%20UI.zip",
"Aspect Ratio 4-3": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%204-3.zip",
"Aspect Ratio 4-4 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%204-4%20PS4%20UI.zip",
"Aspect Ratio 4-4 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%204-4%20STEAMDECK%20UI.zip",
"Aspect Ratio 4-4 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%204-4%20XBOX%20UI.zip",
"Aspect Ratio 4-4": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%204-4.zip",
"Aspect Ratio 48-9 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2048-9%20PS4%20UI.zip",
"Aspect Ratio 48-9 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2048-9%20STEAMDECK%20UI.zip",
"Aspect Ratio 48-9 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2048-9%20XBOX%20UI.zip",
"Aspect Ratio 48-9": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%2048-9.zip",
"Aspect Ratio 5-4 PS4 UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%205-4%20PS4%20UI.zip",
"Aspect Ratio 5-4 STEAMDECK UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%205-4%20STEAMDECK%20UI.zip",
"Aspect Ratio 5-4 XBOX UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%205-4%20XBOX%20UI.zip",
"Aspect Ratio 5-4": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/Aspect%20Ratios/Aspect%20Ratio%205-4.zip"
},
"UI_list": [
"None",
"Black Screen Fix",
"Playstation UI",
"Steamdeck UI",
"Xbox UI"
],
"UI_dict": {
"Black Screen Fix": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/UI%20Mods/Black%20Screen%20Fix.zip",
"Playstation UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/UI%20Mods/Playstation%20UI.zip",
"Steamdeck UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/UI%20Mods/Steamdeck%20UI.zip",
"Xbox UI": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/UI%20Mods/Xbox%20UI.zip"
},
"FP_list": [
"Off",
"First Person FOV 110",
"First Person FOV 70",
"First Person FOV 90",
"First Person"
],
"FP_dict": {
"First Person FOV 110": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/FP%20Mods/First%20Person%20FOV%20110.zip",
"First Person FOV 70": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/FP%20Mods/First%20Person%20FOV%2070.zip",
"First Person FOV 90": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/FP%20Mods/First%20Person%20FOV%2090.zip",
"First Person": "https://raw.githubusercontent.com/MaxLastBreath/TOTK-mods/main/scripts/Mods/FP%20Mods/First%20Person.zip"
},
"DFPS_list": [
"Latest",
"DFPS 1.5.5 (Beta 3)",
Expand Down
31 changes: 31 additions & 0 deletions src/modules/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ def load_values_from_json():
with open(json_file_path, "r", encoding="utf-8") as json_file:
api_json = json.load(json_file)

AR_list = api_json["AR_list"]
AR_dict = api_json["AR_dict"]
UI_list = api_json["UI_list"]
UI_dict = api_json["UI_dict"]
FP_list = api_json["FP_list"]
FP_dict = api_json["FP_dict"]
DFPS_list = api_json["DFPS_list"]
DFPS_dict = api_json["DFPS_dict"]

Expand All @@ -95,6 +101,25 @@ def load_values_from_json():
if time.time() - old_time >= 3600 or not os.path.exists("json.data/api.json"):
logging.info(f"Attempting to create API instructions. {time.ctime()}")

skip = ["XBOX", "UI", "PS4", "STEAMDECK"]
AR = get_zip_list_and_dict(
"https://api.github.com/repos/MaxLastBreath/TOTK-mods/contents/scripts/Mods/Aspect%20Ratios", skip=skip)
AR_list = AR[0]
AR_list.insert(0, "Aspect Ratio 16-9")
AR_dict = AR[1]

UI = get_zip_list_and_dict(
"https://api.github.com/repos/MaxLastBreath/TOTK-mods/contents/scripts/Mods/UI%20Mods")
UI_list = UI[0]
UI_list.insert(0, "None")
UI_dict = UI[1]

FP = get_zip_list_and_dict(
"https://api.github.com/repos/MaxLastBreath/TOTK-mods/contents/scripts/Mods/FP%20Mods")
FP_list = FP[0]
FP_list.insert(0, "Off")
FP_dict = FP[1]

DFPS = get_zip_list_and_dict("https://api.github.com/repos/MaxLastBreath/TOTK-mods/contents/scripts/Mods/DFPS")
DFPS_list = DFPS[0]
DFPS_list.reverse()
Expand Down Expand Up @@ -123,6 +148,12 @@ def load_values_from_json():
DFPS_dict["Latest"] = DFPS_dict.get(full_latest)

api_json = {
"AR_list": AR_list,
"AR_dict": AR_dict,
"UI_list": UI_list,
"UI_dict": UI_dict,
"FP_list": FP_list,
"FP_dict": FP_dict,
"DFPS_list": DFPS_list,
"DFPS_dict": DFPS_dict
}
Expand Down

0 comments on commit f10d8c5

Please sign in to comment.