mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Added window resize support to the profile editor
Fixed UI alignments in profile editor
This commit is contained in:
parent
ef19348e53
commit
809e38da7e
@ -93,7 +93,7 @@ namespace Artemis.InjectionModules
|
||||
Kernel.Bind(x =>
|
||||
x.FromThisAssembly()
|
||||
.SelectAllClasses()
|
||||
.InheritedFrom<LayerCondition>()
|
||||
.InheritedFrom<ILayerCondition>()
|
||||
.BindAllInterfaces());
|
||||
Kernel.Bind(x =>
|
||||
x.FromThisAssembly()
|
||||
|
||||
@ -23,10 +23,10 @@ namespace Artemis.Models
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
public MouseButtons MouseButtons { get; }
|
||||
public HotKey HotKey { get; set; }
|
||||
public Action Action { get; set; }
|
||||
public MouseButtons MouseButtons { get; }
|
||||
public KeyType KeyType { get; set; }
|
||||
public Action Action { get; set; }
|
||||
|
||||
public void InvokeIfMatched(HotKey hotKey, KeyType keyType)
|
||||
{
|
||||
@ -34,7 +34,7 @@ namespace Artemis.Models
|
||||
return;
|
||||
|
||||
if (hotKey.Equals(HotKey))
|
||||
Action?.Invoke();
|
||||
Action?.Invoke();
|
||||
}
|
||||
|
||||
public void InvokeIfMatched(MouseButtons mouseButtons, KeyType keyType)
|
||||
|
||||
@ -1,70 +1,51 @@
|
||||
<UserControl x:Class="Artemis.Modules.Games.AssettoCorsa.AssettoCorsaView"
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="559.725" d:DesignWidth="882.696">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15,5,5,5">
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="600" d:DesignWidth="900">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="By default shows RPM on the F-keys, gear on the other keys and track flags on the numpad." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default shows RPM on the F-keys, gear on the other keys and track flags on the numpad." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom"
|
||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||
TextAlignment="Justify" Margin="5,0,0,10">
|
||||
The Assetto Corsa module uses the
|
||||
<Hyperlink RequestNavigate="Hyperlink_RequestNavigate"
|
||||
NavigateUri="https://github.com/mdjarv/assettocorsasharedmemory">
|
||||
Assetto Corsa Shared Memory Library
|
||||
</Hyperlink>
|
||||
project by mdjarv
|
||||
</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<!-- Sub header -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold" TextAlignment="Justify" Margin="5,0,0,10">
|
||||
The Assetto Corsa module uses the <Hyperlink RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="https://github.com/mdjarv/assettocorsasharedmemory">Assetto Corsa Shared Memory Library</Hyperlink> project by mdjarv.
|
||||
</TextBlock>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-20,0" />
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -1,67 +1,56 @@
|
||||
<UserControl x:Class="Artemis.Modules.Games.CounterStrike.CounterStrikeView"
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15,5,5,5">
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="By default shows team, HP, ammo and money on the keyboard and shows team colors on mouse and headset" />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default shows team, HP, ammo and money on the keyboard and shows team colors on mouse and headset." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
|
||||
<!-- Directory -->
|
||||
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left" Content="Counter-Strike Global Offensive directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||
Text="{Binding Path=Settings.GameDirectory, Mode=TwoWay}"
|
||||
cal:Message.Attach="[Event LostFocus] = [Action PlaceConfigFile]" />
|
||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
||||
HorizontalAlignment="Right" Width="25"
|
||||
Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="0,0,30,0" Text="{Binding Path=Settings.GameDirectory, Mode=TwoWay}" cal:Message.Attach="[Event LostFocus] = [Action PlaceConfigFile]" />
|
||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944" HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-20,0" />
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="4" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using Artemis.Managers;
|
||||
using System.Windows.Forms;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Ninject;
|
||||
|
||||
@ -6,8 +7,7 @@ namespace Artemis.Modules.Games.CounterStrike
|
||||
{
|
||||
public sealed class CounterStrikeViewModel : ModuleViewModel
|
||||
{
|
||||
public CounterStrikeViewModel(MainManager mainManager,
|
||||
[Named(nameof(CounterStrikeModel))] ModuleModel moduleModel, IKernel kernel)
|
||||
public CounterStrikeViewModel(MainManager mainManager, [Named(nameof(CounterStrikeModel))] ModuleModel moduleModel, IKernel kernel)
|
||||
: base(mainManager, moduleModel, kernel)
|
||||
{
|
||||
DisplayName = "CS:GO";
|
||||
@ -15,10 +15,23 @@ namespace Artemis.Modules.Games.CounterStrike
|
||||
|
||||
public override bool UsesProfileEditor => true;
|
||||
|
||||
public void BrowseDirectory()
|
||||
public void PlaceConfigFile()
|
||||
{
|
||||
((CounterStrikeModel) ModuleModel).PlaceConfigFile();
|
||||
NotifyOfPropertyChange(() => Settings);
|
||||
}
|
||||
|
||||
public void BrowseDirectory()
|
||||
{
|
||||
var dialog = new FolderBrowserDialog { SelectedPath = ((CounterStrikeSettings)Settings).GameDirectory };
|
||||
var result = dialog.ShowDialog();
|
||||
if (result != DialogResult.OK)
|
||||
return;
|
||||
|
||||
((CounterStrikeSettings)Settings).GameDirectory = dialog.SelectedPath;
|
||||
((CounterStrikeModel)ModuleModel).PlaceConfigFile();
|
||||
Settings.Save();
|
||||
NotifyOfPropertyChange(() => Settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,63 +4,53 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15,5,5,5">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="By default shows mana, HP, character state on the keyboard and colors headset and mouse according to HP" />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default shows mana, HP, character state on the keyboard and colors headset and mouse according to HP." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<!-- Directory -->
|
||||
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left" Content="Dota 2 directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||
Text="{Binding Path=Settings.GameDirectory, Mode=TwoWay}"
|
||||
cal:Message.Attach="[Event LostFocus] = [Action PlaceConfigFile]" />
|
||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
||||
HorizontalAlignment="Right" Width="25"
|
||||
Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="0,0,30,0" Text="{Binding Path=Settings.GameDirectory, Mode=TwoWay}" cal:Message.Attach="[Event LostFocus] = [Action PlaceConfigFile]" />
|
||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944" HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-20,0" />
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="4" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using Artemis.Managers;
|
||||
using System.Windows.Forms;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Ninject;
|
||||
|
||||
@ -6,18 +7,31 @@ namespace Artemis.Modules.Games.Dota2
|
||||
{
|
||||
public sealed class Dota2ViewModel : ModuleViewModel
|
||||
{
|
||||
public Dota2ViewModel(MainManager mainManager, [Named(nameof(Dota2Model))] ModuleModel moduleModel,
|
||||
IKernel kernel) : base(mainManager, moduleModel, kernel)
|
||||
public Dota2ViewModel(MainManager mainManager, [Named(nameof(Dota2Model))] ModuleModel moduleModel, IKernel kernel)
|
||||
: base(mainManager, moduleModel, kernel)
|
||||
{
|
||||
DisplayName = "Dota 2";
|
||||
}
|
||||
|
||||
public override bool UsesProfileEditor => true;
|
||||
|
||||
public void BrowseDirectory()
|
||||
public void PlaceConfigFile()
|
||||
{
|
||||
((Dota2Model) ModuleModel).PlaceConfigFile();
|
||||
NotifyOfPropertyChange(() => Settings);
|
||||
}
|
||||
|
||||
public void BrowseDirectory()
|
||||
{
|
||||
var dialog = new FolderBrowserDialog { SelectedPath = ((Dota2Settings)Settings).GameDirectory };
|
||||
var result = dialog.ShowDialog();
|
||||
if (result != DialogResult.OK)
|
||||
return;
|
||||
|
||||
((Dota2Settings)Settings).GameDirectory = dialog.SelectedPath;
|
||||
((Dota2Model)ModuleModel).PlaceConfigFile();
|
||||
Settings.Save();
|
||||
NotifyOfPropertyChange(() => Settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,101 +3,75 @@
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="559.725" d:DesignWidth="882.696">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15,5,5,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="By default shows indicator lights, speed and engine RPM on the keyboard" />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom"
|
||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||
TextAlignment="Justify" Margin="5,0,0,10">
|
||||
The Truck Simulator module uses code from the
|
||||
<Hyperlink RequestNavigate="Hyperlink_RequestNavigate"
|
||||
NavigateUri="https://github.com/Funbit/ets2-telemetry-server">
|
||||
ETS2 Telemetry Web Server
|
||||
</Hyperlink>
|
||||
project by Funbit
|
||||
</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2">
|
||||
<!-- ETS2 dir -->
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="0,0,1,0" Grid.Column="0">
|
||||
<Label FontSize="16" HorizontalAlignment="Left" Content="Euro Truck Simulator 2 directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="Ets2GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||
Text="{Binding Path=Settings.Ets2GameDirectory, Mode=TwoWay}"
|
||||
cal:Message.Attach="[Event LostFocus] = [Action Ets2PlacePlugin]" />
|
||||
<Button x:Name="Ets2BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
||||
HorizontalAlignment="Right" Width="25"
|
||||
Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<!-- ATS dir -->
|
||||
<StackPanel Margin="0,0,1,0" Grid.Column="1">
|
||||
<Label FontSize="16" HorizontalAlignment="Left" Content="American Truck Simulator directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="AtsGameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||
Text="{Binding Path=Settings.AtsGameDirectory, Mode=TwoWay}"
|
||||
cal:Message.Attach="[Event LostFocus] = [Action AtsPlacePlugin]" />
|
||||
<Button x:Name="AtsBrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
||||
HorizontalAlignment="Right" Width="25"
|
||||
Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-20,0" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="5" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default shows indicator lights, speed and engine RPM on the keyboard." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<!-- Sub header -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold" TextAlignment="Justify" Margin="5,0,0,10">
|
||||
The Truck Simulator module uses code from the <Hyperlink RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="https://github.com/Funbit/ets2-telemetry-server">ETS2 Telemetry Web Server</Hyperlink> project by Funbit.
|
||||
</TextBlock>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Directories -->
|
||||
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2">
|
||||
<!-- ETS2 dir -->
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="0,0,1,0" Grid.Column="0">
|
||||
<Label FontSize="16" HorizontalAlignment="Left" Content="Euro Truck Simulator 2 directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="Ets2GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0" Text="{Binding Path=Settings.Ets2GameDirectory, Mode=TwoWay}" cal:Message.Attach="[Event LostFocus] = [Action Ets2PlacePlugin]" />
|
||||
<Button x:Name="Ets2BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944" HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<!-- ATS dir -->
|
||||
<StackPanel Margin="0,0,1,0" Grid.Column="1">
|
||||
<Label FontSize="16" HorizontalAlignment="Left" Content="American Truck Simulator directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="AtsGameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0" Text="{Binding Path=Settings.AtsGameDirectory, Mode=TwoWay}" cal:Message.Attach="[Event LostFocus] = [Action AtsPlacePlugin]" />
|
||||
<Button x:Name="AtsBrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944" HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="4" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@ -1,54 +1,46 @@
|
||||
<UserControl x:Class="Artemis.Modules.Games.GtaV.GtaVView"
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15, 5, 15, 5">
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="By default fills up the keyboard and colors all devices according to the character you're playing/team you're in." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default fills up the keyboard and colors all devices according to the character you're playing/team you're in." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-30,0" />
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="9" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -3,58 +3,44 @@
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="559.725" d:DesignWidth="882.696">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15,5,5,5">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="Mirrors Light FX lighting to your RGB devices" />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="Mirrors Light FX lighting to your RGB devices." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-20,0" />
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -3,86 +3,60 @@
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="410.933" d:DesignWidth="732.154">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15, 5, 15, 5">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="By default colors the keyboard according to the chosen hero and shows ability cooldowns." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default colors the keyboard according to the chosen hero and shows ability cooldowns." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom"
|
||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||
TextAlignment="Justify" Margin="5,0,0,10">
|
||||
Note: If you're having trouble getting the profile to work, check out
|
||||
<Hyperlink RequestNavigate="Hyperlink_RequestNavigate"
|
||||
NavigateUri="https://github.com/SpoinkyNL/Artemis/wiki/Overwatch">
|
||||
the wiki
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<!-- Sub header -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold" TextAlignment="Justify" Margin="5,0,0,10">
|
||||
Note: If you're having trouble getting the profile to work, check out <Hyperlink RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="https://github.com/SpoinkyNL/Artemis/wiki/Overwatch">the wiki</Hyperlink>.
|
||||
</TextBlock>
|
||||
|
||||
<!-- Game directory -->
|
||||
<StackPanel Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<Label FontSize="20" HorizontalAlignment="Left" Content="Overwatch Directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||
Text="{Binding Path=GameSettings.GameDirectory, Mode=TwoWay}"
|
||||
cal:Message.Attach="[Event LostFocus] = [Action PlaceDll]" />
|
||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
||||
HorizontalAlignment="Right" Width="25"
|
||||
Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
</Grid>
|
||||
<!-- Game directory -->
|
||||
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left" Content="Overwatch Directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="0,0,30,0" Text="{Binding Path=Settings.GameDirectory, Mode=TwoWay}" cal:Message.Attach="[Event LostFocus] = [Action PlaceDll]" />
|
||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944" HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor"
|
||||
Margin="0,0,-30,0" />
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<StackPanel Grid.Column="0" Grid.Row="4" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@ -15,6 +15,11 @@ namespace Artemis.Modules.Games.Overwatch
|
||||
|
||||
public override bool UsesProfileEditor => true;
|
||||
|
||||
public void PlaceDll()
|
||||
{
|
||||
((OverwatchModel)ModuleModel).PlaceDll();
|
||||
}
|
||||
|
||||
public void BrowseDirectory()
|
||||
{
|
||||
var dialog = new FolderBrowserDialog {SelectedPath = ((OverwatchSettings) Settings).GameDirectory};
|
||||
|
||||
@ -9,10 +9,13 @@ namespace Artemis.Modules.Games.ProjectCars.Data
|
||||
{
|
||||
public pCarsDataClass MapStructToClass(pCarsAPIStruct pcarsDataStruct, pCarsDataClass pCarsData)
|
||||
{
|
||||
//pCarsDataClass pCarsData = new pCarsDataClass();
|
||||
pCarsData.mVersion = pcarsDataStruct.mVersion;
|
||||
pCarsData.mBuildVersion = pcarsDataStruct.mBuildVersion;
|
||||
|
||||
// The game isn't running if these are 0
|
||||
if (pcarsDataStruct.mVersion == 0 && pcarsDataStruct.mBuildVersion == 0)
|
||||
return pCarsData;
|
||||
|
||||
// Session type
|
||||
pCarsData.mGameState = (eGameState) pcarsDataStruct.mGameState;
|
||||
pCarsData.mSessionState = (eSessionState) pcarsDataStruct.mSessionState;
|
||||
|
||||
@ -37,6 +37,10 @@ namespace Artemis.Modules.Games.ProjectCars.Data
|
||||
if (memoryMappedFile == null)
|
||||
InitialiseSharedMemory();
|
||||
|
||||
// If it's still null here the game isn't running
|
||||
if (memoryMappedFile == null)
|
||||
return new Tuple<bool, pCarsAPIStruct>(true, _pcarsapistruct);
|
||||
|
||||
using (var sharedMemoryStreamView = memoryMappedFile.CreateViewStream())
|
||||
{
|
||||
var sharedMemoryStream = new BinaryReader(sharedMemoryStreamView);
|
||||
|
||||
@ -3,68 +3,49 @@
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="559.725" d:DesignWidth="882.696">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15,5,5,5">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="By default shows RPM on the F-keys, gear on the other keys and track flags on the numpad." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default shows RPM on the F-keys, gear on the other keys and track flags on the numpad." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom"
|
||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||
TextAlignment="Justify" Margin="5,0,0,10">
|
||||
The Project CARS module uses code from the
|
||||
<Hyperlink RequestNavigate="Hyperlink_RequestNavigate"
|
||||
NavigateUri="https://bitbucket.org/MikeyTT/pcars-api-demo">
|
||||
pCars API Demo
|
||||
</Hyperlink>
|
||||
project by MikeyTT
|
||||
</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<!-- Sub header -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold" TextAlignment="Justify" Margin="5,0,0,10">
|
||||
The Project CARS module uses code from the <Hyperlink RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="https://bitbucket.org/MikeyTT/pcars-api-demo">pCars API Demo</Hyperlink> project by MikeyTT.
|
||||
</TextBlock>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-20,0" />
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -4,54 +4,47 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15, 5, 15, 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="By default fills up the keyboard and colors all devices according to the amount boost." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-30,0" />
|
||||
|
||||
<TextBlock x:Name="VersionText" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center"
|
||||
Margin="0,8" TextWrapping="Wrap" HorizontalAlignment="Left"
|
||||
Foreground="{DynamicResource HighlightBrush}" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="5" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default fills up the keyboard and colors all devices according to the amount boost." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<!-- Sub header -->
|
||||
<TextBlock x:Name="VersionText" Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold" TextAlignment="Justify" Margin="5,0,0,10"/>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@ -36,15 +36,13 @@ namespace Artemis.Modules.Games.RocketLeague
|
||||
{
|
||||
if (!SettingsProvider.Load<GeneralSettings>().EnablePointersUpdate)
|
||||
{
|
||||
VersionText = "Note: You disabled pointer updates, this could result in the " +
|
||||
"Rocket League effect not working after a game update.";
|
||||
VersionText = "You disabled pointer updates, this could result in the Rocket League effect not working after a game update.";
|
||||
return;
|
||||
}
|
||||
|
||||
Updater.GetPointers();
|
||||
var version = SettingsProvider.Load<OffsetSettings>().RocketLeague.GameVersion;
|
||||
VersionText = $"Note: Requires patch {version}. When a new patch is released Artemis downloads " +
|
||||
"new pointers for the latest version (unless disabled in settings).";
|
||||
VersionText = $"Requires patch {version}. When a new patch is released Artemis downloads new pointers for the latest version (unless disabled in settings).";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,60 +1,52 @@
|
||||
<UserControl x:Class="Artemis.Modules.Games.TheDivision.TheDivisionView"
|
||||
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:Artemis.Modules.Games.TheDivision"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="416.495" d:DesignWidth="553.608">
|
||||
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:Artemis.Modules.Games.TheDivision"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="416.495" d:DesignWidth="553.608">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid Margin="15, 5, 5, 5">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="Shows verious game states and events on the keyboard. (BETA, uses much CPU!)" />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default shows RPM on the F-keys, gear on the other keys and track flags on the numpad." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center"
|
||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||
TextAlignment="Justify" Margin="5,0,0,0">
|
||||
For this game to work with Artemis, please open up your Division settings, navigate to 3rd Party
|
||||
and set LED keyboard support to Yes. (This only works if you have Artemis running before starting the game)
|
||||
<!-- Sub header -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold" TextAlignment="Justify" Margin="5,0,0,10">
|
||||
For this game to work with Artemis, please open up your Division settings, navigate to 3rd Party and set LED keyboard support to Yes. (This only works if you have Artemis running before starting the game)
|
||||
</TextBlock>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-20,0" />
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="4" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -8,62 +8,50 @@
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15, 5, 15, 5">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="By default shows team, HP armor and ammo on the keyboard and shows team colors on mouse and headset." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default shows team, HP armor and ammo on the keyboard and shows team colors on mouse and headset." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Game directory -->
|
||||
<StackPanel Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
|
||||
<!-- Directory -->
|
||||
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left" Content="Unreal Tournament Directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||
Text="{Binding Path=Settings.GameDirectory, Mode=TwoWay}"
|
||||
cal:Message.Attach="[Event LostFocus] = [Action PlaceFiles]" />
|
||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
||||
HorizontalAlignment="Right" Width="25"
|
||||
Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="0,0,30,0" Text="{Binding Path=Settings.GameDirectory, Mode=TwoWay}" cal:Message.Attach="[Event LostFocus] = [Action PlaceFiles]" />
|
||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944" HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-30,0" />
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<StackPanel Grid.Column="0" Grid.Row="4" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -32,6 +32,13 @@ namespace Artemis.Modules.Games.UnrealTournament
|
||||
NotifyOfPropertyChange(() => Settings);
|
||||
}
|
||||
|
||||
public void PlaceFiles()
|
||||
{
|
||||
((UnrealTournamentModel)ModuleModel).PlaceFiles();
|
||||
Settings.Save();
|
||||
NotifyOfPropertyChange(() => Settings);
|
||||
}
|
||||
|
||||
// Installing GIF on editor open to make sure the proper profiles are loaded
|
||||
private void InstallGif()
|
||||
{
|
||||
|
||||
@ -3,13 +3,14 @@
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="386.842" d:DesignWidth="554.887">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid Margin="15, 5, 5, 5">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
@ -17,43 +18,39 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="By default colors the keyboard according to the sign Gerald is using." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center"
|
||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||
TextAlignment="Justify" Margin="5,0,0,10">
|
||||
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="By default shows team, HP, ammo and money on the keyboard and shows team colors on mouse and headset." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<!-- Sub header -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold" TextAlignment="Justify" Margin="5,0,0,10">
|
||||
Artemis requires the latest Witcher 3 version and mod to be installed in order to work. If you don't use any (conflicting) Witcher 3 mods, the mod can automatically be installed.
|
||||
</TextBlock>
|
||||
<Button Grid.Row="2" Grid.Column="0" Margin="5,0,0,0" x:Name="AutoInstall"
|
||||
Content="Try automatic mod install" Width="160" Style="{DynamicResource SquareButtonStyle}"
|
||||
HorizontalAlignment="Left" />
|
||||
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Mod installation -->
|
||||
<Button Grid.Row="2" Grid.Column="0" Margin="5,0,0,0" x:Name="AutoInstall" Content="Try automatic mod install" Width="160" Style="{DynamicResource SquareButtonStyle}" HorizontalAlignment="Left" />
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-30,0" />
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="4" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -8,49 +8,45 @@
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15, 5, 15, 5">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap"
|
||||
Text="Fight The Burning Legion in style with reactive lighting" />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="Fight the Legion in style with reactive lighting." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<!-- Sub header -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold" TextAlignment="Justify" Margin="5,0,0,10">
|
||||
This module hasn't been approved by Blizzard and could lead to an account ban. Even though the risk is minimal, it's still your own risk.
|
||||
</TextBlock>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-30,0" />
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="9" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -3,51 +3,44 @@
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15, 5, 15, 5">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="Allows you to create layers shown while not gaming" />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="Allows you to create layers outside the supported games." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,-30,0" x:Name="ProfileEditor"/>
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="9" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset module" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -1,53 +1,46 @@
|
||||
<UserControl x:Class="Artemis.Modules.Overlays.OverlayProfile.OverlayProfileView"
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15, 5, 15, 5">
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="Allows you to create layers on top of any other active module." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Label Content="Enable module" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||
<ToggleButton Margin="0 3 0 0" Width="25" Height="25"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||
ToolTip="Note: You can't enable an module when Artemis is disabled"
|
||||
IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event Click] = [Action ToggleModule]" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Header -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
<AccessText TextWrapping="Wrap" Text="Allows you to create layers on top of any other active module." />
|
||||
</Label.Content>
|
||||
</Label>
|
||||
|
||||
<!-- Enable -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||
<controls:ToggleSwitchButton IsChecked="{Binding Path=IsModuleEnabled, Mode=OneWay}" cal:Message.Attach="[Event Click] = [Action ToggleModule]"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,-30,0" x:Name="ProfileEditor"/>
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="9" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset module" VerticalAlignment="Top" Width="100"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||
Margin="10,0,0,0"
|
||||
Style="{DynamicResource SquareButtonStyle}" />
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@ -1,39 +1,10 @@
|
||||
using Artemis.Modules.Abstract;
|
||||
using Artemis.Profiles.Layers.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Artemis.Profiles.Layers.Abstract
|
||||
{
|
||||
public abstract class LayerCondition
|
||||
public interface ILayerCondition
|
||||
{
|
||||
[JsonIgnore]
|
||||
public bool HotKeyMet { get; set; }
|
||||
|
||||
public abstract bool ConditionsMet(LayerModel layerModel, ModuleDataModel dataModel);
|
||||
|
||||
|
||||
public void KeyDownTask(LayerConditionModel condition)
|
||||
{
|
||||
switch (condition.Field)
|
||||
{
|
||||
case "hotkeyEnable":
|
||||
HotKeyMet = true;
|
||||
break;
|
||||
case "hotkeyDisable":
|
||||
HotKeyMet = false;
|
||||
break;
|
||||
case "hotkeyToggle":
|
||||
HotKeyMet = !HotKeyMet;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void KeyUpTask(LayerConditionModel condition)
|
||||
{
|
||||
if (condition.Field == "hotkeyEnable")
|
||||
HotKeyMet = false;
|
||||
else
|
||||
HotKeyMet = true;
|
||||
}
|
||||
bool ConditionsMet(LayerModel layerModel, ModuleDataModel dataModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,52 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Artemis.Profiles.Layers.Abstract;
|
||||
using Artemis.Profiles.Layers.Models;
|
||||
|
||||
namespace Artemis.Profiles.Layers.Conditions
|
||||
{
|
||||
public class DataModelCondition : LayerCondition
|
||||
public class DataModelCondition : ILayerCondition
|
||||
{
|
||||
public override bool ConditionsMet(LayerModel layerModel, ModuleDataModel dataModel)
|
||||
public bool ConditionsMet(LayerModel layerModel, ModuleDataModel dataModel)
|
||||
{
|
||||
lock (layerModel.Properties.Conditions)
|
||||
{
|
||||
var checkConditions = layerModel.Properties.Conditions.Where(c => c.Field != null && !c.Field.Contains("hotkey")).ToList();
|
||||
|
||||
if (checkConditions.Count == layerModel.Properties.Conditions.Count)
|
||||
return SimpleConditionsMet(layerModel, dataModel, checkConditions);
|
||||
|
||||
var conditionMet = false;
|
||||
var checkConditions = layerModel.Properties.Conditions.Where(c => c.Field != null).ToList();
|
||||
switch (layerModel.Properties.ConditionType)
|
||||
{
|
||||
case ConditionType.AnyMet:
|
||||
conditionMet = HotKeyMet || checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
break;
|
||||
return checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
case ConditionType.AllMet:
|
||||
conditionMet = HotKeyMet && checkConditions.All(cm => cm.ConditionMet(dataModel));
|
||||
break;
|
||||
return checkConditions.All(cm => cm.ConditionMet(dataModel));
|
||||
case ConditionType.NoneMet:
|
||||
conditionMet = !HotKeyMet && !checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
break;
|
||||
return !checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
}
|
||||
|
||||
return conditionMet;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool SimpleConditionsMet(LayerModel layerModel, ModuleDataModel dataModel, IEnumerable<LayerConditionModel> checkConditions)
|
||||
{
|
||||
switch (layerModel.Properties.ConditionType)
|
||||
{
|
||||
case ConditionType.AnyMet:
|
||||
return checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
case ConditionType.AllMet:
|
||||
return checkConditions.All(cm => cm.ConditionMet(dataModel));
|
||||
case ConditionType.NoneMet:
|
||||
return !checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
default:
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,33 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Artemis.Profiles.Layers.Abstract;
|
||||
using Artemis.Profiles.Layers.Models;
|
||||
|
||||
namespace Artemis.Profiles.Layers.Conditions
|
||||
{
|
||||
public class EventCondition : LayerCondition
|
||||
public class EventCondition : ILayerCondition
|
||||
{
|
||||
public override bool ConditionsMet(LayerModel layerModel, ModuleDataModel dataModel)
|
||||
public bool ConditionsMet(LayerModel layerModel, ModuleDataModel dataModel)
|
||||
{
|
||||
lock (layerModel.Properties.Conditions)
|
||||
{
|
||||
var checkConditions = layerModel.Properties.Conditions.Where(c => c.Field != null && !c.Field.Contains("hotkey")).ToList();
|
||||
|
||||
if (checkConditions.Count == layerModel.Properties.Conditions.Count)
|
||||
return SimpleConditionsMet(layerModel, dataModel, checkConditions);
|
||||
|
||||
var checkConditions = layerModel.Properties.Conditions.Where(c => c.Field != null).ToList();
|
||||
var conditionsMet = false;
|
||||
switch (layerModel.Properties.ConditionType)
|
||||
{
|
||||
case ConditionType.AnyMet:
|
||||
conditionsMet = HotKeyMet || checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
conditionsMet = checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
break;
|
||||
case ConditionType.AllMet:
|
||||
conditionsMet = HotKeyMet && checkConditions.All(cm => cm.ConditionMet(dataModel));
|
||||
conditionsMet = checkConditions.All(cm => cm.ConditionMet(dataModel));
|
||||
break;
|
||||
case ConditionType.NoneMet:
|
||||
conditionsMet = !HotKeyMet && !checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
conditionsMet = !checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -35,27 +30,9 @@ namespace Artemis.Profiles.Layers.Conditions
|
||||
|
||||
if (conditionsMet)
|
||||
layerModel.EventProperties.TriggerEvent(layerModel);
|
||||
if (layerModel.EventProperties.MustStop(layerModel))
|
||||
HotKeyMet = false;
|
||||
|
||||
return layerModel.EventProperties.MustDraw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static bool SimpleConditionsMet(LayerModel layerModel, ModuleDataModel dataModel, IEnumerable<LayerConditionModel> checkConditions)
|
||||
{
|
||||
switch (layerModel.Properties.ConditionType)
|
||||
{
|
||||
case ConditionType.AnyMet:
|
||||
return checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
case ConditionType.AllMet:
|
||||
return checkConditions.All(cm => cm.ConditionMet(dataModel));
|
||||
case ConditionType.NoneMet:
|
||||
return !checkConditions.Any(cm => cm.ConditionMet(dataModel));
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ namespace Artemis.Profiles.Layers.Models
|
||||
#region Layer type properties
|
||||
|
||||
public ILayerType LayerType { get; set; }
|
||||
public LayerCondition LayerCondition { get; set; }
|
||||
public ILayerCondition LayerCondition { get; set; }
|
||||
public ILayerAnimation LayerAnimation { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -1,297 +1,297 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using Artemis.DeviceProviders;
|
||||
using Artemis.Events;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Models;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Artemis.Profiles.Layers.Interfaces;
|
||||
using Artemis.Profiles.Layers.Models;
|
||||
using Artemis.Utilities.ParentChild;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Artemis.Profiles
|
||||
{
|
||||
public class ProfileModel
|
||||
{
|
||||
private readonly char[] _invalidFileNameChars;
|
||||
private List<KeybindModel> _profileBinds;
|
||||
|
||||
public ProfileModel()
|
||||
{
|
||||
_invalidFileNameChars = Path.GetInvalidFileNameChars();
|
||||
_profileBinds = new List<KeybindModel>();
|
||||
|
||||
Layers = new ChildItemCollection<ProfileModel, LayerModel>(this);
|
||||
OnProfileUpdatedEvent += OnOnProfileUpdatedEvent;
|
||||
}
|
||||
|
||||
public ChildItemCollection<ProfileModel, LayerModel> Layers { get; }
|
||||
public string Name { get; set; }
|
||||
public bool IsDefault { get; set; }
|
||||
public string KeyboardSlug { get; set; }
|
||||
public string GameName { get; set; }
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
public string LuaScript { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string Slug => new string(Name.Where(ch => !_invalidFileNameChars.Contains(ch)).ToArray());
|
||||
|
||||
private void OnOnProfileUpdatedEvent(object sender, EventArgs e)
|
||||
{
|
||||
ClearKeybinds();
|
||||
ApplyKeybinds();
|
||||
}
|
||||
|
||||
public event EventHandler<ProfileDeviceEventsArg> OnDeviceUpdatedEvent;
|
||||
public event EventHandler<ProfileDeviceEventsArg> OnDeviceDrawnEvent;
|
||||
public event EventHandler<EventArgs> OnProfileUpdatedEvent;
|
||||
|
||||
public void FixOrder()
|
||||
{
|
||||
Layers.Sort(l => l.Order);
|
||||
for (var i = 0; i < Layers.Count; i++)
|
||||
Layers[i].Order = i;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gives all the layers and their children in a flat list
|
||||
/// </summary>
|
||||
public List<LayerModel> GetLayers()
|
||||
{
|
||||
var layers = new List<LayerModel>();
|
||||
foreach (var layerModel in Layers.OrderBy(l => l.Order))
|
||||
{
|
||||
layers.Add(layerModel);
|
||||
layers.AddRange(layerModel.GetLayers());
|
||||
}
|
||||
|
||||
return layers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a flat list containing all layers that must be rendered on the keyboard,
|
||||
/// the first mouse layer to be rendered and the first headset layer to be rendered
|
||||
/// </summary>
|
||||
/// <param name="dataModel">Instance of said game data model</param>
|
||||
/// <param name="keyboardOnly">Whether or not to ignore anything but keyboards</param>
|
||||
/// <param name="ignoreConditions"></param>
|
||||
/// <returns>A flat list containing all layers that must be rendered</returns>
|
||||
public List<LayerModel> GetRenderLayers(ModuleDataModel dataModel, bool keyboardOnly,
|
||||
bool ignoreConditions = false)
|
||||
{
|
||||
var layers = new List<LayerModel>();
|
||||
foreach (var layerModel in Layers.OrderByDescending(l => l.Order))
|
||||
{
|
||||
if (!layerModel.Enabled || keyboardOnly && layerModel.LayerType.DrawType != DrawType.Keyboard)
|
||||
continue;
|
||||
|
||||
if (!ignoreConditions)
|
||||
if (!layerModel.ConditionsMet(dataModel))
|
||||
continue;
|
||||
|
||||
layers.Add(layerModel);
|
||||
layers.AddRange(layerModel.GetRenderLayers(dataModel, keyboardOnly, ignoreConditions));
|
||||
}
|
||||
|
||||
return layers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draw all the given layers on the given rect
|
||||
/// </summary>
|
||||
/// <param name="deviceVisualModel"></param>
|
||||
/// <param name="renderLayers">The layers to render</param>
|
||||
/// <param name="dataModel">The data model to base the layer's properties on</param>
|
||||
/// <param name="preview">Indicates wheter the layer is drawn as a preview, ignoring dynamic properties</param>
|
||||
internal void DrawLayers(DeviceVisualModel deviceVisualModel, List<LayerModel> renderLayers,
|
||||
ModuleDataModel dataModel, bool preview)
|
||||
{
|
||||
renderLayers = renderLayers.Where(rl => rl.LayerType.DrawType == deviceVisualModel.DrawType).ToList();
|
||||
if (!renderLayers.Any())
|
||||
return;
|
||||
|
||||
// Setup the DrawingVisual's size
|
||||
var c = deviceVisualModel.GetDrawingContext();
|
||||
|
||||
c.PushClip(new RectangleGeometry(deviceVisualModel.Rect));
|
||||
c.DrawRectangle(new SolidColorBrush(Color.FromArgb(0, 0, 0, 0)), null, deviceVisualModel.Rect);
|
||||
|
||||
// Update the layers
|
||||
foreach (var layerModel in renderLayers)
|
||||
layerModel.Update(dataModel, preview, true);
|
||||
RaiseDeviceUpdatedEvent(new ProfileDeviceEventsArg(deviceVisualModel.DrawType, dataModel, preview, null));
|
||||
|
||||
// Draw the layers
|
||||
foreach (var layerModel in renderLayers)
|
||||
layerModel.Draw(dataModel, c, preview, true);
|
||||
RaiseDeviceDrawnEvent(new ProfileDeviceEventsArg(deviceVisualModel.DrawType, dataModel, preview, c));
|
||||
|
||||
// Remove the clip
|
||||
c.Pop();
|
||||
}
|
||||
|
||||
private void RaiseDeviceUpdatedEvent(ProfileDeviceEventsArg e)
|
||||
{
|
||||
OnDeviceUpdatedEvent?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public void RaiseDeviceDrawnEvent(ProfileDeviceEventsArg e)
|
||||
{
|
||||
OnDeviceDrawnEvent?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public virtual void OnOnProfileUpdatedEvent()
|
||||
{
|
||||
OnProfileUpdatedEvent?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks at all the layers wthin the profile and makes sure they are within boundaries of the given rectangle
|
||||
/// </summary>
|
||||
/// <param name="keyboardRectangle"></param>
|
||||
public void FixBoundaries(Rect keyboardRectangle)
|
||||
{
|
||||
foreach (var layer in GetLayers())
|
||||
{
|
||||
if (!layer.LayerType.ShowInEdtor)
|
||||
continue;
|
||||
|
||||
var props = layer.Properties;
|
||||
var layerRect = new Rect(new Point(props.X, props.Y), new Size(props.Width, props.Height));
|
||||
if (keyboardRectangle.Contains(layerRect))
|
||||
continue;
|
||||
|
||||
props.X = 0;
|
||||
props.Y = 0;
|
||||
layer.Properties = props;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resizes layers that are shown in the editor and match exactly the full keyboard widht and height
|
||||
/// </summary>
|
||||
/// <param name="target">The new keyboard to adjust the layers for</param>
|
||||
public void ResizeLayers(KeyboardProvider target)
|
||||
{
|
||||
foreach (var layer in GetLayers())
|
||||
{
|
||||
if (!layer.LayerType.ShowInEdtor ||
|
||||
!(Math.Abs(layer.Properties.Width - Width) < 0.01) ||
|
||||
!(Math.Abs(layer.Properties.Height - Height) < 0.01))
|
||||
continue;
|
||||
|
||||
layer.Properties.Width = target.Width;
|
||||
layer.Properties.Height = target.Height;
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate(LuaManager luaManager)
|
||||
{
|
||||
ApplyKeybinds();
|
||||
luaManager.SetupLua(this);
|
||||
}
|
||||
|
||||
public void Deactivate(LuaManager luaManager)
|
||||
{
|
||||
ClearKeybinds();
|
||||
luaManager.ClearLua();
|
||||
}
|
||||
|
||||
public LayerModel AddLayer(LayerModel afterLayer)
|
||||
{
|
||||
// Create a new layer
|
||||
var layer = LayerModel.CreateLayer();
|
||||
|
||||
if (afterLayer != null)
|
||||
{
|
||||
afterLayer.InsertAfter(layer);
|
||||
}
|
||||
else
|
||||
{
|
||||
Layers.Add(layer);
|
||||
FixOrder();
|
||||
}
|
||||
|
||||
return layer;
|
||||
}
|
||||
|
||||
public void ApplyKeybinds()
|
||||
{
|
||||
_profileBinds.Clear();
|
||||
foreach (var layerModel in GetLayers())
|
||||
{
|
||||
for (var index = 0; index < layerModel.Properties.Conditions.Count; index++)
|
||||
{
|
||||
var condition = layerModel.Properties.Conditions[index];
|
||||
if (condition.Field == null || !condition.Field.Contains("hotkey"))
|
||||
continue;
|
||||
|
||||
// Create an action for the layer, the layer's specific condition type handles activation
|
||||
if (condition.Operator == "held")
|
||||
{
|
||||
var downAction = new Action(() => layerModel.LayerCondition.KeyDownTask(condition));
|
||||
var downKb = new KeybindModel($"{GameName}-{Name}-{layerModel.Name}-down-{index}", condition.HotKey, KeyType.KeyDown, downAction);
|
||||
var upAction = new Action(() => layerModel.LayerCondition.KeyUpTask(condition));
|
||||
var upKb = new KeybindModel($"{GameName}-{Name}-{layerModel.Name}-up-{index}", condition.HotKey, KeyType.KeyUp, upAction);
|
||||
|
||||
KeybindManager.AddOrUpdate(downKb);
|
||||
KeybindManager.AddOrUpdate(upKb);
|
||||
_profileBinds.Add(downKb);
|
||||
_profileBinds.Add(upKb);
|
||||
}
|
||||
else
|
||||
{
|
||||
var action = new Action(() => layerModel.LayerCondition.KeyDownTask(condition));
|
||||
var kb = new KeybindModel($"{GameName}-{Name}-{layerModel.Name}-{index}", condition.HotKey, KeyType.KeyDown, action);
|
||||
|
||||
KeybindManager.AddOrUpdate(kb);
|
||||
_profileBinds.Add(kb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearKeybinds()
|
||||
{
|
||||
foreach (var keybindModel in _profileBinds)
|
||||
KeybindManager.Remove(keybindModel);
|
||||
_profileBinds.Clear();
|
||||
}
|
||||
|
||||
#region Compare
|
||||
|
||||
protected bool Equals(ProfileModel other)
|
||||
{
|
||||
return string.Equals(Slug, other.Slug) &&
|
||||
string.Equals(KeyboardSlug, other.KeyboardSlug) &&
|
||||
string.Equals(GameName, other.GameName);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != GetType()) return false;
|
||||
return Equals((ProfileModel) obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
var hashCode = Slug?.GetHashCode() ?? 0;
|
||||
hashCode = (hashCode * 397) ^ (KeyboardSlug?.GetHashCode() ?? 0);
|
||||
hashCode = (hashCode * 397) ^ (GameName?.GetHashCode() ?? 0);
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using Artemis.DeviceProviders;
|
||||
using Artemis.Events;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Models;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Artemis.Profiles.Layers.Interfaces;
|
||||
using Artemis.Profiles.Layers.Models;
|
||||
using Artemis.Utilities.ParentChild;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Artemis.Profiles
|
||||
{
|
||||
public class ProfileModel
|
||||
{
|
||||
private readonly char[] _invalidFileNameChars;
|
||||
private List<KeybindModel> _profileBinds;
|
||||
|
||||
public ProfileModel()
|
||||
{
|
||||
_invalidFileNameChars = Path.GetInvalidFileNameChars();
|
||||
_profileBinds = new List<KeybindModel>();
|
||||
|
||||
Layers = new ChildItemCollection<ProfileModel, LayerModel>(this);
|
||||
OnProfileUpdatedEvent += OnOnProfileUpdatedEvent;
|
||||
}
|
||||
|
||||
public ChildItemCollection<ProfileModel, LayerModel> Layers { get; }
|
||||
public string Name { get; set; }
|
||||
public bool IsDefault { get; set; }
|
||||
public string KeyboardSlug { get; set; }
|
||||
public string GameName { get; set; }
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
public string LuaScript { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string Slug => new string(Name.Where(ch => !_invalidFileNameChars.Contains(ch)).ToArray());
|
||||
|
||||
private void OnOnProfileUpdatedEvent(object sender, EventArgs e)
|
||||
{
|
||||
ClearKeybinds();
|
||||
ApplyKeybinds();
|
||||
}
|
||||
|
||||
public event EventHandler<ProfileDeviceEventsArg> OnDeviceUpdatedEvent;
|
||||
public event EventHandler<ProfileDeviceEventsArg> OnDeviceDrawnEvent;
|
||||
public event EventHandler<EventArgs> OnProfileUpdatedEvent;
|
||||
|
||||
public void FixOrder()
|
||||
{
|
||||
Layers.Sort(l => l.Order);
|
||||
for (var i = 0; i < Layers.Count; i++)
|
||||
Layers[i].Order = i;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gives all the layers and their children in a flat list
|
||||
/// </summary>
|
||||
public List<LayerModel> GetLayers()
|
||||
{
|
||||
var layers = new List<LayerModel>();
|
||||
foreach (var layerModel in Layers.OrderBy(l => l.Order))
|
||||
{
|
||||
layers.Add(layerModel);
|
||||
layers.AddRange(layerModel.GetLayers());
|
||||
}
|
||||
|
||||
return layers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a flat list containing all layers that must be rendered on the keyboard,
|
||||
/// the first mouse layer to be rendered and the first headset layer to be rendered
|
||||
/// </summary>
|
||||
/// <param name="dataModel">Instance of said game data model</param>
|
||||
/// <param name="keyboardOnly">Whether or not to ignore anything but keyboards</param>
|
||||
/// <param name="ignoreConditions"></param>
|
||||
/// <returns>A flat list containing all layers that must be rendered</returns>
|
||||
public List<LayerModel> GetRenderLayers(ModuleDataModel dataModel, bool keyboardOnly,
|
||||
bool ignoreConditions = false)
|
||||
{
|
||||
var layers = new List<LayerModel>();
|
||||
foreach (var layerModel in Layers.OrderByDescending(l => l.Order))
|
||||
{
|
||||
if (!layerModel.Enabled || keyboardOnly && layerModel.LayerType.DrawType != DrawType.Keyboard)
|
||||
continue;
|
||||
|
||||
if (!ignoreConditions)
|
||||
if (!layerModel.ConditionsMet(dataModel))
|
||||
continue;
|
||||
|
||||
layers.Add(layerModel);
|
||||
layers.AddRange(layerModel.GetRenderLayers(dataModel, keyboardOnly, ignoreConditions));
|
||||
}
|
||||
|
||||
return layers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draw all the given layers on the given rect
|
||||
/// </summary>
|
||||
/// <param name="deviceVisualModel"></param>
|
||||
/// <param name="renderLayers">The layers to render</param>
|
||||
/// <param name="dataModel">The data model to base the layer's properties on</param>
|
||||
/// <param name="preview">Indicates wheter the layer is drawn as a preview, ignoring dynamic properties</param>
|
||||
internal void DrawLayers(DeviceVisualModel deviceVisualModel, List<LayerModel> renderLayers,
|
||||
ModuleDataModel dataModel, bool preview)
|
||||
{
|
||||
renderLayers = renderLayers.Where(rl => rl.LayerType.DrawType == deviceVisualModel.DrawType).ToList();
|
||||
if (!renderLayers.Any())
|
||||
return;
|
||||
|
||||
// Setup the DrawingVisual's size
|
||||
var c = deviceVisualModel.GetDrawingContext();
|
||||
|
||||
c.PushClip(new RectangleGeometry(deviceVisualModel.Rect));
|
||||
c.DrawRectangle(new SolidColorBrush(Color.FromArgb(0, 0, 0, 0)), null, deviceVisualModel.Rect);
|
||||
|
||||
// Update the layers
|
||||
foreach (var layerModel in renderLayers)
|
||||
layerModel.Update(dataModel, preview, true);
|
||||
RaiseDeviceUpdatedEvent(new ProfileDeviceEventsArg(deviceVisualModel.DrawType, dataModel, preview, null));
|
||||
|
||||
// Draw the layers
|
||||
foreach (var layerModel in renderLayers)
|
||||
layerModel.Draw(dataModel, c, preview, true);
|
||||
RaiseDeviceDrawnEvent(new ProfileDeviceEventsArg(deviceVisualModel.DrawType, dataModel, preview, c));
|
||||
|
||||
// Remove the clip
|
||||
c.Pop();
|
||||
}
|
||||
|
||||
private void RaiseDeviceUpdatedEvent(ProfileDeviceEventsArg e)
|
||||
{
|
||||
OnDeviceUpdatedEvent?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public void RaiseDeviceDrawnEvent(ProfileDeviceEventsArg e)
|
||||
{
|
||||
OnDeviceDrawnEvent?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public virtual void OnOnProfileUpdatedEvent()
|
||||
{
|
||||
OnProfileUpdatedEvent?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks at all the layers wthin the profile and makes sure they are within boundaries of the given rectangle
|
||||
/// </summary>
|
||||
/// <param name="keyboardRectangle"></param>
|
||||
public void FixBoundaries(Rect keyboardRectangle)
|
||||
{
|
||||
foreach (var layer in GetLayers())
|
||||
{
|
||||
if (!layer.LayerType.ShowInEdtor)
|
||||
continue;
|
||||
|
||||
var props = layer.Properties;
|
||||
var layerRect = new Rect(new Point(props.X, props.Y), new Size(props.Width, props.Height));
|
||||
if (keyboardRectangle.Contains(layerRect))
|
||||
continue;
|
||||
|
||||
props.X = 0;
|
||||
props.Y = 0;
|
||||
layer.Properties = props;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resizes layers that are shown in the editor and match exactly the full keyboard widht and height
|
||||
/// </summary>
|
||||
/// <param name="target">The new keyboard to adjust the layers for</param>
|
||||
public void ResizeLayers(KeyboardProvider target)
|
||||
{
|
||||
foreach (var layer in GetLayers())
|
||||
{
|
||||
if (!layer.LayerType.ShowInEdtor ||
|
||||
!(Math.Abs(layer.Properties.Width - Width) < 0.01) ||
|
||||
!(Math.Abs(layer.Properties.Height - Height) < 0.01))
|
||||
continue;
|
||||
|
||||
layer.Properties.Width = target.Width;
|
||||
layer.Properties.Height = target.Height;
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate(LuaManager luaManager)
|
||||
{
|
||||
ApplyKeybinds();
|
||||
luaManager.SetupLua(this);
|
||||
}
|
||||
|
||||
public void Deactivate(LuaManager luaManager)
|
||||
{
|
||||
ClearKeybinds();
|
||||
luaManager.ClearLua();
|
||||
}
|
||||
|
||||
public LayerModel AddLayer(LayerModel afterLayer)
|
||||
{
|
||||
// Create a new layer
|
||||
var layer = LayerModel.CreateLayer();
|
||||
|
||||
if (afterLayer != null)
|
||||
{
|
||||
afterLayer.InsertAfter(layer);
|
||||
}
|
||||
else
|
||||
{
|
||||
Layers.Add(layer);
|
||||
FixOrder();
|
||||
}
|
||||
|
||||
return layer;
|
||||
}
|
||||
|
||||
public void ApplyKeybinds()
|
||||
{
|
||||
// _profileBinds.Clear();
|
||||
// foreach (var layerModel in GetLayers())
|
||||
// {
|
||||
// for (var index = 0; index < layerModel.Properties.Conditions.Count; index++)
|
||||
// {
|
||||
// var condition = layerModel.Properties.Conditions[index];
|
||||
// if (condition.Field == null || !condition.Field.Contains("hotkey"))
|
||||
// continue;
|
||||
//
|
||||
// // Create an action for the layer, the layer's specific condition type handles activation
|
||||
// if (condition.Operator == "held")
|
||||
// {
|
||||
// var downAction = new Action(() => layerModel.LayerCondition.KeyDownTask(condition));
|
||||
// var downKb = new KeybindModel($"{GameName}-{Name}-{layerModel.Name}-down-{index}", condition.HotKey, KeyType.KeyDown, downAction);
|
||||
// var upAction = new Action(() => layerModel.LayerCondition.KeyUpTask(condition));
|
||||
// var upKb = new KeybindModel($"{GameName}-{Name}-{layerModel.Name}-up-{index}", condition.HotKey, KeyType.KeyUp, upAction);
|
||||
//
|
||||
// KeybindManager.AddOrUpdate(downKb);
|
||||
// KeybindManager.AddOrUpdate(upKb);
|
||||
// _profileBinds.Add(downKb);
|
||||
// _profileBinds.Add(upKb);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var action = new Action(() => layerModel.LayerCondition.KeyDownTask(condition));
|
||||
// var kb = new KeybindModel($"{GameName}-{Name}-{layerModel.Name}-{index}", condition.HotKey, KeyType.KeyDown, action);
|
||||
//
|
||||
// KeybindManager.AddOrUpdate(kb);
|
||||
// _profileBinds.Add(kb);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
public void ClearKeybinds()
|
||||
{
|
||||
// foreach (var keybindModel in _profileBinds)
|
||||
// KeybindManager.Remove(keybindModel);
|
||||
// _profileBinds.Clear();
|
||||
}
|
||||
|
||||
#region Compare
|
||||
|
||||
protected bool Equals(ProfileModel other)
|
||||
{
|
||||
return string.Equals(Slug, other.Slug) &&
|
||||
string.Equals(KeyboardSlug, other.KeyboardSlug) &&
|
||||
string.Equals(GameName, other.GameName);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != GetType()) return false;
|
||||
return Equals((ProfileModel) obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
var hashCode = Slug?.GetHashCode() ?? 0;
|
||||
hashCode = (hashCode * 397) ^ (KeyboardSlug?.GetHashCode() ?? 0);
|
||||
hashCode = (hashCode * 397) ^ (GameName?.GetHashCode() ?? 0);
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,7 +147,11 @@ namespace Artemis.ViewModels
|
||||
|
||||
private void ActivateViews()
|
||||
{
|
||||
var vms = _kernel.GetAll<BaseViewModel>().ToList();
|
||||
var vms = _kernel.GetAll<BaseViewModel>()
|
||||
.OrderBy(v => v.DisplayName != "Welcome")
|
||||
.ThenBy(v => v.DisplayName)
|
||||
.ToList();
|
||||
|
||||
Items.Clear();
|
||||
Items.AddRange(vms);
|
||||
ActivateItem(vms.FirstOrDefault());
|
||||
|
||||
@ -3,10 +3,9 @@
|
||||
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:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<TabControl Margin="0,10" x:Name="Items" controls:TabControlHelper.IsUnderlined="True">
|
||||
<TabControl x:Name="Items" TabStripPlacement="Left">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
|
||||
<TabControl Margin="0,10" x:Name="Items" controls:TabControlHelper.IsUnderlined="True">
|
||||
<TabControl x:Name="Items" TabStripPlacement="Left">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
@ -3,11 +3,9 @@
|
||||
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:Artemis.Views"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<TabControl Margin="0,10" x:Name="Items" controls:TabControlHelper.IsUnderlined="True">
|
||||
<TabControl x:Name="Items" TabStripPlacement="Left">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
@ -1,64 +1,41 @@
|
||||
<UserControl x:Class="Artemis.Views.ProfileEditorView"
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:itemBehaviours="clr-namespace:Artemis.ItemBehaviours"
|
||||
xmlns:dragDrop="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
|
||||
xmlns:converters="clr-namespace:Artemis.Utilities.Converters"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="510" Width="1055">
|
||||
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:cal="http://www.caliburnproject.org"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:itemBehaviours="clr-namespace:Artemis.ItemBehaviours"
|
||||
xmlns:dragDrop="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
|
||||
xmlns:converters="clr-namespace:Artemis.Utilities.Converters"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="400" d:DesignWidth="1060">
|
||||
<UserControl.Resources>
|
||||
<converters:LayerOrderConverter x:Key="LayerOrderConverter" />
|
||||
<Storyboard x:Key="Pulse" RepeatBehavior="Forever">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="BlurRadius" Storyboard.TargetName="ShadowEffect">
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0" Value="25" />
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="10" />
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="25" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</UserControl.Resources>
|
||||
<UserControl.Triggers>
|
||||
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
|
||||
<BeginStoryboard Storyboard="{StaticResource Pulse}" />
|
||||
</EventTrigger>
|
||||
</UserControl.Triggers>
|
||||
<Grid Width="Auto" Height="Auto">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="245" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="60" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Preview Background="#FF232323" -->
|
||||
<!-- Preview -->
|
||||
<Label Grid.Column="0" Grid.Row="0" FontSize="20" HorizontalAlignment="Left" Content="Preview" />
|
||||
<Border Grid.Column="0" Grid.Row="1" Background="#FF232323" BorderBrush="{DynamicResource HighlightBrush}"
|
||||
BorderThickness="3" Width="800" Height="400">
|
||||
<Border>
|
||||
<Border Grid.Column="0" Grid.Row="1" Background="#FF232323" BorderBrush="{DynamicResource HighlightBrush}" BorderThickness="3">
|
||||
<Border Padding="50">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect x:Name="ShadowEffect" ShadowDepth="0" Color="{DynamicResource HighlightColor}"
|
||||
Opacity="1" />
|
||||
<DropShadowEffect x:Name="ShadowEffect" ShadowDepth="0" Color="{DynamicResource HighlightColor}" Opacity="1" BlurRadius="25" />
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=KeyboardImage}"
|
||||
Margin="50" />
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=KeyboardPreview}"
|
||||
Opacity="0.8"
|
||||
Width="{Binding Path=PreviewSettings.Width}"
|
||||
Height="{Binding Path=PreviewSettings.Height}"
|
||||
Margin="{Binding Path=PreviewSettings.Margin}"
|
||||
Stretch="Fill" Cursor="{Binding Path=KeyboardPreviewCursor}"
|
||||
cal:Message.Attach="[Event MouseMove] = [Action MouseMoveKeyboardPreview($eventArgs)];
|
||||
[Event MouseDown] = [Action MouseDownKeyboardPreview($eventArgs)];
|
||||
[Event MouseUp] = [Action MouseUpKeyboardPreview($eventArgs)]"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}" />
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=KeyboardImage}" MinHeight="10" MinWidth="10" Stretch="Uniform" />
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=KeyboardPreview}" Opacity="0.8" Stretch="Uniform" Cursor="{Binding Path=KeyboardPreviewCursor}" IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event MouseMove] = [Action MouseMoveKeyboardPreview($eventArgs)]; [Event MouseDown] = [Action MouseDownKeyboardPreview($eventArgs)]; [Event MouseUp] = [Action MouseUpKeyboardPreview($eventArgs)]" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Border>
|
||||
@ -68,11 +45,9 @@
|
||||
<Label Content="Active profile" />
|
||||
<ComboBox Width="220" VerticalAlignment="Top" x:Name="ProfileNames" Margin="5,0,0,0" />
|
||||
<Button x:Name="AddProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Add profile">
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Add profile">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_add}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -80,39 +55,29 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="RenameProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Rename profile"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}">
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Rename profile"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_edit}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
</Rectangle>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="DuplicateProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0"
|
||||
ToolTip="Duplicate profile"
|
||||
IsEnabled="{Binding Path=ProfileSelected, Mode=OneWay}">
|
||||
<Button x:Name="DuplicateProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}" Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0"
|
||||
ToolTip="Duplicate profile" IsEnabled="{Binding Path=ProfileSelected, Mode=OneWay}">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_clipboard_paste}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
</Rectangle>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="DeleteProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Delete profile"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}">
|
||||
<Button x:Name="DeleteProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}" Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Delete profile" IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_delete}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -120,13 +85,12 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock VerticalAlignment="Top" Foreground="{DynamicResource HighlightBrush}" HorizontalAlignment="Left"
|
||||
Margin="5,5,0,0" Text="Note: To edit a default profile, duplicate it first." FontWeight="Bold" />
|
||||
<TextBlock VerticalAlignment="Top" Foreground="{DynamicResource HighlightBrush}" HorizontalAlignment="Left" Margin="5,5,0,0" Text="Note: To edit a default profile, duplicate it first." FontWeight="Bold" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="2" Orientation="Horizontal" Margin="0,5,0,0" HorizontalAlignment="Right">
|
||||
<Button x:Name="ImportProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Height="26" HorizontalAlignment="Right">
|
||||
Height="26" HorizontalAlignment="Right">
|
||||
<Button.Content>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Rectangle
|
||||
@ -141,7 +105,7 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="ExportProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" IsEnabled="{Binding ProfileSelected}">
|
||||
Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" IsEnabled="{Binding ProfileSelected}">
|
||||
<Button.Content>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Rectangle
|
||||
@ -156,8 +120,8 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="EditLua" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}" Height="26"
|
||||
HorizontalAlignment="Right" Margin="10,0,0,0" IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}"
|
||||
Visibility="{Binding Path=LuaButtonVisible, Converter={StaticResource BoolToVis} }">
|
||||
HorizontalAlignment="Right" Margin="10,0,0,0" IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}"
|
||||
Visibility="{Binding Path=LuaButtonVisible, Converter={StaticResource BoolToVis} }">
|
||||
<Button.Content>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Rectangle
|
||||
@ -174,40 +138,34 @@
|
||||
</StackPanel>
|
||||
|
||||
<!-- Layer list -->
|
||||
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal">
|
||||
<Label FontSize="20" HorizontalAlignment="Left" Content="Layers" Margin="10,0,0,0" />
|
||||
<Label HorizontalAlignment="Right" ToolTip="Show all layers instead of just the one you have selected"
|
||||
Content="Show all" Margin="88,0,0,0" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="ShowAll" ToolTip="Show all layers instead of just the one you have selected"
|
||||
Margin="0 3 0 0" Width="25" Height="25"
|
||||
IsChecked="{Binding Path=ShowAll, Mode=TwoWay}"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}" HorizontalAlignment="Right" />
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="1" Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" FontSize="20" HorizontalAlignment="Left" Content="Layers" Margin="10,0,0,0" VerticalAlignment="Center" />
|
||||
<Label Grid.Column="1" Content="Show all layers" HorizontalAlignment="Right" VerticalAlignment="Center" />
|
||||
<controls:ToggleSwitchButton Grid.Column="2" IsChecked="{Binding Path=ShowAll, Mode=TwoWay}" HorizontalAlignment="Right"
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Show all layers instead of just the one you have selected" VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
|
||||
<Border Grid.Column="1" Grid.Row="1" Background="#FF232323" BorderBrush="{DynamicResource HighlightBrush}"
|
||||
BorderThickness="3" Margin="10,0,0,0" Height="400" Width="233">
|
||||
<TreeView x:Name="ProfileTree"
|
||||
dragDrop:DragDrop.IsDragSource="True"
|
||||
dragDrop:DragDrop.IsDropTarget="True"
|
||||
dragDrop:DragDrop.DropHandler="{Binding}"
|
||||
ItemsSource="{Binding Path=Layers, Converter={StaticResource LayerOrderConverter}, ConverterParameter=Order}"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event MouseDoubleClick] = [Action EditLayerFromDoubleClick]">
|
||||
<Border Grid.Column="1" Grid.Row="1" Background="#FF232323" BorderBrush="{DynamicResource HighlightBrush}" BorderThickness="3" Margin="5,0,-5,0" Width="235">
|
||||
<TreeView x:Name="ProfileTree" dragDrop:DragDrop.IsDragSource="True" dragDrop:DragDrop.IsDropTarget="True" dragDrop:DragDrop.DropHandler="{Binding}"
|
||||
ItemsSource="{Binding Path=Layers, Converter={StaticResource LayerOrderConverter}, ConverterParameter=Order}" IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}"
|
||||
cal:Message.Attach="[Event MouseDoubleClick] = [Action EditLayerFromDoubleClick]">
|
||||
<i:Interaction.Behaviors>
|
||||
<itemBehaviours:BindableSelectedItemBehavior
|
||||
SelectedItem="{Binding SelectedLayer, Mode=TwoWay}" />
|
||||
</i:Interaction.Behaviors>
|
||||
<TreeView.Resources>
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
|
||||
</TreeView.Resources>
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate
|
||||
ItemsSource="{Binding Children, Converter={StaticResource LayerOrderConverter}, ConverterParameter=Order}">
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding Children, Converter={StaticResource LayerOrderConverter}, ConverterParameter=Order}">
|
||||
<StackPanel Orientation="Horizontal" Tag="{Binding DataContext, ElementName=ProfileTree}">
|
||||
<StackPanel.ContextMenu>
|
||||
<ContextMenu
|
||||
cal:Action.TargetWithoutContext="{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Self}}">
|
||||
<ContextMenu cal:Action.TargetWithoutContext="{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Rename" cal:Message.Attach="RenameLayer($datacontext)" />
|
||||
<MenuItem Header="Duplicate" cal:Message.Attach="CloneLayer($datacontext)" />
|
||||
<MenuItem Header="Delete" cal:Message.Attach="RemoveLayer($datacontext)" />
|
||||
@ -227,14 +185,12 @@
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
</Border>
|
||||
<StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal" Margin="10,5,0,0" HorizontalAlignment="Right">
|
||||
<StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal" Margin="0,5,0,0" HorizontalAlignment="Right">
|
||||
<Button x:Name="AddLayer" VerticalAlignment="Top"
|
||||
Style="{DynamicResource SquareButtonStyle}" IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}"
|
||||
Width="26" Height="26" ToolTip="Add layer" HorizontalAlignment="Left">
|
||||
Style="{DynamicResource SquareButtonStyle}" IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}"
|
||||
Width="26" Height="26" ToolTip="Add layer" HorizontalAlignment="Left">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_add}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -242,12 +198,10 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="AddFolder" VerticalAlignment="Top"
|
||||
Style="{DynamicResource SquareButtonStyle}" IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}"
|
||||
Width="26" Height="26" ToolTip="Add folder" HorizontalAlignment="Left" Margin="10,0,0,0">
|
||||
Style="{DynamicResource SquareButtonStyle}" IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}"
|
||||
Width="26" Height="26" ToolTip="Add folder" HorizontalAlignment="Left" Margin="10,0,0,0">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_folder}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -255,12 +209,10 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="EditLayer" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Edit layer"
|
||||
IsEnabled="{Binding Path=LayerSelected}">
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Edit layer"
|
||||
IsEnabled="{Binding Path=LayerSelected}">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_edit}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -268,12 +220,10 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="CloneLayer" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Duplicate layer"
|
||||
IsEnabled="{Binding Path=LayerSelected}">
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Duplicate layer"
|
||||
IsEnabled="{Binding Path=LayerSelected}">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_clipboard_paste}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -281,12 +231,10 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="RemoveLayer" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Delete layer"
|
||||
IsEnabled="{Binding Path=LayerSelected}">
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Delete layer"
|
||||
IsEnabled="{Binding Path=LayerSelected}">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_delete}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
|
||||
@ -12,4 +12,4 @@ namespace Artemis.Views
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,26 +1,23 @@
|
||||
<Controls:MetroWindow x:Class="Artemis.Views.ShellView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:dialogs="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
|
||||
xmlns:viewModels="clr-namespace:Artemis.ViewModels"
|
||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||
dialogs:DialogParticipation.Register="{Binding RelativeSource={RelativeSource Self}, Path=DataContext}"
|
||||
mc:Ignorable="d"
|
||||
Title="Artemis" Height="800" Width="1210"
|
||||
MinHeight="800" MinWidth="1210"
|
||||
GlowBrush="{DynamicResource AccentColorBrush}" Icon="../logo.ico"
|
||||
d:DataContext="{d:DesignInstance viewModels:ShellViewModel}">
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
xmlns:dialogs="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
|
||||
xmlns:viewModels="clr-namespace:Artemis.ViewModels"
|
||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||
dialogs:DialogParticipation.Register="{Binding RelativeSource={RelativeSource Self}, Path=DataContext}"
|
||||
mc:Ignorable="d" d:DataContext="{d:DesignInstance viewModels:ShellViewModel}"
|
||||
Title="Artemis" Height="800" Width="1210" MinHeight="600" MinWidth="600" GlowBrush="{DynamicResource AccentColorBrush}" Icon="../logo.ico">
|
||||
<!-- Bit of extra code to use a different icon than in the taskbar -->
|
||||
<Controls:MetroWindow.Resources>
|
||||
<DrawingImage x:Key="BowIcon">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<GeometryDrawing Brush="{DynamicResource IdealForegroundColorBrush}"
|
||||
Geometry="M1518 3378 c-48 -63 -61 -101 -66 -184 -4 -70 -1 -91 27
|
||||
Geometry="M1518 3378 c-48 -63 -61 -101 -66 -184 -4 -70 -1 -91 27
|
||||
-170 l31 -89 -27 -20 c-32 -24 -849 -601 -981 -693 l-93 -64 -87 40
|
||||
c-48 22 -91 37 -95 32 -5 -4 9 -41 29 -83 l37 -75 -28 -24 c-23 -20
|
||||
-29 -35 -33 -81 l-4 -56 -82 -19 c-109 -25 -109 -41 4 -91 l85 -38 7
|
||||
@ -48,7 +45,7 @@
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
|
||||
|
||||
<!-- Tray icon -->
|
||||
<ContextMenu x:Shared="false" x:Key="MainSysTrayMenu">
|
||||
<MenuItem Header="Show Artemis" cal:Message.Attach="ShowWindow" />
|
||||
@ -60,17 +57,17 @@
|
||||
|
||||
<!-- the application main system tray icon -->
|
||||
<tb:TaskbarIcon x:Key="SystemTrayIcon"
|
||||
IconSource="{Binding Path=ActiveIcon, Mode=OneWay}"
|
||||
ToolTipText="Artemis"
|
||||
cal:Message.Attach="[Event TrayMouseDoubleClick] = [Action ShowWindow]"
|
||||
ContextMenu="{StaticResource MainSysTrayMenu}" />
|
||||
IconSource="{Binding Path=ActiveIcon, Mode=OneWay}"
|
||||
ToolTipText="Artemis"
|
||||
cal:Message.Attach="[Event TrayMouseDoubleClick] = [Action ShowWindow]"
|
||||
ContextMenu="{StaticResource MainSysTrayMenu}" />
|
||||
</Controls:MetroWindow.Resources>
|
||||
<Controls:MetroWindow.IconTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Background="Transparent"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Margin="0,0,-10,0">
|
||||
Height="{TemplateBinding Height}"
|
||||
Background="Transparent"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Margin="0,0,-10,0">
|
||||
<Image Source="{DynamicResource BowIcon}" Stretch="Uniform" Margin="6" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
@ -83,7 +80,7 @@
|
||||
<Button cal:Message.Attach="Settings">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Rectangle Width="10" Height="10"
|
||||
Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
|
||||
Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Stretch="Fill" Visual="{StaticResource appbar_settings}" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -116,11 +113,10 @@
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
|
||||
</Grid.Resources>
|
||||
<TabControl Margin="0,10,10,10" TabStripPlacement="Left" x:Name="Items"
|
||||
cal:Message.Attach="[Event GotFocus] = [Action CloseSettings]">
|
||||
<TabControl Margin="10" Controls:TabControlHelper.IsUnderlined="True" x:Name="Items" cal:Message.Attach="[Event GotFocus] = [Action CloseSettings]">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DisplayName}" />
|
||||
<TextBlock Text="{Binding DisplayName}" FontSize="22" />
|
||||
</DataTemplate>
|
||||
</TabControl.ItemTemplate>
|
||||
</TabControl>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
Hello, <LineBreak /><LineBreak />
|
||||
Thanks a bunch for downloading this application. You're going to enjoy this! :)<LineBreak />
|
||||
<LineBreak />
|
||||
To get started you can click any of the categories on the left and browse through the effects.
|
||||
To get started you can click any of the categories on the top and browse through the modules.
|
||||
<LineBreak />
|
||||
Some games require a bit of setting up, so be sure to take a look at everything you want to use.
|
||||
<LineBreak /><LineBreak />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user