-
Notifications
You must be signed in to change notification settings - Fork 328
FIX: ISXB-543 GamepadButton property drawer fix #1862
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
Conversation
…our for which aliased enum value is selected and drop-down shows alias mapping.
I am still reproducing the issue: Unity_2024-02-29_11-56-25.mp4Is it because the circle is technically the east button so It's kind of giving me the right option? But why have them split to more platform specific options then |
This is a pure usability problem, it could be done differently. What would you suggest? That we combine the items on a single line? E.g. "North / Y / Triangle" instead? Its the same value. Yes technically they are the same value. |
Before this PR it was completely random which one of the aliased values was being converted to string making it even more confusing. |
Thanks for explaining, yes combining them makes sense to me but it is not necessary to do in this PR. I've found that It also breaks the inspector and throws these errors when actually used in PlayMode:
This is all my script is doing:
And it does not reproduce in Develop Unity_2024-02-29_13-37-32.mp4 |
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.
Updating status - bug above needs fixing
…to lazily initialize array if lost in domain reload.
@Pauliusd01 The bug should be fixed via c1f4c9e |
I did not modify behavior so UX question remains: a) Do we want current behavior where one aliased enumeration type is displayed e.g. "North" with aliased enums listed as e.g. "Triangle (North)" and "Y (North)". OR Notice that this is due to they all mapping to same integer value so only different "labels / identifiers" for the same option (usages). |
@ekcoh Thanks for looking into this. In my view, the aliasing behaviour is not ideal, since it breaks the mental model of an enum of choices. My suggestion is to go with option 2 - we just collapse the items to the real underlying enum and avoid the aliasing altogether. That means the menu would have items such as:
This avoids the need for aliasing and means users have an expected behaviour with the menu. |
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.
Code looks reasonable but I haven't tested it in action.
Suggest adding QA or design for a manual verification
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.
I think this PR is out of data and needs closing.
New PR is here:
#1983 (review)
This is no longe relevant, superseded by https://github.com/Unity-Technologies/InputSystem/pull/1983/files |
Description
FIX: ISXB-543 GamepadButton property drawer now has consistent behaviour for which aliased enum value is selected and drop-down shows alias mapping. https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-543
Original contribution by @ppandi-rythmos in #1860 routed via this PR.
Changes made
Introducing a custom aliased enum property drawer and a specialised version for GamepadButton enum type.
Notes
Easiest to test by creating a script with a GamepadButton public property and check in Inspector.
Checklist
Before review:
Changed
,Fixed
,Added
sections.([case %number%](https://issuetracker.unity3d.com/issues/...))
.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.