Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 4, 2014, 11:25:18 PM (11 years ago)
Author:
landauf
Message:

I think that was a bug - why should a command not be added if it has input parameters and an overwritten binding mode? (formerly on line 224)
fixed this now and reduced redundancy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/input/Button.cc

    r9978 r9981  
    213213
    214214                    // we don't know whether this is an actual axis or just a button
    215                     if (mode == KeybindMode::None)
    216                     {
    217                         if (!addParamCommand(cmd))
    218                         {
    219                             mode = eval.getConsoleCommand()->getKeybindMode();
    220                             this->addCommand(cmd, mode, commands);
    221                         }
    222                     }
    223                     else
    224                         cmd->setFixedKeybindMode(true);
     215                    if (mode != KeybindMode::None || !addParamCommand(cmd))
     216                        this->addCommand(cmd, mode, commands);
    225217                }
    226218                else
     
    228220                    SimpleCommand* cmd = new SimpleCommand();
    229221                    cmd->evaluation_ = eval;
    230 
    231                     if (mode == KeybindMode::None)
    232                         mode = eval.getConsoleCommand()->getKeybindMode();
    233                     else
    234                         cmd->setFixedKeybindMode(true);
    235222
    236223                    this->addCommand(cmd, mode, commands);
     
    255242    inline void Button::addCommand(BaseCommand* cmd, KeybindMode::Value mode, std::vector<BaseCommand*> commands[3])
    256243    {
     244        if (mode == KeybindMode::None)
     245            mode = cmd->getEvaluation()->getConsoleCommand()->getKeybindMode();
     246        else
     247            cmd->setFixedKeybindMode(true);
     248
    257249        if (mode == KeybindMode::OnPressAndRelease)
    258250        {
Note: See TracChangeset for help on using the changeset viewer.