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

Add map load pre- and post- events #705

Open
vadi2 opened this issue Mar 31, 2017 · 2 comments
Open

Add map load pre- and post- events #705

vadi2 opened this issue Mar 31, 2017 · 2 comments
Labels

Comments

@vadi2
Copy link
Member

vadi2 commented Mar 31, 2017

Since all user-modified content is lost when an MMP map is downloaded, it would be a good idea to add events to before the map load event and after the map load event that allows users to make scripts and keep whatever information they'd like from a map update.

Launchpad Details: #LP1633796 Vadim Peretokin - 2016-10-16 01:26:44 +0000

@vadi2 vadi2 added the wishlist label Mar 31, 2017
@vadi2
Copy link
Member Author

vadi2 commented Mar 31, 2017

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...

Launchpad Details: #LPC Stephen Lyons - 2016-10-16 03:23:02 +0000

@vadi2
Copy link
Member Author

vadi2 commented Mar 31, 2017

How about instead of having an xml map pre-import event, we have a generic
one somewhere at the start of loadMap() that also says the location and/or
filename of the map it's loading from? Then the user can figure out for
themselves what kind of a map is getting loaded, and act accordingly.

On Sun, Oct 16, 2016 at 1:35 PM Stephen Lyons
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...

--
You received this bug notification because you are a member of Mudlet
Makers, which is subscribed to Mudlet.
https://bugs.launchpad.net/bugs/1633796

Title:
Add map load pre- and post- events

Status in Mudlet:
New

Bug description:
Since all user-modified content is lost when an MMP map is downloaded,
it would be a good idea to add events to before the map load event and
after the map load event that allows users to make scripts and keep
whatever information they'd like from a map update.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mudlet/+bug/1633796/+subscriptions


Mailing list: https://launchpad.net/~mudlet-makers
Post to :
Unsubscribe : https://launchpad.net/~mudlet-makers
More help : https://help.launchpad.net/ListHelp

Launchpad Details: #LPC Vadim Peretokin - 2016-10-16 03:39:49 +0000

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

No branches or pull requests

1 participant