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
-
- Posts: 36
- Joined: 2003-01-19 22:22
- Location: Rochester, NY, USA
- Contact:
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));
}
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.