mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Implemented GIF layer, added layer type icons
This commit is contained in:
parent
e18b8adfb7
commit
4f0091f45c
@ -2,50 +2,21 @@
|
|||||||
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<sectionGroup name="userSettings"
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<section name="Artemis.Modules.Games.TheDivision.TheDivision" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Modules.Games.TheDivision.TheDivision"
|
<section name="Artemis.Modules.Games.Dota2.Dota2" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
<section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Modules.Games.Dota2.Dota2"
|
<section name="Artemis.Settings.Offsets" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
<section name="Artemis.Modules.Games.Witcher3.Witcher3" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay"
|
<section name="Artemis.Modules.Games.CounterStrike.CounterStrike" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
<section name="Artemis.Settings.CounterStrike" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Artemis.Settings.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague"
|
<section name="Artemis.Settings.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
<section name="Artemis.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Artemis.Settings.TypeWave" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Settings.Offsets"
|
<section name="Artemis.Settings.General" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Modules.Games.Witcher3.Witcher3"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Modules.Games.CounterStrike.CounterStrike"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.CounterStrike"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.AudioVisualization"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.RocketLeague"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Properties.Settings"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.TypeWave"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.General"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<connectionStrings />
|
<connectionStrings />
|
||||||
|
|||||||
@ -223,6 +223,10 @@
|
|||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
|
<Reference Include="XamlAnimatedGif, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\XamlAnimatedGif.1.1.2\lib\net45\XamlAnimatedGif.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Xceed.Wpf.AvalonDock, Version=2.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.AvalonDock, Version=2.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.7\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
|
<HintPath>..\packages\Extended.Wpf.Toolkit.2.7\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@ -391,6 +395,7 @@
|
|||||||
<Compile Include="Utilities\GameState\GameDataReceivedEventArgs.cs" />
|
<Compile Include="Utilities\GameState\GameDataReceivedEventArgs.cs" />
|
||||||
<Compile Include="Utilities\GameState\GameStateWebServer.cs" />
|
<Compile Include="Utilities\GameState\GameStateWebServer.cs" />
|
||||||
<Compile Include="Utilities\GeneralHelpers.cs" />
|
<Compile Include="Utilities\GeneralHelpers.cs" />
|
||||||
|
<Compile Include="Utilities\GifImage.cs" />
|
||||||
<Compile Include="Utilities\ImageUtilities.cs" />
|
<Compile Include="Utilities\ImageUtilities.cs" />
|
||||||
<Compile Include="Utilities\Keyboard\KeyboardHook.cs" />
|
<Compile Include="Utilities\Keyboard\KeyboardHook.cs" />
|
||||||
<Compile Include="Utilities\LayerDrawer.cs" />
|
<Compile Include="Utilities\LayerDrawer.cs" />
|
||||||
@ -551,7 +556,6 @@
|
|||||||
<Resource Include="Resources\Dota2\dotaGamestateConfiguration.txt" />
|
<Resource Include="Resources\Dota2\dotaGamestateConfiguration.txt" />
|
||||||
<Resource Include="Resources\Entypo.ttf" />
|
<Resource Include="Resources\Entypo.ttf" />
|
||||||
<None Include="Resources\LogitechLED.dll" />
|
<None Include="Resources\LogitechLED.dll" />
|
||||||
<None Include="Resources\folder.png" />
|
|
||||||
<Resource Include="Resources\Keyboards\k65.png" />
|
<Resource Include="Resources\Keyboards\k65.png" />
|
||||||
<Resource Include="Resources\Keyboards\k70.png" />
|
<Resource Include="Resources\Keyboards\k70.png" />
|
||||||
<Resource Include="Resources\Keyboards\k95.png" />
|
<Resource Include="Resources\Keyboards\k95.png" />
|
||||||
@ -559,6 +563,10 @@
|
|||||||
<Resource Include="Resources\Keyboards\g910.png" />
|
<Resource Include="Resources\Keyboards\g910.png" />
|
||||||
<Resource Include="Resources\WindowsIcons-license.txt" />
|
<Resource Include="Resources\WindowsIcons-license.txt" />
|
||||||
<Resource Include="Resources\Entypo-license.txt" />
|
<Resource Include="Resources\Entypo-license.txt" />
|
||||||
|
<None Include="Resources\folder.png" />
|
||||||
|
<None Include="Resources\headset.png" />
|
||||||
|
<None Include="Resources\mouse.png" />
|
||||||
|
<None Include="Resources\gif.png" />
|
||||||
<Content Include="Resources\Witcher3\playerWitcher.txt" />
|
<Content Include="Resources\Witcher3\playerWitcher.txt" />
|
||||||
<Content Include="Resources\Witcher3\artemis.txt" />
|
<Content Include="Resources\Witcher3\artemis.txt" />
|
||||||
<None Include="Settings\Offsets.settings">
|
<None Include="Settings\Offsets.settings">
|
||||||
|
|||||||
@ -149,7 +149,7 @@ namespace Artemis.Managers
|
|||||||
ActiveEffect?.Dispose();
|
ActiveEffect?.Dispose();
|
||||||
|
|
||||||
ActiveEffect = PauseEffect;
|
ActiveEffect = PauseEffect;
|
||||||
ActiveEffect.Enable();
|
ActiveEffect?.Enable();
|
||||||
|
|
||||||
_mainManager.Unpause();
|
_mainManager.Unpause();
|
||||||
PauseEffect = null;
|
PauseEffect = null;
|
||||||
@ -159,7 +159,7 @@ namespace Artemis.Managers
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Non-game effects are stored as the new LastEffect.
|
// Non-game effects are stored as the new LastEffect.
|
||||||
General.Default.LastEffect = ActiveEffect.Name;
|
General.Default.LastEffect = ActiveEffect?.Name;
|
||||||
General.Default.Save();
|
General.Default.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ namespace Artemis.Models.Profiles
|
|||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public LayerType LayerType { get; set; }
|
public LayerType LayerType { get; set; }
|
||||||
|
public string GifFile { get; set; }
|
||||||
public bool Enabled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
public int Order { get; set; }
|
public int Order { get; set; }
|
||||||
public LayerPropertiesModel UserProps { get; set; }
|
public LayerPropertiesModel UserProps { get; set; }
|
||||||
@ -60,7 +61,7 @@ namespace Artemis.Models.Profiles
|
|||||||
if (LayerType == LayerType.Keyboard || LayerType == LayerType.Keyboard)
|
if (LayerType == LayerType.Keyboard || LayerType == LayerType.Keyboard)
|
||||||
_drawer.Draw(c, _mustDraw);
|
_drawer.Draw(c, _mustDraw);
|
||||||
else if (LayerType == LayerType.KeyboardGif)
|
else if (LayerType == LayerType.KeyboardGif)
|
||||||
_drawer.DrawGif(c);
|
_drawer.DrawGif(c, _mustDraw);
|
||||||
_mustDraw = false;
|
_mustDraw = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using Artemis.Events;
|
using Artemis.Events;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
|
using Artemis.Utilities;
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
|
|
||||||
@ -67,19 +68,7 @@ namespace Artemis.Modules.Effects.Debug
|
|||||||
|
|
||||||
public void Handle(ChangeBitmap message)
|
public void Handle(ChangeBitmap message)
|
||||||
{
|
{
|
||||||
using (var memory = new MemoryStream())
|
ImageSource = ImageUtilities.BitmapToBitmapImage(message.Bitmap);
|
||||||
{
|
|
||||||
message.Bitmap.Save(memory, ImageFormat.Png);
|
|
||||||
memory.Position = 0;
|
|
||||||
|
|
||||||
var bitmapImage = new BitmapImage();
|
|
||||||
bitmapImage.BeginInit();
|
|
||||||
bitmapImage.StreamSource = memory;
|
|
||||||
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
|
|
||||||
bitmapImage.EndInit();
|
|
||||||
|
|
||||||
ImageSource = bitmapImage;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@
|
|||||||
cal:Message.Attach="[Event LostFocus] = [Action PlaceConfigFile]" />
|
cal:Message.Attach="[Event LostFocus] = [Action PlaceConfigFile]" />
|
||||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
||||||
HorizontalAlignment="Right" Width="25"
|
HorizontalAlignment="Right" Width="25"
|
||||||
Style="{DynamicResource SquareButtonStyle}" Height="25" />
|
Style="{DynamicResource SquareButtonStyle}" Height="26" Margin="0,-2,0,0" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
|||||||
30
Artemis/Artemis/Properties/Resources.Designer.cs
generated
30
Artemis/Artemis/Properties/Resources.Designer.cs
generated
@ -155,6 +155,26 @@ namespace Artemis.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap gif {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("gif", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap headset {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("headset", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -215,6 +235,16 @@ namespace Artemis.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap mouse {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("mouse", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to /***********************************************************************/
|
/// Looks up a localized string similar to /***********************************************************************/
|
||||||
////** © 2015 CD PROJEKT S.A. All rights reserved.
|
////** © 2015 CD PROJEKT S.A. All rights reserved.
|
||||||
|
|||||||
@ -142,9 +142,6 @@
|
|||||||
<data name="playerWitcherWs" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="playerWitcherWs" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\witcher3\playerwitcher.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
|
<value>..\resources\witcher3\playerwitcher.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="folder" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="k65" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="k65" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\keyboards\k65.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\resources\keyboards\k65.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
@ -160,4 +157,16 @@
|
|||||||
<data name="g910" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="g910" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\Keyboards\g910.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\Keyboards\g910.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="folder" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="headset" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\headset.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="mouse" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\mouse.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="gif" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\gif.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 147 B |
BIN
Artemis/Artemis/Resources/gif.png
Normal file
BIN
Artemis/Artemis/Resources/gif.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 203 B |
BIN
Artemis/Artemis/Resources/headset.png
Normal file
BIN
Artemis/Artemis/Resources/headset.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 559 B |
BIN
Artemis/Artemis/Resources/mouse.png
Normal file
BIN
Artemis/Artemis/Resources/mouse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@ -33,11 +33,11 @@ namespace Artemis.Services
|
|||||||
{
|
{
|
||||||
public class MetroDialogService : DialogService
|
public class MetroDialogService : DialogService
|
||||||
{
|
{
|
||||||
private readonly ShellViewModel _shellViewModel;
|
private readonly IScreen _viewModel;
|
||||||
|
|
||||||
public MetroDialogService(ShellViewModel shellViewModel)
|
public MetroDialogService(IScreen viewModel)
|
||||||
{
|
{
|
||||||
_shellViewModel = shellViewModel;
|
_viewModel = viewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private MetroWindow GetActiveWindow()
|
private MetroWindow GetActiveWindow()
|
||||||
@ -58,7 +58,7 @@ namespace Artemis.Services
|
|||||||
|
|
||||||
public override void ShowMessageBox(string title, string message)
|
public override void ShowMessageBox(string title, string message)
|
||||||
{
|
{
|
||||||
if (_shellViewModel.IsActive == false)
|
if (_viewModel.IsActive == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Execute.OnUIThread(() => GetActiveWindow().ShowMessageAsync(title, message));
|
Execute.OnUIThread(() => GetActiveWindow().ShowMessageAsync(title, message));
|
||||||
@ -66,7 +66,7 @@ namespace Artemis.Services
|
|||||||
|
|
||||||
public override async Task<bool?> ShowQuestionMessageBox(string title, string message)
|
public override async Task<bool?> ShowQuestionMessageBox(string title, string message)
|
||||||
{
|
{
|
||||||
if (_shellViewModel.IsActive == false)
|
if (_viewModel.IsActive == false)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var metroDialogSettings = new MetroDialogSettings {AffirmativeButtonText = "Yes", NegativeButtonText = "No"};
|
var metroDialogSettings = new MetroDialogSettings {AffirmativeButtonText = "Yes", NegativeButtonText = "No"};
|
||||||
@ -87,7 +87,7 @@ namespace Artemis.Services
|
|||||||
|
|
||||||
public override Task<string> ShowInputDialog(string title, string message)
|
public override Task<string> ShowInputDialog(string title, string message)
|
||||||
{
|
{
|
||||||
if (_shellViewModel.IsActive == false)
|
if (_viewModel.IsActive == false)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return GetActiveWindow().ShowInputAsync(title, message);
|
return GetActiveWindow().ShowInputAsync(title, message);
|
||||||
@ -95,7 +95,7 @@ namespace Artemis.Services
|
|||||||
|
|
||||||
public override bool ShowOpenDialog(out string path, string defaultExt, string filter, string initialDir = null)
|
public override bool ShowOpenDialog(out string path, string defaultExt, string filter, string initialDir = null)
|
||||||
{
|
{
|
||||||
if (_shellViewModel.IsActive == false)
|
if (_viewModel.IsActive == false)
|
||||||
{
|
{
|
||||||
path = null;
|
path = null;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
63
Artemis/Artemis/Utilities/GifImage.cs
Normal file
63
Artemis/Artemis/Utilities/GifImage.cs
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
|
||||||
|
namespace Artemis.Utilities
|
||||||
|
{
|
||||||
|
public class GifImage
|
||||||
|
{
|
||||||
|
private readonly int _delay;
|
||||||
|
private readonly FrameDimension _dimension;
|
||||||
|
private readonly int _frameCount;
|
||||||
|
private readonly Image _gifImage;
|
||||||
|
private int _currentFrame = -1;
|
||||||
|
private DateTime _lastRequest;
|
||||||
|
private int _step = 1;
|
||||||
|
|
||||||
|
public GifImage(string path)
|
||||||
|
{
|
||||||
|
_lastRequest = DateTime.Now;
|
||||||
|
_gifImage = Image.FromFile(path); //initialize
|
||||||
|
_dimension = new FrameDimension(_gifImage.FrameDimensionsList[0]); //gets the GUID
|
||||||
|
_frameCount = _gifImage.GetFrameCount(_dimension); //total frames in the animation
|
||||||
|
|
||||||
|
var item = _gifImage.GetPropertyItem(0x5100); // FrameDelay in libgdiplus
|
||||||
|
_delay = (item.Value[0] + item.Value[1]*256)*10; // Time is in 1/100th of a second
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the gif should play backwards when it reaches the end
|
||||||
|
/// </summary>
|
||||||
|
public bool ReverseAtEnd { get; set; }
|
||||||
|
|
||||||
|
public Image GetNextFrame()
|
||||||
|
{
|
||||||
|
// Only pass the next frame if the proper amount of time has passed
|
||||||
|
if ((DateTime.Now - _lastRequest).Milliseconds > _delay)
|
||||||
|
{
|
||||||
|
_currentFrame += _step;
|
||||||
|
_lastRequest = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
//if the animation reaches a boundary...
|
||||||
|
if (_currentFrame < _frameCount && _currentFrame >= 1)
|
||||||
|
return GetFrame(_currentFrame);
|
||||||
|
|
||||||
|
if (ReverseAtEnd)
|
||||||
|
{
|
||||||
|
_step *= -1; //...reverse the count
|
||||||
|
_currentFrame += _step; //apply it
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_currentFrame = 0; //...or start over
|
||||||
|
|
||||||
|
return GetFrame(_currentFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Image GetFrame(int index)
|
||||||
|
{
|
||||||
|
_gifImage.SelectActiveFrame(_dimension, index); //find the frame
|
||||||
|
return (Image) _gifImage.Clone(); //return a copy of it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@ -60,6 +61,26 @@ namespace Artemis.Utilities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static BitmapImage BitmapToBitmapImage(Bitmap b)
|
||||||
|
{
|
||||||
|
if (b == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
using (var memory = new MemoryStream())
|
||||||
|
{
|
||||||
|
b.Save(memory, ImageFormat.Png);
|
||||||
|
memory.Position = 0;
|
||||||
|
|
||||||
|
var bitmapImage = new BitmapImage();
|
||||||
|
bitmapImage.BeginInit();
|
||||||
|
bitmapImage.StreamSource = memory;
|
||||||
|
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
|
||||||
|
bitmapImage.EndInit();
|
||||||
|
|
||||||
|
return bitmapImage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Bitmap DrawinVisualToBitmap(DrawingVisual visual, Rect rect)
|
public static Bitmap DrawinVisualToBitmap(DrawingVisual visual, Rect rect)
|
||||||
{
|
{
|
||||||
var bmp = new RenderTargetBitmap((int) rect.Width, (int) rect.Height, 96, 96, PixelFormats.Pbgra32);
|
var bmp = new RenderTargetBitmap((int) rect.Width, (int) rect.Height, 96, 96, PixelFormats.Pbgra32);
|
||||||
|
|||||||
@ -1,7 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Artemis.Models.Profiles;
|
using Artemis.Models.Profiles;
|
||||||
|
using Artemis.Properties;
|
||||||
|
using Pen = System.Windows.Media.Pen;
|
||||||
|
using Point = System.Windows.Point;
|
||||||
|
using Size = System.Windows.Size;
|
||||||
|
|
||||||
namespace Artemis.Utilities
|
namespace Artemis.Utilities
|
||||||
{
|
{
|
||||||
@ -10,6 +16,8 @@ namespace Artemis.Utilities
|
|||||||
private readonly LayerModel _layerModel;
|
private readonly LayerModel _layerModel;
|
||||||
private double _animationProgress;
|
private double _animationProgress;
|
||||||
private Rect _firstRect;
|
private Rect _firstRect;
|
||||||
|
private GifImage _gifImage;
|
||||||
|
private string _gifSource;
|
||||||
private Rect _rectangle;
|
private Rect _rectangle;
|
||||||
private Rect _secondRect;
|
private Rect _secondRect;
|
||||||
|
|
||||||
@ -113,13 +121,22 @@ namespace Artemis.Utilities
|
|||||||
|
|
||||||
public DrawingImage GetThumbnail()
|
public DrawingImage GetThumbnail()
|
||||||
{
|
{
|
||||||
if (_layerModel.UserProps.Brush == null)
|
var thumbnailRect = new Rect(0, 0, 18, 18);
|
||||||
return null;
|
|
||||||
|
|
||||||
var visual = new DrawingVisual();
|
var visual = new DrawingVisual();
|
||||||
using (var c = visual.RenderOpen())
|
using (var c = visual.RenderOpen())
|
||||||
c.DrawRectangle(_layerModel.UserProps.Brush, new Pen(new SolidColorBrush(Colors.White), 1),
|
{
|
||||||
new Rect(0, 0, 18, 18));
|
// Draw the appropiate icon or draw the brush
|
||||||
|
if (_layerModel.LayerType == LayerType.Folder)
|
||||||
|
c.DrawImage(ImageUtilities.BitmapToBitmapImage(Resources.folder), thumbnailRect);
|
||||||
|
else if (_layerModel.LayerType == LayerType.Headset)
|
||||||
|
c.DrawImage(ImageUtilities.BitmapToBitmapImage(Resources.headset), thumbnailRect);
|
||||||
|
else if(_layerModel.LayerType == LayerType.Mouse)
|
||||||
|
c.DrawImage(ImageUtilities.BitmapToBitmapImage(Resources.mouse), thumbnailRect);
|
||||||
|
else if(_layerModel.LayerType == LayerType.KeyboardGif)
|
||||||
|
c.DrawImage(ImageUtilities.BitmapToBitmapImage(Resources.gif), thumbnailRect);
|
||||||
|
else if(_layerModel.LayerType == LayerType.Keyboard && _layerModel.UserProps.Brush != null)
|
||||||
|
c.DrawRectangle(_layerModel.UserProps.Brush, new Pen(new SolidColorBrush(Colors.White), 1), thumbnailRect);
|
||||||
|
}
|
||||||
|
|
||||||
var image = new DrawingImage(visual.Drawing);
|
var image = new DrawingImage(visual.Drawing);
|
||||||
return image;
|
return image;
|
||||||
@ -153,8 +170,25 @@ namespace Artemis.Utilities
|
|||||||
new Point(_rectangle.Width/2, _rectangle.Height/2), _rectangle.Width, _rectangle.Height);
|
new Point(_rectangle.Width/2, _rectangle.Height/2), _rectangle.Width, _rectangle.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawGif(DrawingContext bmp)
|
public void DrawGif(DrawingContext c, bool update = true)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(_layerModel.GifFile))
|
||||||
|
return;
|
||||||
|
if (!File.Exists(_layerModel.GifFile))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_layerModel.GifFile != _gifSource || _gifSource == null)
|
||||||
|
{
|
||||||
|
_gifImage = new GifImage(_layerModel.GifFile);
|
||||||
|
_gifSource = _layerModel.GifFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
var gifRect = new Rect(_layerModel.CalcProps.X*Scale,
|
||||||
|
_layerModel.CalcProps.Y*Scale, _layerModel.CalcProps.Width*Scale,
|
||||||
|
_layerModel.CalcProps.Height*Scale);
|
||||||
|
|
||||||
|
var draw = update ? _gifImage.GetNextFrame() : _gifImage.GetFrame(0);
|
||||||
|
c.DrawImage(ImageUtilities.BitmapToBitmapImage(new Bitmap(draw)), gifRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateMouse()
|
public void UpdateMouse()
|
||||||
|
|||||||
@ -1,12 +1,16 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Windows.Forms;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Artemis.KeyboardProviders;
|
using Artemis.KeyboardProviders;
|
||||||
using Artemis.Models.Profiles;
|
using Artemis.Models.Profiles;
|
||||||
|
using Artemis.Services;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
|
using Screen = Caliburn.Micro.Screen;
|
||||||
|
|
||||||
namespace Artemis.ViewModels.LayerEditor
|
namespace Artemis.ViewModels.LayerEditor
|
||||||
{
|
{
|
||||||
@ -18,12 +22,15 @@ namespace Artemis.ViewModels.LayerEditor
|
|||||||
private LayerModel _layer;
|
private LayerModel _layer;
|
||||||
private LayerModel _proposedLayer;
|
private LayerModel _proposedLayer;
|
||||||
private LayerPropertiesModel _proposedProperties;
|
private LayerPropertiesModel _proposedProperties;
|
||||||
|
private LayerType _layerType;
|
||||||
|
private MetroDialogService _dialogService;
|
||||||
|
|
||||||
public LayerEditorViewModel(KeyboardProvider activeKeyboard, LayerModel layer)
|
public LayerEditorViewModel(KeyboardProvider activeKeyboard, LayerModel layer)
|
||||||
{
|
{
|
||||||
_activeKeyboard = activeKeyboard;
|
_activeKeyboard = activeKeyboard;
|
||||||
_wasEnabled = layer.Enabled;
|
_wasEnabled = layer.Enabled;
|
||||||
|
|
||||||
|
_dialogService = new MetroDialogService(this);
|
||||||
Layer = layer;
|
Layer = layer;
|
||||||
ProposedLayer = new LayerModel();
|
ProposedLayer = new LayerModel();
|
||||||
GeneralHelpers.CopyProperties(ProposedLayer, Layer);
|
GeneralHelpers.CopyProperties(ProposedLayer, Layer);
|
||||||
@ -42,7 +49,7 @@ namespace Artemis.ViewModels.LayerEditor
|
|||||||
_previewWorker.DoWork += PreviewWorkerOnDoWork;
|
_previewWorker.DoWork += PreviewWorkerOnDoWork;
|
||||||
_previewWorker.RunWorkerAsync();
|
_previewWorker.RunWorkerAsync();
|
||||||
|
|
||||||
PropertyChanged += AnimationUiHandler;
|
PropertyChanged += GridDisplayHandler;
|
||||||
PreSelect();
|
PreSelect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +98,9 @@ namespace Artemis.ViewModels.LayerEditor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool KeyboardGridIsVisible => Layer.LayerType == LayerType.Keyboard;
|
||||||
|
public bool GifGridIsVisible => Layer.LayerType == LayerType.KeyboardGif;
|
||||||
|
|
||||||
public ImageSource LayerImage
|
public ImageSource LayerImage
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -128,12 +138,28 @@ namespace Artemis.ViewModels.LayerEditor
|
|||||||
public void PreSelect()
|
public void PreSelect()
|
||||||
{
|
{
|
||||||
GeneralHelpers.CopyProperties(ProposedProperties, Layer.UserProps);
|
GeneralHelpers.CopyProperties(ProposedProperties, Layer.UserProps);
|
||||||
|
LayerType = Layer.LayerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AnimationUiHandler(object sender, PropertyChangedEventArgs e)
|
public LayerType LayerType
|
||||||
{
|
{
|
||||||
if (e.PropertyName != "_proposedProperties")
|
get { return _layerType; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == _layerType) return;
|
||||||
|
_layerType = value;
|
||||||
|
NotifyOfPropertyChange(() => LayerType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GridDisplayHandler(object sender, PropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.PropertyName != "LayerType")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Layer.LayerType = LayerType;
|
||||||
|
NotifyOfPropertyChange(() => KeyboardGridIsVisible);
|
||||||
|
NotifyOfPropertyChange(() => GifGridIsVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddCondition()
|
public void AddCondition()
|
||||||
@ -149,6 +175,9 @@ namespace Artemis.ViewModels.LayerEditor
|
|||||||
HeightProperties.Apply();
|
HeightProperties.Apply();
|
||||||
WidthProperties.Apply();
|
WidthProperties.Apply();
|
||||||
OpacityProperties.Apply();
|
OpacityProperties.Apply();
|
||||||
|
|
||||||
|
if (!File.Exists(Layer.GifFile) && Layer.LayerType == LayerType.KeyboardGif)
|
||||||
|
_dialogService.ShowErrorMessageBox("Couldn't find or access the provided GIF file.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteCondition(LayerConditionViewModel<T> layerConditionViewModel,
|
public void DeleteCondition(LayerConditionViewModel<T> layerConditionViewModel,
|
||||||
@ -158,6 +187,14 @@ namespace Artemis.ViewModels.LayerEditor
|
|||||||
Layer.LayerConditions.Remove(layerConditionModel);
|
Layer.LayerConditions.Remove(layerConditionModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void BrowseGif()
|
||||||
|
{
|
||||||
|
var dialog = new OpenFileDialog {Filter = "Animated image file (*.gif)|*.gif"};
|
||||||
|
var result = dialog.ShowDialog();
|
||||||
|
if (result == DialogResult.OK)
|
||||||
|
Layer.GifFile = dialog.FileName;
|
||||||
|
}
|
||||||
|
|
||||||
public override void CanClose(Action<bool> callback)
|
public override void CanClose(Action<bool> callback)
|
||||||
{
|
{
|
||||||
_previewWorker.CancelAsync();
|
_previewWorker.CancelAsync();
|
||||||
|
|||||||
@ -1,14 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Dynamic;
|
using System.Dynamic;
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using Artemis.DAL;
|
using Artemis.DAL;
|
||||||
using Artemis.Events;
|
using Artemis.Events;
|
||||||
using Artemis.KeyboardProviders;
|
using Artemis.KeyboardProviders;
|
||||||
@ -133,7 +130,10 @@ namespace Artemis.ViewModels
|
|||||||
drawingContext.DrawRectangle(new SolidColorBrush(Color.FromArgb(0, 0, 0, 0)), null, keyboardRect);
|
drawingContext.DrawRectangle(new SolidColorBrush(Color.FromArgb(0, 0, 0, 0)), null, keyboardRect);
|
||||||
|
|
||||||
// Draw the layers
|
// Draw the layers
|
||||||
foreach (var layerModel in _selectedProfile.Layers.OrderByDescending(l => l.Order))
|
foreach (
|
||||||
|
var layerModel in
|
||||||
|
_selectedProfile.Layers.OrderByDescending(l => l.Order)
|
||||||
|
.Where(l => l.LayerType == LayerType.Keyboard || l.LayerType == LayerType.KeyboardGif))
|
||||||
layerModel.DrawPreview(drawingContext);
|
layerModel.DrawPreview(drawingContext);
|
||||||
|
|
||||||
// Get the selection color
|
// Get the selection color
|
||||||
@ -170,28 +170,7 @@ namespace Artemis.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageSource KeyboardImage
|
public ImageSource KeyboardImage => ImageUtilities.BitmapToBitmapImage(ActiveKeyboard?.PreviewSettings.Image);
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
using (var memory = new MemoryStream())
|
|
||||||
{
|
|
||||||
if (ActiveKeyboard?.PreviewSettings.Image == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
ActiveKeyboard.PreviewSettings.Image.Save(memory, ImageFormat.Png);
|
|
||||||
memory.Position = 0;
|
|
||||||
|
|
||||||
var bitmapImage = new BitmapImage();
|
|
||||||
bitmapImage.BeginInit();
|
|
||||||
bitmapImage.StreamSource = memory;
|
|
||||||
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
|
|
||||||
bitmapImage.EndInit();
|
|
||||||
|
|
||||||
return bitmapImage;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public PreviewSettings? PreviewSettings => ActiveKeyboard?.PreviewSettings;
|
public PreviewSettings? PreviewSettings => ActiveKeyboard?.PreviewSettings;
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,13 @@
|
|||||||
ResizeMode="NoResize">
|
ResizeMode="NoResize">
|
||||||
<controls:MetroWindow.Resources>
|
<controls:MetroWindow.Resources>
|
||||||
<utilities:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" />
|
<utilities:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" />
|
||||||
|
<ObjectDataProvider MethodName="GetValues"
|
||||||
|
ObjectType="{x:Type sys:Enum}"
|
||||||
|
x:Key="LayerEnumValues">
|
||||||
|
<ObjectDataProvider.MethodParameters>
|
||||||
|
<x:Type TypeName="profileEnumerations:LayerType" />
|
||||||
|
</ObjectDataProvider.MethodParameters>
|
||||||
|
</ObjectDataProvider>
|
||||||
<ObjectDataProvider MethodName="GetValues"
|
<ObjectDataProvider MethodName="GetValues"
|
||||||
ObjectType="{x:Type sys:Enum}"
|
ObjectType="{x:Type sys:Enum}"
|
||||||
x:Key="AnimationEnumValues">
|
x:Key="AnimationEnumValues">
|
||||||
@ -44,12 +51,6 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
@ -62,6 +63,17 @@
|
|||||||
<TextBox Grid.Row="1" Grid.Column="1" x:Name="Name" Margin="10" Text="{Binding Path=Layer.Name}" />
|
<TextBox Grid.Row="1" Grid.Column="1" x:Name="Name" Margin="10" Text="{Binding Path=Layer.Name}" />
|
||||||
|
|
||||||
<!-- Layer type -->
|
<!-- Layer type -->
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="2" Margin="10,12" FontSize="13.333" Text="Type:"
|
||||||
|
VerticalAlignment="Center" Height="18" />
|
||||||
|
|
||||||
|
<ComboBox Grid.Row="1" Grid.Column="3" ItemsSource="{Binding Source={StaticResource LayerEnumValues}}"
|
||||||
|
Margin="10" SelectedItem="{Binding Path=LayerType}">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
<!-- Condition editor -->
|
<!-- Condition editor -->
|
||||||
<Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" FontSize="20" Content="Display if.." />
|
<Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" FontSize="20" Content="Display if.." />
|
||||||
@ -85,58 +97,104 @@
|
|||||||
<Label Grid.Row="4" Grid.Column="0" FontSize="20" HorizontalAlignment="Left"
|
<Label Grid.Row="4" Grid.Column="0" FontSize="20" HorizontalAlignment="Left"
|
||||||
Content="Advanced" Width="97" VerticalAlignment="Bottom" />
|
Content="Advanced" Width="97" VerticalAlignment="Bottom" />
|
||||||
|
|
||||||
<!-- Colors -->
|
<!-- Advanced settings - Keyboard -->
|
||||||
<TextBlock Grid.Row="5" Grid.Column="0" Margin="10,13,10,0" FontSize="13.333" Text="Color(s):"
|
<Grid x:Name="KeyboardGridIsVisible" Grid.Row="5" Grid.ColumnSpan="4" Grid.Column="0">
|
||||||
VerticalAlignment="Top" Height="18" />
|
<!-- Colors -->
|
||||||
<Border Grid.Row="5" Grid.Column="1" Margin="10" BorderBrush="{StaticResource ControlBorderBrush}"
|
<Grid.ColumnDefinitions>
|
||||||
BorderThickness="1" SnapsToDevicePixels="True" ToolTip="Click to edit">
|
<ColumnDefinition />
|
||||||
<ncore:ColorBox Brush="{Binding Path=ProposedProperties.Brush, Mode=TwoWay}" Height="24" />
|
<ColumnDefinition />
|
||||||
</Border>
|
<ColumnDefinition />
|
||||||
|
<ColumnDefinition />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="0" Margin="10,13,10,0" FontSize="13.333" Text="Color(s):"
|
||||||
|
VerticalAlignment="Top" Height="18" />
|
||||||
|
<Border Grid.Row="0" Grid.Column="1" Margin="10" BorderBrush="{StaticResource ControlBorderBrush}"
|
||||||
|
BorderThickness="1" SnapsToDevicePixels="True" ToolTip="Click to edit">
|
||||||
|
<ncore:ColorBox Brush="{Binding Path=ProposedProperties.Brush, Mode=TwoWay}" Height="24" />
|
||||||
|
</Border>
|
||||||
|
|
||||||
<!-- ContainedBrush -->
|
<!-- ContainedBrush -->
|
||||||
<TextBlock Grid.Row="5" Grid.Column="2" Margin="10" FontSize="13.333" Text="Contained colors:"
|
<TextBlock Grid.Row="0" Grid.Column="2" Margin="10" FontSize="13.333" Text="Contained colors:"
|
||||||
VerticalAlignment="Center" Height="18" />
|
VerticalAlignment="Center" Height="18" />
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=ProposedProperties.ContainedBrush, Mode=TwoWay}" Grid.Row="5"
|
<controls:ToggleSwitch IsChecked="{Binding Path=ProposedProperties.ContainedBrush, Mode=TwoWay}"
|
||||||
Grid.Column="3" OnLabel="Yes" OffLabel="No" Margin="10,1,5,1" VerticalAlignment="Center"
|
Grid.Row="0"
|
||||||
Height="36" />
|
Grid.Column="3" OnLabel="Yes" OffLabel="No" Margin="10,1,5,1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Height="36" />
|
||||||
|
|
||||||
<!-- Animation -->
|
<!-- Animation -->
|
||||||
<TextBlock Grid.Row="6" Grid.Column="0" Margin="10" FontSize="13.333" Text="Animation:"
|
<TextBlock Grid.Row="1" Grid.Column="0" Margin="10" FontSize="13.333" Text="Animation:"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Height="18" />
|
Height="18" />
|
||||||
<ComboBox Grid.Row="6" Grid.Column="1" ItemsSource="{Binding Source={StaticResource AnimationEnumValues}}"
|
<ComboBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Source={StaticResource AnimationEnumValues}}"
|
||||||
Margin="10,10,10,0" SelectedItem="{Binding Path=ProposedProperties.Animation}"
|
Margin="10,10,10,0" SelectedItem="{Binding Path=ProposedProperties.Animation}"
|
||||||
VerticalAlignment="Top" Height="22">
|
VerticalAlignment="Top" Height="22">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
|
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
<!-- Animation Speed -->
|
<!-- Animation Speed -->
|
||||||
<TextBlock Grid.Row="6" Grid.Column="2" Margin="10" FontSize="13.333" Text="Animation speed:"
|
<TextBlock Grid.Row="1" Grid.Column="2" Margin="10" FontSize="13.333" Text="Animation speed:"
|
||||||
VerticalAlignment="Center" Height="18" />
|
VerticalAlignment="Center" Height="18" />
|
||||||
<Slider x:Name="RotationSpeed" Grid.Row="6" Grid.Column="3" VerticalAlignment="Center"
|
<Slider x:Name="RotationSpeed" Grid.Row="1" Grid.Column="3" VerticalAlignment="Center"
|
||||||
TickPlacement="None" TickFrequency="0.05"
|
TickPlacement="None" TickFrequency="0.05"
|
||||||
Value="{Binding Path=ProposedProperties.AnimationSpeed, Mode=TwoWay}" Minimum="0.05" Maximum="3"
|
Value="{Binding Path=ProposedProperties.AnimationSpeed, Mode=TwoWay}" Minimum="0.05" Maximum="3"
|
||||||
SmallChange="1" IsSnapToTickEnabled="True" Margin="10,12,10,2" Height="24" />
|
SmallChange="1" IsSnapToTickEnabled="True" Margin="10,12,10,2" Height="24" />
|
||||||
|
|
||||||
<!-- Dynamic -->
|
<!-- Dynamic -->
|
||||||
<Label Grid.Row="7" Grid.Column="0" FontSize="20" HorizontalAlignment="Left"
|
<Label Grid.Row="3" Grid.Column="0" FontSize="20" HorizontalAlignment="Left"
|
||||||
Content="Dynamic" Width="97" VerticalAlignment="Bottom" />
|
Content="Dynamic" Width="97" VerticalAlignment="Bottom" />
|
||||||
|
|
||||||
<!-- Dynamic property views -->
|
<!-- Dynamic property views -->
|
||||||
<ContentControl Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="4" x:Name="HeightProperties" />
|
<ContentControl Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4" x:Name="HeightProperties" />
|
||||||
<ContentControl Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="4" x:Name="WidthProperties" />
|
<ContentControl Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4" x:Name="WidthProperties" />
|
||||||
<ContentControl Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="4" x:Name="OpacityProperties" />
|
<ContentControl Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" x:Name="OpacityProperties" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Button Grid.Row="12" Grid.Column="0" x:Name="Apply" Content="Apply" VerticalAlignment="Bottom"
|
<!-- Advanced settings - Keyboard -->
|
||||||
|
<Grid x:Name="GifGridIsVisible" Grid.Row="5" Grid.ColumnSpan="4" Grid.Column="0">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition />
|
||||||
|
<ColumnDefinition />
|
||||||
|
<ColumnDefinition />
|
||||||
|
<ColumnDefinition />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="0" Margin="10,13,10,0" FontSize="13.333" Text="GIF file:"
|
||||||
|
VerticalAlignment="Top" Height="18" />
|
||||||
|
<Grid Grid.Row="0" Grid.Column="1" ColumnSpan="3" Margin="5,10,10,0" VerticalAlignment="Top">
|
||||||
|
<TextBox Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||||
|
Text="{Binding Path=Layer.GifFile, Mode=TwoWay}" />
|
||||||
|
<Button x:Name="BrowseGif" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
||||||
|
HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="25" />
|
||||||
|
</Grid>
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="10,13,10,0" FontSize="13.333"
|
||||||
|
Foreground="{DynamicResource HighlightBrush}"
|
||||||
|
Text="Note: It is recommended to use very tiny gifs (25x7 per example). Any higher will degrade performance without any noticeable quality difference."
|
||||||
|
VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" />
|
||||||
|
</Grid>
|
||||||
|
<Button Grid.Row="6" Grid.Column="0" x:Name="Apply" Content="Apply" VerticalAlignment="Bottom"
|
||||||
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,20"
|
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,20"
|
||||||
Height="30" />
|
Height="30" />
|
||||||
<Button Grid.Row="12" Grid.Column="1" x:Name="PreSelect" Content="Reset" VerticalAlignment="Bottom"
|
<Button Grid.Row="6" Grid.Column="1" x:Name="PreSelect" Content="Reset" VerticalAlignment="Bottom"
|
||||||
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,20"
|
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,20"
|
||||||
Height="30" />
|
Height="30" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</controls:MetroWindow>
|
</controls:MetroWindow>
|
||||||
@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Autofac" version="4.0.0-rc1-177" targetFramework="net452" />
|
<package id="Autofac" version="4.0.0-rc1-177" targetFramework="net452" />
|
||||||
<package id="Caliburn.Micro" version="2.0.2" targetFramework="net452" />
|
<package id="Caliburn.Micro" version="2.0.2" targetFramework="net452" />
|
||||||
@ -24,4 +23,5 @@
|
|||||||
<package id="System.Linq.Dynamic" version="1.0.6" targetFramework="net452" />
|
<package id="System.Linq.Dynamic" version="1.0.6" targetFramework="net452" />
|
||||||
<package id="VirtualInput" version="1.0.1" targetFramework="net452" />
|
<package id="VirtualInput" version="1.0.1" targetFramework="net452" />
|
||||||
<package id="WpfExceptionViewer" version="1.0.0.0" targetFramework="net452" />
|
<package id="WpfExceptionViewer" version="1.0.0.0" targetFramework="net452" />
|
||||||
|
<package id="XamlAnimatedGif" version="1.1.2" targetFramework="net452" />
|
||||||
</packages>
|
</packages>
|
||||||
Loading…
x
Reference in New Issue
Block a user