From 4e59b31a35626070f0544f906a1d406e163ec067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= Date: Mon, 4 Nov 2024 17:00:42 -0300 Subject: [PATCH] Switch property labels back to human readable In commit c18ab3f we regressed the property names from capitalized to lower case. We actually want both: capitalize them and then lower case them. Fixes https://github.com/endlessm/godot-block-coding/issues/302 --- addons/block_code/code_generation/blocks_catalog.gd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/block_code/code_generation/blocks_catalog.gd b/addons/block_code/code_generation/blocks_catalog.gd index 227b568f..e4ece40d 100644 --- a/addons/block_code/code_generation/blocks_catalog.gd +++ b/addons/block_code/code_generation/blocks_catalog.gd @@ -118,7 +118,7 @@ static func _add_property_definitions(_class_name: String, property_list: Array[ block_settings.category, Types.BlockType.STATEMENT, TYPE_NIL, - "set %s to {value: %s}" % [property.name.to_lower(), type_string], + "set %s to {value: %s}" % [property.name.capitalize().to_lower(), type_string], "%s = {value}" % property.name, {"value": block_settings.get("default_set", _FALLBACK_SET_FOR_TYPE[property.type])}, ) @@ -136,7 +136,7 @@ static func _add_property_definitions(_class_name: String, property_list: Array[ block_settings.category, Types.BlockType.STATEMENT, TYPE_NIL, - "change %s by {value: %s}" % [property.name.to_lower(), type_string], + "change %s by {value: %s}" % [property.name.capitalize().to_lower(), type_string], "%s += {value}" % property.name, {"value": block_settings.get("default_change", _FALLBACK_CHANGE_FOR_TYPE[property.type])}, ) @@ -153,7 +153,7 @@ static func _add_property_definitions(_class_name: String, property_list: Array[ block_settings.category, Types.BlockType.VALUE, property.type, - "%s" % property.name.to_lower(), + "%s" % property.name.capitalize().to_lower(), "%s" % property.name, ) )