Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 1, 2010, 10:05:56 PM (14 years ago)
Author:
rgrieder
Message:

Added support for keybindings.ini merging:
When running development builds, the keybinder will merge the local file and the one from the data folder.
Catch: if you want to remove a binding, you'll have to write "NoBinding" (not case sensitive) to override the default command

The keybind command already does that for you though.

File:
1 edited

Legend:

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

    r6432 r6437  
    8282    }
    8383
    84     void Button::readBinding(ConfigFile* configFile)
    85     {
    86         const std::string& binding = configFile->getOrCreateValue(groupName_, name_, "", true);
     84    void Button::readBinding(ConfigFile* configFile, ConfigFile* fallbackFile)
     85    {
     86        std::string binding = configFile->getOrCreateValue(groupName_, name_, "", true);
     87        if (binding.empty() && fallbackFile)
     88            binding = fallbackFile->getValue(groupName_, name_, true);
    8789        this->parse(binding);
    8890    }
    8991
    90     void Button::setBinding(ConfigFile* configFile, const std::string& binding, bool bTemporary)
     92    void Button::setBinding(ConfigFile* configFile, ConfigFile* fallbackFile, const std::string& binding, bool bTemporary)
    9193    {
    9294        if (!bTemporary)
     
    104106        this->bindingString_ = binding;
    105107
    106         if (isEmpty(bindingString_))
     108        if (isEmpty(bindingString_) || removeTrailingWhitespaces(getLowercase(binding)) == "nobinding")
    107109            return;
    108110
Note: See TracChangeset for help on using the changeset viewer.