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

Suggestion - adding a pizza action shouldn't delete the previous action #8

Open
AdamBrezik opened this issue Oct 25, 2023 · 4 comments

Comments

@AdamBrezik
Copy link

AdamBrezik commented Oct 25, 2023

Hello,

This is a suggestion for the situation when you're adding new actions by clicking on an action right mouse to split it in twine. Currently this deletes the item, creating 2 empty items. My suggestion is that first of the items retains the parameters of the item that is currently being deleted.

Kind regards,

Aidee

@JumperOnJava
Copy link
Owner

I don't really remember how this part is implemented so it may be eary or hard.
Thanks for the suggestion btw, i will try to make it as soon as possible

@ginsm
Copy link

ginsm commented Aug 2, 2024

This would be very convenient

@AdamBrezik
Copy link
Author

Well, I couldn't even find the part. To be honest, I'd love your code to have more comments.

@ginsm
Copy link

ginsm commented Aug 2, 2024

The split happens here EntirePizzaConfiguratorScreen#122. I think I managed to get it to work, where the previous action remains, with this code:

public void splitSlice(ConfigurablePizzaSlice clickedSlice) {
    CircleSlice circleSlice = clickedSlice.getSlice();

    editSlices.add(new RunnableSlice("Empty action", new CircleSlice(circleSlice.getMidAngle(), circleSlice.endAngle),clickedSlice.getManager()));

    // Updates the clickedSlice's CircleSlice in place
    ((RunnableSlice) clickedSlice).setSlice(
        new CircleSlice(circleSlice.startAngle, circleSlice.getMidAngle())
    );

    rebuildSlices();
}

It seems to be working without issue, anyway:
https://youtu.be/R-nJYxt1qXU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants