Changeset 6428 for code/trunk/src/libraries/core/input/Button.cc
- Timestamp:
- Dec 28, 2009, 11:10:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/input/Button.cc
r6417 r6428 42 42 #include "core/CommandEvaluation.h" 43 43 #include "core/CommandExecutor.h" 44 #include "core/ConfigValueContainer.h"45 44 46 45 namespace orxonox … … 52 51 */ 53 52 Button::Button() 54 : configContainer_(0) 55 , bButtonThresholdUser_(false) 53 : bButtonThresholdUser_(false) 56 54 , paramCommandBuffer_(0) 57 55 { … … 64 62 { 65 63 this->clear(); 66 67 if (this->configContainer_)68 delete this->configContainer_;69 64 } 70 65 … … 83 78 } 84 79 } 85 } 86 87 void Button::readConfigValue(ConfigFileType configFile) 88 { 89 // create/get ConfigValueContainer 90 if (!configContainer_) 91 { 92 configContainer_ = new ConfigValueContainer(configFile, 0, groupName_, name_, "", name_); 93 configContainer_->callback(this, &Button::parse); 94 } 95 configContainer_->getValue(&bindingString_, this); 96 } 97 98 void Button::parse() 99 { 80 this->bindingString_.clear(); 81 } 82 83 void Button::readBinding(ConfigFileType type) 84 { 85 const std::string& binding = ConfigFileManager::getInstance().getValue(type, groupName_, name_, "", true); 86 this->parse(binding); 87 } 88 89 void Button::setBinding(ConfigFileType type, const std::string& binding, bool bTemporary) 90 { 91 if (!bTemporary) 92 ConfigFileManager::getInstance().setValue(type, groupName_, name_, binding, true); 93 this->parse(binding); 94 } 95 96 void Button::parse(const std::string& binding) 97 { 98 if (binding == this->bindingString_) 99 return; 100 100 101 // delete all commands 101 102 clear(); 103 this->bindingString_ = binding; 102 104 103 105 if (isEmpty(bindingString_))
Note: See TracChangeset
for help on using the changeset viewer.