-
Notifications
You must be signed in to change notification settings - Fork 317
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
FIX: Scheme Name in Control Scheme editor menu that gets reset when editing devices (ISXB-763) #1941
FIX: Scheme Name in Control Scheme editor menu that gets reset when editing devices (ISXB-763) #1941
Conversation
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.
Basically this fix looks good to me, good work, but I had some minor tweaks I think could be adressed. Minor though so approving already now but let you consider if it makes sense to update based on comments.
Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ControlSchemesView.cs
Outdated
Show resolved
Hide resolved
((TextField)evt.currentTarget).value); | ||
// If the name is the same as the current name, don't change it | ||
var newName = ((TextField)evt.currentTarget).value.Trim(); | ||
if (string.IsNullOrEmpty(newName) || String.Compare(newName, state.selectedControlScheme.name) == 0) |
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.
Minor: I think you can remove the string.IsNullOrEmpty since it cannot be null from Trim() right?
In addition String.Compare will be 0 if newName is empty.
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.
yes it can't be null but IsEmpty doesn't exist.
String.Compare() will not be 0 if the string is empty, except if both are empty
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.
LGTM, checked changing scheme names when making a new one/editing and adding new devices at various times.
…cheme-name-gets-reset-when-editing # Conflicts: # Packages/com.unity.inputsystem/CHANGELOG.md
Description
Fixed Scheme Name in Control Scheme editor menu that gets reset when editing devices
Changes made
In ControlSchemesView
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
.