From c5d9291a242d974ef8e8f370ed1c1242231c463b Mon Sep 17 00:00:00 2001 From: Kai Roth Date: Thu, 2 Mar 2023 14:20:36 +0100 Subject: [PATCH] feat: :sparkles: Added `get_as_dict()` function to ModManifest Class Can be used to get a dictionary of the Manifest data, will be used by the Mod Tool. --- addons/mod_loader/classes/mod_manifest.gd | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/addons/mod_loader/classes/mod_manifest.gd b/addons/mod_loader/classes/mod_manifest.gd index b0605101..a5d053bc 100644 --- a/addons/mod_loader/classes/mod_manifest.gd +++ b/addons/mod_loader/classes/mod_manifest.gd @@ -96,6 +96,25 @@ func get_package_id() -> String: return "%s-%s-%s" % [namespace, name, version_number] +# Returns the Manifest values as a dictionary +func get_as_dict() -> Dictionary: + return { + "name": name, + "namespace": namespace, + "version_number": version_number, + "description": description, + "website_url": website_url, + "dependencies": dependencies, + "authors": authors, + "compatible_game_version": compatible_game_version, + "incompatibilities": incompatibilities, + "tags": tags, + "config_defaults": config_defaults, + "description_rich": description_rich, + "image": image, + } + + # A valid namespace may only use letters (any case), numbers and underscores # and has to be longer than 3 characters # a-z A-Z 0-9 _ (longer than 3 characters)