From 9e996fe6022f63b8669dbae04dc511d58c968d33 Mon Sep 17 00:00:00 2001 From: Cassidy James Blaede Date: Thu, 29 Aug 2024 16:02:50 -0600 Subject: [PATCH 1/4] blocks: Add descriptions for Viewport blocks These were missing, and it's better to have something than nothing at all! https://phabricator.endlessm.com/T35563 --- addons/block_code/blocks/graphics/viewport_center.tres | 2 +- addons/block_code/blocks/graphics/viewport_height.tres | 2 +- addons/block_code/blocks/graphics/viewport_width.tres | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/block_code/blocks/graphics/viewport_center.tres b/addons/block_code/blocks/graphics/viewport_center.tres index 3779ce21..e3b65041 100644 --- a/addons/block_code/blocks/graphics/viewport_center.tres +++ b/addons/block_code/blocks/graphics/viewport_center.tres @@ -5,7 +5,7 @@ [resource] script = ExtResource("1_rc1so") name = &"viewport_center" -description = "" +description = "Coordinates of the middle of the viewable screen when playing." category = "Graphics | Viewport" type = 3 variant_type = 5 diff --git a/addons/block_code/blocks/graphics/viewport_height.tres b/addons/block_code/blocks/graphics/viewport_height.tres index 789de6d6..50dcf640 100644 --- a/addons/block_code/blocks/graphics/viewport_height.tres +++ b/addons/block_code/blocks/graphics/viewport_height.tres @@ -5,7 +5,7 @@ [resource] script = ExtResource("1_1debb") name = &"viewport_height" -description = "" +description = "How tall the viewable screen is when playing." category = "Graphics | Viewport" type = 3 variant_type = 3 diff --git a/addons/block_code/blocks/graphics/viewport_width.tres b/addons/block_code/blocks/graphics/viewport_width.tres index ceb30730..39ba35aa 100644 --- a/addons/block_code/blocks/graphics/viewport_width.tres +++ b/addons/block_code/blocks/graphics/viewport_width.tres @@ -5,7 +5,7 @@ [resource] script = ExtResource("1_ll4rh") name = &"viewport_width" -description = "" +description = "How wide the viewable screen is when playing." category = "Graphics | Viewport" type = 3 variant_type = 3 From edfbe8d72ee5f736d02c05c994b3332936afe82f Mon Sep 17 00:00:00 2001 From: Cassidy James Blaede Date: Thu, 29 Aug 2024 16:04:07 -0600 Subject: [PATCH 2/4] characterbody2d_move: add description Hopefully this makes sense? It documents the order of the inputs as well which I think is important. https://phabricator.endlessm.com/T35563 --- addons/block_code/blocks/input/characterbody2d_move.tres | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/block_code/blocks/input/characterbody2d_move.tres b/addons/block_code/blocks/input/characterbody2d_move.tres index 07614611..89e20a9a 100644 --- a/addons/block_code/blocks/input/characterbody2d_move.tres +++ b/addons/block_code/blocks/input/characterbody2d_move.tres @@ -6,7 +6,7 @@ script = ExtResource("1_btxic") name = &"characterbody2d_move" target_node_class = "CharacterBody2D" -description = "" +description = "Move the node up, down, left, and right with the keyboard. Speed is in the format x, y (left/right, up/down)." category = "Input" type = 2 variant_type = 0 From ea8a90f9865852734577615c801ad99ee5e7afcb Mon Sep 17 00:00:00 2001 From: Cassidy James Blaede Date: Thu, 29 Aug 2024 16:38:12 -0600 Subject: [PATCH 3/4] characterbody2d_move: improve description --- addons/block_code/blocks/input/characterbody2d_move.tres | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/block_code/blocks/input/characterbody2d_move.tres b/addons/block_code/blocks/input/characterbody2d_move.tres index 89e20a9a..688ff5af 100644 --- a/addons/block_code/blocks/input/characterbody2d_move.tres +++ b/addons/block_code/blocks/input/characterbody2d_move.tres @@ -6,7 +6,7 @@ script = ExtResource("1_btxic") name = &"characterbody2d_move" target_node_class = "CharacterBody2D" -description = "Move the node up, down, left, and right with the keyboard. Speed is in the format x, y (left/right, up/down)." +description = "Move the character up, down, left, and right with the keyboard using the given keys. The speed of movement can be adjusted separately for x (left and right) and y (up and down)." category = "Input" type = 2 variant_type = 0 From 34f9beee5936b5ad4c53bf1cc3564158e4fdde65 Mon Sep 17 00:00:00 2001 From: Cassidy James Blaede Date: Thu, 29 Aug 2024 17:11:33 -0600 Subject: [PATCH 4/4] simple_character: Add description for tooltip The multi-line formatting is a little weird in the code, but it looks nice as a tooltip! https://phabricator.endlessm.com/T35563 --- .../simple_nodes/simple_character/simple_character.gd | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/block_code/simple_nodes/simple_character/simple_character.gd b/addons/block_code/simple_nodes/simple_character/simple_character.gd index dffaff35..90987be1 100644 --- a/addons/block_code/simple_nodes/simple_character/simple_character.gd +++ b/addons/block_code/simple_nodes/simple_character/simple_character.gd @@ -129,6 +129,13 @@ static func setup_custom_blocks(): block_definition.category = "Input" block_definition.type = Types.BlockType.STATEMENT block_definition.display_template = "Move with {player: OPTION} buttons as {kind: OPTION}" + block_definition.description = """Move the character using the “Player 1” or “Player 2” controls as configured in Godot. + +“Top-down” enables the character to move in both x (vertical) and y (horizontal) dimensions, as if the camera is above the character, looking down. No gravity is added. + +“Platformer” enables the character to move as if the camera is looking from the side, like a side-scroller. Gravity is applied on the x (vertical) axis, making the character fall down until they collide. + +“Spaceship” uses the left/right controls to turn the character and up/down controls to go forward or backward.""" # TODO: delta here is assumed to be the parameter name of # the _process or _physics_process method: block_definition.code_template = 'move_with_player_buttons("{player}", "{kind}", delta)'