You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERR_FAIL_COND_V_MSG(other_language->get_extension() == p_language->get_extension(), ERR_ALREADY_EXISTS, vformat("A script language with extension '%s' is already registered.", p_language->get_extension()));
241
+
String shared_extensions;
242
+
String shared_types;
243
+
for (String ext : p_language->get_extensions()) {
244
+
if (other_language->get_extensions().has(ext)) {
245
+
if (!shared_extensions.is_empty()) {
246
+
shared_extensions += ", ";
247
+
}
248
+
shared_extensions += ext;
249
+
}
250
+
if (other_language->get_type_from_extension(ext) == p_language->get_type_from_extension(ext)) {
251
+
if (!shared_types.is_empty()) {
252
+
shared_types += ", ";
253
+
}
254
+
shared_types += ext;
255
+
}
256
+
}
257
+
ERR_FAIL_COND_V_MSG(!shared_extensions.is_empty(), ERR_ALREADY_EXISTS, vformat("A script language with extension '%s' is already registered.", shared_extensions));
241
258
ERR_FAIL_COND_V_MSG(other_language->get_name() == p_language->get_name(), ERR_ALREADY_EXISTS, vformat("A script language with name '%s' is already registered.", p_language->get_name()));
242
-
ERR_FAIL_COND_V_MSG(other_language->get_type() == p_language->get_type(), ERR_ALREADY_EXISTS, vformat("A script language with type '%s' is already registered.", p_language->get_type()));
259
+
ERR_FAIL_COND_V_MSG(!shared_types.is_empty(), ERR_ALREADY_EXISTS, vformat("A script language with type '%s' is already registered.", shared_types));
virtualboolhas_script_subtype(const String &p_type) const { returnfalse; } // For script with possible multiple script types, for instance interfaces or traits(in GDScript).
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when the [annotation @GDScript.@onready] is not used overridden variable from traits and trait variable uses [annotation @GDScript.@onready].
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a signal is declared but never explicitly used in the class.
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when the [code]static[/code] is not used overridden variable or function from traits and trait variable or function uses [code]static[/code].
Copy file name to clipboardexpand all lines: doc/classes/Script.xml
+7-1
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
<description>
7
7
A class stored as a resource. A script extends the functionality of all objects that instantiate it.
8
8
This is the base class for all scripts and should not be used directly. Trying to create a new script with this class will result in an error.
9
-
The [code]new[/code] method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes.
9
+
The [code]new[/code] method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes and if script is attachable check by [method is_attachable].
0 commit comments