| 24 | } |
| 25 | |
| 26 | bool CommandManager::executeCommand(const MyGUI::UString& _command) |
| 27 | { |
| 28 | bool result = false; |
| 29 | MyGUI::UString command = _command; |
| 30 | size_t index = _command.find('.'); |
| 31 | if (index != MyGUI::UString::npos) |
| 32 | { |
| 33 | command = _command.substr(0, index); |
| 34 | mData = _command.substr(index + 1); |
| 35 | } |
| 36 | |
| 37 | EventType* event = getEvent(command); |
| 38 | if (event != nullptr) |
| 39 | { |
| 40 | event->operator()(command, result); |
| 41 | } |
| 42 | else |
| 43 | { |
| 44 | MYGUI_LOG(Warning, "Command '" << command << "' not found"); |
| 45 | } |
| 46 | |
| 47 | mData.clear(); |
| 48 | |
| 49 | return result; |
| 50 | } |
| 51 | |
| 52 | void CommandManager::setCommandData(const MyGUI::UString& _data) |
| 53 | { |
no test coverage detected