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

Room Editor Reverting #177

Closed
RobertBColton opened this Issue Dec 5, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@RobertBColton
Collaborator

RobertBColton commented Dec 5, 2014

This is not a regression and is an old issue existing since lgm16b4, I've gone back and tested.
http://enigma-dev.org/docs/Wiki/LateralGM:_Revisions

After loading a project and opening or creating a new room and immediately hitting the exit changes are always seen even though none were actually made. I used the following code to find the keys.

        for (Entry<P,Object> entry : res.properties.entrySet()) {
            if (!entry.getValue().equals(resOriginal.get(entry.getKey()))) {
            System.out.println(entry.getKey());
            }
        }

And the results were:
EDITOR_WIDTH
EDITOR_HEIGHT

  1. A solution to this is to override resourceChanged in the RoomFrame and check for all keys except those two, similar to what I did in GameInformationFrame.
    https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/subframes/GameInformationFrame.java#L918

  2. A more permanent solution is to add a map that is checked by the original resourceChanged method so resources can flag their own keys as not recognizable for changes and just put it right in the static key constructor map. In other words to just have it all automated so they don't have to override anything or duplicate any code.

@IsmAvatar What do you think about these solutions?

@IsmAvatar

This comment has been minimized.

Show comment
Hide comment
@IsmAvatar

IsmAvatar Dec 5, 2014

Owner

I do seem to recall this bug. I'm surprised I never opened a ticket about it.
I would not mind silent data loss of the editor size if they click the X button (I think that's option 1 - it's what you were originally proposing before you edited it). However I am curious why the editor is changing size.
Option 2 could be fun, if I understand you correctly. Rather than having a whitelist for resourceChanged, have a blacklist. However there may be some dynamic fields, renamed fields, or values that combine into one field that might make that difficult. It's also a lot of work for minimal gain at this point. So I'd probably just recommend avoiding option 2.

Owner

IsmAvatar commented Dec 5, 2014

I do seem to recall this bug. I'm surprised I never opened a ticket about it.
I would not mind silent data loss of the editor size if they click the X button (I think that's option 1 - it's what you were originally proposing before you edited it). However I am curious why the editor is changing size.
Option 2 could be fun, if I understand you correctly. Rather than having a whitelist for resourceChanged, have a blacklist. However there may be some dynamic fields, renamed fields, or values that combine into one field that might make that difficult. It's also a lot of work for minimal gain at this point. So I'd probably just recommend avoiding option 2.

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Dec 5, 2014

Collaborator

@IsmAvatar Cool beans I'll go with option one for now like Game Info and close this ticket when I release the next version with the patch.

Collaborator

RobertBColton commented Dec 5, 2014

@IsmAvatar Cool beans I'll go with option one for now like Game Info and close this ticket when I release the next version with the patch.

@IsmAvatar

This comment has been minimized.

Show comment
Hide comment
@IsmAvatar

IsmAvatar Dec 5, 2014

Owner

Leave this ticket open though to remind you to investigate why the Room Editor is resizing.

Owner

IsmAvatar commented Dec 5, 2014

Leave this ticket open though to remind you to investigate why the Room Editor is resizing.

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Nov 25, 2015

Collaborator

This has been finally addressed in the latest release. The issue was caused by me trying to increase the default room size in LGM 1.8.2, the first LGM release made by me. I have reverted those changes and correctly set the defaults in the room editor default property map.

The solution stated above by me could still be added if we want to add the preference to disable saving the room editor settings. GMS also has a preference for disabling this. I can understand because it does seem confusing at first when you can't think of whether you actually changed something.

Collaborator

RobertBColton commented Nov 25, 2015

This has been finally addressed in the latest release. The issue was caused by me trying to increase the default room size in LGM 1.8.2, the first LGM release made by me. I have reverted those changes and correctly set the defaults in the room editor default property map.

The solution stated above by me could still be added if we want to add the preference to disable saving the room editor settings. GMS also has a preference for disabling this. I can understand because it does seem confusing at first when you can't think of whether you actually changed something.

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