Convert _notification methods to switch - Chunk C

This commit is contained in:
Jakob Bouchard 2022-02-16 09:17:55 -05:00
parent 98b97d34df
commit 6553f5c242
No known key found for this signature in database
GPG key ID: 1322EC579631D074
37 changed files with 378 additions and 327 deletions

View file

@ -438,13 +438,16 @@ void ShaderGlobalsEditor::_bind_methods() {
}
void ShaderGlobalsEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
if (is_visible_in_tree()) {
inspector->edit(interface);
}
}
if (p_what == NOTIFICATION_PREDELETE) {
inspector->edit(nullptr);
switch (p_what) {
case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_visible_in_tree()) {
inspector->edit(interface);
}
} break;
case NOTIFICATION_PREDELETE: {
inspector->edit(nullptr);
} break;
}
}