From bcf27feb980aec593c7cb771984e46113cfad757 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 16 Dec 2014 22:31:57 -0300 Subject: New Code Completion -=-=-=-=-=-=-=-=-=- -Massive improvement to code completion -Argument hinting for functions If you manage to out-smart the code-completion in a situation where completion should be possible to guess, let me know. Please enter the commit message for your changes. Lines starting --- scene/resources/material.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'scene/resources/material.cpp') diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 2c278f4fed..e3427cbe2c 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -458,6 +458,8 @@ FixedMaterial::~FixedMaterial() { } + + bool ShaderMaterial::_set(const StringName& p_name, const Variant& p_value) { if (p_name==SceneStringNames::get_singleton()->shader_shader) { @@ -558,7 +560,21 @@ void ShaderMaterial::_bind_methods() { } +void ShaderMaterial::get_argument_options(const StringName& p_function,int p_idx,List*r_options) const { + + String f = p_function.operator String(); + if ((f=="get_shader_param" || f=="set_shader_param") && p_idx==0) { + if (shader.is_valid()) { + List pl; + shader->get_param_list(&pl); + for (List::Element *E=pl.front();E;E=E->next()) { + r_options->push_back(E->get().name); + } + } + } + Material::get_argument_options(p_function,p_idx,r_options); +} ShaderMaterial::ShaderMaterial() :Material(VisualServer::get_singleton()->material_create()){ -- cgit v1.2.3