InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

[ISXB-544] Fix for 1.6.X: Wrong value is chosen when selecting GamepadButton in a dropdown menu

Open ppandi-rythmos opened this issue 1 year ago • 3 comments

Description

[Case ISXB-544] (https://jira.unity3d.com/browse/ISXB-544)

The GamepadButton enum has aliased enum members, and when detected by Unity as enum exposed as field and uses default property drawer, it causes confusing behaviour in the UI. This PR tries to introduce a generic property drawers for aliased types, such that the UI now has aliased entries appended with names of the aliasing member in paranthesis (). This will be intuitive to the user and they would be aware that the selected value may be remapped on assignment

Changes made

A new property drawer for aliased enums has been introduced. It is made generic, so as to be extendable by any aliased enums in the Input System Package,

Checklist

Before review:

  • [ ] Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • [ ] Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • [ ] Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • [ ] Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

ppandi-rythmos avatar Feb 27 '24 07:02 ppandi-rythmos

@ekcoh Kindly have a look at this PR

ppandi-rythmos avatar Feb 27 '24 07:02 ppandi-rythmos

Thanks for the contribution @ppandi-rythmos, I have rerouted your changes via https://github.com/Unity-Technologies/InputSystem/pull/1862 PR with some small modifications.

ekcoh avatar Feb 29 '24 09:02 ekcoh

I will close this PR when the other one lands.

ekcoh avatar Feb 29 '24 09:02 ekcoh