- Timestamp:
- Aug 27, 2010, 8:41:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/command/ArgumentCompletionFunctions.cc
r7228 r7232 57 57 } 58 58 59 bool groupIsVisible(const std::map<std::string, _ConsoleCommand*>& group) 60 { 61 for (std::map<std::string, _ConsoleCommand*>::const_iterator it_command = group.begin(); it_command != group.end(); ++it_command) 62 if (it_command->second->isActive() && it_command->second->hasAccess() && !it_command->second->isHidden()) 63 return true; 64 65 return false; 66 } 67 59 68 ARGUMENT_COMPLETION_FUNCTION_IMPLEMENTATION(groupsandcommands)() 60 69 { … … 63 72 const std::map<std::string, std::map<std::string, _ConsoleCommand*> >& commands = _ConsoleCommand::getCommands(); 64 73 for (std::map<std::string, std::map<std::string, _ConsoleCommand*> >::const_iterator it_group = commands.begin(); it_group != commands.end(); ++it_group) 65 // todo: check if active / not hidden / not denied66 groupList.push_back(ArgumentCompletionListElement(it_group->first, getLowercase(it_group->first)));74 if (groupIsVisible(it_group->second)) 75 groupList.push_back(ArgumentCompletionListElement(it_group->first, getLowercase(it_group->first))); 67 76 68 77 std::map<std::string, std::map<std::string, _ConsoleCommand*> >::const_iterator it_group = commands.find(""); … … 72 81 73 82 for (std::map<std::string, _ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command) 74 // todo: check if active / not hidden / not denied75 groupList.push_back(ArgumentCompletionListElement(it_command->first, getLowercase(it_command->first)));83 if (it_command->second->isActive() && it_command->second->hasAccess() && !it_command->second->isHidden()) 84 groupList.push_back(ArgumentCompletionListElement(it_command->first, getLowercase(it_command->first))); 76 85 } 77 86 … … 93 102 { 94 103 for (std::map<std::string, _ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command) 95 // todo: check if active / not hidden / not denied96 commandList.push_back(ArgumentCompletionListElement(it_command->first, getLowercase(it_command->first)));104 if (it_command->second->isActive() && it_command->second->hasAccess() && !it_command->second->isHidden()) 105 commandList.push_back(ArgumentCompletionListElement(it_command->first, getLowercase(it_command->first))); 97 106 } 98 107
Note: See TracChangeset
for help on using the changeset viewer.