Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More discrete color updates. #9

Merged
merged 3 commits into from
Jun 27, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Discrete color enable the spin effect.
  • Loading branch information
jeffu231 committed Jun 27, 2013
commit cbcd9692381ed8418ea4c16f782bdb7b1522bfbf
12 changes: 12 additions & 0 deletions Modules/Effect/Spin/Spin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using VixenModules.App.Curves;
using System.Drawing;
using ZedGraph;
using VixenModules.Property.Color;

namespace VixenModules.Effect.Spin
{
Expand All @@ -25,6 +26,17 @@ public Spin()
protected override void _PreRender()
{
_elementData = new EffectIntents();
if (StaticColor.IsEmpty) //We have a new effect
{
//Try to set a default color gradient from our available colors if we have discrete colors
HashSet<Color> validColors = new HashSet<Color>();
validColors.AddRange(TargetNodes.SelectMany(x => ColorModule.getValidColorsForElementNode(x, true)));
ColorGradient = new ColorGradient(validColors.DefaultIfEmpty(Color.White).First());

//Set a default color
StaticColor = validColors.DefaultIfEmpty(Color.White).First();

}
DoRendering();
}

Expand Down
19 changes: 12 additions & 7 deletions Modules/Effect/Spin/Spin.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -31,11 +31,11 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\Vixen.System\Vixen.csproj">
<Project>{50B78623-FCF4-48AF-93FF-FA87C937028F}</Project>
<Name>Vixen</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\Vixen.System\Vixen.csproj">
<Project>{50B78623-FCF4-48AF-93FF-FA87C937028F}</Project>
<Name>Vixen</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down Expand Up @@ -65,6 +65,11 @@
<Name>Curves</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\Property\Color\Color.csproj">
<Project>{73068A83-B3B7-4A2C-923D-71C7886CD5E3}</Project>
<Name>Color</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\Pulse\Pulse.csproj">
<Project>{A815A79E-305D-4167-A0BC-FFA590BB4644}</Project>
<Name>Pulse</Name>
Expand All @@ -79,4 +84,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
2 changes: 1 addition & 1 deletion Modules/Effect/Spin/SpinData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public SpinData()
PulseTime = 100;
PulsePercentage = 10;
DefaultLevel = 0;
StaticColor = Color.White;
StaticColor = Color.Empty;
ColorGradient = new ColorGradient();
PulseCurve = new Curve();
ReverseSpin = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ public SpinEffectEditorControl()
public IEffect TargetEffect
{
get { return _targetEffect; }
set { _targetEffect = value; }
set {
_targetEffect = value;
//Ensure target effect is passed through as these editors need it.
colorTypeEditorControlStaticColor.TargetEffect = _targetEffect;
colorGradientTypeEditorControlGradient.TargetEffect = _targetEffect;
}
}

public object[] EffectParameterValues
Expand Down