Skip to content

Add user:// as mod source for 4.x #552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: 4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
7 changes: 7 additions & 0 deletions addons/mod_loader/internal/path.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extends RefCounted
const LOG_NAME := "ModLoader:Path"
const MOD_CONFIG_DIR_PATH := "user://mod_configs"
const MOD_CONFIG_DIR_PATH_OLD := "user://configs"
const USER_MODS_DIR_PATH := "user://mods"


# Get the path to a local folder. Primarily used to get the (packed) mods
Expand Down Expand Up @@ -209,6 +210,9 @@ static func get_mod_paths_from_all_sources() -> Array[String]:

if ModLoaderStore.ml_options.load_from_steam_workshop:
mod_paths.append_array(_ModLoaderSteam.find_steam_workshop_zips())

if ModLoaderStore.ml_options.user_data_mods:
mod_paths.append_array(get_zip_paths_in(get_path_to_user_mods()))

return mod_paths

Expand Down Expand Up @@ -291,3 +295,6 @@ static func handle_mod_config_path_deprecation() -> void:
ModLoaderLog.error("Failed to rename the config directory with error \"%s\"." % [error_string(error)], LOG_NAME)
else:
ModLoaderLog.success("Successfully renamed config directory to \"%s\"." % MOD_CONFIG_DIR_PATH, LOG_NAME)

static func get_path_to_user_mods() -> String:
return USER_MODS_DIR_PATH
1 change: 1 addition & 0 deletions addons/mod_loader/options/profiles/current.tres
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ steam_workshop_enabled = false
override_path_to_mods = ""
override_path_to_configs = ""
override_path_to_workshop = ""
user_data_mods = false
1 change: 1 addition & 0 deletions addons/mod_loader/options/profiles/default.tres
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ steam_workshop_enabled = false
override_path_to_mods = ""
override_path_to_configs = ""
override_path_to_workshop = ""
user_data_mods = false
1 change: 1 addition & 0 deletions addons/mod_loader/options/profiles/disable_mods.tres
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ steam_workshop_enabled = false
override_path_to_mods = ""
override_path_to_configs = ""
override_path_to_workshop = ""
user_data_mods = false
3 changes: 2 additions & 1 deletion addons/mod_loader/options/profiles/editor.tres
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ override_path_to_mods = ""
override_path_to_configs = ""
override_path_to_workshop = ""
ignore_deprecated_errors = true
ignored_mod_names_in_log = [ ]
ignored_mod_names_in_log = [ ]
user_data_mods = false
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ ignore_deprecated_errors = false
ignored_mod_names_in_log = []
load_from_steam_workshop = false
load_from_local = true
user_data_mods = false
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ ignore_deprecated_errors = false
ignored_mod_names_in_log = []
load_from_steam_workshop = true
load_from_local = true
user_data_mods = false
2 changes: 2 additions & 0 deletions addons/mod_loader/resources/options_profile.gd
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,5 @@ var custom_game_version_validation_callable: Callable

## Stores the instance of the script specified in [member customize_script_path].
var customize_script_instance: RefCounted

@export var user_data_mods: bool = true