forked from antonpup/Aurora
-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aytackydln
committed
Jul 24, 2024
1 parent
0cfd01a
commit a6965f3
Showing
13 changed files
with
1,253 additions
and
1,241 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
Project-Aurora/Project-Aurora/Controls/Control_AnimationEditor.Circle.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
using System.Windows.Controls; | ||
using AuroraRgb.EffectsEngine.Animations; | ||
|
||
namespace AuroraRgb.Controls; | ||
|
||
public partial class Control_AnimationEditor | ||
{ | ||
private void CreateCircle(AnimationCircle circle, StackPanel newPanel, double separatorHeight) | ||
{ | ||
var varItemColor = new Control_VariableItem | ||
{ | ||
VariableTitle = "Color", | ||
VariableObject = circle.Color | ||
}; | ||
varItemColor.VariableUpdated += VarItemColor_VariableUpdated; | ||
var varItemWidth = new Control_VariableItem | ||
{ | ||
VariableTitle = "Width", | ||
VariableObject = circle.Width | ||
}; | ||
varItemWidth.VariableUpdated += VarItemWidth_VariableUpdated; | ||
var varItemCenterX = new Control_VariableItem | ||
{ | ||
VariableTitle = "Center X", | ||
VariableObject = circle.Center.X | ||
}; | ||
varItemCenterX.VariableUpdated += VarItemCenterX_VariableUpdated; | ||
var varItemCenterY = new Control_VariableItem | ||
{ | ||
VariableTitle = "Center Y", | ||
VariableObject = circle.Center.Y | ||
}; | ||
varItemCenterY.VariableUpdated += VarItemCenterY_VariableUpdated; | ||
var varItemDimensionRadius = new Control_VariableItem | ||
{ | ||
VariableTitle = "Radius", | ||
VariableObject = circle.Radius | ||
}; | ||
varItemDimensionRadius.VariableUpdated += VarItemDimensionRadius_VariableUpdated; | ||
|
||
newPanel.Children.Add(varItemColor); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
if (circle is not AnimationFilledCircle) | ||
{ | ||
newPanel.Children.Add(varItemWidth); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
} | ||
|
||
newPanel.Children.Add(varItemCenterX); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemCenterY); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemDimensionRadius); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
} | ||
|
||
private void VarItemDimensionRadius_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is Control_AnimationFrameItem { ContextFrame: AnimationCircle animationCircle } frameItem) | ||
frameItem.ContextFrame = animationCircle.SetRadius((float)newVariable); | ||
} | ||
|
||
private void VarItemCenterY_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is Control_AnimationFrameItem { ContextFrame: AnimationCircle animationCircle } frameItem) | ||
frameItem.ContextFrame = animationCircle.SetCenter(animationCircle.Center with { Y = (float)newVariable }); | ||
} | ||
|
||
private void VarItemCenterX_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is Control_AnimationFrameItem { ContextFrame: AnimationCircle animationCircle } item) | ||
item.ContextFrame = animationCircle.SetCenter(animationCircle.Center with { X = (float)newVariable }); | ||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
Project-Aurora/Project-Aurora/Controls/Control_AnimationEditor.Line.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
using System.Drawing; | ||
using System.Windows.Controls; | ||
using AuroraRgb.EffectsEngine.Animations; | ||
|
||
namespace AuroraRgb.Controls; | ||
|
||
public partial class Control_AnimationEditor | ||
{ | ||
private void CreateLine(AnimationLine line, StackPanel newPanel, double separatorHeight) | ||
{ | ||
var varItemColor = new Control_VariableItem | ||
{ | ||
VariableTitle = "Start Color", | ||
VariableObject = line.Color | ||
}; | ||
varItemColor.VariableUpdated += VarItemColor_VariableUpdated; | ||
var varItemEndColor = new Control_VariableItem | ||
{ | ||
VariableTitle = "End Color", | ||
VariableObject = line.EndColor | ||
}; | ||
varItemEndColor.VariableUpdated += VarItemEndColor_VariableUpdated; | ||
var varItemWidth = new Control_VariableItem | ||
{ | ||
VariableTitle = "Width", | ||
VariableObject = line.Width | ||
}; | ||
varItemWidth.VariableUpdated += VarItemWidth_VariableUpdated; | ||
var varItemStartPositionX = new Control_VariableItem | ||
{ | ||
VariableTitle = "Start Position X", | ||
VariableObject = line.StartPoint.X | ||
}; | ||
varItemStartPositionX.VariableUpdated += VarItemStartPositionX_VariableUpdated; | ||
varItemWidth.VariableUpdated += VarItemWidth_VariableUpdated; | ||
var varItemStartPositionY = new Control_VariableItem | ||
{ | ||
VariableTitle = "Start Position Y", | ||
VariableObject = line.StartPoint.Y | ||
}; | ||
varItemStartPositionY.VariableUpdated += VarItemStartPositionY_VariableUpdated; | ||
var varItemEndPositionX = new Control_VariableItem | ||
{ | ||
VariableTitle = "End Position X", | ||
VariableObject = line.EndPoint.X | ||
}; | ||
varItemEndPositionX.VariableUpdated += VarItemEndPositionX_VariableUpdated; | ||
varItemWidth.VariableUpdated += VarItemWidth_VariableUpdated; | ||
var varItemEndPositionY = new Control_VariableItem | ||
{ | ||
VariableTitle = "End Position Y", | ||
VariableObject = line.EndPoint.Y | ||
}; | ||
varItemEndPositionY.VariableUpdated += VarItemEndPositionY_VariableUpdated; | ||
|
||
|
||
newPanel.Children.Add(varItemColor); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemEndColor); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemWidth); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemStartPositionX); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemStartPositionY); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemEndPositionX); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemEndPositionY); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
} | ||
|
||
private void VarItemEndColor_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is Control_AnimationFrameItem { ContextFrame: AnimationLine animationLine } frameItem) | ||
frameItem.ContextFrame = animationLine.SetEndColor((Color)newVariable); | ||
} | ||
|
||
private void VarItemEndPositionY_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is Control_AnimationFrameItem { ContextFrame: AnimationLine animationLine } frameItem) | ||
frameItem.ContextFrame = animationLine.SetEndPoint(animationLine.EndPoint with { Y = (float)newVariable }); | ||
} | ||
|
||
private void VarItemEndPositionX_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is Control_AnimationFrameItem { ContextFrame: AnimationLine animationLine } frameItem) | ||
frameItem.ContextFrame = animationLine.SetEndPoint(animationLine.EndPoint with { X = (float)newVariable }); | ||
} | ||
|
||
private void VarItemStartPositionY_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is Control_AnimationFrameItem { ContextFrame: AnimationLine animationLine } frameItem) | ||
frameItem.ContextFrame = animationLine.SetStartPoint(animationLine.StartPoint with { Y = (float)newVariable }); | ||
} | ||
|
||
private void VarItemStartPositionX_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is Control_AnimationFrameItem { ContextFrame: AnimationLine animationLine } frameItem) | ||
frameItem.ContextFrame = animationLine.SetStartPoint(animationLine.StartPoint with { X = (float)newVariable }); | ||
} | ||
} |
131 changes: 131 additions & 0 deletions
131
Project-Aurora/Project-Aurora/Controls/Control_AnimationEditor.Rectangle.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
using System.Windows.Controls; | ||
using AuroraRgb.EffectsEngine.Animations; | ||
|
||
namespace AuroraRgb.Controls; | ||
|
||
public partial class Control_AnimationEditor | ||
{ | ||
private void CreateRectangle(AnimationRectangle rectangle, StackPanel newPanel, double separatorHeight) | ||
{ | ||
var varItemColor = new Control_VariableItem | ||
{ | ||
VariableTitle = "Color", | ||
VariableObject = rectangle.Color | ||
}; | ||
varItemColor.VariableUpdated += VarItemColor_VariableUpdated; | ||
var varItemWidth = new Control_VariableItem | ||
{ | ||
VariableTitle = "Width", | ||
VariableObject = rectangle.Width | ||
}; | ||
varItemWidth.VariableUpdated += VarItemWidth_VariableUpdated; | ||
var varItemPositionX = new Control_VariableItem | ||
{ | ||
VariableTitle = "Position X", | ||
VariableObject = rectangle.Dimension.X | ||
}; | ||
varItemPositionX.VariableUpdated += VarItemPositionX_VariableUpdated; | ||
var varItemPositionY = new Control_VariableItem | ||
{ | ||
VariableTitle = "Position Y", | ||
VariableObject = rectangle.Dimension.Y | ||
}; | ||
varItemPositionY.VariableUpdated += VarItemPositionY_VariableUpdated; | ||
var varItemDimensionWidth = new Control_VariableItem | ||
{ | ||
VariableTitle = "Width", | ||
VariableObject = rectangle.Dimension.Width | ||
}; | ||
varItemDimensionWidth.VariableUpdated += VarItemDimensionWidth_VariableUpdated; | ||
var varItemDimensionHeight = new Control_VariableItem | ||
{ | ||
VariableTitle = "Height", | ||
VariableObject = rectangle.Dimension.Height | ||
}; | ||
varItemDimensionHeight.VariableUpdated += VarItemDimensionHeight_VariableUpdated; | ||
|
||
|
||
newPanel.Children.Add(varItemColor); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
if (rectangle is not AnimationFilledRectangle) | ||
{ | ||
newPanel.Children.Add(varItemWidth); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
} | ||
|
||
newPanel.Children.Add(varItemPositionX); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemPositionY); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemDimensionWidth); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
newPanel.Children.Add(varItemDimensionHeight); | ||
newPanel.Children.Add(new Separator { Height = separatorHeight, Opacity = 0 }); | ||
} | ||
|
||
private void VarItemDimensionHeight_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is not Control_AnimationFrameItem { ContextFrame: AnimationRectangle animationRectangle } frameItem) return; | ||
var frameType = animationRectangle.GetType(); | ||
|
||
if (frameType == typeof(AnimationRectangle) || frameType == typeof(AnimationFilledRectangle)) | ||
{ | ||
frameItem.ContextFrame = animationRectangle.SetDimension(animationRectangle.Dimension with { Height = (float)newVariable }); | ||
} | ||
else | ||
{ | ||
frameItem.ContextFrame = frameItem.ContextFrame.SetDimension(frameItem.ContextFrame.Dimension with { Height = (float)newVariable }); | ||
} | ||
} | ||
|
||
private void VarItemDimensionWidth_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is not Control_AnimationFrameItem frameItem) return; | ||
var frameType = frameItem.ContextFrame?.GetType(); | ||
|
||
if (frameType == typeof(AnimationRectangle) || frameType == typeof(AnimationFilledRectangle)) | ||
{ | ||
var frame = frameItem.ContextFrame as AnimationRectangle; | ||
|
||
frameItem.ContextFrame = frame?.SetDimension(frame.Dimension with { Width = (float)newVariable }); | ||
} | ||
else | ||
{ | ||
frameItem.ContextFrame = frameItem.ContextFrame?.SetDimension(frameItem.ContextFrame.Dimension with { Width = (float)newVariable }); | ||
} | ||
} | ||
|
||
private void VarItemPositionY_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is not Control_AnimationFrameItem frameItem) return; | ||
var frameType = frameItem.ContextFrame?.GetType(); | ||
|
||
if (frameType == typeof(AnimationRectangle) || frameType == typeof(AnimationFilledRectangle)) | ||
{ | ||
var frame = frameItem.ContextFrame as AnimationRectangle; | ||
|
||
frameItem.ContextFrame = frame?.SetDimension(frame.Dimension with { Y = (float)newVariable }); | ||
} | ||
else | ||
{ | ||
frameItem.ContextFrame = frameItem.ContextFrame?.SetDimension(frameItem.ContextFrame.Dimension with { Y = (float)newVariable }); | ||
} | ||
} | ||
|
||
private void VarItemPositionX_VariableUpdated(object? sender, object? newVariable) | ||
{ | ||
if (_selectedFrameItem is not Control_AnimationFrameItem frameItem) return; | ||
var frameType = frameItem.ContextFrame?.GetType(); | ||
|
||
if (frameType == typeof(AnimationRectangle) || frameType == typeof(AnimationFilledRectangle)) | ||
{ | ||
var frame = frameItem.ContextFrame as AnimationRectangle; | ||
|
||
frameItem.ContextFrame = frame?.SetDimension(frame.Dimension with { X = (float)newVariable }); | ||
} | ||
else | ||
{ | ||
frameItem.ContextFrame = frameItem.ContextFrame?.SetDimension(frameItem.ContextFrame.Dimension with { X = (float)newVariable }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.