Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2008, 1:11:51 AM (17 years ago)
Author:
landauf
Message:
  • fixed a bug in CommandExecutor
  • InGameConsole wraps now too long output lines and does something similar for the input line
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/core/ConsoleCommand.cc

    r1402 r1416  
    4141    }
    4242
    43     ConsoleCommand& ConsoleCommand::setArgumentCompletionList(unsigned int param, const std::list<std::pair<std::string, std::string> >& (*function) (void))
     43    ConsoleCommand& ConsoleCommand::setArgumentCompletionList(unsigned int param, std::list<std::pair<std::string, std::string> > (*function) (void))
    4444    {
    4545        if (param < 5)
     
    5252    }
    5353
    54     const std::list<std::pair<std::string, std::string> >& ConsoleCommand::getArgumentCompletionList(unsigned int param) const
     54    const std::list<std::pair<std::string, std::string> >& ConsoleCommand::getArgumentCompletionList(unsigned int param)
    5555    {
    5656        if (param < 5)
    57             return (*this->autocompletionFunction_[param])();
     57            this->argumentList_ = (*this->autocompletionFunction_[param])();
    5858        else
    59             return autocompletion::fallback();
     59            this->argumentList_ = autocompletion::fallback();
     60
     61        return this->argumentList_;
    6062    }
    6163
    62     std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListBegin(unsigned int param) const
     64    std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListBegin(unsigned int param)
    6365    {
    64 std::cout << "3_1: param: " << param << "\n";
    6566        if (param < 5)
    66         {
    67 std::cout << "3_2: >" << this->autocompletionFunction_[param] << "<\n";
    68             return (*this->autocompletionFunction_[param])().begin();
    69         }
     67            this->argumentList_ = (*this->autocompletionFunction_[param])();
    7068        else
    71         {
    72 std::cout << "3_3\n";
    73             return autocompletion::fallback().begin();
    74         }
     69            this->argumentList_ = autocompletion::fallback();
     70
     71        return this->argumentList_.begin();
    7572    }
    7673
    77     std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListEnd(unsigned int param) const
     74    std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListEnd(unsigned int param)
    7875    {
    79 std::cout << "4_1: param: " << param << "\n";
    8076        if (param < 5)
    81         {
    82 std::cout << "4_2: >" << this->autocompletionFunction_[param] << "<\n";
    83             return (*this->autocompletionFunction_[param])().end();
    84         }
     77            this->argumentList_ = (*this->autocompletionFunction_[param])();
    8578        else
    86         {
    87 std::cout << "4_3\n";
    88             return autocompletion::fallback().end();
    89         }
     79            this->argumentList_ = autocompletion::fallback();
     80
     81        return this->argumentList_.end();
    9082    }
    9183}
Note: See TracChangeset for help on using the changeset viewer.