| 55 | } |
| 56 | |
| 57 | void Console::notifyComboAccept(MyGUI::ComboBox* _sender, size_t _index) |
| 58 | { |
| 59 | const MyGUI::UString& command = _sender->getOnlyText(); |
| 60 | if (command.empty()) |
| 61 | return; |
| 62 | |
| 63 | MyGUI::UString key = command; |
| 64 | MyGUI::UString value; |
| 65 | |
| 66 | size_t pos = command.find(' '); |
| 67 | if (pos != MyGUI::UString::npos) |
| 68 | { |
| 69 | key = command.substr(0, pos); |
| 70 | value = command.substr(pos + 1); |
| 71 | } |
| 72 | |
| 73 | MapDelegate::iterator iter = mDelegates.find(key); |
| 74 | if (iter != mDelegates.end()) |
| 75 | { |
| 76 | iter->second(key, value); |
| 77 | } |
| 78 | else |
| 79 | { |
| 80 | if (eventConsoleUnknowCommand.empty()) |
| 81 | { |
| 82 | addToConsole(mStringUnknow + "'" + key + "'"); |
| 83 | } |
| 84 | else |
| 85 | { |
| 86 | eventConsoleUnknowCommand(key, value); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | _sender->setCaption(MyGUI::UString()); |
| 91 | } |
| 92 | |
| 93 | |
| 94 | void Console::notifyButtonPressed(MyGUI::Widget* _sender, MyGUI::KeyCode _key, MyGUI::Char _char) |
nothing calls this directly
no test coverage detected