help with making a new tab
- the panda next door
- Private First Class
- Posts: 42
- Joined: Sun Mar 16, 2008 3:55 am
- Location: Las Vegas
help with making a new tab
I find that when I have been sent private messages, they are stuck in between other chat messages and I need to scroll up or down and find flashing messages. Because of that, I want to make a new tab and bind it to "Shift+F5", but what I'm trying obviously isn't working. I have already made the tab appear with the text "->you". How to filter and insert text into the tab also eludes me.
Why don't you run debugger on the code and see what happens when you switch tabs, that may give you a clue...
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
If you followed what anomaly said, you should have ended up looking in the function handleMessage(void*) in playing.cxx. If you scroll to the end of the function, you'll see some calls to addMessage(). This function calls ControlPanel::addMessage(), and, as you would expect, adds a message to the console. The integer constant passed to addMessage() in playing.cxx is the tab the text will show up in. The integer constant corresponds to an enumeration in ControlPanel.h:
The enumeration is private, which explains why integer constants are used instead of the enumeration names.
In playing.cxx, I just added a small "if(toAdmin)" to the code:
Code: Select all
enum MessageModes {
MessageAllTabs = -2,
MessageCurrent = -1,
MessageAll = 0,
MessageChat = 1,
MessageServer = 2,
MessageMisc = 3,
MessageAdmin = 4, //I added this to try adding a tab
MessageModeCount
};
In playing.cxx, I just added a small "if(toAdmin)" to the code:
Code: Select all
if (fromServer)
addMessage(NULL, fullMsg, 2, false, oldcolor.c_str());
else if(toAdmin)
addMessage(NULL, fullMsg, 4, false, oldcolor.c_str());
else
addMessage(NULL, fullMsg, 1, false, oldcolor.c_str());
- Attachments
-
- Picture 1.png
- (306.73 KiB) Downloaded 26 times
- the panda next door
- Private First Class
- Posts: 42
- Joined: Sun Mar 16, 2008 3:55 am
- Location: Las Vegas
binding tab to F5
I finally got it to work!
Explanation in this pic:
Explanation in this pic:
- Attachments
-
- Picture 1.png
- (186.22 KiB) Downloaded 32 times