Add SectionContext #6058
Labels
2.8
Targeting a 2.8.X version release
core task
Tasks that may be handled only by the core developer team.
enhancement
Feature request, an issue about something that could be improved, or a PR improving something.
priority: low
Issues that are not harmful to the experience but are related to useful changes or additions.
Suggestion
Add SomeNameSectionContext so that syntaxes can use
TriggerSection#getSectionContext(Example.class)
similar to StructureData but for SectionsWhy?
This way addons and Skript's own syntaxes don't need to register the trigger as it's own event context. Which when using loadCode with an event. The
ParserInstance#getCurrentSection
gets cleared because of delayed calling. A trigger can then load later, and when it loads later, the getCurrentSection will not reflect properly. So we clear it when the loadCode is set.This solution makes it so that you won't need to change the event context, but rather just collect the data from the current section so that the section itself can then use that data after it calls the trigger.
Other
This is used for custom sections with custom expressions like in my EffSecPlaceStructure at #5222
Currently SectionContext is a class that is used on Structures, so some other name would be needed or maybe that itself needs a rename.
Agreement
The text was updated successfully, but these errors were encountered: