From 261edddd92ec02c1d278213e730aa30a1fea71d0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 18 May 2013 20:39:30 +0300 Subject: Remove static list with chat commands for autocomplete. --- src/commandhandler.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/commandhandler.cpp') diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index d769f121f..8edea1666 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -43,6 +43,23 @@ CommandHandler::CommandHandler() : } } +void CommandHandler::addChatCommands(std::list &arr) +{ + const int sz = sizeof(commands) / sizeof(CommandInfo); + for (int f = 0; f < sz; f ++) + { + const CommandInfo &info = commands[f]; + const std::string name = info.name; + if (!name.empty()) + { + std::string cmd = std::string("/").append(name); + if (info.useArgs) + cmd.append(" "); + arr.push_back(cmd); + } + } +} + void CommandHandler::handleCommands(const std::string &command, ChatTab *const tab) { -- cgit v1.2.3-70-g09d2