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

StoryGoal actions receive the name of the unlocked goal #476

Merged

Conversation

tinyhoot
Copy link
Contributor

@tinyhoot tinyhoot commented Sep 27, 2023

Changes made in this pull request

Breaking changes

  • None

@Metious Metious linked an issue Sep 27, 2023 that may be closed by this pull request
Copy link
Member

@Metious Metious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in the issue, revert the breaking changes to the current methods, and just add two other overloads that only takes an Action<string>.

@tinyhoot
Copy link
Contributor Author

Only an Action<string>? Without a key, any such method would receive the custom events of all other mods too.

Copy link
Member

@MrPurple6411 MrPurple6411 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think these are the changes @Metious is meaning.

Hopefully he will clarify if I am off base.

Nautilus/MonoBehaviours/CustomStoryGoalManager.cs Outdated Show resolved Hide resolved
Nautilus/MonoBehaviours/CustomStoryGoalManager.cs Outdated Show resolved Hide resolved
Nautilus/MonoBehaviours/CustomStoryGoalManager.cs Outdated Show resolved Hide resolved
Nautilus/Handlers/StoryGoalHandler.cs Outdated Show resolved Hide resolved
@Metious
Copy link
Member

Metious commented Sep 28, 2023

Only an Action<string>? Without a key, any such method would receive the custom events of all other mods too.

Isn't that the point? Perhaps I'm simply not familiar with your use-case, but I think it's useless to assign a key while also taking the key as a parameter in the delegate.

If the method only takes an Action<string>, you should be able to handle multiple goals in the same method. This is also the closest implementation to the vanilla custom goals implementation, so it's fine for those delegates to be callbacked on every goal.

It's a feature, not a bug :)

@tinyhoot
Copy link
Contributor Author

It's a feature, not a bug :)

That's a good point! I've incorporated both of your suggested changes into this. The documentation for the method which only takes an Action also no longer claims that a parameter will be passed.

Please let me know if there's anything else I can adjust.

@MrPurple6411
Copy link
Member

hrmmm @Metious Do we want the keyhandlers to run before or after the regular ones.

Copy link
Member

@Metious Metious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm.

@Metious Metious merged commit 9f27720 into SubnauticaModding:master Sep 28, 2023
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StoryGoal Custom Events do not receive name of triggering goal
3 participants