Hmm.. Interesting idea. If the commands for setting of the bar included an extension so you could do:
Info(BSTR Message, BOOL Global);
but mushclient would then have to keep track of the state and it presents a major problem if one of the plugins uses the default global bar, but you are trying to use the local one. Which does it update or show? What if you intended to have it use both for some reason?
I would still prefer to do something like:
test = World.HadFocus
if test then
Do stuff to set infobar.
end if
since while it isn't fool proof, since it makes it not work globally, but that could be worked around as well in theory, except that I just noticed there is no way to 'retirieve' the bars contents either.. :p If there where then global features could have been nested in [] or something, so that that part of the line could be kept/changed when the worlds focus was shifted, while allowing the world to set all the rest 'if' it has the focus.
As things are.. We seem to be in trouble, since the bar seems to be like a post-it note, with us using an ink pen. You can stuff everything you want onto it, but at some point the only option is to throw out the current note and start on a new one. This is far less useful than I first thought Nick..., since it makes global use impossible, even within a single world, if 'any' plugin or script clears it to place new things there. The only other option is 'all' global and that won't work either, because then the contents are never cleared and every world keeps dumping stuff on there in the assumption it is the only one using it. How was this supposed to work right again? lol
Possibility.. What if you had world.SetGlobalInfo (BSTR Text) and BSTR = world.GetGlobalInfo options. This would 'always' appear as the last thing on the infobar, would be recoverable to make changes to it and while you couldn't prevent someone from abusing the feature, a smart person could simply place 1-2 characters to ID a world and some sort of color indication of HP or whatever the 'global' info is that it is tracking. You would still need a way to make sure the main bar isn't being altered when the world doesn't have focus, but it would be easier to do.
Of course that brings up how to return the style info, since we still want color and fonts in the global bit.. Maybe returning HTML is an option. The set and get routines could translate it to and from the bar data a lot easier than a regular user can fiddle with a mess of style change data from a seperate command imho. Grrrr.. This is a nightmare trying to find a way to actually use this thing or 'really' improve it beyond testing to the world state in script and plugins. lol
Hmm. Wait.. possible better option.. Make the global stuff an array of sorts (that always shows up as the last thing one the bar), then you set the color and text like:
GlobalInfoColour 0,"Blue","Black","He:"
GlobalInfoColour 0,"Red","Black","*"
Then also provide the options to:
data = GetGlobalInfo(0)
then you could have 10 or so such slots, and check to find an unused one when your world/plugin first tries to set some global info. This is probably the only way short of completely seperate local and global bars that would work and since the global ones really can't be used globally anyway the way they are right now... |