Changeset 957 for code/branches/core2/src/orxonox/core/CommandExecutor.cc
- Timestamp:
- Mar 30, 2008, 5:38:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/core/CommandExecutor.cc
r955 r957 192 192 break; 193 193 case CS_Shortcut_Params: 194 // not enough parameters but lets hope there are some additional parameters 195 if (evaluation.shortcut_ != 0) 196 return evaluation.shortcut_->parse(tokens.subSet(1).join() + " " + evaluation.additionalParameter_); 197 break; 194 // not enough parameters but lets hope there are some additional parameters and go on 198 195 case CS_Shortcut_Finished: 199 196 // call the shortcut 200 197 if (evaluation.shortcut_ != 0) 201 return evaluation.shortcut_->parse(tokens.subSet(1).join() + " " + evaluation.additionalParameter_); 198 { 199 if (tokens.size() >= 2) 200 return evaluation.shortcut_->parse(tokens.subSet(1).join() + " " + evaluation.additionalParameter_); 201 else 202 return evaluation.shortcut_->parse(evaluation.additionalParameter_); 203 } 202 204 break; 203 205 case CS_Function: 204 206 break; 205 207 case CS_Function_Params: 206 // not enough parameters but lets hope there are some additional parameters 207 if (evaluation.function_ != 0) 208 return evaluation.function_->parse(tokens.subSet(2).join() + " " + evaluation.additionalParameter_); 209 break; 208 // not enough parameters but lets hope there are some additional parameters and go on 210 209 case CS_Function_Finished: 211 210 // call the shortcut 212 211 if (evaluation.function_ != 0) 213 return evaluation.function_->parse(tokens.subSet(2).join() + " " + evaluation.additionalParameter_); 212 { 213 if (tokens.size() >= 3) 214 return evaluation.function_->parse(tokens.subSet(2).join() + " " + evaluation.additionalParameter_); 215 else 216 return evaluation.function_->parse(evaluation.additionalParameter_); 217 } 214 218 break; 215 219 case CS_ConfigValueClass: … … 218 222 break; 219 223 case CS_ConfigValueType: 220 // not enough parameters but lets hope there are some additional parameters 221 if (evaluation.configvalue_ != 0) 222 return evaluation.configvalue_->parseString(tokens.subSet(3).join() + " " + evaluation.additionalParameter_); 223 break; 224 // not enough parameters but lets hope there are some additional parameters and go on 224 225 case CS_ConfigValueFinished: 225 226 // set the config value 226 227 if (evaluation.configvalue_ != 0) 227 return evaluation.configvalue_->parseString(tokens.subSet(3).join() + " " + evaluation.additionalParameter_); 228 { 229 if ((tokens.size() >= 1) && (tokens[0] == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE)) 230 { 231 if (tokens.size() >= 4) 232 return evaluation.configvalue_->set(tokens.subSet(3).join() + " " + evaluation.additionalParameter_); 233 else 234 return evaluation.configvalue_->set(evaluation.additionalParameter_); 235 } 236 else if ((tokens.size() >= 1) && (tokens[0] == COMMAND_EXECUTOR_KEYWORD_SET_CONFIG_VALUE_TEMPORARY)) 237 { 238 if (tokens.size() >= 4) 239 return evaluation.configvalue_->tset(tokens.subSet(3).join() + " " + evaluation.additionalParameter_); 240 else 241 return evaluation.configvalue_->tset(evaluation.additionalParameter_); 242 } 243 } 228 244 break; 229 245 case CS_KeybindKey: 230 246 break; 231 247 case CS_KeybindCommand: 232 // not enough parameters but lets hope there are some additional parameters 233 break; 248 // not enough parameters but lets hope there are some additional parameters and go on 234 249 case CS_KeybindFinished: 235 250 // set the keybind … … 980 995 981 996 if (executor->defaultValueSet(i)) 982 output += " ]";997 output += "=" + executor->getDefaultValue(i).toString() + "]"; 983 998 else 984 999 output += "}"; … … 989 1004 std::string CommandExecutor::dump(const ConfigValueContainer* container) 990 1005 { 991 return container->getTypename(); 1006 AddLanguageEntry("CommandExecutor::oldvalue", "old value"); 1007 return "{" + container->getTypename() + "} (" + GetLocalisation("CommandExecutor::oldvalue") + ": " + container->toString() + ")"; 992 1008 } 993 1009
Note: See TracChangeset
for help on using the changeset viewer.