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
Patch unit events #472
Merged
Merged
Patch unit events #472
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A handler is now obligatory and must be a function
If the event was previously registered as a unit event and then as unitless
Rainrider
force-pushed
the
patch-unit-events
branch
from
December 18, 2018 18:19
b1aec37
to
76f0b5f
Compare
Rainrider
force-pushed
the
patch-unit-events
branch
from
December 28, 2018 18:19
cc89667
to
7f85072
Compare
NOTE: the unit check is needed because of the possibility for mixed event registration - 💄 - fixed early exit for pvpindicator when the event is HONOR_LEVEL_UPDATE - resurrect and summon indicators now use the event unit
Rainrider
force-pushed
the
patch-unit-events
branch
from
December 29, 2018 12:35
e7ebe39
to
0738959
Compare
UpdateUnits registers the event for the right units
Rainrider
force-pushed
the
patch-unit-events
branch
from
December 30, 2018 23:00
e6f04af
to
47545f2
Compare
Rainrider
force-pushed
the
patch-unit-events
branch
from
December 30, 2018 23:21
47545f2
to
204ec0c
Compare
Blizzard API documentation should not be part of code comments I think
I think this is working as intended now. Please test and comment. To sum it up:
|
Covers the case where layouts might be calling RegisterEvent after real units have been set
ls-
approved these changes
Jan 3, 2019
p3lim
reviewed
Jan 3, 2019
local isOK, _ = pcall(validator.RegisterUnitEvent, validator, 'UNIT_HEALTH', unit) | ||
if isOK then | ||
_, unit = validator:IsEventRegistered('UNIT_HEALTH') | ||
if unit then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing paranteses in this and the above conditional.
doadin
pushed a commit
to doadin/Elvui
that referenced
this pull request
Jan 7, 2019
doadin
pushed a commit
to doadin/Elvui
that referenced
this pull request
Jan 7, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Basically, deciding silently for the layout which event is unitless is bad.
Events like PARTY_MEMBER_ENABLE, INCOMING_RESURRECT_CHANGED, PLAYER_SPECIALIZATION_CHANGED and others are all unit events but were always wrongly considered unitless.
Side notes:
The following code from a layout:
will produce the following error:
This is because PLAYER_TOTEM_UPDATE is unitless and cannot be registered as a unit event. Blame Blizz about the wording of the error message.
This is a breaking change. Layouts will have to mark unitless events by using the 4th param of RegisterEvent.
The possibility of mixed registration may be a thing. All event handlers should check if they got the expected unit.