Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 32b9141

Browse files
committed
Merge branch 'master' of https://github.com/Aurora-RGB/Aurora
2 parents fb3ad68 + e872c13 commit 32b9141

1 file changed

Lines changed: 27 additions & 28 deletions

File tree

Project-Aurora/Project-Aurora/Settings/Layers/BreathingLayerHandler.cs

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
using Aurora.EffectsEngine;
2-
using Aurora.Profiles;
3-
using Newtonsoft.Json;
4-
using System;
5-
using System.Collections.Generic;
1+
using System;
62
using System.Drawing;
7-
using System.Linq;
8-
using System.Text;
9-
using System.Threading.Tasks;
103
using System.Windows.Controls;
4+
using Aurora.EffectsEngine;
5+
using Aurora.Profiles;
6+
using Aurora.Settings.Overrides;
7+
using Aurora.Utils;
8+
using Newtonsoft.Json;
119

1210
namespace Aurora.Settings.Layers
1311
{
@@ -16,38 +14,40 @@ public class BreathingLayerHandlerProperties : LayerHandlerProperties2Color<Brea
1614
public bool? _RandomPrimaryColor { get; set; }
1715

1816
[JsonIgnore]
19-
public bool RandomPrimaryColor { get { return Logic._RandomPrimaryColor ?? _RandomPrimaryColor ?? false; } }
17+
public bool RandomPrimaryColor => Logic._RandomPrimaryColor ?? _RandomPrimaryColor ?? false;
2018

2119
public bool? _RandomSecondaryColor { get; set; }
2220

2321
[JsonIgnore]
24-
public bool RandomSecondaryColor { get { return Logic._RandomSecondaryColor ?? _RandomSecondaryColor ?? false; } }
22+
public bool RandomSecondaryColor => Logic._RandomSecondaryColor ?? _RandomSecondaryColor ?? false;
2523

26-
[Overrides.LogicOverridable("Effect Speed")]
24+
[LogicOverridable("Effect Speed")]
2725
public float? _EffectSpeed { get; set; }
2826

2927
[JsonIgnore]
30-
public float EffectSpeed { get { return Logic._EffectSpeed ?? _EffectSpeed ?? 0.0f; } }
28+
public float EffectSpeed => Logic._EffectSpeed ?? _EffectSpeed ?? 0.0f;
3129

32-
public BreathingLayerHandlerProperties() : base() { }
30+
public BreathingLayerHandlerProperties()
31+
{ }
3332

3433
public BreathingLayerHandlerProperties(bool assign_default = false) : base(assign_default) { }
3534

3635
public override void Default()
3736
{
3837
base.Default();
39-
this._RandomPrimaryColor = false;
40-
this._RandomSecondaryColor = false;
41-
this._EffectSpeed = 1.0f;
38+
_RandomPrimaryColor = false;
39+
_RandomSecondaryColor = false;
40+
_EffectSpeed = 1.0f;
4241
}
4342
}
4443

4544
public class BreathingLayerHandler : LayerHandler<BreathingLayerHandlerProperties>
4645
{
47-
private float current_sine = 0.0f;
46+
EffectLayer breathing_layer = new("Breathing Layer");
47+
private float _currentSine;
4848

49-
private Color current_primary_color = Color.Transparent;
50-
private Color current_secondary_color = Color.Transparent;
49+
private Color _currentPrimaryColor = Color.Transparent;
50+
private Color _currentSecondaryColor = Color.Transparent;
5151

5252
protected override UserControl CreateControl()
5353
{
@@ -56,20 +56,19 @@ protected override UserControl CreateControl()
5656

5757
public override EffectLayer Render(IGameState gamestate)
5858
{
59-
current_sine = (float)Math.Pow(Math.Sin((double)((Utils.Time.GetMillisecondsSinceEpoch() % 10000L) / 10000.0f) * 2 * Math.PI * Properties.EffectSpeed), 2);
59+
_currentSine = (float)Math.Pow(Math.Sin((double)((Time.GetMillisecondsSinceEpoch() % 10000L) / 10000.0f) * 2 * Math.PI * Properties.EffectSpeed), 2);
6060

61-
if (current_sine <= 0.0025f * Properties.EffectSpeed && Properties.RandomSecondaryColor)
62-
current_secondary_color = Utils.ColorUtils.GenerateRandomColor();
61+
if (_currentSine <= 0.0025f * Properties.EffectSpeed && Properties.RandomSecondaryColor)
62+
_currentSecondaryColor = ColorUtils.GenerateRandomColor();
6363
else if(!Properties.RandomSecondaryColor)
64-
current_secondary_color = Properties.SecondaryColor;
64+
_currentSecondaryColor = Properties.SecondaryColor;
6565

66-
if (current_sine >= 1.0f - (0.0025f * Properties.EffectSpeed) && Properties.RandomPrimaryColor)
67-
current_primary_color = Utils.ColorUtils.GenerateRandomColor();
66+
if (_currentSine >= 1.0f - (0.0025f * Properties.EffectSpeed) && Properties.RandomPrimaryColor)
67+
_currentPrimaryColor = ColorUtils.GenerateRandomColor();
6868
else if (!Properties.RandomPrimaryColor)
69-
current_primary_color = Properties.PrimaryColor;
69+
_currentPrimaryColor = Properties.PrimaryColor;
7070

71-
EffectLayer breathing_layer = new EffectLayer();
72-
breathing_layer.Set(Properties.Sequence, Utils.ColorUtils.BlendColors(current_primary_color, current_secondary_color, current_sine));
71+
breathing_layer.Set(Properties.Sequence, ColorUtils.BlendColors(_currentPrimaryColor, _currentSecondaryColor, _currentSine));
7372

7473
return breathing_layer;
7574
}

0 commit comments

Comments
 (0)