diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-23 13:19:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-23 13:19:37 +0300 |
commit | 5251869d3507c8c3dc5fd4c824a06987fd6437e2 (patch) | |
tree | 2d60fdf3ddebfe1ee0f55b132f81be7820798f29 /src/input/inputmanager.cpp | |
parent | 07012a81f523b7f6bd095325ddd2675a3ce06d09 (diff) | |
download | manaplus-5251869d3507c8c3dc5fd4c824a06987fd6437e2.tar.gz manaplus-5251869d3507c8c3dc5fd4c824a06987fd6437e2.tar.bz2 manaplus-5251869d3507c8c3dc5fd4c824a06987fd6437e2.tar.xz manaplus-5251869d3507c8c3dc5fd4c824a06987fd6437e2.zip |
Add autocomplete chat commands from actions.
Diffstat (limited to 'src/input/inputmanager.cpp')
-rw-r--r-- | src/input/inputmanager.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index c74544432..235d50da9 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -847,3 +847,19 @@ int InputManager::getActionByKey(const SDL_Event &event) const } return InputAction::NO_VALUE; } + +void InputManager::addChatCommands(std::list<std::string> &arr) +{ + for (int i = 0; i < InputAction::TOTAL; i++) + { + const InputActionData &ad = inputActionData[i]; + std::string cmd = ad.chatCommand; + if (!cmd.empty()) + { + cmd = std::string("/").append(cmd); + if (ad.useArgs) + cmd.append(" "); + arr.push_back(cmd); + } + } +} |