I have a function in user.cpp which is intended to output a line of text to my own chat window (not actually get sent to the chat). This involves using the addline fucntion in HubFrame.cpp. Is there a series of links i can do to get from user to hubframe? like, to go from user to client, user->getclient, blah blah. If not, what would be a way for me to get from a user.cpp based function to having a line display in my chat window?
Thanks in advance!
getting from user to hubframe
Moderator: Moderators
-
dieselmachine
- Posts: 36
- Joined: 2003-01-20 03:22
- Location: Rochester, NY, USA
-
sarf
- Posts: 382
- Joined: 2003-01-24 10:43
- Location: Sweden
One possible way would be to use the Client pointer that is present in the user.
Add this code to the Client class (in the public part of the class, I might add) :
It should prove sufficient.
Then you simply do a user->getClient()->addLine("Whatever you want to show up as a line in the HubFrame");
Sarf
---
Time Warner: bringing you the finest in cradle-to-grave thought management.
Add this code to the Client class (in the public part of the class, I might add) :
Code: Select all
void addLine(string line)
{
fire(ClientListener::MESSAGE, this, Util::validateMessage(line, true));
}It should prove sufficient.
Then you simply do a user->getClient()->addLine("Whatever you want to show up as a line in the HubFrame");
Sarf
---
Time Warner: bringing you the finest in cradle-to-grave thought management.
Who is online
Users browsing this forum: Google [Bot] and 0 guests