Hide Ambient Light properties in Environment inspector depending on mode

This commit is contained in:
Hugo Locurcio 2022-12-26 21:59:19 +01:00
parent b6e06038f8
commit 58fcf5ed70
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C

View File

@ -1043,6 +1043,18 @@ void Environment::_validate_property(PropertyInfo &p_property) const {
} }
} }
if (p_property.name == "ambient_light_color" || p_property.name == "ambient_light_energy") {
if (ambient_source == AMBIENT_SOURCE_DISABLED) {
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
}
if (p_property.name == "ambient_light_sky_contribution") {
if (ambient_source == AMBIENT_SOURCE_DISABLED || ambient_source == AMBIENT_SOURCE_COLOR) {
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
}
if (p_property.name == "fog_aerial_perspective") { if (p_property.name == "fog_aerial_perspective") {
if (bg_mode != BG_SKY) { if (bg_mode != BG_SKY) {
p_property.usage = PROPERTY_USAGE_NO_EDITOR; p_property.usage = PROPERTY_USAGE_NO_EDITOR;