-
Notifications
You must be signed in to change notification settings - Fork 823
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
FIXES #4070 The Pitch piemenu do not remember the last selected accidental value #4071
base: master
Are you sure you want to change the base?
Conversation
|
||
// Store the selected accidental in the block for later use. | ||
prevAccidental = selection["attr"]; | ||
block.prevAccidental = prevAccidental; |
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.
This retains the value during the session, but not between sessions. Maybe we need to think about saving/restoring this attribute with the block (much the way we do with the start block attributes).
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.
Like do you want the pitch block to save the data for last session like this @walterbender
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.
So what should I change in this pr regarding the issue @walterbender
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 you don't need to change anything in what you have already done, but in this function in activity.js, this.prepareExport
, you can see how some attributes are stored in the start
block. We'll want to do something similar with the pitch block. And then restore the state on project import (in loadNewBlocks
in blocks.js
.
But maybe all that complexity can be dealt with in a separate PR. Let me test this code as is.
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.
Okay @walterbender i ll make a new PR in regards to these changes and will resolve soon.
@walterbender yaa i see this issue will make it resolved soon |
@walterbender i m not getting that why this happen so as when you change the pitch combination after every time you opens the piemenu it works fine but when you click and dont change the attributes it dont print the accidental value |
It may be a caching problem with the artwork. In any case, I think we should try to fix it in this PR. |
Well, maybe not. I think the value is getting reset. |
@walterbender I was trying to fix it in the new pr |
Or should I create a new ticket for this issue as what you would recommend |
I think it is related to this MR, so I think it should be fixed here. |
@walterbender okay so I ll be updating this PR soon to resolve all the issues |
In the old version, the selector would be reset to the mode, so if you entered and left w/o clicking, the accidental would be reset. In your patch, it doesn't change to the mode after the first time in the selector, but it seems to reset the value anyway. |
Okay I ll make the changes accordingly |
by this commit the note name get displayed coreectly even after no selection after the piemenu is opened
@walterbender now when the user did not select the any value and simple closes the pie menu the block still displayes the name of the accidental correctly |
@walterbender you can see the changes here Screen.Recording.2024-11-24.at.12.28.04.AM.mov |
if (selectedAccidental === "♮" || selectedAccidental === "") { | ||
that.text.text = selectedNote; // Natural or no accidental | ||
} else { | ||
that.text.text = selectedNote + selectedAccidental; // Combine note and accidental |
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.
please fix the indentation
fixing issue #4070
Now the pitch piemenu remembers the last selected accidental value
custom pitch selected ;
the wheel represents the same value as selected ;