forked from antonpup/Aurora
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
206 changed files
with
5,289 additions
and
2,706 deletions.
There are no files selected for viewing
Binary file not shown.
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
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
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
16 changes: 16 additions & 0 deletions
16
Project-Aurora/Plugin-Example/Layers/Control_ExampleLayer.xaml
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,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
67
Project-Aurora/Plugin-Example/Layers/Control_ExampleLayer.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,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
37
Project-Aurora/Plugin-Example/Layers/ExampleLayerHandler.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,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; | ||
} | ||
} | ||
} |
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,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> |
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,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() | ||
{ | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.