[MIRROR] Cleans up the SS13_base lua file and adds a new lua file for easily handling multiple signals on different objects. #2822
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mirrored on Nova: NovaSector/NovaSector#1905
Original PR: tgstation/tgstation#82458
About The Pull Request
Cleaned up the SS13.register_signal and SS13.unregister_signal, removing the weird list shifting.
Also adds a new lua file that can be included for the use of registering different signals on various datums and being able to clear them all in 1 function.
Removed the make_easy_clear_function option when registering a signal via lua because I don't think it's used by anyone and it lacks any sort of versatility. Users can just create their own function for clearing signals from a datum.
Also updates the documentation for HARDDELETES.md as COMSIG_PARENT_QDELETING was renamed to COMSIG_QDELETING
Why It's Good For The Game
New handler file makes registering signals in batches a lot easier if you want to clear them in one go without clearing unrelated callbacks on the same datum. The list shifting in SS13.register_signal had pretty significant performance problems, so removing that will make registering and unregistering signals faster.
Changelog
🆑 Watermelon914
admin: LUA - Adds a new library called handler_group. Include it in your files by doing require('handler_group')
/:cl: