diff --git a/Artemis/Artemis/App.config b/Artemis/Artemis/App.config index b40177305..94b40688d 100644 --- a/Artemis/Artemis/App.config +++ b/Artemis/Artemis/App.config @@ -277,6 +277,9 @@ 14 + + 25 + diff --git a/Artemis/Artemis/Modules/Effects/Bubbles/Bubbles.Designer.cs b/Artemis/Artemis/Modules/Effects/Bubbles/Bubbles.Designer.cs index 0c2d69d79..6815b56a6 100644 --- a/Artemis/Artemis/Modules/Effects/Bubbles/Bubbles.Designer.cs +++ b/Artemis/Artemis/Modules/Effects/Bubbles/Bubbles.Designer.cs @@ -106,5 +106,17 @@ namespace Artemis.Modules.Effects.Bubbles { this["BubbleCount"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("25")] + public int Smoothness { + get { + return ((int)(this["Smoothness"])); + } + set { + this["Smoothness"] = value; + } + } } } diff --git a/Artemis/Artemis/Modules/Effects/Bubbles/Bubbles.settings b/Artemis/Artemis/Modules/Effects/Bubbles/Bubbles.settings index 82bc109bc..98fa04416 100644 --- a/Artemis/Artemis/Modules/Effects/Bubbles/Bubbles.settings +++ b/Artemis/Artemis/Modules/Effects/Bubbles/Bubbles.settings @@ -23,5 +23,8 @@ 14 + + 25 + \ No newline at end of file diff --git a/Artemis/Artemis/Modules/Effects/Bubbles/BubblesModel.cs b/Artemis/Artemis/Modules/Effects/Bubbles/BubblesModel.cs index 0e5513853..66ecd0ea2 100644 --- a/Artemis/Artemis/Modules/Effects/Bubbles/BubblesModel.cs +++ b/Artemis/Artemis/Modules/Effects/Bubbles/BubblesModel.cs @@ -28,7 +28,6 @@ namespace Artemis.Modules.Effects.Bubbles : base(mainManager, null) { Name = "Bubbles"; - KeyboardScale = 25; Settings = settings; Initialized = false; } @@ -39,18 +38,23 @@ namespace Artemis.Modules.Effects.Bubbles public override void Enable() { + KeyboardScale = Settings.Smoothness; + Rect rect = MainManager.DeviceManager.ActiveKeyboard.KeyboardRectangle(KeyboardScale); + double scaleFactor = Settings.Smoothness / 25.0; + for (int i = 0; i < Settings.BubbleCount; i++) { Color color = Settings.IsRandomColors ? ColorHelpers.GetRandomRainbowColor() : ColorHelpers.ToDrawingColor(Settings.BubbleColor); // -Settings.MoveSpeed because we want to spawn at least one move away from borders - double initialPositionX = ((rect.Width - (Settings.BubbleSize * 2) - Settings.MoveSpeed) * _random.NextDouble()) + Settings.BubbleSize; - double initialPositionY = ((rect.Height - (Settings.BubbleSize * 2) - Settings.MoveSpeed) * _random.NextDouble()) + Settings.BubbleSize; - double initialDirectionX = (Settings.MoveSpeed * _random.NextDouble()) * (_random.Next(1) == 0 ? -1 : 1); - double initialDirectionY = (Settings.MoveSpeed - Math.Abs(initialDirectionX)) * (_random.Next(1) == 0 ? -1 : 1); + double initialPositionX = ((rect.Width - (Settings.BubbleSize * scaleFactor * 2) - Settings.MoveSpeed * scaleFactor) * _random.NextDouble()) + Settings.BubbleSize * scaleFactor; + double initialPositionY = ((rect.Height - (Settings.BubbleSize * scaleFactor * 2) - Settings.MoveSpeed * scaleFactor) * _random.NextDouble()) + Settings.BubbleSize * scaleFactor; + double initialDirectionX = (Settings.MoveSpeed * scaleFactor * _random.NextDouble()) * (_random.Next(1) == 0 ? -1 : 1); + double initialDirectionY = (Settings.MoveSpeed * scaleFactor - Math.Abs(initialDirectionX)) * (_random.Next(1) == 0 ? -1 : 1); - _bubbles.Add(new Bubble(color, Settings.BubbleSize, new System.Windows.Point(initialPositionX, initialPositionY), new Vector(initialDirectionX, initialDirectionY))); + _bubbles.Add(new Bubble(color, (int)Math.Round(Settings.BubbleSize * scaleFactor), + new System.Windows.Point(initialPositionX, initialPositionY), new Vector(initialDirectionX, initialDirectionY))); } Initialized = true; diff --git a/Artemis/Artemis/Modules/Effects/Bubbles/BubblesSettings.cs b/Artemis/Artemis/Modules/Effects/Bubbles/BubblesSettings.cs index 9a656d77b..149daa6d1 100644 --- a/Artemis/Artemis/Modules/Effects/Bubbles/BubblesSettings.cs +++ b/Artemis/Artemis/Modules/Effects/Bubbles/BubblesSettings.cs @@ -17,6 +17,7 @@ namespace Artemis.Modules.Effects.Bubbles public int BubbleSize { get; set; } public int MoveSpeed { get; set; } public int BubbleCount { get; set; } + public int Smoothness { get; set; } public sealed override void Load() { @@ -27,6 +28,7 @@ namespace Artemis.Modules.Effects.Bubbles BubbleSize = Bubbles.Default.BubbleSize; MoveSpeed = Bubbles.Default.MoveSpeed; BubbleCount = Bubbles.Default.BubbleCount; + Smoothness = Bubbles.Default.Smoothness; } public sealed override void Save() @@ -38,6 +40,7 @@ namespace Artemis.Modules.Effects.Bubbles Bubbles.Default.BubbleSize = BubbleSize; Bubbles.Default.MoveSpeed = MoveSpeed; Bubbles.Default.BubbleCount = BubbleCount; + Bubbles.Default.Smoothness = Smoothness; Bubbles.Default.Save(); } @@ -51,6 +54,7 @@ namespace Artemis.Modules.Effects.Bubbles BubbleSize = 25; MoveSpeed = 4; BubbleCount = 14; + Smoothness = 25; } } } diff --git a/Artemis/Artemis/Modules/Effects/Bubbles/BubblesView.xaml b/Artemis/Artemis/Modules/Effects/Bubbles/BubblesView.xaml index efe17de4f..9c40b7792 100644 --- a/Artemis/Artemis/Modules/Effects/Bubbles/BubblesView.xaml +++ b/Artemis/Artemis/Modules/Effects/Bubbles/BubblesView.xaml @@ -24,6 +24,7 @@ + @@ -119,9 +120,19 @@ HorizontalAlignment="Right" Width="110" TickPlacement="None" TickFrequency="1" Value="{Binding Path=EffectSettings.MoveSpeed, Mode=TwoWay}" Minimum="1" Maximum="15" SmallChange="10" IsSnapToTickEnabled="True" /> + + + + Smoothness + + - +