From 5251869d3507c8c3dc5fd4c824a06987fd6437e2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 23 Aug 2014 13:19:37 +0300 Subject: Add autocomplete chat commands from actions. --- src/input/inputmanager.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/input/inputmanager.cpp') 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 &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); + } + } +} -- cgit v1.2.3-70-g09d2