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
Copy file name to clipboardExpand all lines: doc/classes/ProjectSettings.xml
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -471,6 +471,9 @@
471
471
Specifies the maximum number of log files allowed (used for rotation). Set to [code]1[/code] to disable log file rotation.
472
472
If the [code]--log-file <file>[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url] is used, log rotation is always disabled.
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a class member is accessed from external places, such as accessing a private member from other classes that are not derived from the class where the member is defined.
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when an [code]assert[/code] call always evaluates to [code]false[/code].
returnvformat(R"*(The default value is using "%s" which won't return nodes in the scene tree before "_ready()" is called. Use the "@onready" annotation to solve this.)*", symbols[0]);
163
163
case ONREADY_WITH_EXPORT:
164
164
returnR"("@onready" will set the default value after "@export" takes effect and will override it.)";
165
+
case ACCESS_PRIVATE_MEMBER:
166
+
CHECK_SYMBOLS(1);
167
+
returnvformat(R"(Trying to access a private member "%s" from an external place, which would cause problems during runtime.)", symbols[0]);
168
+
case CALLING_PRIVATE_METHOD:
169
+
CHECK_SYMBOLS(1);
170
+
returnvformat(R"*(Trying to call a private method "%s()" from an external place, which would cause problems during runtime.)*", symbols[0]);
165
171
#ifndef DISABLE_DEPRECATED
166
172
// Never produced. These warnings migrated from 3.x by mistake.
167
173
case PROPERTY_USED_AS_FUNCTION: // There is already an error.
Copy file name to clipboardExpand all lines: modules/gdscript/gdscript_warning.h
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,8 @@ class GDScriptWarning {
89
89
NATIVE_METHOD_OVERRIDE, // The script method overrides a native one, this may not work as intended.
90
90
GET_NODE_DEFAULT_WITHOUT_ONREADY, // A class variable uses `get_node()` (or the `$` notation) as its default value, but does not use the @onready annotation.
91
91
ONREADY_WITH_EXPORT, // The `@onready` annotation will set the value after `@export` which is likely not intended.
92
+
ACCESS_PRIVATE_MEMBER, // Accessing a private member from external places. E.g. accessing an `_`-prefixed member from other classes that are not derived from the class where the member is defined.
93
+
CALLING_PRIVATE_METHOD, // Calling a private method from external places. E.g. calling an `_`-prefixed method from other classes that are not derived from the class where the method is defined.
92
94
#ifndef DISABLE_DEPRECATED
93
95
PROPERTY_USED_AS_FUNCTION, // Function not found, but there's a property with the same name.
94
96
CONSTANT_USED_AS_FUNCTION, // Function not found, but there's a constant with the same name.
@@ -146,6 +148,8 @@ class GDScriptWarning {
146
148
ERROR, // NATIVE_METHOD_OVERRIDE // May not work as expected.
147
149
ERROR, // GET_NODE_DEFAULT_WITHOUT_ONREADY // May not work as expected.
148
150
ERROR, // ONREADY_WITH_EXPORT // May not work as expected.
0 commit comments