diff options
Diffstat (limited to 'modules/visual_script')
5 files changed, 74 insertions, 68 deletions
diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index 3fd2b474bb..07f152efd4 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -277,22 +277,22 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case MATH_EXP: case MATH_ISNAN: case MATH_ISINF: { - return PropertyInfo(Variant::REAL, "s"); + return PropertyInfo(Variant::FLOAT, "s"); } break; case MATH_ATAN2: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "y"); + return PropertyInfo(Variant::FLOAT, "y"); else - return PropertyInfo(Variant::REAL, "x"); + return PropertyInfo(Variant::FLOAT, "x"); } break; case MATH_FMOD: case MATH_FPOSMOD: case LOGIC_MAX: case LOGIC_MIN: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "a"); + return PropertyInfo(Variant::FLOAT, "a"); else - return PropertyInfo(Variant::REAL, "b"); + return PropertyInfo(Variant::FLOAT, "b"); } break; case MATH_POSMOD: { if (p_idx == 0) @@ -302,63 +302,63 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const } break; case MATH_POW: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "base"); + return PropertyInfo(Variant::FLOAT, "base"); else - return PropertyInfo(Variant::REAL, "exp"); + return PropertyInfo(Variant::FLOAT, "exp"); } break; case MATH_EASE: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "s"); + return PropertyInfo(Variant::FLOAT, "s"); else - return PropertyInfo(Variant::REAL, "curve"); + return PropertyInfo(Variant::FLOAT, "curve"); } break; case MATH_STEP_DECIMALS: { - return PropertyInfo(Variant::REAL, "step"); + return PropertyInfo(Variant::FLOAT, "step"); } break; case MATH_STEPIFY: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "s"); + return PropertyInfo(Variant::FLOAT, "s"); else - return PropertyInfo(Variant::REAL, "steps"); + return PropertyInfo(Variant::FLOAT, "steps"); } break; case MATH_LERP: case MATH_LERP_ANGLE: case MATH_INVERSE_LERP: case MATH_SMOOTHSTEP: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "from"); + return PropertyInfo(Variant::FLOAT, "from"); else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "to"); + return PropertyInfo(Variant::FLOAT, "to"); else - return PropertyInfo(Variant::REAL, "weight"); + return PropertyInfo(Variant::FLOAT, "weight"); } break; case MATH_RANGE_LERP: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "value"); + return PropertyInfo(Variant::FLOAT, "value"); else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "istart"); + return PropertyInfo(Variant::FLOAT, "istart"); else if (p_idx == 2) - return PropertyInfo(Variant::REAL, "istop"); + return PropertyInfo(Variant::FLOAT, "istop"); else if (p_idx == 3) - return PropertyInfo(Variant::REAL, "ostart"); + return PropertyInfo(Variant::FLOAT, "ostart"); else - return PropertyInfo(Variant::REAL, "ostop"); + return PropertyInfo(Variant::FLOAT, "ostop"); } break; case MATH_MOVE_TOWARD: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "from"); + return PropertyInfo(Variant::FLOAT, "from"); else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "to"); + return PropertyInfo(Variant::FLOAT, "to"); else - return PropertyInfo(Variant::REAL, "delta"); + return PropertyInfo(Variant::FLOAT, "delta"); } break; case MATH_DECTIME: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "value"); + return PropertyInfo(Variant::FLOAT, "value"); else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "amount"); + return PropertyInfo(Variant::FLOAT, "amount"); else - return PropertyInfo(Variant::REAL, "step"); + return PropertyInfo(Variant::FLOAT, "step"); } break; case MATH_RANDOMIZE: case MATH_RAND: @@ -367,37 +367,37 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const } break; case MATH_RANDOM: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "from"); + return PropertyInfo(Variant::FLOAT, "from"); else - return PropertyInfo(Variant::REAL, "to"); + return PropertyInfo(Variant::FLOAT, "to"); } break; case MATH_SEED: case MATH_RANDSEED: { return PropertyInfo(Variant::INT, "seed"); } break; case MATH_DEG2RAD: { - return PropertyInfo(Variant::REAL, "deg"); + return PropertyInfo(Variant::FLOAT, "deg"); } break; case MATH_RAD2DEG: { - return PropertyInfo(Variant::REAL, "rad"); + return PropertyInfo(Variant::FLOAT, "rad"); } break; case MATH_LINEAR2DB: { - return PropertyInfo(Variant::REAL, "nrg"); + return PropertyInfo(Variant::FLOAT, "nrg"); } break; case MATH_DB2LINEAR: { - return PropertyInfo(Variant::REAL, "db"); + return PropertyInfo(Variant::FLOAT, "db"); } break; case MATH_POLAR2CARTESIAN: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "r"); + return PropertyInfo(Variant::FLOAT, "r"); else - return PropertyInfo(Variant::REAL, "th"); + return PropertyInfo(Variant::FLOAT, "th"); } break; case MATH_CARTESIAN2POLAR: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "x"); + return PropertyInfo(Variant::FLOAT, "x"); else - return PropertyInfo(Variant::REAL, "y"); + return PropertyInfo(Variant::FLOAT, "y"); } break; case MATH_WRAP: { if (p_idx == 0) @@ -410,11 +410,11 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case MATH_WRAPF: case LOGIC_CLAMP: { if (p_idx == 0) - return PropertyInfo(Variant::REAL, "value"); + return PropertyInfo(Variant::FLOAT, "value"); else if (p_idx == 1) - return PropertyInfo(Variant::REAL, "min"); + return PropertyInfo(Variant::FLOAT, "min"); else - return PropertyInfo(Variant::REAL, "max"); + return PropertyInfo(Variant::FLOAT, "max"); } break; case LOGIC_NEAREST_PO2: { return PropertyInfo(Variant::INT, "value"); @@ -475,7 +475,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const if (p_idx == 0) return PropertyInfo(Variant::STRING, "name"); else - return PropertyInfo(Variant::REAL, "alpha"); + return PropertyInfo(Variant::FLOAT, "alpha"); } break; case FUNC_MAX: { } @@ -504,7 +504,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons case MATH_FPOSMOD: case MATH_FLOOR: case MATH_CEIL: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_POSMOD: case MATH_ROUND: { @@ -519,14 +519,14 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons case MATH_POW: case MATH_LOG: case MATH_EXP: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_ISNAN: case MATH_ISINF: { t = Variant::BOOL; } break; case MATH_EASE: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_STEP_DECIMALS: { t = Variant::INT; @@ -539,7 +539,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons case MATH_SMOOTHSTEP: case MATH_MOVE_TOWARD: case MATH_DECTIME: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_RANDOMIZE: { @@ -551,7 +551,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons } break; case MATH_RANDF: case MATH_RANDOM: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_SEED: { @@ -568,7 +568,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons case MATH_LINEAR2DB: case MATH_WRAPF: case MATH_DB2LINEAR: { - t = Variant::REAL; + t = Variant::FLOAT; } break; case MATH_POLAR2CARTESIAN: case MATH_CARTESIAN2POLAR: { @@ -679,7 +679,7 @@ VisualScriptBuiltinFunc::BuiltinFunc VisualScriptBuiltinFunc::get_func() { if (!p_inputs[m_arg]->is_num()) { \ r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; \ r_error.argument = m_arg; \ - r_error.expected = Variant::REAL; \ + r_error.expected = Variant::FLOAT; \ return; \ } @@ -781,7 +781,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in int64_t i = *p_inputs[0]; *r_return = ABS(i); - } else if (p_inputs[0]->get_type() == Variant::REAL) { + } else if (p_inputs[0]->get_type() == Variant::FLOAT) { real_t r = *p_inputs[0]; *r_return = Math::abs(r); @@ -789,7 +789,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::REAL; + r_error.expected = Variant::FLOAT; } } break; case VisualScriptBuiltinFunc::MATH_SIGN: { @@ -798,7 +798,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in int64_t i = *p_inputs[0]; *r_return = i < 0 ? -1 : (i > 0 ? +1 : 0); - } else if (p_inputs[0]->get_type() == Variant::REAL) { + } else if (p_inputs[0]->get_type() == Variant::FLOAT) { real_t r = *p_inputs[0]; *r_return = r < 0.0 ? -1.0 : (r > 0.0 ? +1.0 : 0.0); @@ -806,7 +806,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::REAL; + r_error.expected = Variant::FLOAT; } } break; case VisualScriptBuiltinFunc::MATH_POW: { diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 787f0b7f40..8d58cb9c4d 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -346,7 +346,7 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::BOOL: color = Color(0.55, 0.65, 0.94); break; case Variant::INT: color = Color(0.49, 0.78, 0.94); break; - case Variant::REAL: color = Color(0.38, 0.85, 0.96); break; + case Variant::FLOAT: color = Color(0.38, 0.85, 0.96); break; case Variant::STRING: color = Color(0.42, 0.65, 0.93); break; case Variant::VECTOR2: color = Color(0.74, 0.57, 0.95); break; @@ -367,8 +367,10 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::ARRAY: color = Color(0.88, 0.88, 0.88); break; case Variant::PACKED_BYTE_ARRAY: color = Color(0.67, 0.96, 0.78); break; - case Variant::PACKED_INT_ARRAY: color = Color(0.69, 0.86, 0.96); break; - case Variant::PACKED_REAL_ARRAY: color = Color(0.59, 0.91, 0.97); break; + case Variant::PACKED_INT32_ARRAY: color = Color(0.69, 0.86, 0.96); break; + case Variant::PACKED_FLOAT32_ARRAY: color = Color(0.59, 0.91, 0.97); break; + case Variant::PACKED_INT64_ARRAY: color = Color(0.69, 0.86, 0.96); break; + case Variant::PACKED_FLOAT64_ARRAY: color = Color(0.59, 0.91, 0.97); break; case Variant::PACKED_STRING_ARRAY: color = Color(0.62, 0.77, 0.95); break; case Variant::PACKED_VECTOR2_ARRAY: color = Color(0.82, 0.7, 0.96); break; case Variant::PACKED_VECTOR3_ARRAY: color = Color(0.87, 0.61, 0.95); break; @@ -383,7 +385,7 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::BOOL: color = Color(0.43, 0.56, 0.92); break; case Variant::INT: color = Color(0.31, 0.7, 0.91); break; - case Variant::REAL: color = Color(0.15, 0.8, 0.94); break; + case Variant::FLOAT: color = Color(0.15, 0.8, 0.94); break; case Variant::STRING: color = Color(0.27, 0.56, 0.91); break; case Variant::VECTOR2: color = Color(0.68, 0.46, 0.93); break; @@ -404,8 +406,10 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::ARRAY: color = Color(0.45, 0.45, 0.45); break; case Variant::PACKED_BYTE_ARRAY: color = Color(0.38, 0.92, 0.6); break; - case Variant::PACKED_INT_ARRAY: color = Color(0.38, 0.73, 0.92); break; - case Variant::PACKED_REAL_ARRAY: color = Color(0.25, 0.83, 0.95); break; + case Variant::PACKED_INT32_ARRAY: color = Color(0.38, 0.73, 0.92); break; + case Variant::PACKED_FLOAT32_ARRAY: color = Color(0.25, 0.83, 0.95); break; + case Variant::PACKED_INT64_ARRAY: color = Color(0.38, 0.73, 0.92); break; + case Variant::PACKED_FLOAT64_ARRAY: color = Color(0.25, 0.83, 0.95); break; case Variant::PACKED_STRING_ARRAY: color = Color(0.38, 0.62, 0.92); break; case Variant::PACKED_VECTOR2_ARRAY: color = Color(0.62, 0.36, 0.92); break; case Variant::PACKED_VECTOR3_ARRAY: color = Color(0.79, 0.35, 0.92); break; @@ -521,8 +525,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Control::get_icon("Dictionary", "EditorIcons"), Control::get_icon("Array", "EditorIcons"), Control::get_icon("PackedByteArray", "EditorIcons"), - Control::get_icon("PackedIntArray", "EditorIcons"), - Control::get_icon("PackedRealArray", "EditorIcons"), + Control::get_icon("PackedInt32Array", "EditorIcons"), + Control::get_icon("PackedFloat32Array", "EditorIcons"), Control::get_icon("PackedStringArray", "EditorIcons"), Control::get_icon("PackedVector2Array", "EditorIcons"), Control::get_icon("PackedVector3Array", "EditorIcons"), @@ -977,8 +981,8 @@ void VisualScriptEditor::_update_members() { Control::get_icon("Dictionary", "EditorIcons"), Control::get_icon("Array", "EditorIcons"), Control::get_icon("PackedByteArray", "EditorIcons"), - Control::get_icon("PackedIntArray", "EditorIcons"), - Control::get_icon("PackedRealArray", "EditorIcons"), + Control::get_icon("PackedInt32Array", "EditorIcons"), + Control::get_icon("PackedFloat32Array", "EditorIcons"), Control::get_icon("PackedStringArray", "EditorIcons"), Control::get_icon("PackedVector2Array", "EditorIcons"), Control::get_icon("PackedVector3Array", "EditorIcons"), @@ -2910,8 +2914,8 @@ void VisualScriptEditor::_graph_connected(const String &p_from, int p_from_slot, if (to_type != Variant::NIL && from_type != Variant::NIL && to_type != from_type) { // add a constructor node between the ports bool exceptions = false; // true if there are any exceptions - exceptions = exceptions || (to_type == Variant::INT && from_type == Variant::REAL); - exceptions = exceptions || (to_type == Variant::REAL && from_type == Variant::INT); + exceptions = exceptions || (to_type == Variant::INT && from_type == Variant::FLOAT); + exceptions = exceptions || (to_type == Variant::FLOAT && from_type == Variant::INT); if (Variant::can_convert(from_type, to_type) && !exceptions) { MethodInfo mi; mi.name = Variant::get_type_name(to_type); diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 1f1c3e2f52..4a9a6bdb1d 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -2259,7 +2259,7 @@ PropertyInfo VisualScriptMathConstant::get_input_value_port_info(int p_idx) cons PropertyInfo VisualScriptMathConstant::get_output_value_port_info(int p_idx) const { - return PropertyInfo(Variant::REAL, const_name[constant]); + return PropertyInfo(Variant::FLOAT, const_name[constant]); } String VisualScriptMathConstant::get_caption() const { diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index 51b77659c4..20bad364dc 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -120,8 +120,10 @@ void VisualScriptPropertySelector::_update_search() { Control::get_icon("Dictionary", "EditorIcons"), Control::get_icon("Array", "EditorIcons"), Control::get_icon("PackedByteArray", "EditorIcons"), - Control::get_icon("PackedIntArray", "EditorIcons"), - Control::get_icon("PackedRealArray", "EditorIcons"), + Control::get_icon("PackedInt32Array", "EditorIcons"), + Control::get_icon("PackedFloat32Array", "EditorIcons"), + Control::get_icon("PackedInt64Array", "EditorIcons"), + Control::get_icon("PackedFloat64Array", "EditorIcons"), Control::get_icon("PackedStringArray", "EditorIcons"), Control::get_icon("PackedVector2Array", "EditorIcons"), Control::get_icon("PackedVector3Array", "EditorIcons"), @@ -279,7 +281,7 @@ void VisualScriptPropertySelector::_update_search() { if (type == Variant::BOOL) { get_visual_node_names("operators/logic/", Set<String>(), found, root, search_box); } - if (type == Variant::BOOL || type == Variant::INT || type == Variant::REAL || type == Variant::VECTOR2 || type == Variant::VECTOR3) { + if (type == Variant::BOOL || type == Variant::INT || type == Variant::FLOAT || type == Variant::VECTOR2 || type == Variant::VECTOR3) { get_visual_node_names("operators/math/", Set<String>(), found, root, search_box); } } diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp index 40d2ec88c5..858074742e 100644 --- a/modules/visual_script/visual_script_yield_nodes.cpp +++ b/modules/visual_script/visual_script_yield_nodes.cpp @@ -188,7 +188,7 @@ void VisualScriptYield::_bind_methods() { ClassDB::bind_method(D_METHOD("get_wait_time"), &VisualScriptYield::get_wait_time); ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Frame,Physics Frame,Time", PROPERTY_USAGE_NOEDITOR), "set_yield_mode", "get_yield_mode"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "wait_time"), "set_wait_time", "get_wait_time"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wait_time"), "set_wait_time", "get_wait_time"); BIND_ENUM_CONSTANT(YIELD_FRAME); BIND_ENUM_CONSTANT(YIELD_PHYSICS_FRAME); |