[Feature]: One click/command addon loading
Feature Request
I am writing an addon for maptool and i commonly do the steps, end editing -> call make to zip my addon -> switch to maptool -> go to file menu -> click on the addon libraries menu -> click on my addon -> click remove -> click on add addon -> navigate through 5 directories -> double click my addon -> finally i can test.
The Solution you'd like
I would like to have my addon immediately updated on a single command/interaction after proper setup. so that the flow is. end editing -> single short command/click/something similarly simple -> testing there are some ways to accomplish this, one could be to have maptool listen for commands so that i can just add a command to load my addon to my makefile. another would be to expand the macro api so that a macro that calls make and them loads the new version of my library is possible so using the new version of the addon is as simple as clicking a macro. Or add a option for maptool to watch a mtlib file so that whenever it changes it updates my addon, in this case i would only need to call make. Any one of the three options presented would be enough.
Alternatives that you've considered.
Continue living with a fixable annoyance.
Additional Context
i know this is minor but I am willing to fix this myself the only problem is that i am unfamiliar with the addon part of the code base. and i do not know which of the three options would be easiest. so any direction and tips would be appreciated.
Isn't this what #3453 does? unless mtlib != addon
I have a script that will insert a .mtlib into a .cmpgn file, so my sequence is make and then reload the campaign (alt->enter->up->up->right->enter). You can find it in my maptool-utils repo here on GH.
I don't think auto reimporting an addon using inotify to detect it has changed is a good idea. It's great while developing, but you might not be able to or want to update an addon used in a real game automatically.
Nor do I think we want to have maptool listen for RPC stuff, it currently doesn't, and that becomes a whole platform-specific can of work that I don't think is worth doing.
A macro to load an addon might be possible. The addon itself could be loaded in any of the usual ways (most probably by enabling the REST api and loading it, maybe base64 encoded). The issue is I'm not sure it's enough faster than the insert-into-camapgin and reload method to be worth the time and effort to do.
Isn't this what #3453 does? unless mtlib != addon
That may be sufficient for dark-ether. The problem is it assumes you have a nice way to drag-and-drop files, which means using the "rat". Given MT's overall design, it might be the best that can be done with a reasonable amount of work though.
One could probably create a special client to "inject" a changed addon to a running server via protobuf rpc after authticating via handshake.
Assuming addon injection can be done by any GM, and not just the host (and obviously, can be done with the server running), this could work. Again, I don't know if it's worth the dev time to do it, but it might be of use as an example of what can be done with protobuf.