summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/classes/MultiplayerAPIExtension.xml11
-rw-r--r--doc/classes/Resource.xml1
-rw-r--r--scene/gui/popup_menu.cpp1
3 files changed, 9 insertions, 4 deletions
diff --git a/doc/classes/MultiplayerAPIExtension.xml b/doc/classes/MultiplayerAPIExtension.xml
index 4a2d397260..7f6e7951b2 100644
--- a/doc/classes/MultiplayerAPIExtension.xml
+++ b/doc/classes/MultiplayerAPIExtension.xml
@@ -15,7 +15,7 @@
var base_multiplayer = SceneMultiplayer.new()
func _init():
- # Just passthourgh base signals (copied to var to avoid cyclic reference)
+ # Just passthrough base signals (copied to var to avoid cyclic reference)
var cts = connected_to_server
var cf = connection_failed
var pc = peer_connected
@@ -25,13 +25,16 @@
base_multiplayer.peer_connected.connect(func(id): pc.emit(id))
base_multiplayer.peer_disconnected.connect(func(id): pd.emit(id))
+ func _poll():
+ return base_multiplayer.poll()
+
# Log RPC being made and forward it to the default multiplayer.
- func _rpc(peer: int, object: Object, method: StringName, args: Array) -> int: # Error
+ func _rpc(peer: int, object: Object, method: StringName, args: Array) -> Error:
print("Got RPC for %d: %s::%s(%s)" % [peer, object, method, args])
return base_multiplayer.rpc(peer, object, method, args)
# Log configuration add. E.g. root path (nullptr, NodePath), replication (Node, Spawner|Synchronizer), custom.
- func _object_configuration_add(object, config: Variant) -> int: # Error
+ func _object_configuration_add(object, config: Variant) -> Error:
if config is MultiplayerSynchronizer:
print("Adding synchronization configuration for %s. Synchronizer: %s" % [object, config])
elif config is MultiplayerSpawner:
@@ -39,7 +42,7 @@
return base_multiplayer.object_configuration_add(object, config)
# Log configuration remove. E.g. root path (nullptr, NodePath), replication (Node, Spawner|Synchronizer), custom.
- func _object_configuration_remove(object, config: Variant) -> int: # Error
+ func _object_configuration_remove(object, config: Variant) -> Error:
if config is MultiplayerSynchronizer:
print("Removing synchronization configuration for %s. Synchronizer: %s" % [object, config])
elif config is MultiplayerSpawner:
diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml
index 75c258253d..c8146bb48f 100644
--- a/doc/classes/Resource.xml
+++ b/doc/classes/Resource.xml
@@ -92,6 +92,7 @@
</member>
<member name="resource_name" type="String" setter="set_name" getter="get_name" default="&quot;&quot;">
An optional name for this resource. When defined, its value is displayed to represent the resource in the Inspector dock. For built-in scripts, the name is displayed as part of the tab name in the script editor.
+ [b]Note:[/b] Some resource formats do not support resource names. You can still set the name in the editor or via code, but it will be lost when the resource is reloaded. For example, only built-in scripts can have a resource name, while scripts stored in separate files cannot.
</member>
<member name="resource_path" type="String" setter="set_path" getter="get_path" default="&quot;&quot;">
The unique path to this resource. If it has been saved to disk, the value will be its filepath. If the resource is exclusively contained within a scene, the value will be the [PackedScene]'s filepath, followed by a unique identifier.
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index ec9e2cacb4..0cda27ec24 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -1487,6 +1487,7 @@ void PopupMenu::add_icon_radio_check_shortcut(const Ref<Texture2D> &p_icon, cons
}
void PopupMenu::add_submenu_item(const String &p_label, const String &p_submenu, int p_id) {
+ ERR_FAIL_COND_MSG(p_submenu.validate_node_name() != p_submenu, "Invalid node name for submenu, the following characters are not allowed:\n" + String::get_invalid_node_name_characters());
Item item;
item.text = p_label;
item.xl_text = atr(p_label);