ID:2138382
 
(See the best response by Lummox JR.)
Code:


Problem description:
I had some problems trying to figure out how to make it so when one player points the mouse at an object on the map, they get different megssage in the bottom bar where the names of objects are shown.

The point behind this is to see things about an object if it is something in a list of objects you are allowed to see the details of. Like maybe a weapon that if you are allowed to see its stats it might show up as: Shot Gun (4 shells) 80 damage, but if you are not allowed to see the stats it would only show the name Shot Gun when the mouse is pointed at it.

I already know how to do alternative things like open a little stat window if it is clicked on or pointed at, but doing it the way I described above would be so much nicer.
Best response
You'd either have to change the object's name var, or don't use the status bar for this and just handle MouseOver and a special display HUD yourself.
Is it possible to change the object's name, update the status bar, then change the name of the object back, and if so, is there any special proc that updates the status bar?
You could, but I wouldn't recommend it, as anything that happened in the meantime would use that changed name.

You're probably better off handling this 100% yourself instead of trying to hack something together using the standard features.
Is there an actual proc that triggers the display on the status bar? If there is a way to trigger it after the mouse enters, then it would work, but its currently showing the name the object has when the mouse enters it, not the nsme it gets changed to. If there was only a way to force it to update the status bar, it would work the way I want it to.
No, the statusbar is a very old legacy feature and it can't be altered on the fly.
In response to Nadrew
Nadrew wrote:
No, the statusbar is a very old legacy feature and it can't be altered on the fly.

Except in the webclient, which is magic. Your options are much better in the webclient.
*ahem* /image with a different name an override set to 1.
Hmm, now that the appearance variable is a thing, that option is definitely a crapload more appealing, good one!
In response to Ter13
Ooh, that's a good idea.

Of course, any manipulation of the name var is going to limit other things you can do with the object, like using it in verbs or macros; however with a more modern game interface you're probably not doing those things anyway.

Me, I think I'd prefer to go full modern and just use MouseEntered() and MouseExited() to display a nice HUD overlay, and for the webclient do one better by having a custom control handle everything client-side.
MouseEntered() and MouseExited() can get a bit hungry when used too much, so you'd probably want to limit what things do show the info pretty heavily. I remember one time I tried to replace the statusbar entirely and had MouseEntered() and MouseExited() on everything... oh man.