Navigation Menu

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

Game Information asking to save when no changes were made #14

Closed
bobtheblueberry opened this issue Apr 7, 2012 · 3 comments
Closed

Comments

@bobtheblueberry
Copy link

Open a game like Street Race.gm6 and open the game infomation and close it. LGM acts like you've changed something.

@IsmAvatar
Copy link
Owner

This is caused by the RTF document. Due to the way RTF is designed, there are many ways to represent the same styled document. Java stores the information in a more abstract way, and then regenerates the flat document on demand. This usually comes out as a slightly different representation, with the same visual results. Unfortunately, I can't really make a visual comparison (or, at least, certainly not efficiently), so detecting real changes is quite difficult.

A better solution might be to register a change listener to the underlying document. Or better yet, an UndoManager - if there is nothing to undo, it can probably be assumed that there have been no changes.

@RobertBColton
Copy link
Collaborator

I have temporarily fixed this in 8eb131f by using a document listener as well as comparing only certain properties of the frames resources.

However I also had to reset the variable when visibility of the frame changed, so I am wondering if maybe IsmAvatar's idea of checking the undo manager, which the frame does now have, is a little more elegant.

Edit: At the current moment in time that solution is not possible because as soon as a new project is loaded the frame is reverted and starts out with at least 1 bullshit undo.

@RobertBColton
Copy link
Collaborator

After fixing the behavior of the undo manager in 5344d6a to know when to properly clear its undo history on a visibility change or revert I can say that this now properly works, as such I am closing this ticket as resolved.

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

3 participants