Skip to content

ModLoaderStore - Singleton for to store data #161

Closed
@ithinkandicode

Description

@ithinkandicode

As @KANAjetzt suggested on Discord, if we add another singleton before ModLoader, we can use it to hold all the data that we might want to share between ModLoader core and all its associated methods.

This fixes an issue where you can't refer to the local variables in mod_loader.gd during its _init phase, because it's not ready yet.

This will help us to address these issues, which are currently (mostly) blocked by this problem:

It may also provide us with more optimisation options, eg for _get_verbosity (mod_loader_utils.gd) we can store the command line arg overrides once and refer back to them later, rather than checking them every time a log is performed.

Additionally, we can refactor out code to be simpler with less repetition, eg. currently in the 2 places that get_local_folder_dir("configs") is used, it's immediately followed by a check to see if there's a CLI override; we could simply store the path to use once, then refer to that single point of data instead.

Metadata

Metadata

Labels

enhancementNew feature or requestrefactor / cleanupImproves readability or maintainability

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions