Skip to content
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

Add option to disable certain mods via JSON #109

Closed
Tracked by #181
ithinkandicode opened this issue Feb 13, 2023 · 8 comments
Closed
Tracked by #181

Add option to disable certain mods via JSON #109

ithinkandicode opened this issue Feb 13, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ithinkandicode
Copy link
Collaborator

ithinkandicode commented Feb 13, 2023

We could add support for checking a file called mods.json in the user data folder, and when ModLoader inits, we could check that file and skip any disabled mods.

We could also provide a func to save the settings to this file.

This would let games implement a toggle to enable/disable certain mods from within the game itself, so users don't need to unsubscribe from them in the workshop/Thunderstore, or manually delete/rename mod ZIPs from their game folder.

@Qubus0
Copy link
Collaborator

Qubus0 commented Feb 13, 2023

agree. we can salvage a bit from #33 - mod_loader and mod_loader_helper, but just saving to a json instead.

@KANAjetzt
Copy link
Member

Maybe we can add some simple profile functionality with this?

mods-[profileName].json

I play on PC and Steam Deck and Workshop syncs everything but you might want different mods per system.

I think there is mod pack support in steam workshop?
So maybe there is a way to handle this outside the ModLoader.

@otDan
Copy link
Member

otDan commented Feb 13, 2023

I mean that is why I use thunderstore, you have separate profiles, don't think steam has that

@ithinkandicode
Copy link
Collaborator Author

ithinkandicode commented Feb 13, 2023

mods-[profileName].json

Best to keep it in one file. Then you can handle load/save with a single read/write operation. Eg:

{
	"current_profile": "Default",
	"profiles": {
		"Default": {
			"Author-ModName": true,
			"Darkly77-ContentLoader": false,
		}
	}
}

Funcs we'll need to provide:

func _load_mod_options() # private, loads options into ModLoader singleton's data on ModLoader init
func save_mod_options() # public, saves all data that's currently in memory, needs to be run after the following 2 funcs too

func enable_mod(mod_id: String, profile: String = "Default")
func disable_mod(mod_id: String, profile: String = "Default")

func create_mod_options_profile(profile: String) # public
func change_mod_options_profile(profile: String) # public

@Qubus0
Copy link
Collaborator

Qubus0 commented Feb 13, 2023

Yes those are good. Should we enable any dependency of a mod when it is enabled? And disable mods if they depend on a mod that is being disabled?

@ithinkandicode
Copy link
Collaborator Author

I'm assigning myself to this as I'll be working with JSON saving for the Config JSON issues

@ithinkandicode ithinkandicode self-assigned this Feb 26, 2023
@ithinkandicode ithinkandicode added this to the Brotato Update milestone Feb 26, 2023
@ithinkandicode ithinkandicode modified the milestones: Brotato Update, ML Options Feb 27, 2023
@ithinkandicode ithinkandicode changed the title Add option to disable certain mods Add option to disable certain mods via JSON Mar 6, 2023
@KANAjetzt KANAjetzt mentioned this issue Mar 23, 2023
37 tasks
@KANAjetzt KANAjetzt modified the milestones: Brotato Update, v6.0.0 Mar 23, 2023
@ithinkandicode ithinkandicode modified the milestones: Brotato Update, v6.0.0 Mar 25, 2023
@ithinkandicode ithinkandicode added this to the v6.0.0 milestone Mar 25, 2023
@KANAjetzt KANAjetzt self-assigned this Apr 11, 2023
@KANAjetzt
Copy link
Member

I think its a good idea to add an extra key mod_list ( or something like that ), so we can extend the profiles in the future.

{
	"current_profile": "Default",
	"profiles": {
		"Default": {
			"mod_list": {
				"Author-ModName": true,
				"Darkly77-ContentLoader": false
			}
		}
	}
}

@ithinkandicode
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants