Changeset 11052 for code/trunk/src/libraries/core
- Timestamp:
- Jan 9, 2016, 6:26:20 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/CoreConfig.cc
- Property svn:eol-style set to native
-
code/trunk/src/libraries/core/CoreConfig.h
- Property svn:eol-style set to native
-
code/trunk/src/libraries/core/GUIManager.cc
r10624 r11052 36 36 #include <OgreRenderWindow.h> 37 37 38 extern "C" { 39 #include <lua.h> 40 } 41 38 42 #if CEGUI_VERSION >= 0x000800 39 43 # include <CEGUI/DefaultLogger.h> … … 251 255 /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen"; //Alternative: Orxonox (not fully complete yet, see the graphics menu) 252 256 253 SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false); 254 SetConsoleCommand("hideGUI", &GUIManager::hideGUI); 255 SetConsoleCommand("toggleGUI", &GUIManager::toggleGUI).defaultValue(1, false).defaultValue(2, false); 257 namespace autocompletion 258 { 259 /** 260 @brief Returns the names of all currently existing OverlayGroups. 261 */ 262 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(guinames)(); 263 ARGUMENT_COMPLETION_FUNCTION_IMPLEMENTATION(guinames)() 264 { 265 ArgumentCompletionList names; 266 const std::vector<std::string> guis = GUIManager::getInstance().getLoadedGUIs(); 267 for (size_t i = 0; i < guis.size(); ++i) 268 names.push_back(ArgumentCompletionListElement(guis[i], getLowercase(guis[i]))); 269 return names; 270 } 271 } 272 273 SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false) 274 .argumentCompleter(0, autocompletion::guinames()); 275 SetConsoleCommand("hideGUI", &GUIManager::hideGUI) 276 .argumentCompleter(0, autocompletion::guinames()); 277 SetConsoleCommand("toggleGUI", &GUIManager::toggleGUI).defaultValue(1, false).defaultValue(2, false) 278 .argumentCompleter(0, autocompletion::guinames()); 256 279 257 280 RegisterAbstractClass(GUIManager).inheritsFrom<WindowEventListener>(); … … 489 512 { 490 513 this->luaState_->doString(str, rootFileInfo_); 514 } 515 516 std::vector<std::string> GUIManager::getLoadedGUIs() 517 { 518 // TODO: is there a better way to read back a return value from lua? i.e. by using LuaState? 519 lua_State* L = this->luaState_->getInternalLuaState(); 520 521 // push function 522 lua_getglobal(L, "getLoadedSheets"); 523 524 // do the call (0 arguments, 1 result) 525 if (lua_pcall(L, 0, 1, 0) != 0) 526 orxout(internal_error) << "error running function: " << lua_tostring(L, -1) << endl; 527 528 // retrieve result 529 if (!lua_isstring(L, -1)) 530 orxout(internal_error) << "function must return a string" << endl; 531 std::string value = lua_tostring(L, -1); 532 lua_pop(L, 1); 533 534 SubString tokens(value, ","); 535 return tokens.getAllStrings(); 491 536 } 492 537 -
code/trunk/src/libraries/core/GUIManager.h
r9675 r11052 107 107 void preUpdate(const Clock& time); 108 108 109 std::vector<std::string> getLoadedGUIs(); 110 109 111 void loadGUI(const std::string& name); 110 112 static void showGUI(const std::string& name, bool bHidePrevious = false, bool bNoInput = false); -
code/trunk/src/libraries/core/GameConfig.cc
- Property svn:eol-style set to native
-
code/trunk/src/libraries/core/GameConfig.h
- Property svn:eol-style set to native
-
code/trunk/src/libraries/core/command/ArgumentCompletionFunctions.h
r7401 r11052 161 161 */ 162 162 #define ARGUMENT_COMPLETION_FUNCTION_DECLARATION(functionname) \ 163 _CoreExportArgumentCompleter* functionname(); \164 _CoreExportArgumentCompletionList acf_##functionname163 ArgumentCompleter* functionname(); \ 164 ArgumentCompletionList acf_##functionname 165 165 166 166 /** … … 196 196 namespace autocompletion 197 197 { 198 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(fallback)();199 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(groupsandcommands)(const std::string& fragment);200 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(subcommands)(const std::string& fragment, const std::string& group);201 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(command)(const std::string& fragment);202 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(hiddencommand)(const std::string& fragment);203 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(files)(const std::string& fragment);204 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingssections)();205 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsentries)(const std::string& fragment, const std::string& section);206 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsvalue)(const std::string& fragment, const std::string& entry, const std::string& section);207 ARGUMENT_COMPLETION_FUNCTION_DECLARATION(tclthreads)();198 _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(fallback)(); 199 _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(groupsandcommands)(const std::string& fragment); 200 _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(subcommands)(const std::string& fragment, const std::string& group); 201 _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(command)(const std::string& fragment); 202 _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(hiddencommand)(const std::string& fragment); 203 _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(files)(const std::string& fragment); 204 _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingssections)(); 205 _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsentries)(const std::string& fragment, const std::string& section); 206 _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(settingsvalue)(const std::string& fragment, const std::string& entry, const std::string& section); 207 _CoreExport ARGUMENT_COMPLETION_FUNCTION_DECLARATION(tclthreads)(); 208 208 } 209 209 } -
code/trunk/src/libraries/core/command/ConsoleCommandIncludes.cc
- Property svn:eol-style set to native
-
code/trunk/src/libraries/core/command/ConsoleCommandManager.cc
- Property svn:eol-style set to native
-
code/trunk/src/libraries/core/commandline/CMakeLists.txt
- Property svn:eol-style set to native
-
code/trunk/src/libraries/core/input/KeyBinder.cc
r10624 r11052 359 359 /** 360 360 @brief 361 Return the first key name for a specific command in a human readable form 362 */ 363 const std::string& KeyBinder::getBindingReadable(const std::string& commandName) 364 { 365 const std::string& binding = this->getBinding(commandName); 366 367 SubString substring = SubString(binding, "."); 368 std::string name; 369 std::string group; 370 switch(substring.size()) 371 { 372 case 0: 373 return binding; 374 case 1: 375 return binding; 376 case 2: 377 group = substring[0]; 378 default: 379 name = substring.subSet(1).join("."); 380 } 381 382 std::stringstream stream; 383 if(group.compare("Keys") == 0) 384 stream << "Key " << name.substr(3); 385 else if(group.compare("MouseButtons") == 0) 386 stream << "Mouse " << name; 387 else if(group.compare("JoyStickButtons") == 0) 388 stream << "Joystick " << name; 389 else if(group.compare("JoyStickAxes") == 0) 390 stream << "Joystick Axis" << name.substr(5, 6) << name.substr(name.find("Axis")+6); 391 else if(group.compare("MouseAxes") == 0) 392 stream << "Mouse " << name.substr(1,3) << " " << name.substr(0, 1) << "-Axis"; 393 else 394 return binding; 395 396 return *(new std::string(stream.str())); 397 } 398 399 /** 400 @brief 361 401 Get the number of different key bindings of a specific command. 362 402 @param commandName -
code/trunk/src/libraries/core/input/KeyBinder.h
r9978 r11052 68 68 const std::string& getBinding(const std::string& commandName); //tolua_export 69 69 const std::string& getBinding(const std::string& commandName, unsigned int index); //tolua_export 70 const std::string& getBindingReadable(const std::string& commandName); //tolua_export 70 71 unsigned int getNumberOfBindings(const std::string& commandName); //tolua_export 71 72 -
code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.cc
- Property svn:eol-style set to native
-
code/trunk/src/libraries/core/singleton/ScopedSingletonIncludes.h
- Property svn:eol-style set to native
Note: See TracChangeset
for help on using the changeset viewer.