Comment 1 for bug 1633796

Revision history for this message
Stephen Lyons (slysven) wrote :

It would not be too hard to put a sysMapPreImport event before the call to TMap::mapClear() in TMap::readXmlMapFile() which would fire for an Xml map file import from:
1 a lua loadMap(...)
2 the profile preferences dialog's "Load Map" for an Xml file
3 the successful result of clicking the "Download" map button AND a file being received and stored successfully

A sysMapPostImport event would be a bit harder to position, I think it could go at the end of TConsole::importMap which would catch successful outcomes of 1 and 2 above but case 3 would already be covered by the sysMapDownloadEvent - so to retain existing functionality we have to leave the existing one there and put this one after it or NOT do so and advise a script writer to write a function to handle both events the same if they need coverage of all cases where an Xml is inserted into their running systems.

Should we also provide a related post load event at the end of TMap::audit() for full Mudlet Map format file reading - Oh! That will also be called for Xml file imports so that could be another place for a post load Xml file event. I'll need to look further to see where a pre Mudlet Map format load event could go as THAT happens in multiple places and I am not sure everything BUT the map would be loaded during profile start up cases...