-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit vector/rect properties in a "linked" manner when holding down Ctrl #41555
Edit vector/rect properties in a "linked" manner when holding down Ctrl #41555
Conversation
For Rect2, Rect2i and AABB, this only applies to the size, not the position. This closes godotengine/godot-proposals#144.
v3.z = spin[2]->get_value(); | ||
if (Input::get_singleton()->is_key_pressed(KEY_CONTROL)) { | ||
// Set all components to the edited value to quickly set "linked" values such as scale. | ||
if (p_name == "x") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_value_changed
has a val
parameter. Use that instead of whatever this is.
I think that a link button would make more sense. I did a bit of work in my fork |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the lines to change and suggestions (Thanks @aaronfranke)
if (p_name == "x") { | ||
v3.x = spin[0]->get_value(); | ||
v3.y = spin[0]->get_value(); | ||
v3.z = spin[0]->get_value(); | ||
} else if (p_name == "y") { | ||
v3.x = spin[1]->get_value(); | ||
v3.y = spin[1]->get_value(); | ||
v3.z = spin[1]->get_value(); | ||
} else if (p_name == "z") { | ||
v3.x = spin[2]->get_value(); | ||
v3.y = spin[2]->get_value(); | ||
v3.z = spin[2]->get_value(); | ||
} else { | ||
ERR_PRINT("Unexpected component name (please report)."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (p_name == "x") { | |
v3.x = spin[0]->get_value(); | |
v3.y = spin[0]->get_value(); | |
v3.z = spin[0]->get_value(); | |
} else if (p_name == "y") { | |
v3.x = spin[1]->get_value(); | |
v3.y = spin[1]->get_value(); | |
v3.z = spin[1]->get_value(); | |
} else if (p_name == "z") { | |
v3.x = spin[2]->get_value(); | |
v3.y = spin[2]->get_value(); | |
v3.z = spin[2]->get_value(); | |
} else { | |
ERR_PRINT("Unexpected component name (please report)."); | |
} | |
v3 = Vector3(val, val, val); |
if (p_name == "x") { | ||
v3.x = spin[0]->get_value(); | ||
v3.y = spin[0]->get_value(); | ||
v3.z = spin[0]->get_value(); | ||
} else if (p_name == "y") { | ||
v3.x = spin[1]->get_value(); | ||
v3.y = spin[1]->get_value(); | ||
v3.z = spin[1]->get_value(); | ||
} else if (p_name == "z") { | ||
v3.x = spin[2]->get_value(); | ||
v3.y = spin[2]->get_value(); | ||
v3.z = spin[2]->get_value(); | ||
} else { | ||
ERR_PRINT("Unexpected component name (please report)."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with above
if (p_name == "x") { | |
v3.x = spin[0]->get_value(); | |
v3.y = spin[0]->get_value(); | |
v3.z = spin[0]->get_value(); | |
} else if (p_name == "y") { | |
v3.x = spin[1]->get_value(); | |
v3.y = spin[1]->get_value(); | |
v3.z = spin[1]->get_value(); | |
} else if (p_name == "z") { | |
v3.x = spin[2]->get_value(); | |
v3.y = spin[2]->get_value(); | |
v3.z = spin[2]->get_value(); | |
} else { | |
ERR_PRINT("Unexpected component name (please report)."); | |
} | |
v3 = Vector3(val, val, val); |
@Calinou What's the status of this PR? Do you plan to continue working on this? There are requested changes above that need to be addressed. |
Superseded by #59125. |
Don't merge yet. This PR needs to be modified so it doesn't link coordinates when dragging properties to change their values while holding down Ctrl.
For Rect2, Rect2i and AABB, this only applies to the size, not the position.
This closes godotengine/godot-proposals#144.
Note: When cherry-picking to the
3.2
branch, remove the parts that modify the integer vector types as these aren't present in 3.2.x.