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