Author Topic: [done] Don't prompt to save map on closing the editor if no changes were made  (Read 2546 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
When closing the map editor, it prompts to save the file, which is great. However, it also prompts if you have no changed the default map in any way. This is akin to a text editor prompting you to save when you haven't typed any text (and most modern text editors will not prompt for an empty file).

The method of detecting if the file has been changed varies. One method would be to compare the file to an empty map. If it's a match, the map cannot have been edited. Another method would be to set a flag the moment the user makes a change to the map. The latter would be faster, but if the user undos their change, the map is still recognized as changed, so the former method would be more accurate (if you type in a text editor, then remove the text, it won't prompt you to save, since saving an empty file is rarely desirable).
« Last Edit: 14 April 2014, 22:49:48 by tomreyn »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
all true but in my opninion not worth the effort  :-/
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Not sure which map editor you are trying but i think this was already fixed in svn. Did you try the beta map editor? When i load the editor i can close without any prompt.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
He was talking about making a change, then revert it and then try to save.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Baŝto

  • Summoner
  • **
  • Posts: 59
    • View Profile
    • find me on diaspora

 

anything