-
Notifications
You must be signed in to change notification settings - Fork 22
Add "Change Side" to Notes -> Convert #209
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
base: beta
Are you sure you want to change the base?
Conversation
I think there's probably a myriad of things wrong with this so I would love feedback, mostly on how default shortcuts are made and what not, if the placement is correct, and if this code quality is acceptable. Thank you in advance! EDIT: Also, theres a part in this where it deletes the notes of the selection, then it adds in the new notes. This creates two actions which means two undos! I don't know how to merge these two actions together because the clear flag on modify seems to leave the last note alone for some reason! |
Yeah this is hardcoded to be dance-doubles and nothing else. Also, you're pointing at the release instead of the beta branch, which is the development branch here. Other than that, it looks fine from a first glance. |
279f3b2
to
bde6c12
Compare
Hi! Thanks for the feedback, I went ahead and changed the target branch to the beta branch (my bad, I didn't know that lol). Commits should all be cleaned up for it now. My implementation also checks for the number of columns, not the style name (though at first it did, not sure if I pushed that here though.) |
7af7a74
to
79875e0
Compare
Had to fix some formatting stuff inside of Shortcuts, just ran clang-format on it. Also fixed the double undo bug I was talking about, but now it's triggering the warning message for when a note is added on the same row. Hmm |
My problem is that you're not really checking for any other styles identified as double, and instead is just focused on dance-double exclusively. In other words, Hopefully you understand what I am trying to say, I may have not been too clear on the first comment, that's my fault. |
Yeah I think I misunderstood what you were trying to say, but I think I get it now: HudNote("Switch side is only available in a double style."); Is explicitly stating that it needs to be a double style, in which it does not check if it is a double style, but just if it has 8 columns. Maybe it'd be better if this somehow detected what a 'side' is programmatically? Ie, maybe split down the middle; and have it check like that? Like if you have 6 columns, 3 per side. And anything below 4 wouldn't count as a style with a "side." Though numbers like 5, I just don't know. So maybe it should be limited to just 8 columns, or maybe even numbers like 8. |
I'll just give you an example of what ideally it should do:
Pretty much, you're just using the variables that style already has to determine how it should swap stuff. You might also get the idea to check the amount of columns can cleanly divide by two, but this is what I am trying to get across. |
Yeah that's a good idea, will do that. |
Will now use half point for double styles, like 8, 16, 32, etc
return; | ||
} | ||
|
||
if (!style.id.endsWith("double")) { |
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.
if (!style.id.endsWith("double")) { | |
if (!style->id.ends_with("double")) { |
The string functions have changed to use std::string instead of Vortex::String
} | ||
|
||
NoteEdit edit; | ||
gSelection->getSelectedNotes(edit.add); |
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 section doesn't work because the note array of the selection shares the same pointer.
You'll need to build one of the lists by hand.
|
||
NoteEdit edit; | ||
gSelection->getSelectedNotes(edit.add); | ||
edit.rem = edit.add; |
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.
edit.rem = edit.add; |
n.col -= halfpoint; | ||
} | ||
} | ||
|
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.
The notes in edit.add need to be in the correct order to avoid an error message.
Just copy the code in mirrorNotes() that sorts them to here.
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 code also has some clang format violations.
If you're using Visual Studio, you can reformat the offending files with Ctrl+K, Ctrl+D.
Otherwise, looks good! Sorry for merging into your branch, I had screwed up the formatting in Shortcuts.cpp and didn't want to make you handle the merge conflict.
You should be able to run the CI now. Let me know if it's not working, because I can run it again.
Addresses #208
Allows for the switching of sides in a double chart (8 columns)