1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Some code simplifications

AnimationNodeBlendSpace2DEditor:
- `!tree` is always false, because it is checked a few lines above

CurveEdit:
- grabbing != GRAB_NONE is redundant

GradientTexture2DEdit:
- grabbed != HANDLE_FROM is redundant
- grabbed != HANDLE_TO is redundant

Viewport:
- index is not used afterwards
- In these cases `gui.mouse_focus` is always valid. Move check to a DEV_ASSERT
- simplify `stopped` calculation
This commit is contained in:
Markus Sauermann
2023-02-08 18:39:05 +01:00
parent 2985a9ac34
commit 5ddab1f363
4 changed files with 9 additions and 22 deletions

View File

@@ -820,9 +820,7 @@ void AnimationNodeBlendSpace2DEditor::_notification(int p_what) {
String error;
if (!tree) {
error = TTR("BlendSpace2D does not belong to an AnimationTree node.");
} else if (!tree->is_active()) {
if (!tree->is_active()) {
error = TTR("AnimationTree is inactive.\nActivate to enable playback, check node warnings if activation fails.");
} else if (tree->is_state_invalid()) {
error = tree->get_invalid_state_reason();