From a4c734ed32c1714b32aef6c56a06504778469c9e Mon Sep 17 00:00:00 2001 From: Doug Thompson Date: Sun, 15 Jan 2023 13:26:21 +0000 Subject: [PATCH] Class reference: snake_case .gd filenames, _on_* This is for: https://github.com/godotengine/godot-docs/issues/6245 --- doc/classes/Callable.xml | 2 +- doc/classes/Control.xml | 4 ++-- doc/classes/DTLSServer.xml | 4 ++-- doc/classes/UndoRedo.xml | 2 +- doc/classes/bool.xml | 2 +- modules/webxr/doc_classes/WebXRInterface.xml | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index d1fdaef29c6..79e65f34725 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -14,7 +14,7 @@ func test(): var callable = Callable(self, "print_args") callable.call("hello", "world") # Prints "hello world ". - callable.call(Vector2.UP, 42, callable) # Prints "(0, -1) 42 Node(Node.gd)::print_args". + callable.call(Vector2.UP, 42, callable) # Prints "(0, -1) 42 Node(node.gd)::print_args". callable.call("invalid") # Invalid call, should have at least 2 arguments. [/gdscript] [csharp] diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 08964cf21d6..75afb0cdbfc 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -180,14 +180,14 @@ [codeblocks] [gdscript] func _make_custom_tooltip(for_text): - var tooltip = preload("res://SomeTooltipScene.tscn").instantiate() + var tooltip = preload("res://some_tooltip_scene.tscn").instantiate() tooltip.get_node("Label").text = for_text return tooltip [/gdscript] [csharp] public override Godot.Control _MakeCustomTooltip(String forText) { - Node tooltip = ResourceLoader.Load<PackedScene>("res://SomeTooltipScene.tscn").Instantiate(); + Node tooltip = ResourceLoader.Load<PackedScene>("res://some_tooltip_scene.tscn").Instantiate(); tooltip.GetNode<Label>("Label").Text = forText; return tooltip; } diff --git a/doc/classes/DTLSServer.xml b/doc/classes/DTLSServer.xml index 9af8be99ef5..457513b8aa7 100644 --- a/doc/classes/DTLSServer.xml +++ b/doc/classes/DTLSServer.xml @@ -8,7 +8,7 @@ Below a small example of how to use it: [codeblocks] [gdscript] - # ServerNode.gd + # server_node.gd extends Node var dtls := DTLSServer.new() @@ -86,7 +86,7 @@ [/codeblocks] [codeblocks] [gdscript] - # ClientNode.gd + # client_node.gd extends Node var dtls := PacketPeerDTLS.new() diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 7258efbddaf..42baf7728d9 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -17,7 +17,7 @@ func undo_something(): pass # Put here the code that reverts what's done by "do_something()". - func _on_MyButton_pressed(): + func _on_my_button_pressed(): var node = get_node("MyNode2D") undo_redo.create_action("Move the node") undo_redo.add_do_method(self, "do_something") diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml index d0ef6642816..e1a98f0ea40 100644 --- a/doc/classes/bool.xml +++ b/doc/classes/bool.xml @@ -60,7 +60,7 @@ _can_shoot = false _cool_down.start() - func _on_CoolDownTimer_timeout(): + func _on_cool_down_timer_timeout(): _can_shoot = true [/gdscript] [csharp] diff --git a/modules/webxr/doc_classes/WebXRInterface.xml b/modules/webxr/doc_classes/WebXRInterface.xml index f5964eb4d14..ba1750386f1 100644 --- a/modules/webxr/doc_classes/WebXRInterface.xml +++ b/modules/webxr/doc_classes/WebXRInterface.xml @@ -18,7 +18,7 @@ func _ready(): # We assume this node has a button as a child. # This button is for the user to consent to entering immersive VR mode. - $Button.pressed.connect(self._on_Button_pressed) + $Button.pressed.connect(self._on_button_pressed) webxr_interface = XRServer.find_interface("WebXR") if webxr_interface: @@ -38,7 +38,7 @@ if session_mode == 'immersive-vr': vr_supported = supported - func _on_Button_pressed(): + func _on_button_pressed(): if not vr_supported: OS.alert("Your browser doesn't support VR") return