So here's my back story...
I've decided that I want to make a dynamic z-ordering system for a bunch of plugins that all create miniwindows so that players can raise any miniwindow to the top of all other miniwindows (or at least the ones that subscribe to this system). In order to do this properly, I (unless I can figure out a better system) need to have a master table somewhere that keeps track of which (of 100 possible) positions are currently being used so that new plugins that get loaded that want to be in a position that is currently in use can be put into a free spot as appropriate.
But plugins can't set global world variables.
So I created a new plugin that has as its primary purpose in life, aside from containing supporting code which could have gone into a .lua file, the storage of this table. And rather than calling .lua functions directly from all the miniwindow plugins, I use CallPlugin. Ok, so far so good.
But now I have a strict dependency and I need to make sure that this monitor plugin is always loaded first, before any other plugin tries to register with it, for obvious reasons. So as a precaution I throw in:
And that works too. Except that if a player ever goes to the Plugins... dialog and for some bonheaded-user reason reloads that plugin, when the world file saves it will have this extra bit in it that says
And THAT really messes things up, because that line will fail the next time the world is loaded, because the plugins before it have already loaded the plugin that it is trying to load. And for some reason that's a horrible catastrophe of world-ending proportions according to MUSHclient.
So for this convoluted reason, I'd like to see a possibility for flagging plugins as temporary (i.e. don't save to the world file ever) and/or make MUSHclient not choke on itself when trying to load plugins from the world file if they are already loaded.
Or let plugins set temporary global variables. Actually I'd really like that as well. I'm not a fan of brick walls in the code that I'm trying to interface with.
I've decided that I want to make a dynamic z-ordering system for a bunch of plugins that all create miniwindows so that players can raise any miniwindow to the top of all other miniwindows (or at least the ones that subscribe to this system). In order to do this properly, I (unless I can figure out a better system) need to have a master table somewhere that keeps track of which (of 100 possible) positions are currently being used so that new plugins that get loaded that want to be in a position that is currently in use can be put into a free spot as appropriate.
But plugins can't set global world variables.
So I created a new plugin that has as its primary purpose in life, aside from containing supporting code which could have gone into a .lua file, the storage of this table. And rather than calling .lua functions directly from all the miniwindow plugins, I use CallPlugin. Ok, so far so good.
But now I have a strict dependency and I need to make sure that this monitor plugin is always loaded first, before any other plugin tries to register with it, for obvious reasons. So as a precaution I throw in:
if not IsPluginInstalled ("462b665ecb569efbf261422f") then
LoadPlugin(GetPluginInfo(GetPluginID(),20).."aard_miniwindow_z_order_monitor.xml")
end
And that works too. Except that if a player ever goes to the Plugins... dialog and for some bonheaded-user reason reloads that plugin, when the world file saves it will have this extra bit in it that says
<include name="aard_miniwindow_z_order_monitor.xml" plugin="y" />
And THAT really messes things up, because that line will fail the next time the world is loaded, because the plugins before it have already loaded the plugin that it is trying to load. And for some reason that's a horrible catastrophe of world-ending proportions according to MUSHclient.
So for this convoluted reason, I'd like to see a possibility for flagging plugins as temporary (i.e. don't save to the world file ever) and/or make MUSHclient not choke on itself when trying to load plugins from the world file if they are already loaded.
Or let plugins set temporary global variables. Actually I'd really like that as well. I'm not a fan of brick walls in the code that I'm trying to interface with.