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

Level Designer should be able to undo changes in FragEd #6

Open
codeimpossible opened this issue Jul 15, 2013 · 6 comments
Open

Level Designer should be able to undo changes in FragEd #6

codeimpossible opened this issue Jul 15, 2013 · 6 comments

Comments

@codeimpossible
Copy link
Member

A level designer needs to be able to undo changes made in FragEd.

@codeimpossible
Copy link
Member Author

Some links on undo/redo in c# winforms:

http://stackoverflow.com/questions/597792/c-how-to-implement-good-and-efficient-undo-redo-functionality-for-a-textbox
http://msdn.microsoft.com/en-us/library/system.componentmodel.ieditableobject.aspx
http://www.codeproject.com/Articles/33384/Multilevel-Undo-and-Redo-Implementation-in-C-Part
http://pradeep1210.wordpress.com/2011/04/09/add-undoredo-or-backforward-functionality-to-your-application/

I don't want to spend a lot of time with the codebase to get this feature in. This is a must-have for v1 so if we have to compromise on the cleanliness of our codebase to get this done then we should do that.

@codeimpossible
Copy link
Member Author

I definitely wish I had attempted a different development pattern for our FragEd code. It probably would have made this a lot easier to do.

@codeimpossible
Copy link
Member Author

Did some research on Undo/Redo support into FragEd. I'm thinking that the easiest way will be to add a class UndoStep:

public class UndoStep {
    public object PreviousValue { get; set; }
    public object NewValue { get; set; }
    public string Type { get; set; }
}

and create a List<UndoStep> called UndoHistory in each Level Editor Form. When changes are made via the form new UndoSteps will be added to the UndoHistory. When a user triggers an Undo we'll invoke a handler, determined by the Type property, with the two arguments PreviousValue and NewValue. The handler will be responsible for performing the actual Undo/Redo.

@ghost ghost assigned codeimpossible Nov 6, 2013
@codeimpossible
Copy link
Member Author

When a user presses [ctrl] + [z], what happens next?

@codeimpossible
Copy link
Member Author

going to move this out of v1 milestone. This will take a long time and shouldn't block our first release.

@jbubriski
Copy link
Contributor

What are the pain points that are going to be caused by not having an undo
feature? Maybe we can handle those few scenarios with different
behaviors... Ex. if the user deletes an object from the level, maybe we
just store it's data in a "deleted entities" collection so they can grab it
back if they need it. Just a thought.

On Sun, Nov 17, 2013 at 6:22 PM, Jared Barboza [email protected]:

going to move this out of v1 milestone. This will take a long time and
shouldn't block our first release.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-28667430
.

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

No branches or pull requests

2 participants