StringName Dictionary keys

also added 'is_string()' method to Variant
and refactored many String type comparisons to use it instead
This commit is contained in:
rune-scape 2023-12-28 14:44:23 -08:00 committed by rune-scape
parent 40b378e9e2
commit 154049ce17
34 changed files with 65 additions and 82 deletions

View file

@ -2201,7 +2201,7 @@ void VisualShaderEditor::_update_options_menu() {
if (input.is_valid()) {
input->set_shader_mode(visual_shader->get_mode());
input->set_shader_type(visual_shader->get_shader_type());
if (!add_options[i].ops.is_empty() && add_options[i].ops[0].get_type() == Variant::STRING) {
if (!add_options[i].ops.is_empty() && add_options[i].ops[0].is_string()) {
input->set_input_name((String)add_options[i].ops[0]);
}
}
@ -3281,7 +3281,7 @@ void VisualShaderEditor::_setup_node(VisualShaderNode *p_node, const Vector<Vari
VisualShaderNodeInput *input = Object::cast_to<VisualShaderNodeInput>(p_node);
if (input) {
ERR_FAIL_COND(p_ops[0].get_type() != Variant::STRING);
ERR_FAIL_COND(!p_ops[0].is_string());
input->set_input_name((String)p_ops[0]);
return;
}