diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-01-03 13:03:13 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-01-03 13:03:13 -0300 |
commit | 6b5b95bb4e269a1bd740707e27eae09983b84268 (patch) | |
tree | aa0c80dd4d683eaa99e1ad804d8d742f369bdd73 /core | |
parent | 85c084c7707c4b9cac978bc0caec0a76b5e37818 (diff) |
-added new code completion guess locations, closes #1032
-moved commandline fix to mingw-only, should fix #1064
Diffstat (limited to 'core')
-rw-r--r-- | core/os/input.cpp | 25 | ||||
-rw-r--r-- | core/os/input.h | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/core/os/input.cpp b/core/os/input.cpp index 4151c1b5a8..a827e75896 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -29,6 +29,7 @@ #include "input.h" #include "input_map.h" #include "os/os.h" +#include "globals.h" Input *Input::singleton=NULL; Input *Input::get_singleton() { @@ -69,6 +70,30 @@ void Input::_bind_methods() { ADD_SIGNAL( MethodInfo("joy_connection_changed", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "connected")) ); } +void Input::get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const { +#ifdef TOOLS_ENABLED + + String pf=p_function; + if (p_idx==0 && (pf=="is_action_pressed" || pf=="action_press" || pf=="action_release")) { + + List<PropertyInfo> pinfo; + Globals::get_singleton()->get_property_list(&pinfo); + + for(List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { + const PropertyInfo &pi=E->get(); + + if (!pi.name.begins_with("input/")) + continue; + + String name = pi.name.substr(pi.name.find("/")+1,pi.name.length()); + r_options->push_back("\""+name+"\""); + + } + } +#endif + +} + Input::Input() { singleton=this; diff --git a/core/os/input.h b/core/os/input.h index 1cb0f35d96..387a43a35a 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -76,6 +76,8 @@ public: virtual void action_press(const StringName& p_action)=0; virtual void action_release(const StringName& p_action)=0; + void get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const; + Input(); }; |