diff options
author | jordi <creptthrust@gmail.com> | 2022-03-23 12:54:41 -0500 |
---|---|---|
committer | jordi <creptthrust@gmail.com> | 2023-01-24 12:33:55 -0600 |
commit | bb9a00889ac9ce6f33adb34a583208e3843c3f92 (patch) | |
tree | d0dcb210127d7fdd2322e5edf0ec862561777a02 /modules/gdscript/gdscript_warning.cpp | |
parent | 9de0c73e4529afe3ea060332a03e17cc0581efd8 (diff) | |
download | redot-engine-bb9a00889ac9ce6f33adb34a583208e3843c3f92.tar.gz |
Add hint for identifiers renamed since Godot 3
Diffstat (limited to 'modules/gdscript/gdscript_warning.cpp')
-rw-r--r-- | modules/gdscript/gdscript_warning.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_warning.cpp b/modules/gdscript/gdscript_warning.cpp index a6cbb7f6ae..ec2ea9ba4d 100644 --- a/modules/gdscript/gdscript_warning.cpp +++ b/modules/gdscript/gdscript_warning.cpp @@ -159,6 +159,9 @@ String GDScriptWarning::get_message() const { CHECK_SYMBOLS(1); return vformat(R"(The identifier "%s" has misleading characters and might be confused with something else.)", symbols[0]); } + case RENAMED_IN_GD4_HINT: { + break; // Renamed identifier hint is taken care of by the GDScriptAnalyzer. No message needed here. + } case WARNING_MAX: break; // Can't happen, but silences warning } @@ -180,6 +183,9 @@ int GDScriptWarning::get_default_value(Code p_code) { PropertyInfo GDScriptWarning::get_property_info(Code p_code) { // Making this a separate function in case a warning needs different PropertyInfo in the future. + if (p_code == Code::RENAMED_IN_GD4_HINT) { + return PropertyInfo(Variant::BOOL, get_settings_path_from_code(p_code)); + } return PropertyInfo(Variant::INT, get_settings_path_from_code(p_code), PROPERTY_HINT_ENUM, "Ignore,Warn,Error"); } @@ -224,6 +230,7 @@ String GDScriptWarning::get_name_from_code(Code p_code) { "INT_ASSIGNED_TO_ENUM", "STATIC_CALLED_ON_INSTANCE", "CONFUSABLE_IDENTIFIER", + "RENAMED_IN_GODOT_4_HINT" }; static_assert((sizeof(names) / sizeof(*names)) == WARNING_MAX, "Amount of warning types don't match the amount of warning names."); |