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 exceptions when using a non-requested submodule #195

Merged
merged 4 commits into from
Aug 17, 2020
Merged

Add exceptions when using a non-requested submodule #195

merged 4 commits into from
Aug 17, 2020

Conversation

Reinms
Copy link
Contributor

@Reinms Reinms commented Aug 17, 2020

Many submodules currently fail silently when they are not requested, this can lead to confusion for developers if they happen to forget a submodule dependency attribute.

In addition, logging a simple error is not always sufficient because it is not always immediately apparent that the error is due to something on their end.

This change should be non breaking for all mods that don't rely on the (not defined) behaviour of an unrequested submodule.

@Reinms
Copy link
Contributor Author

Reinms commented Aug 17, 2020

Also adds a very simple helper method to LoadoutAPI which allows the following syntax:

//Old:
mySkill.activationState = new SerializableEntityStateType(typeof(MySkillState));
//New:
mySkill.activationState = LoadoutAPI.StateTypeOf<MySkillState>();
//New:
using static R2API.LoadoutAPI;
mySkill.activationState = StateTypeOf<MySkillState>();

@tristanmcpherson tristanmcpherson merged commit b4b8de4 into risk-of-thunder:master Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants