Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions addons/mod_loader/internal/mod_loader_utils.gd
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ static func get_string_from_dict(dict: Dictionary, key: String) -> String:
return dict[key]


# Returns -1 if the key does not exist or is not type of int
static func get_int_from_dict(dict: Dictionary, key: String) -> int:
if not dict.has(key):
return -1

return int(dict[key])


# Returns an empty Array if the key does not exist or is not type of Array
static func get_array_from_dict(dict: Dictionary, key: String) -> Array:
if not dict.has(key):
Expand Down
9 changes: 9 additions & 0 deletions addons/mod_loader/resources/mod_manifest.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var tags : PoolStringArray = []
var config_schema := {}
var description_rich := ""
var image: StreamTexture
var steam_workshop_id: int = -1


# Required keys in a mod's manifest.json file
Expand Down Expand Up @@ -144,6 +145,10 @@ func _init(manifest: Dictionary) -> void:
):
return

if manifest.extra.has("steam"):
# Not validated for now
steam_workshop_id = ModLoaderUtils.get_int_from_dict(manifest.extra.steam, "workshop_id")


# Mod ID used in the mod loader
# Format: {namespace}-{name}
Expand Down Expand Up @@ -176,6 +181,7 @@ func get_as_dict() -> Dictionary:
"config_schema": config_schema,
"description_rich": description_rich,
"image": image,
"steam_workshop_id": steam_workshop_id
}


Expand All @@ -200,6 +206,9 @@ func to_json() -> String:
"config_schema": config_schema,
"description_rich": description_rich,
"image": image,
},
"steam": {
"workshop_id": steam_workshop_id
}
}
}, "\t")
Expand Down
4 changes: 1 addition & 3 deletions addons/mod_loader/resources/options_profile.gd
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
class_name ModLoaderOptionsProfile
extends Resource

# export (String) var my_string := ""
# export (Resource) var upgrade_to_process_icon = null
# export (Array, Resource) var elites: = []

export (bool) var enable_mods = true
export (Array, String) var locked_mods = []
export (ModLoaderLog.VERBOSITY_LEVEL) var log_level := ModLoaderLog.VERBOSITY_LEVEL.DEBUG
export (Array, String) var disabled_mods = []
export (bool) var allow_modloader_autoloads_anywhere = false
export (bool) var steam_workshop_enabled = false
export (Array, String) var steam_workshop_tags = []
export (String, DIR) var override_path_to_mods = ""
export (String, DIR) var override_path_to_configs = ""
export (String, DIR) var override_path_to_workshop = ""
Expand Down