Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-wh authored Jun 17, 2017
2 parents fca1ebd + 5135ade commit 6743779
Show file tree
Hide file tree
Showing 206 changed files with 5,289 additions and 2,706 deletions.
Binary file not shown.
4 changes: 2 additions & 2 deletions Project-Aurora/Aurora-RazerLEDWrapper/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ WRAPPER_EFFECT HandleKeyboardEffect(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZ
additional_effect_data << "\"blue_start\": " << "\"" << GetBValue(breathing_effect->Color1) << "\"" << ',';
additional_effect_data << "\"red_end\": " << "\"" << GetRValue(breathing_effect->Color2) << "\"" << ',';
additional_effect_data << "\"green_end\": " << "\"" << GetGValue(breathing_effect->Color2) << "\"" << ',';
additional_effect_data << "\blue_end\": " << "\"" << GetBValue(breathing_effect->Color2) << "\"" << ',';
additional_effect_data << "\"blue_end\": " << "\"" << GetBValue(breathing_effect->Color2) << "\"" << ',';
additional_effect_data << "\"effect_type\": " << "\"" << "CHROMA_BREATHING" << "\"" << ',';

switch (breathing_effect->Type)
Expand Down Expand Up @@ -1222,7 +1222,7 @@ WRAPPER_EFFECT HandleMouseEffect(ChromaSDK::Mouse::EFFECT_TYPE Effect, PRZPARAM
additional_effect_data << "\"blue_start\": " << "\"" << GetBValue(breathing_effect->Color1) << "\"" << ',';
additional_effect_data << "\"red_end\": " << "\"" << GetRValue(breathing_effect->Color2) << "\"" << ',';
additional_effect_data << "\"green_end\": " << "\"" << GetGValue(breathing_effect->Color2) << "\"" << ',';
additional_effect_data << "\blue_end\": " << "\"" << GetBValue(breathing_effect->Color2) << "\"" << ',';
additional_effect_data << "\"blue_end\": " << "\"" << GetBValue(breathing_effect->Color2) << "\"" << ',';
additional_effect_data << "\"effect_type\": " << "\"" << "CHROMA_BREATHING" << "\"" << ',';

switch (breathing_effect->Type)
Expand Down
20 changes: 10 additions & 10 deletions Project-Aurora/Aurora-Updater/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ static void Main(string[] args)
{
versionMajor = new UpdateVersion(_maj);

if (!(StaticStorage.Manager.responce.Major.Version <= versionMajor))
if (!(StaticStorage.Manager.response.Major.Version <= versionMajor))
{
UpdateInfoForm userResult = new UpdateInfoForm()
{
changelog = StaticStorage.Manager.responce.Major.Changelog,
updateDescription = StaticStorage.Manager.responce.Major.Description,
updateVersion = StaticStorage.Manager.responce.Major.Version.ToString(),
changelog = StaticStorage.Manager.response.Major.Changelog,
updateDescription = StaticStorage.Manager.response.Major.Description,
updateVersion = StaticStorage.Manager.response.Major.Version.ToString(),
currentVersion = versionMajor.ToString(),
updateSize = StaticStorage.Manager.responce.Major.FileSize
updateSize = StaticStorage.Manager.response.Major.FileSize
};

userResult.ShowDialog();
Expand Down Expand Up @@ -171,19 +171,19 @@ static void Main(string[] args)
{
versionMinor = new UpdateVersion(_min);

if (!(StaticStorage.Manager.responce.Minor.Version <= versionMinor))
if (!(StaticStorage.Manager.response.Minor.Version <= versionMinor))
{
if (isSilentMinor)
StaticStorage.Manager.RetrieveUpdate(UpdateType.Minor);
else
{
UpdateInfoForm userResult = new UpdateInfoForm()
{
changelog = StaticStorage.Manager.responce.Minor.Changelog,
updateDescription = StaticStorage.Manager.responce.Minor.Description,
updateVersion = StaticStorage.Manager.responce.Minor.Version.ToString(),
changelog = StaticStorage.Manager.response.Minor.Changelog,
updateDescription = StaticStorage.Manager.response.Minor.Description,
updateVersion = StaticStorage.Manager.response.Minor.Version.ToString(),
currentVersion = versionMinor.ToString(),
updateSize = StaticStorage.Manager.responce.Minor.FileSize
updateSize = StaticStorage.Manager.response.Minor.FileSize
};

userResult.ShowDialog();
Expand Down
14 changes: 7 additions & 7 deletions Project-Aurora/Aurora-Updater/UpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class UpdateManager
{
private string infoUrl = @"http://project-aurora.com/vcheck.php";
private string[] ignoreFiles = { };
public UpdateResponce responce = new UpdateResponce();
public UpdateResponse response = new UpdateResponse();
private Queue<LogEntry> log = new Queue<LogEntry>();
private float downloadProgess = 0.0f;
private float extractProgess = 0.0f;
Expand Down Expand Up @@ -102,7 +102,7 @@ private bool FetchData()
WebClient client = new WebClient();
string reply = client.DownloadString(infoUrl);

responce = new UpdateResponce(reply);
response = new UpdateResponse(reply);

//Console.WriteLine(reply);
}
Expand All @@ -117,7 +117,7 @@ private bool FetchData()

public bool RetrieveUpdate(UpdateType type)
{
string url = @"http://project-aurora.com/download.php?id=" + (type == UpdateType.Major ? responce.Major.ID : responce.Minor.ID);
string url = @"http://project-aurora.com/download.php?id=" + (type == UpdateType.Major ? response.Major.ID : response.Minor.ID);
updateState = UpdateStatus.InProgress;
try
{
Expand Down Expand Up @@ -296,7 +296,7 @@ private void PerformCleanup()
}


public class UpdateResponce
public class UpdateResponse
{
protected Newtonsoft.Json.Linq.JObject _ParsedData;
protected string json;
Expand Down Expand Up @@ -329,13 +329,13 @@ public UpdateInfoNode Minor
}
}

public UpdateResponce()
public UpdateResponse()
{
json = "{}";
_ParsedData = Newtonsoft.Json.Linq.JObject.Parse(json);
}

public UpdateResponce(string json_data)
public UpdateResponse(string json_data)
{
if (String.IsNullOrWhiteSpace(json_data))
{
Expand All @@ -346,7 +346,7 @@ public UpdateResponce(string json_data)
_ParsedData = Newtonsoft.Json.Linq.JObject.Parse(json_data);
}

public UpdateResponce(UpdateResponce other_state)
public UpdateResponse(UpdateResponse other_state)
{
_ParsedData = other_state._ParsedData;
json = other_state.json;
Expand Down
16 changes: 16 additions & 0 deletions Project-Aurora/Plugin-Example/Layers/Control_ExampleLayer.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Plugin_Example.Layers"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:Controls="clr-namespace:Aurora.Controls;assembly=Aurora"
x:Class="Plugin_Example.Layers.Control_ExampleLayer"
mc:Ignorable="d" Loaded="UserControl_Loaded">
<Grid>
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Color:" VerticalAlignment="Top" Margin="0,4,0,0"/>
<xctk:ColorPicker x:Name="ColorPicker_primaryColor" HorizontalAlignment="Left" Height="24" Margin="36,0,0,0" VerticalAlignment="Top" Width="139" ColorMode="ColorCanvas" SelectedColorChanged="ColorPicker_primaryColor_SelectedColorChanged" UsingAlphaChannel="True"/>
<Controls:KeySequence x:Name="KeySequence_keys" Margin="0,29,-44,-5" HorizontalAlignment="Left" Width="230" RecordingTag="ExampleLayer" Title="Affected Keys" SequenceUpdated="KeySequence_keys_SequenceUpdated"/>
</Grid>
</UserControl>
67 changes: 67 additions & 0 deletions Project-Aurora/Plugin-Example/Layers/Control_ExampleLayer.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Aurora.Utils;

namespace Plugin_Example.Layers
{
/// <summary>
/// Interaction logic for Control_DefaultLayer.xaml
/// </summary>
public partial class Control_ExampleLayer : UserControl
{
private bool settingsset = false;

public Control_ExampleLayer()
{
InitializeComponent();
}

public Control_ExampleLayer(ExampleLayerHandler datacontext)
{
InitializeComponent();

this.DataContext = datacontext;
}

public void SetSettings()
{
if(this.DataContext is ExampleLayerHandler && !settingsset)
{
this.ColorPicker_primaryColor.SelectedColor = ColorUtils.DrawingColorToMediaColor((this.DataContext as ExampleLayerHandler).Properties._PrimaryColor ?? System.Drawing.Color.Empty);
this.KeySequence_keys.Sequence = (this.DataContext as ExampleLayerHandler).Properties._Sequence;

settingsset = true;
}
}

private void ColorPicker_primaryColor_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs<Color?> e)
{
if (IsLoaded && settingsset && this.DataContext is ExampleLayerHandler && sender is Xceed.Wpf.Toolkit.ColorPicker && (sender as Xceed.Wpf.Toolkit.ColorPicker).SelectedColor.HasValue)
(this.DataContext as ExampleLayerHandler).Properties._PrimaryColor = ColorUtils.MediaColorToDrawingColor((sender as Xceed.Wpf.Toolkit.ColorPicker).SelectedColor.Value);
}

private void KeySequence_keys_SequenceUpdated(object sender, EventArgs e)
{
if (IsLoaded && settingsset && this.DataContext is ExampleLayerHandler && sender is Aurora.Controls.KeySequence)
(this.DataContext as ExampleLayerHandler).Properties._Sequence = (sender as Aurora.Controls.KeySequence).Sequence;
}

private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
SetSettings();

this.Loaded -= UserControl_Loaded;
}
}
}
37 changes: 37 additions & 0 deletions Project-Aurora/Plugin-Example/Layers/ExampleLayerHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Aurora.Settings.Layers;
using System.Windows.Controls;
using Aurora.EffectsEngine;
using Aurora.Profiles;

namespace Plugin_Example.Layers
{
public class ExampleLayerHandlerProperties : LayerHandlerProperties<ExampleLayerHandlerProperties>
{

}

public class ExampleLayerHandler : LayerHandler<LayerHandlerProperties>
{
public ExampleLayerHandler()
{
_ID = "ExampleLayer";
}

protected override UserControl CreateControl()
{
return new Control_ExampleLayer(this);
}

public override EffectLayer Render(IGameState gamestate)
{
EffectLayer solidcolor_layer = new EffectLayer();
solidcolor_layer.Set(Properties.Sequence, Properties.PrimaryColor);
return solidcolor_layer;
}
}
}
82 changes: 82 additions & 0 deletions Project-Aurora/Plugin-Example/Plugin-Example.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DAE33996-53E3-46A3-8F06-CBAF0AFE3708}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Plugin_Example</RootNamespace>
<AssemblyName>Plugin-Example</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>6</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="Xceed.Wpf.Toolkit, Version=2.9.15603.14400, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>..\packages\Xceed.Wpf.Toolkit.2.9.15603.14400\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Layers\Control_ExampleLayer.xaml.cs">
<DependentUpon>Control_ExampleLayer.xaml</DependentUpon>
</Compile>
<Compile Include="Layers\ExampleLayerHandler.cs" />
<Compile Include="PluginMain.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ColorBox\ColorBox.csproj">
<Project>{40085232-aced-4cbe-945b-90ba8153c151}</Project>
<Name>ColorBox</Name>
</ProjectReference>
<ProjectReference Include="..\Project-Aurora\Project-Aurora.csproj">
<Project>{18d2d471-3f57-4ece-9c62-836a801473d8}</Project>
<Name>Project-Aurora</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Profiles\" />
</ItemGroup>
<ItemGroup>
<Page Include="Layers\Control_ExampleLayer.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
40 changes: 40 additions & 0 deletions Project-Aurora/Plugin-Example/PluginMain.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Aurora.Profiles;
using Plugin_Example.Layers;

namespace Plugin_Example
{


public class PluginMain : IPlugin
{
public string ID { get; private set; } = "PluginExample";

public string Title { get; private set; } = "Example Plugin";

public string Author { get; private set; } = "YOU";

public Version Version { get; private set; } = new Version(0, 1);

private IPluginHost pluginHost;

public IPluginHost PluginHost { get { return pluginHost; }
set {
pluginHost = value;
if (value is LightingStateManager)
{
((LightingStateManager)value).RegisterLayerHandler(new LayerHandlerEntry("ExampleLayer", "Example Layer", typeof(ExampleLayerHandler)));
}
}
}

public PluginMain()
{

}
}
}
Loading

0 comments on commit 6743779

Please sign in to comment.