mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Hide more options of disabled properties
This commit is contained in:
@@ -159,6 +159,7 @@ int Light2D::get_item_shadow_cull_mask() const {
|
||||
void Light2D::set_shadow_enabled(bool p_enabled) {
|
||||
shadow = p_enabled;
|
||||
RS::get_singleton()->canvas_light_set_shadow_enabled(canvas_light, shadow);
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
bool Light2D::is_shadow_enabled() const {
|
||||
@@ -221,6 +222,12 @@ float Light2D::get_shadow_smooth() const {
|
||||
return shadow_smooth;
|
||||
}
|
||||
|
||||
void Light2D::_validate_property(PropertyInfo &property) const {
|
||||
if (!shadow && (property.name == "shadow_color" || property.name == "shadow_filter" || property.name == "shadow_filter_smooth" || property.name == "shadow_item_cull_mask")) {
|
||||
property.usage = PROPERTY_USAGE_NOEDITOR;
|
||||
}
|
||||
}
|
||||
|
||||
void Light2D::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &Light2D::set_enabled);
|
||||
ClassDB::bind_method(D_METHOD("is_enabled"), &Light2D::is_enabled);
|
||||
|
||||
Reference in New Issue
Block a user