Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11045


Ignore:
Timestamp:
Jan 5, 2016, 11:00:32 AM (9 years ago)
Author:
landauf
Message:

added argument completion function for overlay groups

Location:
code/branches/presentationHS15/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS15/src/libraries/core/command/ArgumentCompletionFunctions.h

    r7401 r11045  
    161161*/
    162162#define ARGUMENT_COMPLETION_FUNCTION_DECLARATION(functionname) \
    163     _CoreExport ArgumentCompleter* functionname(); \
    164     _CoreExport ArgumentCompletionList acf_##functionname
     163    ArgumentCompleter* functionname(); \
     164    ArgumentCompletionList acf_##functionname
    165165
    166166/**
     
    196196    namespace autocompletion
    197197    {
    198         ARGUMENT_COMPLETION_FUNCTION_DECLARATION(fallback)();
    199         ARGUMENT_COMPLETION_FUNCTION_DECLARATION(groupsandcommands)(const std::string& fragment);
    200         ARGUMENT_COMPLETION_FUNCTION_DECLARATION(subcommands)(const std::string& fragment, const std::string& group);
    201         ARGUMENT_COMPLETION_FUNCTION_DECLARATION(command)(const std::string& fragment);
    202         ARGUMENT_COMPLETION_FUNCTION_DECLARATION(hiddencommand)(const std::string& fragment);
    203         ARGUMENT_COMPLETION_FUNCTION_DECLARATION(files)(const std::string& fragment);
    204         ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingssections)();
    205         ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsentries)(const std::string& fragment, const std::string& section);
    206         ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsvalue)(const std::string& fragment, const std::string& entry, const std::string& section);
    207         ARGUMENT_COMPLETION_FUNCTION_DECLARATION(tclthreads)();
     198        _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(fallback)();
     199        _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(groupsandcommands)(const std::string& fragment);
     200        _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(subcommands)(const std::string& fragment, const std::string& group);
     201        _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(command)(const std::string& fragment);
     202        _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(hiddencommand)(const std::string& fragment);
     203        _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(files)(const std::string& fragment);
     204        _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingssections)();
     205        _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsentries)(const std::string& fragment, const std::string& section);
     206        _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsvalue)(const std::string& fragment, const std::string& entry, const std::string& section);
     207        _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(tclthreads)();
    208208    }
    209209}
  • code/branches/presentationHS15/src/orxonox/overlays/OverlayGroup.cc

    r10624 r11045  
    4242namespace orxonox
    4343{
     44    namespace autocompletion
     45    {
     46        /**
     47            @brief Returns the names of all currently existing OverlayGroups.
     48        */
     49        ARGUMENT_COMPLETION_FUNCTION_DECLARATION(overlaygroupnames)();
     50        ARGUMENT_COMPLETION_FUNCTION_IMPLEMENTATION(overlaygroupnames)()
     51        {
     52            ArgumentCompletionList names;
     53            for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
     54                names.push_back(ArgumentCompletionListElement(it->getName(), getLowercase(it->getName())));
     55            return names;
     56        }
     57    }
     58
     59    SetConsoleCommand("OverlayGroup", "toggleVisibility", &OverlayGroup::toggleVisibility).argumentCompleter(0, autocompletion::overlaygroupnames());
     60    SetConsoleCommand("OverlayGroup", "show",             &OverlayGroup::show            ).argumentCompleter(0, autocompletion::overlaygroupnames());
     61    SetConsoleCommand("OverlayGroup", "scaleGroup",       &OverlayGroup::scaleGroup      ).argumentCompleter(0, autocompletion::overlaygroupnames());
     62    SetConsoleCommand("OverlayGroup", "scrollGroup",      &OverlayGroup::scrollGroup     ).argumentCompleter(0, autocompletion::overlaygroupnames());
     63
    4464    RegisterClass(OverlayGroup);
    45 
    46     SetConsoleCommand("OverlayGroup", "toggleVisibility", &OverlayGroup::toggleVisibility);
    47     SetConsoleCommand("OverlayGroup", "show", &OverlayGroup::show);
    48     SetConsoleCommand("OverlayGroup", "scaleGroup",       &OverlayGroup::scaleGroup);
    49     SetConsoleCommand("OverlayGroup", "scrollGroup",      &OverlayGroup::scrollGroup);
    5065
    5166    OverlayGroup::OverlayGroup(Context* context)
Note: See TracChangeset for help on using the changeset viewer.