Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ NOT Sharing the Info Bar between worlds.
NOT Sharing the Info Bar between worlds.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Thu 21 Nov 2002 05:33 PM (UTC) |
Message
| I'm thinking about programming something for the Info Bar... but I don't want to share it among worlds.
I suppose I could use the script configuration to call a subroutine for 'World Get Focus' and 'World Lose Focus', but I expect to be doing this in a plugin, and I don't think there is an equivelant for plugins... or is there? |
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | Top |
|
Posted by
| Shadowfyr
USA (1,791 posts) Bio
|
Date
| Reply #1 on Thu 21 Nov 2002 06:44 PM (UTC) |
Message
| I have to agree here.. While being able to handle Focus events is nice, it would be in some cases more useful to check the current 'state' of the world in a script, instead of relying on the events. A world.hasfocus command would be nice to have. Additionally, it could possibly be useful to allow world.givefocus(WorldID) as well, though I am more concerned with being able to test if the world whose script or plugin is trying to do something has the focus, since testing for that directly would allow multiple worlds to use the info bar or similar items when they have the focus and simply skip the code to set the bars contents when they don't. Sharing is nice, but only if the scripts know when to get out of each others way. ;) | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #2 on Fri 22 Nov 2002 01:42 PM (UTC) |
Message
| And for god's sake, put a "Clear info bar" command in the Display menu :p |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #3 on Fri 22 Nov 2002 09:42 PM (UTC) |
Message
| For the time being you can use the main world "world get focus" and "world lose focus" to determine which world has the focus. However they won't affect a plugin unfortunately, unless you make a main script that calls a plugin script.
As for clearing the info bar, for now make an alias which calls a script to do it.
Quote:
I'm thinking about programming something for the Info Bar... but I don't want to share it among worlds.
I laughed when I read that, because one of the complaints about the status bar was it was unique to each world, and thus couldn't be used to show (say) activity on world A while world B was active.
So I thought I wouldn't fall for that trap again, and made the info bar shared.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #4 on Sat 23 Nov 2002 08:27 PM (UTC) |
Message
| Heh, well, really, both are handy :) I.E. maybe i want to make a script that displays the health points of all the worlds, or maybe i want to make one that displays the hp of the world i have open now. I think that the best would be if you had something like a "Bind" command, that bound the world file to the info bar, and displayed it when the world was open, but displayed whatever was appropriate when the world lost focus. I.E. we have 3 worlds, with world 1 having a global infobar plugin, and world 3 with a local plugin. The user is in world 1, and the global output is displayed. same thing happens when he's in world 2. but when he goes to world 3, the output changes to whatever the world's last "world.infobar <text>" command was, i.e. mushclient keeps an internal note of what the plugin wanted displayed, and shows it when the world gets focus. If the user went back to world 1 or 2, mushclient would hide the text of world 3 and show the text of world 1. |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Shadowfyr
USA (1,791 posts) Bio
|
Date
| Reply #5 on Sun 24 Nov 2002 07:00 PM (UTC) |
Message
| 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... | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #6 on Sun 24 Nov 2002 07:37 PM (UTC) |
Message
| Hmmm - I see the design of these things evolves. First, as you noticed, the reason you can't return the info bar contents is there is no easy way to return the fonts, bold, underline, font size, colour etc. in such a way they could be "stuffed back" later.
I don't really see how one bar can be shared between different plugins, which all want to display something. You really need multiple bars for that.
I suppose I was hoping that it would be used in the sort of situation like this:
- You were playing a single world and wanted a graphical representation of HP etc. that you could see at a glance, like my example.
- You wanted to use it in a shared world environment to show when world A had activity when you were in world B
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Shadowfyr
USA (1,791 posts) Bio
|
Date
| Reply #7 on Mon 25 Nov 2002 01:31 AM (UTC) |
Message
| Yeah. In a single use situation it works, however this was probably never what anyone else thought it was when you first added it. ;)
One possibility for returning/seting text would be to take the bar info, return HTML, then translate that back when setting it. Sharing between plugins is an issue, and short of some way to break the bars contents into bit that 'only' the plugin that set it can clear... Sharing between worlds is a slightly less of a problem, since you could have a global bar or the like.. It definitely a complicated situation. | Top |
|
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Reply #8 on Mon 25 Nov 2002 04:24 PM (UTC) |
Message
| In the meantime, if there were a way to automatically call a plugin subroutine when the world gets focus, then I would just do that... It would lead to a hostile takeover of the InfoBar, but if everyone's plugins/script did that, there wouldn't be a problem.
I would probably adapt my "Statline" plugin to do the same thing with the Info Bar. That is, one plugin that manages the Info Bar for all the others plugins installed in the same world. |
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
20,854 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top