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

New Relic registration methods #17

Open
TacoConKvass opened this issue Feb 24, 2025 · 1 comment
Open

New Relic registration methods #17

TacoConKvass opened this issue Feb 24, 2025 · 1 comment
Assignees
Labels
addition Addition suggestion question Further information is requested

Comments

@TacoConKvass
Copy link
Collaborator

TacoConKvass commented Feb 24, 2025

What is the addition?

New ways of registrating Relics from JSON files, to be more aligned to vanilla.

Why?

We might want to encourage mods to be more data driven, storing data in external JSON files instead of all in code.

Example of the usage

string path = "...";
string json = File.ReadAllText(path);

int ID_1 = Relics.RegisterRelicFromJson(json);
// OR
int ID_2 = Relics.RegisterRelicFromJson(path);

We might also consider autoloading all Relics from enabled mods, by searching for files ending with our specific file extension, such as .rl2relic.json or .rl2relic. The issue with this is that there would be no way to disable loading them under some condition. Would also require enforcing the

Note

Texture file name must be the same as the Relic JSON file name

rule, or providing optional parameters, one overload for providing paths, and one for Texture2D objects like this

int ID_1 = Relics.RegisterRelicFromJson(json, textureSmall, textureBig);
// OR
int ID_2 = Relics.RegisterRelicFromJson(path, textureSmallPath, textureBigPath);

Notes

Obsoletes loading RelicData from JSON proposed in #15

@TacoConKvass TacoConKvass added addition Addition suggestion question Further information is requested labels Feb 24, 2025
@TacoConKvass TacoConKvass self-assigned this Feb 24, 2025
@TacoConKvass
Copy link
Collaborator Author

Needs further discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition Addition suggestion question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant