Replace XML codeblock spaces with tabs

This commit is contained in:
kobewi
2025-05-17 20:00:17 +02:00
committed by Rémi Verschelde
parent 5dd76968d8
commit 13f642d959
122 changed files with 2407 additions and 2432 deletions

View File

@ -26,7 +26,7 @@
Add custom option to the context menu of the plugin's specified slot. When the option is activated, [param callback] will be called. Callback should take single [Array] argument; array contents depend on context menu slot.
[codeblock]
func _popup_menu(paths):
add_context_menu_item("File Custom options", handle, ICON)
add_context_menu_item("File Custom options", handle, ICON)
[/codeblock]
If you want to assign shortcut to the menu item, use [method add_context_menu_item_from_shortcut] instead.
</description>
@ -40,10 +40,10 @@
Add custom option to the context menu of the plugin's specified slot. The option will have the [param shortcut] assigned and reuse its callback. The shortcut has to be registered beforehand with [method add_menu_shortcut].
[codeblock]
func _init():
add_menu_shortcut(SHORTCUT, handle)
add_menu_shortcut(SHORTCUT, handle)
func _popup_menu(paths):
add_context_menu_item_from_shortcut("File Custom options", SHORTCUT, ICON)
add_context_menu_item_from_shortcut("File Custom options", SHORTCUT, ICON)
[/codeblock]
</description>
</method>
@ -56,12 +56,12 @@
Add a submenu to the context menu of the plugin's specified slot. The submenu is not automatically handled, you need to connect to its signals yourself. Also the submenu is freed on every popup, so provide a new [PopupMenu] every time.
[codeblock]
func _popup_menu(paths):
var popup_menu = PopupMenu.new()
popup_menu.add_item("Blue")
popup_menu.add_item("White")
popup_menu.id_pressed.connect(_on_color_submenu_option)
var popup_menu = PopupMenu.new()
popup_menu.add_item("Blue")
popup_menu.add_item("White")
popup_menu.id_pressed.connect(_on_color_submenu_option)
add_context_submenu_item("Set Node Color", popup_menu)
add_context_submenu_item("Set Node Color", popup_menu)
[/codeblock]
</description>
</method>
@ -73,7 +73,7 @@
Registers a shortcut associated with the plugin's context menu. This method should be called once (e.g. in plugin's [method Object._init]). [param callback] will be called when user presses the specified [param shortcut] while the menu's context is in effect (e.g. FileSystem dock is focused). Callback should take single [Array] argument; array contents depend on context menu slot.
[codeblock]
func _init():
add_menu_shortcut(SHORTCUT, handle)
add_menu_shortcut(SHORTCUT, handle)
[/codeblock]
</description>
</method>
@ -95,7 +95,7 @@
Context menu of Script editor's code editor. [method _popup_menu] will be called with the path to the [CodeEdit] node. You can fetch it using this code:
[codeblock]
func _popup_menu(paths):
var code_edit = Engine.get_main_loop().root.get_node(paths[0]);
var code_edit = Engine.get_main_loop().root.get_node(paths[0]);
[/codeblock]
The option callback will receive reference to that node. You can use [CodeEdit] methods to perform symbol lookups etc.
</constant>
@ -106,7 +106,7 @@
Context menu of 2D editor's basic right-click menu. [method _popup_menu] will be called with paths to all [CanvasItem] nodes under the cursor. You can fetch them using this code:
[codeblock]
func _popup_menu(paths):
var canvas_item = Engine.get_main_loop().root.get_node(paths[0]); # Replace 0 with the desired index.
var canvas_item = Engine.get_main_loop().root.get_node(paths[0]); # Replace 0 with the desired index.
[/codeblock]
The paths array is empty if there weren't any nodes under cursor. The option callback will receive a typed array of [CanvasItem] nodes.
</constant>