From 0c9312c6b8d50e14c44317909b4c40d423a23347 Mon Sep 17 00:00:00 2001 From: Chaosus Date: Tue, 16 Jan 2018 19:31:10 +0300 Subject: Fixes for parameter names of builtin functions in visual scripts/core --- doc/classes/@GDScript.xml | 4 ++-- modules/gdscript/gdscript_functions.cpp | 6 +++--- modules/visual_script/visual_script_builtin_funcs.cpp | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml index 9b73849534..9a8eaf38c4 100644 --- a/doc/classes/@GDScript.xml +++ b/doc/classes/@GDScript.xml @@ -182,7 +182,7 @@ - + @@ -589,7 +589,7 @@ - + Returns the nearest larger power of 2 for integer [code]val[/code]. diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index f15f2197da..eceec27814 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -1483,7 +1483,7 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { return mi; } break; case MATH_INVERSE_LERP: { - MethodInfo mi("inverse_lerp", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "value")); + MethodInfo mi("inverse_lerp", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight")); mi.return_val.type = Variant::REAL; return mi; } break; @@ -1579,12 +1579,12 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { return mi; } break; case LOGIC_CLAMP: { - MethodInfo mi("clamp", PropertyInfo(Variant::REAL, "val"), PropertyInfo(Variant::REAL, "min"), PropertyInfo(Variant::REAL, "max")); + MethodInfo mi("clamp", PropertyInfo(Variant::REAL, "value"), PropertyInfo(Variant::REAL, "min"), PropertyInfo(Variant::REAL, "max")); mi.return_val.type = Variant::REAL; return mi; } break; case LOGIC_NEAREST_PO2: { - MethodInfo mi("nearest_po2", PropertyInfo(Variant::INT, "val")); + MethodInfo mi("nearest_po2", PropertyInfo(Variant::INT, "value")); mi.return_val.type = Variant::INT; return mi; } break; diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index 1ee0989564..7f0a42da82 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -257,10 +257,10 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case MATH_ASIN: case MATH_ACOS: case MATH_ATAN: - case MATH_ATAN2: case MATH_SQRT: { - return PropertyInfo(Variant::REAL, "num"); + return PropertyInfo(Variant::REAL, "s"); } break; + case MATH_ATAN2: case MATH_FMOD: case MATH_FPOSMOD: { if (p_idx == 0) @@ -273,7 +273,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case MATH_ROUND: case MATH_ABS: case MATH_SIGN: { - return PropertyInfo(Variant::REAL, "num"); + return PropertyInfo(Variant::REAL, "s"); } break; @@ -287,7 +287,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case MATH_EXP: case MATH_ISNAN: case MATH_ISINF: { - return PropertyInfo(Variant::REAL, "num"); + return PropertyInfo(Variant::REAL, "s"); } break; case MATH_EASE: { if (p_idx == 0) @@ -318,7 +318,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const else if (p_idx == 1) return PropertyInfo(Variant::REAL, "to"); else - return PropertyInfo(Variant::REAL, "value"); + return PropertyInfo(Variant::REAL, "weight"); } break; case MATH_RANGE_LERP: { if (p_idx == 0) @@ -415,14 +415,14 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const } break; case LOGIC_CLAMP: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "a"); - else if (p_idx == 0) // FIXME: is it ok to test p_idx == 0 twice? + return PropertyInfo(Variant::REAL, "value"); + else if (p_idx == 1) return PropertyInfo(Variant::REAL, "min"); else return PropertyInfo(Variant::REAL, "max"); } break; case LOGIC_NEAREST_PO2: { - return PropertyInfo(Variant::INT, "num"); + return PropertyInfo(Variant::INT, "value"); } break; case OBJ_WEAKREF: { -- cgit v1.2.3