mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Added keyframe support to the default value
This commit is contained in:
parent
f637c131c4
commit
d21c7dffc2
@ -203,15 +203,14 @@ namespace Artemis.Core
|
||||
/// <summary>
|
||||
/// Overrides the property value with the default value
|
||||
/// </summary>
|
||||
public void ApplyDefaultValue()
|
||||
public void ApplyDefaultValue(TimeSpan? time)
|
||||
{
|
||||
if (_disposed)
|
||||
throw new ObjectDisposedException("LayerProperty");
|
||||
|
||||
string json = JsonConvert.SerializeObject(DefaultValue, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All });
|
||||
|
||||
BaseValue = JsonConvert.DeserializeObject<T>(json);
|
||||
CurrentValue = JsonConvert.DeserializeObject<T>(json);
|
||||
|
||||
SetCurrentValue(JsonConvert.DeserializeObject<T>(json), time);
|
||||
}
|
||||
|
||||
private void ReapplyUpdate()
|
||||
@ -508,7 +507,7 @@ namespace Artemis.Core
|
||||
throw new ArtemisCoreException("Layer property is not yet initialized");
|
||||
|
||||
if (!IsLoadedFromStorage)
|
||||
ApplyDefaultValue();
|
||||
ApplyDefaultValue(null);
|
||||
else
|
||||
try
|
||||
{
|
||||
|
||||
@ -51,7 +51,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
|
||||
|
||||
public void ResetToDefault()
|
||||
{
|
||||
LayerProperty.ApplyDefaultValue();
|
||||
LayerProperty.ApplyDefaultValue(_profileEditorService.CurrentTime);
|
||||
_profileEditorService.UpdateSelectedProfileElement();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user