-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Make actions use a list of events #34881
Conversation
I was looking at the D1 issues and saw the other issue involving actions and decided this would be more logical to work on first.
I'd like to do this but I don't actually know what could be cleaned up or deduplicated
I'm not super certain on how to pull out the UseDelay and Speech, but I assume it would involve making them separate Action components? like making a ActionUseDelayComponent. I think I can do that. |
@keronshb has plans for a bigger action refactor, not sure how well this fits into it. |
Ah, I see. If that's the case I'll avoid working on actions beyond this PR then. Hope it goes well. |
I feel that this would cause too many conflicts on some upcoming PRs and stuff that's WIP for us to deal with that workload right now. I was trying to avoid something like this before the Wizard launch (we're close to it). This also only implements half of what I'm planning on implementing for action events. It's not going to just be a sequence of events to take place back to back, but it would be checking if the first event was cancelled and then moving onto the next one. We can either close or put on DNM and then reopen/remove the tag sometime after Wizard is merged. |
Does the wizard update come with the updates you're planning for action events? or is that going to be done separately? |
Done separately. Right now I've been managing a team of contribs & maints to focus on different Wizard PRs. After Wiz I was planning on implementing the changes in bits (Sloth's Charges PR, then cut down similar things from actions and move them into comps) leading up to a full rework. This way it has a lot less disruptions on upcoming PRs and breaks down the review into faster & easier to review bites. |
I see, well. I'll just close the PR and avoid working on things dealing with actions then. Thanks for the information. |
gee imagine if that was done already so action components didnt use inheritance... oh wait |
About the PR
Made all actions accept a list of events rather than just a single event
Why / Balance
Fixes #34599
Technical details
The conversion from
xActionEvent
toBaseEvent
was previously just done throughBaseEvent
=>Event
Since it's now
List<xActionEvent>
to List, we do the conversion by creating a new emptyList<BaseEvent>
, add eachxActionEvent
one by one, and then return the filledList<BaseEvent>
Whenever the event was submitted for performAction(), the event submitted most often was the xActionEvent instead of the BaseEvent. It was implicitly converted from xActionEvent to BaseEvent. Now that it's a list, we can instead just submit the action's BaseEvents field, which does the convertion from
List<xActionEvent>
automatically.Every yml action was updated from using a single event to a list of events. Nothing was optimized, it was just converted.
Media
Display of actions working:
2025-02-04.12-10-43.mp4
Requirements
Breaking changes
BaseActionComponents's BaseActionEvent BaseEvent field was updated to
List<BaseActionEvent> BaseEvents
, and their specific Events, such as WorldTargetActionEvent for example, were converted to also be a list, such asList<WorldTargetActionEvent> Events>
.SharedActionSystems PerformAction()'s parameter
BaseActionEvent actionEvent
was updated toList<BaseActionEvent> actionEvents
. You can typically submit the BaseEvents field whenever this is asked for.To convert from a singular Event to a
List<BaseActionEvent>
, create a newList<BaseActionEvent>()
and.Add()
it as an item.Update all yml actions from event to events, and make it a list.