mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-01 20:25:07 +08:00
Fix parameter synced conflict (#1150)
* fix: parameter should be synced if any of sibling parameter is set to be synced * fix: parameter should be saved/synced if any of menu item references same parameter is set to be saved/synced
This commit is contained in:
parent
b83b89ce38
commit
c80d24ea46
@ -117,8 +117,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
|
|
||||||
var canBeBool = true;
|
var canBeBool = true;
|
||||||
var canBeInt = true;
|
var canBeInt = true;
|
||||||
var isSaved = true;
|
var isSaved = false;
|
||||||
var isSynced = true;
|
var isSynced = false;
|
||||||
|
|
||||||
foreach (var mami in list)
|
foreach (var mami in list)
|
||||||
{
|
{
|
||||||
@ -142,8 +142,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
else
|
else
|
||||||
canBeBool &= mami.Control.value is >= 0 and <= 1;
|
canBeBool &= mami.Control.value is >= 0 and <= 1;
|
||||||
|
|
||||||
isSaved &= mami.isSaved;
|
isSaved |= mami.isSaved;
|
||||||
isSynced &= mami.isSynced;
|
isSynced |= mami.isSynced;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!declaredParams.ContainsKey(paramName))
|
if (!declaredParams.ContainsKey(paramName))
|
||||||
|
@ -116,6 +116,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
ResolvedParameter.saved |= info.ResolvedParameter.saved;
|
ResolvedParameter.saved |= info.ResolvedParameter.saved;
|
||||||
|
ResolvedParameter.localOnly &= info.ResolvedParameter.localOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MergeChild(ParameterInfo info)
|
public void MergeChild(ParameterInfo info)
|
||||||
@ -305,7 +306,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
newParameter.defaultValue = info.ResolvedParameter.HasDefaultValue ? info.ResolvedParameter.defaultValue : parameter.defaultValue;
|
newParameter.defaultValue = info.ResolvedParameter.HasDefaultValue ? info.ResolvedParameter.defaultValue : parameter.defaultValue;
|
||||||
newParameter.name = parameter.name;
|
newParameter.name = parameter.name;
|
||||||
newParameter.valueType = parameter.valueType;
|
newParameter.valueType = parameter.valueType;
|
||||||
newParameter.networkSynced = parameter.networkSynced;
|
newParameter.networkSynced = parameter.networkSynced || !info.ResolvedParameter.localOnly;
|
||||||
newParameter.saved = parameter.saved || info.ResolvedParameter.saved;
|
newParameter.saved = parameter.saved || info.ResolvedParameter.saved;
|
||||||
|
|
||||||
return newParameter;
|
return newParameter;
|
||||||
|
Loading…
Reference in New Issue
Block a user