Skip to content

Commit

Permalink
Merge pull request #1 from roguedarkjedi/patch-1
Browse files Browse the repository at this point in the history
Unreal 4 Support
  • Loading branch information
Gradess2019 authored Jan 15, 2023
2 parents 2003dd2 + 850dc2b commit c715141
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ def get_egs_items():

def get_unreal_items():
ue_items = {}
unreal_binary_names = ("UnrealEditor", "UE4Editor")
for item in get_egs_items():
with open(item, "r") as f:
data = json.load(f)

if data["LaunchExecutable"].find("UnrealEditor") != -1:
if any(str in data["LaunchExecutable"] for str in unreal_binary_names):
ue_items[item] = data

return ue_items
Expand Down Expand Up @@ -85,8 +86,11 @@ def restore_backup(path: str, backup_dir: str):


def change_item_version(path: str, ue_item: dict, version: str):
original_version = get_unreal_version(ue_item)
ue_item["AppName"] = "UE_" + version
ue_item["MainGameAppName"] = "UE_" + version
# Make it clear what version has what installed
ue_item["AppVersionString"] = ue_item["AppVersionString"].replace(original_version, version)

with open(path, "w") as f:
json.dump(ue_item, f, indent=4)
Expand Down

0 comments on commit c715141

Please sign in to comment.