Hide more options of disabled properties

This commit is contained in:
Michael Alexsander
2021-03-03 20:51:35 -03:00
parent 864caf5711
commit 4be282a269
20 changed files with 51 additions and 32 deletions

View File

@@ -569,6 +569,7 @@ void Camera2D::_set_old_smoothing(float p_enable) {
void Camera2D::set_enable_follow_smoothing(bool p_enabled) {
smoothing_enabled = p_enabled;
notify_property_list_changed();
}
bool Camera2D::is_follow_smoothing_enabled() const {
@@ -642,6 +643,12 @@ bool Camera2D::is_margin_drawing_enabled() const {
return margin_drawing_enabled;
}
void Camera2D::_validate_property(PropertyInfo &property) const {
if (!smoothing_enabled && property.name == "smoothing_speed") {
property.usage = PROPERTY_USAGE_NOEDITOR;
}
}
void Camera2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_offset", "offset"), &Camera2D::set_offset);
ClassDB::bind_method(D_METHOD("get_offset"), &Camera2D::get_offset);