diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-01-13 22:38:37 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-01-13 22:38:43 +0100 |
commit | f19fd7a4c1b95d7552f186110c2e7ae8dcbc6ccc (patch) | |
tree | 7562c6e5931eb39962767b2f335599967c773054 /scene/main | |
parent | f392b340ffa832f5395e01ff5d96ae553d0983d6 (diff) |
Reenable node name case setting + code cleanups
The method _generate_serial_child_name is indeed called relatively often
in editor mode, but that commented out code chunk hardly adds to its
slowness (and with the default setting, not at all).
Also did various related code cleanups and simplifications.
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/node.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 3a533d24b3..e98e93b586 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1384,10 +1384,8 @@ String Node::_generate_serial_child_name(Node *p_child) { if (name=="") { name = p_child->get_class(); - /* this is probably too slow to use here, should check alternatives - * // Adjust casing according to project setting. The current type name is expected to be in PascalCase. - switch (Globals::get_singleton()->get("node/name_casing").operator int()) { + switch (GlobalConfig::get_singleton()->get("editor/node_name_casing").operator int()) { case NAME_CASING_PASCAL_CASE: break; case NAME_CASING_CAMEL_CASE: @@ -1397,7 +1395,6 @@ String Node::_generate_serial_child_name(Node *p_child) { name = name.camelcase_to_underscore(true); break; } - */ } // Extract trailing number @@ -2902,10 +2899,10 @@ void Node::request_ready() { void Node::_bind_methods() { - _GLOBAL_DEF("editor/node_name_num_separator",0); + GLOBAL_DEF("editor/node_name_num_separator",0); GlobalConfig::get_singleton()->set_custom_property_info("editor/node_name_num_separator",PropertyInfo(Variant::INT,"editor/node_name_num_separator",PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash")); - _GLOBAL_DEF("node/name_casing",NAME_CASING_PASCAL_CASE); - GlobalConfig::get_singleton()->set_custom_property_info("node/name_casing",PropertyInfo(Variant::INT,"node/name_casing",PROPERTY_HINT_ENUM,"PascalCase,camelCase,snake_case")); + GLOBAL_DEF("node/name_casing",NAME_CASING_PASCAL_CASE); + GlobalConfig::get_singleton()->set_custom_property_info("editor/node_name_casing",PropertyInfo(Variant::INT,"editor/node_name_casing",PROPERTY_HINT_ENUM,"PascalCase,camelCase,snake_case")); ClassDB::bind_method(_MD("_add_child_below_node","node:Node","child_node:Node","legible_unique_name"),&Node::add_child_below_node,DEFVAL(false)); |