You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add enum values (Ignore, Warn, Error) to GDScript warnings
This commit is contained in:
@@ -2213,9 +2213,13 @@ GDScriptLanguage::GDScriptLanguage() {
|
||||
GLOBAL_DEF("debug/gdscript/warnings/treat_warnings_as_errors", false);
|
||||
GLOBAL_DEF("debug/gdscript/warnings/exclude_addons", true);
|
||||
for (int i = 0; i < (int)GDScriptWarning::WARNING_MAX; i++) {
|
||||
String warning = GDScriptWarning::get_name_from_code((GDScriptWarning::Code)i).to_lower();
|
||||
bool default_enabled = !warning.begins_with("unsafe_");
|
||||
GLOBAL_DEF("debug/gdscript/warnings/" + warning, default_enabled);
|
||||
GDScriptWarning::Code code = (GDScriptWarning::Code)i;
|
||||
Variant default_enabled = GDScriptWarning::get_default_value(code);
|
||||
String path = GDScriptWarning::get_settings_path_from_code(code);
|
||||
GLOBAL_DEF(path, default_enabled);
|
||||
|
||||
PropertyInfo property_info = GDScriptWarning::get_property_info(code);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info(path, property_info);
|
||||
}
|
||||
#endif // DEBUG_ENABLED
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user