mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
Add enum values (Ignore, Warn, Error) to GDScript warnings
This commit is contained in:
parent
155a94fabe
commit
14bad75206
5 changed files with 103 additions and 59 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue