feat: allow multi-edit of "Is Default" when parameter names are empty (#1350)

This commit is contained in:
bd_ 2024-11-16 19:20:36 -08:00 committed by GitHub
parent d23b9f94a2
commit e68e176aa4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -521,7 +521,12 @@ namespace nadena.dev.modular_avatar.core.editor
// But, we do want to see if _any_ are default. // But, we do want to see if _any_ are default.
var anyIsDefault = _prop_isDefault.hasMultipleDifferentValues || _prop_isDefault.boolValue; var anyIsDefault = _prop_isDefault.hasMultipleDifferentValues || _prop_isDefault.boolValue;
var mixedIsDefault = multipleSelections && anyIsDefault; var mixedIsDefault = multipleSelections && anyIsDefault;
using (new EditorGUI.DisabledScope(multipleSelections || isDefaultByKnownParam != null))
var allAreAutoParams = !_parameterName.hasMultipleDifferentValues &&
string.IsNullOrWhiteSpace(_parameterName.stringValue);
using (new EditorGUI.DisabledScope((!allAreAutoParams && multipleSelections) ||
isDefaultByKnownParam != null))
{ {
EditorGUI.BeginChangeCheck(); EditorGUI.BeginChangeCheck();
DrawHorizontalToggleProp(_prop_isDefault, G("menuitem.prop.is_default"), mixedIsDefault, DrawHorizontalToggleProp(_prop_isDefault, G("menuitem.prop.is_default"), mixedIsDefault,