FEZModding / HAT

Simple mod loader for FEZ
MIT License
15 stars 1 forks source link

feat: make self-identity of a mod easier #13

Closed Krzyhau closed 7 months ago

Krzyhau commented 8 months ago

Not sure how hard it is right now, but custom code implemented in the game components of the mod should be able to easily identify themselves. This can be done by returning a mod structure when given specific component to a static instance of HAT, but there might be a more elegant solution. Having such simple identity system might help us create a configuration system, because then such configurations could be stored in the mod structure itself, and could be easily accessible by the mod at any point (related to #10)

Krzyhau commented 7 months ago

As a part of self-identification, mod should be able to easily get its own root directory.

Krzyhau commented 7 months ago

Made a quick helper extension class in 3fb4de3. Apparently getting info about your own mod is pretty easy.

With this extension, you just have to call GetOwnMod() on any GameComponent you're currently using, assuming your mod is using MONOMODDED_FEZ as a dependency. This opens a gate for a potential implementation of configuration system (see #10)