Skip to content
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

Del key and add commands #492

Merged
merged 5 commits into from
Jun 15, 2023
Merged

Del key and add commands #492

merged 5 commits into from
Jun 15, 2023

Conversation

moreApi
Copy link
Member

@moreApi moreApi commented Jun 15, 2023

Controls: delete key to delete nodes

closes #473

AddCone,AddCylinder,MenuWeights: Add Cylinder and Cone menu entries

closes #487

@moreApi
Copy link
Member Author

moreApi commented Jun 15, 2023

The cylinder looks a bit shitty because its missing lids. scenerygraphics/scenery#556

@moreApi moreApi closed this Jun 15, 2023
@moreApi moreApi reopened this Jun 15, 2023
@moreApi moreApi marked this pull request as draft June 15, 2023 10:51
@moreApi moreApi marked this pull request as ready for review June 15, 2023 12:55
Copy link
Member

@kephale kephale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I leave the choice to @moreApi, but I favor adding a warning before object deletion (at least for using the delete key).

@@ -185,6 +184,9 @@ open class Controls(val sciview: SciView) {
h.addKeyBinding("node: move selected one closer or further away", "ctrl scroll")
h.addBehaviour("node: rotate selected one", NodeRotateControl(sciview))
h.addKeyBinding("node: rotate selected one", "ctrl shift button1")
h.addBehaviour("node: delete selected one", ClickBehaviour { _, _ -> sciview.deleteActiveNode() })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to warn the user? I think Blender throws up a dialog before deletion. This could be a call to the DeleteObject command and we could have that command contain the dialog warning?

@kephale
Copy link
Member

kephale commented Jun 15, 2023

FWIW, I would also be fine with merging this and creating an issue to track the need for deletion warning dialogs.

@moreApi
Copy link
Member Author

moreApi commented Jun 15, 2023

I would prefer an undo option instead but that probatly requires it own hackerton^^
A warning could be quite annoing if one wants to delete many things. But the delete key also only works if the focus is on the scenery frame that is annoying anyway.

@moreApi
Copy link
Member Author

moreApi commented Jun 15, 2023

Accidentally deleting the node you fiddled with the last hour would be the most annoing though... Therefore I vote for havig a warning.

@moreApi
Copy link
Member Author

moreApi commented Jun 15, 2023

Do you know by heart how to display such a warning? I am not familiar with that.

@moreApi
Copy link
Member Author

moreApi commented Jun 15, 2023

Also I did not use the delete command in the key binding. Maybe that needs also to be fixed.

@kephale
Copy link
Member

kephale commented Jun 15, 2023

Maybe try JOptionPane.showOptionDialog

@kephale
Copy link
Member

kephale commented Jun 15, 2023

IMHO it is fine to not use the DeleteObject command as well, but then the dialog could be part of deleteNode toggled by a keyword argument.

@moreApi
Copy link
Member Author

moreApi commented Jun 15, 2023

ok so now the user has to confirm a delete if it is triggerd by a key press. And the button descriptions would make my human interaction professor proud.

@kephale if you are also happy you are free to merge.

@kephale kephale merged commit 63bdc18 into master Jun 15, 2023
3 checks passed
@kephale kephale deleted the delKeyAndAddCommands branch June 15, 2023 15:19
@skalarproduktraum skalarproduktraum added dd-hackathon-2023 A result of the 2023 Dresden hackathon enhancement labels Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dd-hackathon-2023 A result of the 2023 Dresden hackathon enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Commands for addCylinder and addCone Delete key should delete selected object
3 participants