Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

added argument completion function for overlay groups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.