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

tweak(mono-rt2): change script initialization method #2854

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DaniGP17
Copy link
Contributor

Goal of this PR

Change the way scripts are initialized to prevent a BaseClass with the EnableOnLoad(false) attribute from loading ticks, events and nui callbacks.

How is this PR achieving the goal

First of all I have modified the Initialize function, now when I initialize the script it will call the Enable function again to load the ticks, events and nui callbacks.
Finally, I have eliminated the functions that recorded ticks, callbacks and events when they were added.

This PR applies to the following area(s)

ScRT: C#

Successfully tested on

Game builds: .

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

fixes #2476

@github-actions github-actions bot added ScRT: C# Issues/PRs related to either C# scripting runtimes invalid Requires changes before it's considered valid and can be (re)triaged labels Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged ScRT: C# Issues/PRs related to either C# scripting runtimes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BaseClass with EnableOnLoad(false) still loads ticks, events, etc. by registering them without the attributes
1 participant