1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Fixed that 'merge' >_<

This commit is contained in:
SpoinkyNL 2016-03-07 17:39:24 +01:00
parent 27660176a4
commit ef9af2cd83
55 changed files with 907 additions and 6776 deletions

View File

@ -3,8 +3,8 @@
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Settings.Offsets" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Modules.Games.Witcher3.Witcher3" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
@ -199,7 +199,7 @@
<value>TypeWave</value>
</setting>
<setting name="LastKeyboard" serializeAs="String">
<value>Logitech G910 RGB</value>
<value />
</setting>
<setting name="EnablePointersUpdate" serializeAs="String">
<value>True</value>
@ -208,11 +208,17 @@
<value>51364</value>
</setting>
<setting name="Autorun" serializeAs="String">
<value>True</value>
<value>False</value>
</setting>
<setting name="Suspended" serializeAs="String">
<value>False</value>
</setting>
<setting name="ShowOnStartup" serializeAs="String">
<value>True</value>
</setting>
<setting name="CheckForUpdates" serializeAs="String">
<value>True</value>
</setting>
</Artemis.Settings.General>
</userSettings>
<runtime>

View File

@ -1,14 +1,14 @@
<Application x:Class="Artemis.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Artemis"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:artemis="clr-namespace:Artemis"
DispatcherUnhandledException="Application_DispatcherUnhandledException"
ShutdownMode="OnExplicitShutdown">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<local:ArtemisBootstrapper x:Key="ArtemisBootstrapper" />
<artemis:ArtemisBootstrapper x:Key="ArtemisBootstrapper" />
</ResourceDictionary>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />

View File

@ -16,8 +16,8 @@ namespace Artemis.KeyboardProviders.Corsair
public CorsairRGB()
{
Name = "Corsair RGB Keyboards";
CantEnableText = "Couldn't connect to your Corsair keyboard.\n " +
"Please check your cables and/or drivers (could be outdated) and that Corsair Utility Engine is running.\n\n " +
CantEnableText = "Couldn't connect to your Corsair keyboard.\n" +
"Please check your cables and/or drivers (could be outdated) and that Corsair Utility Engine is running.\n\n" +
"If needed, you can select a different keyboard in Artemis under settings.";
KeyboardRegions = new List<KeyboardRegion>();
}
@ -103,7 +103,6 @@ namespace Artemis.KeyboardProviders.Corsair
/// <summary>
/// Properly resizes any size bitmap to the keyboard by creating a rectangle whose size is dependent on the bitmap
/// size.
/// Does not reset the color each time. Uncomment line 48 for collor reset.
/// </summary>
/// <param name="bitmap"></param>
public override void DrawBitmap(Bitmap bitmap)
@ -125,4 +124,4 @@ namespace Artemis.KeyboardProviders.Corsair
_keyboard.Update(true);
}
}
}
}

View File

@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
using Artemis.KeyboardProviders.Logitech.Utilities;
namespace Artemis.KeyboardProviders.Logitech

View File

@ -10,8 +10,10 @@ namespace Artemis.Managers
{
public class EffectManager
{
private readonly MainManager _mainManager;
private readonly IEventAggregator _events;
private readonly MainManager _mainManager;
private bool _clearing;
private EffectModel _pauseEffect;
public EffectManager(MainManager mainManager, IEventAggregator events)
{
@ -23,7 +25,6 @@ namespace Artemis.Managers
public List<EffectModel> EffectModels { get; set; }
public EffectModel ActiveEffect { get; private set; }
public EffectModel PauseEffect { get; private set; }
public IEnumerable<OverlayModel> EnabledOverlays
{
@ -83,27 +84,27 @@ namespace Artemis.Managers
private void ChangeEffectWithPause(EffectModel effectModel)
{
if (PauseEffect != null)
if (_pauseEffect != null)
return;
PauseEffect = effectModel;
_pauseEffect = effectModel;
_mainManager.Pause();
_mainManager.PauseCallback += MainManagerOnPauseCallback;
_mainManager.PauseCallback += ChangeEffectPauseCallback;
}
private void MainManagerOnPauseCallback()
private void ChangeEffectPauseCallback()
{
// Change effect logic
ActiveEffect?.Dispose();
ActiveEffect = PauseEffect;
ActiveEffect = _pauseEffect;
ActiveEffect.Enable();
// Let the ViewModels know
_events.PublishOnUIThread(new ActiveEffectChanged(ActiveEffect.Name));
PauseEffect = null;
_mainManager.Unpause();
_pauseEffect = null;
if (ActiveEffect is GameModel)
return;
@ -118,18 +119,34 @@ namespace Artemis.Managers
/// </summary>
public void ClearEffect()
{
// Don't mess with the ActiveEffect if in the process of changing the effect.
if (PauseEffect != null)
if (_clearing)
return;
// Don't mess with the ActiveEffect if in the process of changing the effect.
if (_pauseEffect != null)
return;
if (ActiveEffect == null)
return;
_clearing = true;
_mainManager.Pause();
_mainManager.PauseCallback += ClearEffectPauseCallback;
}
private void ClearEffectPauseCallback()
{
ActiveEffect.Dispose();
ActiveEffect = null;
General.Default.LastEffect = null;
General.Default.Save();
_events.PublishOnUIThread(new ActiveEffectChanged(""));
_clearing = false;
_mainManager.Unpause();
}
/// <summary>

View File

@ -19,29 +19,40 @@ namespace Artemis.Managers
public List<KeyboardProvider> KeyboardProviders { get; set; }
public KeyboardProvider ActiveKeyboard { get; set; }
public bool LoadLastKeyboard()
/// <summary>
/// Enables the last keyboard according to the settings file
/// </summary>
public void EnableLastKeyboard()
{
if (General.Default.LastKeyboard == null)
return;
if (General.Default.LastKeyboard == "")
return;
var keyboard = KeyboardProviders.FirstOrDefault(k => k.Name == General.Default.LastKeyboard);
return ChangeKeyboard(keyboard ?? KeyboardProviders.First());
EnableKeyboard(keyboard);
}
public bool ChangeKeyboard(KeyboardProvider keyboardProvider)
/// <summary>
/// Enables the given keyboard
/// </summary>
/// <param name="keyboardProvider"></param>
public void EnableKeyboard(KeyboardProvider keyboardProvider)
{
ReleaseActiveKeyboard();
if (keyboardProvider == null)
return false;
return;
if (ActiveKeyboard != null)
if (keyboardProvider.Name == ActiveKeyboard.Name)
return true;
ReleaseActiveKeyboard();
return;
// Disable everything if there's no active keyboard found
if (!keyboardProvider.CanEnable())
{
MessageBox.Show(keyboardProvider.CantEnableText, "Artemis (╯°□°)╯︵ ┻━┻", MessageBoxButtons.OK,
MessageBoxIcon.Warning);
return false;
_mainManager.DialogService.ShowErrorMessageBox(keyboardProvider.CantEnableText);
return;
}
ActiveKeyboard = keyboardProvider;
@ -49,10 +60,11 @@ namespace Artemis.Managers
General.Default.LastKeyboard = ActiveKeyboard.Name;
General.Default.Save();
return true;
}
/// <summary>
/// Releases the active keyboard
/// </summary>
public void ReleaseActiveKeyboard()
{
if (ActiveKeyboard == null)
@ -61,5 +73,20 @@ namespace Artemis.Managers
ActiveKeyboard.Disable();
ActiveKeyboard = null;
}
/// <summary>
/// Changes the active keyboard
/// </summary>
/// <param name="keyboardProvider"></param>
public void ChangeKeyboard(KeyboardProvider keyboardProvider)
{
if (keyboardProvider == ActiveKeyboard)
return;
General.Default.LastKeyboard = keyboardProvider?.Name;
General.Default.Save();
_mainManager.Restart();
}
}
}

View File

@ -2,9 +2,9 @@
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using Artemis.Events;
using Artemis.Models;
using Artemis.Services;
using Artemis.Utilities.GameState;
using Artemis.Utilities.Keyboard;
using Caliburn.Micro;
@ -17,10 +17,12 @@ namespace Artemis.Managers
private readonly int _fps;
private bool _paused;
private bool _restarting;
public MainManager(IEventAggregator events)
public MainManager(IEventAggregator events, MetroDialogService dialogService)
{
Events = events;
DialogService = dialogService;
KeyboardManager = new KeyboardManager(this);
EffectManager = new EffectManager(this, Events);
@ -28,7 +30,7 @@ namespace Artemis.Managers
_fps = 25;
UpdateWorker = new BackgroundWorker {WorkerSupportsCancellation = true};
ProcessWorker = new BackgroundWorker { WorkerSupportsCancellation = true };
ProcessWorker = new BackgroundWorker {WorkerSupportsCancellation = true};
UpdateWorker.DoWork += UpdateWorker_DoWork;
UpdateWorker.RunWorkerCompleted += BackgroundWorkerExceptionCatcher;
@ -57,6 +59,7 @@ namespace Artemis.Managers
public GameStateWebServer GameStateWebServer { get; set; }
public IEventAggregator Events { get; set; }
public MetroDialogService DialogService { get; set; }
public bool ProgramEnabled { get; private set; }
public bool Suspended { get; set; }
@ -79,7 +82,8 @@ namespace Artemis.Managers
return true;
// Only continue if a keyboard was loaded
if (!KeyboardManager.LoadLastKeyboard())
KeyboardManager.EnableLastKeyboard();
if (KeyboardManager.ActiveKeyboard == null)
return false;
Running = true;
@ -129,6 +133,41 @@ namespace Artemis.Managers
PauseCallback = null;
}
public void Shutdown()
{
Stop();
ProcessWorker.CancelAsync();
GameStateWebServer.Stop();
}
public void Restart()
{
if (_restarting)
return;
if (!Running)
{
Start();
return;
}
_restarting = true;
UpdateWorker.RunWorkerCompleted += FinishRestart;
Stop();
}
public void FinishRestart(object sender, RunWorkerCompletedEventArgs e)
{
UpdateWorker.RunWorkerCompleted -= FinishRestart;
if (e.Error != null)
return;
Start();
_restarting = false;
}
/// <summary>
/// Loads the last active effect and starts the program
/// </summary>
@ -255,12 +294,5 @@ namespace Artemis.Managers
}
#endregion
public void Shutdown()
{
Stop();
ProcessWorker.CancelAsync();
GameStateWebServer.Stop();
}
}
}

View File

@ -1,31 +1,32 @@
using System;
using System.Drawing;
using Artemis.Managers;
namespace Artemis.Models
{
public abstract class EffectModel : IDisposable
{
public delegate void SettingsUpdateHandler(EffectSettings settings);
public MainManager MainManager;
public string Name;
public bool Initialized;
protected EffectModel(MainManager mainManager)
{
MainManager = mainManager;
}
public abstract void Dispose();
// Called on creation
public abstract void Enable();
// Called every iteration
public abstract void Update();
// Called after every update
public abstract Bitmap GenerateBitmap();
}
using System;
using System.Drawing;
using Artemis.Managers;
namespace Artemis.Models
{
public abstract class EffectModel : IDisposable
{
public delegate void SettingsUpdateHandler(EffectSettings settings);
public bool Initialized;
public MainManager MainManager;
public string Name;
protected EffectModel(MainManager mainManager)
{
MainManager = mainManager;
}
public abstract void Dispose();
// Called on creation
public abstract void Enable();
// Called every iteration
public abstract void Update();
// Called after every update
public abstract Bitmap GenerateBitmap();
}
}

View File

@ -17,10 +17,10 @@ namespace Artemis.Modules.Effects.AudioVisualizer
{
private const int FftLength = 2048;
private readonly SampleAggregator _sampleAggregator = new SampleAggregator(FftLength);
private bool _generating;
private IWaveIn _waveIn;
private int _sensitivity;
private bool _fromBottom;
private bool _generating;
private int _sensitivity;
private IWaveIn _waveIn;
public AudioVisualizerModel(MainManager mainManager, AudioVisualizerSettings settings) : base(mainManager)
{
@ -92,7 +92,7 @@ namespace Artemis.Modules.Effects.AudioVisualizer
}
public override void Update()
{
{
// Start filling the model
_generating = true;
@ -118,7 +118,7 @@ namespace Artemis.Modules.Effects.AudioVisualizer
height = (int) Math.Round(SpectrumData[i]/2.55);
// Apply Sensitivity setting
height = height* _sensitivity;
height = height*_sensitivity;
var keyboardHeight =
(int) Math.Round(MainManager.KeyboardManager.ActiveKeyboard.Height/100.00*height*Scale);
if (keyboardHeight > SoundRectangles[i].Height)

View File

@ -37,8 +37,8 @@
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
Style="{DynamicResource MetroCircleToggleButtonStyle}"
cal:Message.Attach="[Event Click] = [Action ToggleEffect]"
ToolTip="Note: You can't enable an effect when Artemis is disabled"/>
cal:Message.Attach="[Event Click] = [Action ToggleEffect]"
ToolTip="Note: You can't enable an effect when Artemis is disabled" />
</StackPanel>
</StackPanel>
<!-- Top color -->

View File

@ -18,7 +18,7 @@ namespace Artemis.Modules.Effects.AudioVisualizer
// Create effect model and add it to MainManager
EffectModel = new AudioVisualizerModel(mainManager, (AudioVisualizerSettings) EffectSettings);
MainManager.EffectManager.EffectModels.Add((AudioVisualizerModel) EffectModel);
MainManager.EffectManager.EffectModels.Add(EffectModel);
}
public static string Name => "Audio Visualizer";

View File

@ -35,9 +35,9 @@
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
Style="{DynamicResource MetroCircleToggleButtonStyle}"
cal:Message.Attach="[Event Click] = [Action ToggleEffect]"
cal:Message.Attach="[Event Click] = [Action ToggleEffect]"
ToolTip="Note: You can't enable an effect when Artemis is disabled"
ToolTipService.ShowOnDisabled="True"/>
ToolTipService.ShowOnDisabled="True" />
</StackPanel>
</StackPanel>

View File

@ -27,7 +27,7 @@ namespace Artemis.Modules.Effects.Debug
// Create effect model and add it to MainManager
EffectModel = new DebugEffectModel(mainManager, (DebugEffectSettings) EffectSettings);
MainManager.EffectManager.EffectModels.Add((DebugEffectModel) EffectModel);
MainManager.EffectManager.EffectModels.Add(EffectModel);
}

View File

@ -37,7 +37,8 @@
IsOpen="{Binding Path=ShowDisabledPopup, Mode=TwoWay}" Placement="Left" VerticalOffset="-10"
PopupAnimation="Fade" StaysOpen="False">
<Border Margin="1">
<TextBlock Background="{DynamicResource AccentColorBrush}" Foreground="{DynamicResource IdealForegroundColorBrush}"
<TextBlock Background="{DynamicResource AccentColorBrush}"
Foreground="{DynamicResource IdealForegroundColorBrush}"
Text="You can't enable an effect when Artemis is disabled" Padding="4" />
</Border>
</Popup>

View File

@ -15,7 +15,7 @@ namespace Artemis.Modules.Effects.TypeHole
// Create effect model and add it to MainManager
EffectModel = new TypeHoleModel(mainManager);
MainManager.EffectManager.EffectModels.Add((TypeHoleModel) EffectModel);
MainManager.EffectManager.EffectModels.Add(EffectModel);
}
public static string Name => "Type Holes (NYI)";

View File

@ -2,7 +2,6 @@
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Artemis.KeyboardProviders.Corsair;
using Artemis.KeyboardProviders.Logitech.Utilities;
@ -24,14 +23,33 @@ namespace Artemis.Modules.Effects.TypeWave
_randomColor = Color.Red;
Settings = settings;
Initialized = false;
Scale = 4;
}
public int Scale { get; set; }
public TypeWaveSettings Settings { get; set; }
public override void Dispose()
{
Initialized = false;
MainManager.KeyboardHook.Unsubscribe(HandleKeypress);
MainManager.KeyboardHook.KeyDownCallback -= KeyboardHookOnKeyDownCallback;
}
private void KeyboardHookOnKeyDownCallback(KeyEventArgs e)
{
// More than 25 waves is pointless
if (_waves.Count >= 25)
return;
var keyMatch = KeyMap.UsEnglishOrionKeys.FirstOrDefault(k => k.KeyCode == e.KeyCode);
if (keyMatch == null)
return;
_waves.Add(Settings.IsRandomColors
? new Wave(new Point(keyMatch.PosX * Scale, keyMatch.PosY * Scale), 0, _randomColor)
: new Wave(new Point(keyMatch.PosX * Scale, keyMatch.PosY * Scale), 0,
ColorHelpers.ToDrawingColor(Settings.WaveColor)));
}
public override void Enable()
@ -39,7 +57,7 @@ namespace Artemis.Modules.Effects.TypeWave
Initialized = false;
// Listener won't start unless the effect is active
MainManager.KeyboardHook.Subscribe(HandleKeypress);
MainManager.KeyboardHook.KeyDownCallback += KeyboardHookOnKeyDownCallback;
Initialized = true;
}
@ -54,7 +72,7 @@ namespace Artemis.Modules.Effects.TypeWave
// TODO: Get from settings
var fps = 25;
_waves[i].Size += Settings.SpreadSpeed;
_waves[i].Size += Settings.SpreadSpeed * Scale;
if (Settings.IsShiftColors)
_waves[i].Color = ColorHelpers.ShiftColor(_waves[i].Color, Settings.ShiftColorSpeed);
@ -78,7 +96,7 @@ namespace Artemis.Modules.Effects.TypeWave
if (_waves.Count == 0)
return null;
var bitmap = MainManager.KeyboardManager.ActiveKeyboard.KeyboardBitmap();
var bitmap = MainManager.KeyboardManager.ActiveKeyboard.KeyboardBitmap(Scale);
using (var g = Graphics.FromImage(bitmap))
{
g.Clear(Color.Transparent);
@ -116,27 +134,6 @@ namespace Artemis.Modules.Effects.TypeWave
}
return bitmap;
}
private void HandleKeypress(object sender, KeyEventArgs e)
{
Task.Factory.StartNew(() => KeyPressTask(e));
}
private void KeyPressTask(KeyEventArgs e)
{
// More than 25 waves is pointless
if (_waves.Count >= 25)
return;
var keyMatch = KeyMap.UsEnglishOrionKeys.FirstOrDefault(k => k.KeyCode == e.KeyCode);
if (keyMatch == null)
return;
_waves.Add(Settings.IsRandomColors
? new Wave(new Point(keyMatch.PosX, keyMatch.PosY), 0, _randomColor)
: new Wave(new Point(keyMatch.PosX, keyMatch.PosY), 0,
ColorHelpers.ToDrawingColor(Settings.WaveColor)));
}
}
public class Wave

View File

@ -40,7 +40,8 @@
IsOpen="{Binding Path=ShowDisabledPopup, Mode=TwoWay}" Placement="Left" VerticalOffset="-10"
PopupAnimation="Fade" StaysOpen="False">
<Border Margin="1">
<TextBlock Background="{DynamicResource AccentColorBrush}" Foreground="{DynamicResource IdealForegroundColorBrush}"
<TextBlock Background="{DynamicResource AccentColorBrush}"
Foreground="{DynamicResource IdealForegroundColorBrush}"
Text="You can't enable an effect when Artemis is disabled" Padding="4" />
</Border>
</Popup>

View File

@ -18,7 +18,7 @@ namespace Artemis.Modules.Effects.TypeWave
// Create effect model and add it to MainManager
EffectModel = new TypeWaveModel(mainManager, (TypeWaveSettings) EffectSettings);
MainManager.EffectManager.EffectModels.Add((TypeWaveModel) EffectModel);
MainManager.EffectManager.EffectModels.Add(EffectModel);
}
public static string Name => "Type Waves";

View File

@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.CounterStrike" GeneratedClassName="CounterStrike">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
GeneratedClassNamespace="Artemis.Modules.Games.CounterStrike" GeneratedClassName="CounterStrike">
<Profiles />
<Settings>
<Setting Name="Enabled" Type="System.Boolean" Scope="User">

View File

@ -3,14 +3,13 @@ using Artemis.Models;
namespace Artemis.Modules.Games.CounterStrike
{
public class CounterStrikeSettings : EffectSettings
public class CounterStrikeSettings : GameSettings
{
public CounterStrikeSettings()
{
Load();
}
public bool Enabled { get; set; }
public string GameDirectory { get; set; }
public bool AmmoEnabled { get; set; }

View File

@ -37,7 +37,7 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
IsChecked="{Binding Path=CounterStrikeSettings.Enabled, Mode=TwoWay}"
IsChecked="{Binding Path=GameSettings.Enabled, Mode=TwoWay}"
Style="{DynamicResource MetroCircleToggleButtonStyle}"
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
</StackPanel>
@ -50,7 +50,7 @@
Width="130" HorizontalAlignment="Left" />
<Grid>
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
Text="{Binding Path=CounterStrikeSettings.GameDirectory, Mode=TwoWay}"
Text="{Binding Path=GameSettings.GameDirectory, Mode=TwoWay}"
cal:Message.Attach="[Event LostFocus] = [Action PlaceConfigFile]" />
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
HorizontalAlignment="Right" Width="25"
@ -63,7 +63,7 @@
Height="16" Margin="0,10,0,9">
Display ammo on F-keys
</TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=CounterStrikeSettings.AmmoEnabled, Mode=TwoWay}"
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.AmmoEnabled, Mode=TwoWay}"
Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
Margin="0,0,-5,0" Width="114" />
@ -73,7 +73,7 @@
Main ammo color
</TextBlock>
<xctk:ColorPicker x:Name="MainColor"
SelectedColor="{Binding Path=CounterStrikeSettings.AmmoMainColor, Mode=TwoWay}"
SelectedColor="{Binding Path=GameSettings.AmmoMainColor, Mode=TwoWay}"
Grid.Row="3" Grid.Column="1" Width="110" HorizontalAlignment="Right"
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
@ -83,7 +83,7 @@
Secondary ammo color
</TextBlock>
<xctk:ColorPicker x:Name="SecondaryColor"
SelectedColor="{Binding Path=CounterStrikeSettings.AmmoSecondaryColor, Mode=TwoWay}"
SelectedColor="{Binding Path=GameSettings.AmmoSecondaryColor, Mode=TwoWay}"
Grid.Row="4" Grid.Column="1" Width="110" HorizontalAlignment="Right"
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
@ -92,7 +92,7 @@
Height="16" Margin="0,9,0,10">
Display smoked effect
</TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=CounterStrikeSettings.SmokeEnabled, Mode=TwoWay}"
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.SmokeEnabled, Mode=TwoWay}"
Grid.Row="5" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
Margin="0,0,-5,0" Width="114" />
@ -101,7 +101,7 @@
Height="16" Margin="0,10,0,9">
Display flashed effect
</TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=CounterStrikeSettings.FlashEnabled, Mode=TwoWay}"
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.FlashEnabled, Mode=TwoWay}"
Grid.Row="6" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
Margin="0,0,-5,0" Width="114" />
@ -110,7 +110,7 @@
Height="16" Margin="0,9,0,10">
Color keyboard according to team
</TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=CounterStrikeSettings.TeamColorEnabled, Mode=TwoWay}"
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.TeamColorEnabled, Mode=TwoWay}"
Grid.Row="7" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
Margin="0,0,-5,0" Width="114" />
@ -119,7 +119,7 @@
Height="16" Margin="0,10,0,9">
Color keyboard red on low HP
</TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=CounterStrikeSettings.LowHpEnabled, Mode=TwoWay}"
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.LowHpEnabled, Mode=TwoWay}"
Grid.Row="8" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
Margin="0,0,-5,0" Width="114" />

View File

@ -2,92 +2,63 @@
using System.Windows.Forms;
using Artemis.Managers;
using Artemis.Properties;
using Screen = Caliburn.Micro.Screen;
using Artemis.ViewModels.Abstract;
namespace Artemis.Modules.Games.CounterStrike
{
public class CounterStrikeViewModel : Screen
public class CounterStrikeViewModel : GameViewModel
{
private CounterStrikeSettings _counterStrikeSettings;
public CounterStrikeViewModel(MainManager mainManager)
{
MainManager = mainManager;
// Settings are loaded from file by class
CounterStrikeSettings = new CounterStrikeSettings();
GameSettings = new CounterStrikeSettings();
// Create effect model and add it to MainManager
CounterStrikeModel = new CounterStrikeModel(mainManager, CounterStrikeSettings);
MainManager.EffectManager.EffectModels.Add(CounterStrikeModel);
GameModel = new CounterStrikeModel(mainManager, (CounterStrikeSettings) GameSettings);
MainManager.EffectManager.EffectModels.Add(GameModel);
PlaceConfigFile();
}
public CounterStrikeSettings CounterStrikeSettings
{
get { return _counterStrikeSettings; }
set
{
if (Equals(value, _counterStrikeSettings)) return;
_counterStrikeSettings = value;
NotifyOfPropertyChange(() => CounterStrikeSettings);
}
}
public CounterStrikeModel CounterStrikeModel { get; set; }
public MainManager MainManager { get; set; }
public static string Name => "CS:GO";
public string Content => "Counter-Strike: GO Content";
public void SaveSettings()
{
CounterStrikeSettings?.Save();
}
public void ResetSettings()
{
// TODO: Confirmation dialog (Generic MVVM approach)
CounterStrikeSettings.ToDefault();
NotifyOfPropertyChange(() => CounterStrikeSettings);
SaveSettings();
}
public void ToggleEffect()
{
CounterStrikeModel.Enabled = _counterStrikeSettings.Enabled;
}
public void BrowseDirectory()
{
var dialog = new FolderBrowserDialog {SelectedPath = CounterStrikeSettings.GameDirectory};
var dialog = new FolderBrowserDialog {SelectedPath = ((CounterStrikeSettings) GameSettings).GameDirectory};
var result = dialog.ShowDialog();
if (result != DialogResult.OK)
return;
CounterStrikeSettings.GameDirectory = dialog.SelectedPath;
NotifyOfPropertyChange(() => CounterStrikeSettings);
((CounterStrikeSettings) GameSettings).GameDirectory = dialog.SelectedPath;
NotifyOfPropertyChange(() => GameSettings);
GameSettings.Save();
PlaceConfigFile();
}
public void PlaceConfigFile()
{
if (CounterStrikeSettings.GameDirectory == string.Empty)
if (((CounterStrikeSettings) GameSettings).GameDirectory == string.Empty)
return;
if (Directory.Exists(CounterStrikeSettings.GameDirectory + "/csgo/cfg"))
if (Directory.Exists(((CounterStrikeSettings) GameSettings).GameDirectory + "/csgo/cfg"))
{
var cfgFile = Resources.gamestateConfiguration.Replace("{{port}}",
MainManager.GameStateWebServer.Port.ToString());
File.WriteAllText(CounterStrikeSettings.GameDirectory + "/csgo/cfg/gamestate_integration_artemis.cfg",
File.WriteAllText(
((CounterStrikeSettings) GameSettings).GameDirectory + "/csgo/cfg/gamestate_integration_artemis.cfg",
cfgFile);
return;
}
MessageBox.Show("Please select a valid CS:GO directory");
CounterStrikeSettings.GameDirectory = string.Empty;
NotifyOfPropertyChange(() => CounterStrikeSettings);
MainManager.DialogService.ShowErrorMessageBox("Please select a valid CS:GO directory\n\n" +
@"By default CS:GO is in \SteamApps\common\Counter-Strike Global Offensive");
((CounterStrikeSettings) GameSettings).GameDirectory = string.Empty;
NotifyOfPropertyChange(() => GameSettings);
GameSettings.Save();
}
}
}

View File

@ -1,17 +1,15 @@
using Artemis.Managers;
using Caliburn.Micro;
using Artemis.ViewModels.Abstract;
namespace Artemis.Modules.Games.Dota2
{
public class Dota2ViewModel : Screen
public class Dota2ViewModel : GameViewModel
{
public Dota2ViewModel(MainManager mainManager)
{
MainManager = mainManager;
}
public MainManager MainManager { get; set; }
public static string Name => "Dota 2 (NYI)";
public string Content => "Dota 2 Content";
}

View File

@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.RocketLeague" GeneratedClassName="RocketLeague">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
GeneratedClassNamespace="Artemis.Modules.Games.RocketLeague" GeneratedClassName="RocketLeague">
<Profiles />
<Settings>
<Setting Name="Enabled" Type="System.Boolean" Scope="User">

View File

@ -49,6 +49,8 @@ namespace Artemis.Modules.Games.RocketLeague
{
Initialized = false;
_contextualColor = Settings.ContextualColor;
_boostRect = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, 0, new List<Color>
{
ColorHelpers.ToDrawingColor(Settings.MainColor),
@ -71,7 +73,6 @@ namespace Artemis.Modules.Games.RocketLeague
if (_memory == null)
return;
ContextualColor = Settings.ContextualColor;
var offsets = _pointer.GameAddresses.First(ga => ga.Description == "Boost").ToString();
var boostAddress = _memory.GetAddress("\"RocketLeague.exe\"" + offsets);
var boostFloat = _memory.ReadFloat(boostAddress)*100/3;

View File

@ -3,14 +3,13 @@ using Artemis.Models;
namespace Artemis.Modules.Games.RocketLeague
{
public class RocketLeagueSettings : EffectSettings
public class RocketLeagueSettings : GameSettings
{
public RocketLeagueSettings()
{
Load();
}
public bool Enabled { get; set; }
public Color MainColor { get; set; }
public Color SecondaryColor { get; set; }
public bool ContextualColor { get; set; }

View File

@ -34,7 +34,7 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
IsChecked="{Binding Path=RocketLeagueSettings.Enabled, Mode=TwoWay}"
IsChecked="{Binding Path=GameSettings.Enabled, Mode=TwoWay}"
Style="{DynamicResource MetroCircleToggleButtonStyle}"
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
</StackPanel>
@ -46,7 +46,7 @@
Main boost display color
</TextBlock>
<xctk:ColorPicker x:Name="MainColor"
SelectedColor="{Binding Path=RocketLeagueSettings.MainColor, Mode=TwoWay}"
SelectedColor="{Binding Path=GameSettings.MainColor, Mode=TwoWay}"
Grid.Row="1" Grid.Column="1" Width="110" HorizontalAlignment="Right"
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
@ -56,7 +56,7 @@
Secondary boost display color
</TextBlock>
<xctk:ColorPicker x:Name="SecondaryColor"
SelectedColor="{Binding Path=RocketLeagueSettings.SecondaryColor, Mode=TwoWay}"
SelectedColor="{Binding Path=GameSettings.SecondaryColor, Mode=TwoWay}"
Grid.Row="2" Grid.Column="1" Width="110" HorizontalAlignment="Right"
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
@ -65,7 +65,7 @@
Height="16" Margin="0,8">
Color bar according to boost amount
</TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=RocketLeagueSettings.ContextualColor, Mode=TwoWay}"
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ContextualColor, Mode=TwoWay}"
Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
Margin="0,0,-5,0" Width="114" />
@ -76,9 +76,10 @@
Tip: To find a color combination you like, start an exhibition match, pickup 100 boost and play around with the colors.
They'll appear on your keyboard immediately! Once you're satisfied don't forget to click save changes.
</TextBlock>
<TextBlock x:Name="VersionText" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
<TextBlock x:Name="VersionText" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center"
Margin="0,8"
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
Foreground="{DynamicResource HighlightBrush}" MaxWidth="510" TextAlignment="Justify"/>
Foreground="{DynamicResource HighlightBrush}" MaxWidth="510" TextAlignment="Justify" />
<!-- Buttons -->
<StackPanel Grid.Column="0" Grid.Row="9" Orientation="Horizontal" VerticalAlignment="Bottom">

View File

@ -1,16 +1,14 @@
using Artemis.Managers;
using Artemis.Models;
using Artemis.Settings;
using Artemis.Utilities;
using Artemis.Utilities.Memory;
using Caliburn.Micro;
using Artemis.ViewModels.Abstract;
using Newtonsoft.Json;
namespace Artemis.Modules.Games.RocketLeague
{
public class RocketLeagueViewModel : Screen
public class RocketLeagueViewModel : GameViewModel
{
private RocketLeagueSettings _rocketLeagueSettings;
private string _versionText;
public RocketLeagueViewModel(MainManager mainManager)
@ -18,15 +16,17 @@ namespace Artemis.Modules.Games.RocketLeague
MainManager = mainManager;
// Settings are loaded from file by class
RocketLeagueSettings = new RocketLeagueSettings();
GameSettings = new RocketLeagueSettings();
// Create effect model and add it to MainManager
RocketLeagueModel = new RocketLeagueModel(mainManager, RocketLeagueSettings);
MainManager.EffectManager.EffectModels.Add(RocketLeagueModel);
GameModel = new RocketLeagueModel(mainManager, (RocketLeagueSettings) GameSettings);
MainManager.EffectManager.EffectModels.Add(GameModel);
SetVersionText();
}
public static string Name => "Rocket League";
public string VersionText
{
get { return _versionText; }
@ -38,22 +38,8 @@ namespace Artemis.Modules.Games.RocketLeague
}
}
public static string Name => "Rocket League";
public MainManager MainManager { get; set; }
public RocketLeagueModel RocketLeagueModel { get; set; }
public RocketLeagueSettings RocketLeagueSettings
{
get { return _rocketLeagueSettings; }
set
{
if (Equals(value, _rocketLeagueSettings)) return;
_rocketLeagueSettings = value;
NotifyOfPropertyChange(() => RocketLeagueSettings);
}
}
private void SetVersionText()
{
if (!General.Default.EnablePointersUpdate)
@ -65,32 +51,10 @@ namespace Artemis.Modules.Games.RocketLeague
Updater.GetPointers();
var version = JsonConvert
.DeserializeObject<GamePointersCollectionModel>(Offsets.Default.RocketLeague)
.DeserializeObject<GamePointersCollection>(Offsets.Default.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).";
}
public void SaveSettings()
{
if (RocketLeagueModel == null)
return;
RocketLeagueSettings.Save();
}
public void ResetSettings()
{
// TODO: Confirmation dialog (Generic MVVM approach)
RocketLeagueSettings.ToDefault();
NotifyOfPropertyChange(() => RocketLeagueSettings);
SaveSettings();
}
public void ToggleEffect()
{
RocketLeagueModel.Enabled = _rocketLeagueSettings.Enabled;
}
}
}

View File

@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.Witcher3" GeneratedClassName="Witcher3">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
GeneratedClassNamespace="Artemis.Modules.Games.Witcher3" GeneratedClassName="Witcher3">
<Profiles />
<Settings>
<Setting Name="Enabled" Type="System.Boolean" Scope="User">

View File

@ -26,7 +26,7 @@ namespace Artemis.Modules.Games.Witcher3
Scale = 4;
Enabled = Settings.Enabled;
Initialized = false;
_updateSw = new Stopwatch();
_signRegex = new Regex("ActiveSign=(.*)", RegexOptions.Compiled);
}
@ -87,21 +87,21 @@ namespace Artemis.Modules.Games.Witcher3
return;
var sign = signRes.Groups[1].Value;
switch (sign)
{
case "ST_Aard\r":
switch (sign)
{
case "ST_Aard\r":
_signRect.Colors = new List<Color> {Color.DeepSkyBlue, Color.Blue};
break;
case "ST_Yrden\r":
case "ST_Yrden\r":
_signRect.Colors = new List<Color> {Color.Purple, Color.DeepPink};
break;
case "ST_Igni\r":
case "ST_Igni\r":
_signRect.Colors = new List<Color> {Color.DarkOrange, Color.Red};
break;
case "ST_Quen\r":
case "ST_Quen\r":
_signRect.Colors = new List<Color> {Color.DarkOrange, Color.FromArgb(232, 193, 0)};
break;
case "ST_Axii\r":
case "ST_Axii\r":
_signRect.Colors = new List<Color> {Color.LawnGreen, Color.DarkGreen};
break;
}

View File

@ -2,15 +2,13 @@
namespace Artemis.Modules.Games.Witcher3
{
public class Witcher3Settings : EffectSettings
public class Witcher3Settings : GameSettings
{
public Witcher3Settings()
{
Load();
}
public bool Enabled { get; set; }
public sealed override void Load()
{
Enabled = Witcher3.Default.Enabled;

View File

@ -29,7 +29,7 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
IsChecked="{Binding Path=Witcher3Settings.Enabled, Mode=TwoWay}"
IsChecked="{Binding Path=GameSettings.Enabled, Mode=TwoWay}"
Style="{DynamicResource MetroCircleToggleButtonStyle}"
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
</StackPanel>

View File

@ -5,65 +5,27 @@ using System.Linq;
using System.Windows.Forms;
using Artemis.Managers;
using Artemis.Properties;
using Screen = Caliburn.Micro.Screen;
using Artemis.ViewModels.Abstract;
namespace Artemis.Modules.Games.Witcher3
{
public class Witcher3ViewModel : Screen
public class Witcher3ViewModel : GameViewModel
{
private Witcher3Settings _witcher3Settings;
public Witcher3ViewModel(MainManager mainManager)
{
MainManager = mainManager;
// Settings are loaded from file by class
Witcher3Settings = new Witcher3Settings();
GameSettings = new Witcher3Settings();
// Create effect model and add it to MainManager
Witcher3Model = new Witcher3Model(mainManager, Witcher3Settings);
MainManager.EffectManager.EffectModels.Add(Witcher3Model);
GameModel = new Witcher3Model(mainManager, (Witcher3Settings) GameSettings);
MainManager.EffectManager.EffectModels.Add(GameModel);
}
public static string Name => "The Witcher 3";
public MainManager MainManager { get; set; }
public Witcher3Model Witcher3Model { get; set; }
public Witcher3Settings Witcher3Settings
{
get { return _witcher3Settings; }
set
{
if (Equals(value, _witcher3Settings)) return;
_witcher3Settings = value;
NotifyOfPropertyChange(() => Witcher3Settings);
}
}
public void SaveSettings()
{
if (Witcher3Model == null)
return;
Witcher3Settings.Save();
}
public void ResetSettings()
{
// TODO: Confirmation dialog (Generic MVVM approach)
Witcher3Settings.ToDefault();
NotifyOfPropertyChange(() => Witcher3Settings);
SaveSettings();
}
public void ToggleEffect()
{
Witcher3Model.Enabled = _witcher3Settings.Enabled;
}
public void AutoInstall()
public async void AutoInstall()
{
// Request The Witcher 3 folder
var dialog = new FolderBrowserDialog
@ -77,15 +39,16 @@ namespace Artemis.Modules.Games.Witcher3
// If the subfolder doesn't contain witcher3.exe, it's the wrong folder.
if (!File.Exists(dialog.SelectedPath + @"\bin\x64\witcher3.exe"))
{
var error = MessageBox.Show("That's not a valid Witcher 3 directory\n\n" +
"Default directories:\n" +
"Steam: C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Witcher 3\n" +
"GOG: C:\\GOG Games\\The Witcher 3 Wild Hunt", "Installation error",
MessageBoxButtons.RetryCancel);
if (error == DialogResult.Retry)
var retry = await
MainManager.DialogService.ShowQuestionMessageBox("Installation error",
"That's not a valid Witcher 3 directory\n\n" +
"Default directories:\n" +
"Steam: \\SteamApps\\common\\The Witcher 3\n" +
"GOG: C:\\GOG Games\\The Witcher 3 Wild Hunt\n\n" +
"Retry?");
if (retry.Value)
AutoInstall();
else
return;
return;
}
// Look for any conflicting mods
@ -99,17 +62,21 @@ namespace Artemis.Modules.Games.Witcher3
// Don't trip over our own mod
if (!file.Contains("modArtemis"))
{
MessageBox.Show("Oh no, you have a conflicting mod!\n\n" +
"Conflicting file: " + file.Remove(0, dialog.SelectedPath.Length) +
"\n\nOnce you press OK you will be taken to an instructions page.",
"Conflicting mod found");
var viewHelp = await
MainManager.DialogService.ShowQuestionMessageBox("Conflicting mod found",
"Oh no, you have a conflicting mod!\n\n" +
"Conflicting file: " + file.Remove(0, dialog.SelectedPath.Length) +
"\n\nWould you like to view instructions on how to manually install the mod?");
if (!viewHelp.Value)
return;
// Put the mod in the documents folder instead
// Create the directory structure
var folder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis";
if (
!Directory.Exists(folder + @"\Witcher3\mods\modArtemis\content\scripts\game\player"))
Directory.CreateDirectory(folder + @"\Witcher3\mods\modArtemis\content\scripts\game\player");
Directory.CreateDirectory(folder +
@"\Witcher3\mods\modArtemis\content\scripts\game\player");
if (
!Directory.Exists(folder + @"\Witcher3\bin\config\r4game\user_config_matrix\pc"))
Directory.CreateDirectory(folder + @"\Witcher3\bin\config\r4game\user_config_matrix\pc");
@ -122,7 +89,6 @@ namespace Artemis.Modules.Games.Witcher3
Resources.playerWitcherWs);
Process.Start(new ProcessStartInfo("https://github.com/SpoinkyNL/Artemis/wiki/The-Witcher-3"));
return;
}
}
@ -140,7 +106,7 @@ namespace Artemis.Modules.Games.Witcher3
File.WriteAllText(dialog.SelectedPath + @"\mods\modArtemis\content\scripts\game\player\playerWitcher.ws",
Resources.playerWitcherWs);
MessageBox.Show("The mod was successfully installed!", "Success");
MainManager.DialogService.ShowMessageBox("Success", "The mod was successfully installed!");
}
}
}

View File

@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Overlays.VolumeDisplay" GeneratedClassName="VolumeDisplay">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
GeneratedClassNamespace="Artemis.Modules.Overlays.VolumeDisplay" GeneratedClassName="VolumeDisplay">
<Profiles />
<Settings>
<Setting Name="Enabled" Type="System.Boolean" Scope="User">

View File

@ -1,6 +1,5 @@
using System.Drawing;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
using Artemis.Managers;
using Artemis.Models;
@ -25,13 +24,13 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
public override void Dispose()
{
MainManager.KeyboardHook.Unsubscribe(HandleKeypress);
MainManager.KeyboardHook.KeyDownCallback -= KeyPressTask;
}
public override void Enable()
{
// Listener won't start unless the effect is active
MainManager.KeyboardHook.Subscribe(HandleKeypress);
MainManager.KeyboardHook.KeyDownCallback += KeyPressTask;
}
public override void Update()
@ -80,11 +79,6 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
return bitmap;
}
private void HandleKeypress(object sender, KeyEventArgs e)
{
Task.Factory.StartNew(() => KeyPressTask(e));
}
private void KeyPressTask(KeyEventArgs e)
{
if (e.KeyCode != Keys.VolumeUp && e.KeyCode != Keys.VolumeDown)

View File

@ -55,12 +55,12 @@
<xctk:ColorPicker x:Name="SecondaryColor"
SelectedColor="{Binding Path=VolumeDisplaySettings.SecondaryColor, Mode=TwoWay}"
Grid.Row="2" Grid.Column="1" Width="110" HorizontalAlignment="Right"
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" >
<xctk:ColorPicker.Template>
<ControlTemplate>
<Rectangle ></Rectangle>
</ControlTemplate>
</xctk:ColorPicker.Template>
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22">
<xctk:ColorPicker.Template>
<ControlTemplate>
<Rectangle />
</ControlTemplate>
</xctk:ColorPicker.Template>
</xctk:ColorPicker>
<TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"

View File

@ -1,66 +1,66 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Artemis.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Artemis.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Artemis.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Artemis.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-16&quot;?&gt;
///&lt;!-- Used by Artemis to get the active Sign --&gt;
///&lt;UserConfig&gt;
@ -69,25 +69,25 @@ namespace Artemis.Properties {
/// &lt;Var id=&quot;ActiveSign&quot; displayName=&quot;ActiveSign&quot; displayType=&quot;SLIDER:0:1:1000000&quot;/&gt;
/// &lt;/VisibleVars&gt;
/// &lt;/Group&gt;
///&lt;/UserConfig&gt;.
/// </summary>
internal static string artemisXml {
get {
return ResourceManager.GetString("artemisXml", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap bow {
get {
object obj = ResourceManager.GetObject("bow", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
///&lt;/UserConfig&gt;.
/// </summary>
internal static string artemisXml {
get {
return ResourceManager.GetString("artemisXml", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap bow {
get {
object obj = ResourceManager.GetObject("bow", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to &quot;Artemis&quot;
///{
/// &quot;uri&quot; &quot;http://localhost:{{port}}/csgo_game_event&quot;
@ -105,36 +105,56 @@ namespace Artemis.Properties {
/// &quot;player_weapons&quot; &quot;1&quot;
/// &quot;player_match_stats&quot; &quot;1&quot;
/// }
///}.
/// </summary>
internal static string gamestateConfiguration {
get {
return ResourceManager.GetString("gamestateConfiguration", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to /***********************************************************************/
////** © 2015 CD PROJEKT S.A. All rights reserved.
////** THE WITCHER® is a trademark of CD PROJEKT S. A.
////** The Witcher game is based on the prose of Andrzej Sapkowski.
////***********************************************************************/
///
///
///
///
///statemachine class W3PlayerWitcher extends CR4Player
///{
///
/// private saved var craftingSchematics : array&lt;name&gt;;
///
///
/// private saved var alchemyRecipes : array&lt;name&gt;; [rest of string was truncated]&quot;;.
/// </summary>
internal static string playerWitcherWs {
get {
return ResourceManager.GetString("playerWitcherWs", resourceCulture);
}
}
}
}
///}.
/// </summary>
internal static string gamestateConfiguration {
get {
return ResourceManager.GetString("gamestateConfiguration", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon logo {
get {
object obj = ResourceManager.GetObject("logo", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon logo_disabled {
get {
object obj = ResourceManager.GetObject("logo_disabled", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to /***********************************************************************/
////** © 2015 CD PROJEKT S.A. All rights reserved.
////** THE WITCHER® is a trademark of CD PROJEKT S. A.
////** The Witcher game is based on the prose of Andrzej Sapkowski.
////***********************************************************************/
///
///
///
///
///statemachine class W3PlayerWitcher extends CR4Player
///{
///
/// private saved var craftingSchematics : array&lt;name&gt;;
///
///
/// private saved var alchemyRecipes : array&lt;name&gt;; [rest of string was truncated]&quot;;.
/// </summary>
internal static string playerWitcherWs {
get {
return ResourceManager.GetString("playerWitcherWs", resourceCulture);
}
}
}
}

View File

@ -1,133 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="artemisXml" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\witcher3\artemis.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="bow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="gamestateConfiguration" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\counterstrike\gamestateconfiguration.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="playerWitcherWs" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\witcher3\playerwitcher.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="artemisXml" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\witcher3\artemis.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="bow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="gamestateConfiguration" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\counterstrike\gamestateconfiguration.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\logo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="logo_disabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\logo-disabled.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="playerWitcherWs" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\witcher3\playerwitcher.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
</root>

View File

@ -1,98 +1,122 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Artemis.Settings {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class General : global::System.Configuration.ApplicationSettingsBase {
private static General defaultInstance = ((General)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new General())));
public static General Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("TypeWave")]
public string LastEffect {
get {
return ((string)(this["LastEffect"]));
}
set {
this["LastEffect"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Logitech G910 RGB")]
public string LastKeyboard {
get {
return ((string)(this["LastKeyboard"]));
}
set {
this["LastKeyboard"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool EnablePointersUpdate {
get {
return ((bool)(this["EnablePointersUpdate"]));
}
set {
this["EnablePointersUpdate"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("51364")]
public int GamestatePort {
get {
return ((int)(this["GamestatePort"]));
}
set {
this["GamestatePort"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool Autorun {
get {
return ((bool)(this["Autorun"]));
}
set {
this["Autorun"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool Suspended {
get {
return ((bool)(this["Suspended"]));
}
set {
this["Suspended"] = value;
}
}
}
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Artemis.Settings {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class General : global::System.Configuration.ApplicationSettingsBase {
private static General defaultInstance = ((General)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new General())));
public static General Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("TypeWave")]
public string LastEffect {
get {
return ((string)(this["LastEffect"]));
}
set {
this["LastEffect"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string LastKeyboard {
get {
return ((string)(this["LastKeyboard"]));
}
set {
this["LastKeyboard"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool EnablePointersUpdate {
get {
return ((bool)(this["EnablePointersUpdate"]));
}
set {
this["EnablePointersUpdate"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("51364")]
public int GamestatePort {
get {
return ((int)(this["GamestatePort"]));
}
set {
this["GamestatePort"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool Autorun {
get {
return ((bool)(this["Autorun"]));
}
set {
this["Autorun"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool Suspended {
get {
return ((bool)(this["Suspended"]));
}
set {
this["Suspended"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool ShowOnStartup {
get {
return ((bool)(this["ShowOnStartup"]));
}
set {
this["ShowOnStartup"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool CheckForUpdates {
get {
return ((bool)(this["CheckForUpdates"]));
}
set {
this["CheckForUpdates"] = value;
}
}
}
}

View File

@ -1,26 +1,30 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
GeneratedClassNamespace="Artemis.Settings" GeneratedClassName="General">
<Profiles />
<Settings>
<Setting Name="LastEffect" Type="System.String" Scope="User">
<Value Profile="(Default)">TypeWave</Value>
</Setting>
<Setting Name="LastKeyboard" Type="System.String" Scope="User">
<Value Profile="(Default)">Logitech G910 RGB</Value>
</Setting>
<Setting Name="EnablePointersUpdate" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="GamestatePort" Type="System.Int32" Scope="User">
<Value Profile="(Default)">51364</Value>
</Setting>
<Setting Name="Autorun" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="Suspended" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Settings" GeneratedClassName="General">
<Profiles />
<Settings>
<Setting Name="LastEffect" Type="System.String" Scope="User">
<Value Profile="(Default)">TypeWave</Value>
</Setting>
<Setting Name="LastKeyboard" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="EnablePointersUpdate" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="GamestatePort" Type="System.Int32" Scope="User">
<Value Profile="(Default)">51364</Value>
</Setting>
<Setting Name="Autorun" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Suspended" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ShowOnStartup" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="CheckForUpdates" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -38,6 +38,26 @@ namespace Artemis.Settings
}
}
public bool CheckForUpdates
{
get { return General.Default.CheckForUpdates; }
set
{
if (General.Default.CheckForUpdates == value) return;
General.Default.CheckForUpdates = value;
}
}
public bool ShowOnStartup
{
get { return General.Default.ShowOnStartup; }
set
{
if (General.Default.ShowOnStartup == value) return;
General.Default.ShowOnStartup = value;
}
}
private void ApplyGamestatePort()
{
// TODO: Restart Gamestate server with new port
@ -71,6 +91,8 @@ namespace Artemis.Settings
GamestatePort = 51364;
EnablePointersUpdate = true;
Autorun = true;
CheckForUpdates = true;
ShowOnStartup = true;
SaveSettings();
}

View File

@ -1,7 +1,9 @@
using System.IO;
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Artemis.Settings;
using Newtonsoft.Json;
@ -29,12 +31,19 @@ namespace Artemis.Utilities.GameState
if (Running)
return;
_listener.Prefixes.Clear();
Port = General.Default.GamestatePort;
_listener.Prefixes.Add($"http://localhost:{Port}/");
try
{
_listener.Prefixes.Clear();
Port = General.Default.GamestatePort;
_listener.Prefixes.Add($"http://localhost:{Port}/");
_listener.Start();
}
catch (Exception)
{
MessageBox.Show("Couldn't start the webserver. CS:GO effect won't work :c \n\nTry changing the port in Settings and restart Artemis.");
}
_listener.Start();
ThreadPool.QueueUserWorkItem(o =>
{
try

View File

@ -1,34 +1,24 @@
using System.Windows.Forms;
using Gma.System.MouseKeyHook;
using System.Threading.Tasks;
using System.Windows.Forms;
using VirtualInput;
namespace Artemis.Utilities.Keyboard
{
public class KeyboardHook
{
private IKeyboardMouseEvents _mGlobalHook;
public int Subscriptions { get; set; }
public delegate void KeyDownCallbackHandler(KeyEventArgs e);
public void Subscribe(KeyEventHandler handleKeypress)
public KeyboardHook()
{
if (_mGlobalHook == null)
_mGlobalHook = Hook.GlobalEvents();
_mGlobalHook.KeyDown += handleKeypress;
Subscriptions++;
VirtualKeyboard.KeyDown += VirtualKeyboardOnKeyDown;
VirtualKeyboard.StartInterceptor();
}
public void Unsubscribe(KeyEventHandler handleKeypress)
private void VirtualKeyboardOnKeyDown(object sender, KeyEventArgs keyEventArgs)
{
if (_mGlobalHook == null)
return;
_mGlobalHook.KeyDown -= handleKeypress;
Subscriptions--;
if (Subscriptions >= 1)
return;
_mGlobalHook.Dispose();
_mGlobalHook = null;
Task.Factory.StartNew(() => { KeyDownCallback?.Invoke(keyEventArgs); });
}
public event KeyDownCallbackHandler KeyDownCallback;
}
}

View File

@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using Artemis.Models;
using Artemis.Settings;
using Newtonsoft.Json;
namespace Artemis.Utilities.Memory
{

View File

@ -3,9 +3,10 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Windows.Forms;
using Artemis.Models;
using System.Threading.Tasks;
using Artemis.Services;
using Artemis.Settings;
using Artemis.Utilities.Memory;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@ -13,22 +14,27 @@ namespace Artemis.Utilities
{
public static class Updater
{
public static int CurrentVersion = 100;
public static int CurrentVersion = 102;
public static void CheckForUpdate()
public static async Task<Action> CheckForUpdate(MetroDialogService dialogService)
{
if (!General.Default.CheckForUpdates)
return null;
var newRelease = IsUpdateAvailable();
if (newRelease == null)
return;
return null;
var viewUpdate =
MessageBox.Show(
var viewUpdate = await
dialogService.ShowQuestionMessageBox("Update available",
$"A new version of Artemis is available, version {newRelease["tag_name"].Value<string>()}.\n" +
"Do you wish to view the update on GitHub now?\n\n" +
"Note: You can disable update notifications in the settings menu", "Artemis - Update available",
MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (viewUpdate == DialogResult.Yes)
"Note: You can disable update notifications in the settings menu");
if (viewUpdate.Value)
Process.Start(new ProcessStartInfo(newRelease["html_url"].Value<string>()));
return null;
}
public static JObject IsUpdateAvailable()
@ -80,7 +86,7 @@ namespace Artemis.Utilities
"https://raw.githubusercontent.com/SpoinkyNL/Artemis/master/pointers.json?random=" + rand.Next());
// Get a list of pointers
var pointers = JsonConvert.DeserializeObject<List<GamePointersCollectionModel>>(json);
var pointers = JsonConvert.DeserializeObject<List<GamePointersCollection>>(json);
// Assign each pointer to the settings file
var rlPointers = JsonConvert.SerializeObject(pointers.FirstOrDefault(p => p.Game == "RocketLeague"));
if (rlPointers != null)

View File

@ -61,9 +61,15 @@ namespace Artemis.ViewModels.Abstract
MainManager.EffectManager.ChangeEffect(EffectModel, true);
}
public void ResetSettings()
public async void ResetSettings()
{
// TODO: Confirmation dialog (Generic MVVM approach)
var resetConfirm = await
MainManager.DialogService.ShowQuestionMessageBox("Reset effect settings",
"Are you sure you wish to reset this effect's settings? \nAny changes you made will be lost.");
if (!resetConfirm.Value)
return;
EffectSettings.ToDefault();
NotifyOfPropertyChange(() => EffectSettings);

View File

@ -8,8 +8,9 @@ using MahApps.Metro.Controls;
namespace Artemis.ViewModels.Flyouts
{
public class FlyoutSettingsViewModel : FlyoutBaseViewModel, IHandle<ToggleEnabled>
public class FlyoutSettingsViewModel : FlyoutBaseViewModel, IHandle<ToggleEnabled>, IHandle<ActiveEffectChanged>
{
private string _activeEffectName;
private bool _enabled;
private GeneralSettings _generalSettings;
private string _selectedKeyboardProvider;
@ -38,7 +39,15 @@ namespace Artemis.ViewModels.Flyouts
public MainManager MainManager { get; set; }
public BindableCollection<string> KeyboardProviders
=> new BindableCollection<string>(MainManager.KeyboardManager.KeyboardProviders.Select(k => k.Name));
{
get
{
var collection = new BindableCollection<string>(MainManager.KeyboardManager.KeyboardProviders
.Select(k => k.Name));
collection.Insert(0, "None");
return collection;
}
}
public string SelectedKeyboardProvider
{
@ -52,7 +61,8 @@ namespace Artemis.ViewModels.Flyouts
return;
MainManager.KeyboardManager.ChangeKeyboard(
MainManager.KeyboardManager.KeyboardProviders.First(k => k.Name == _selectedKeyboardProvider));
MainManager.KeyboardManager.KeyboardProviders.FirstOrDefault(
k => k.Name == _selectedKeyboardProvider));
}
}
@ -68,6 +78,23 @@ namespace Artemis.ViewModels.Flyouts
}
}
public string ActiveEffectName
{
get { return _activeEffectName; }
set
{
if (value == _activeEffectName) return;
_activeEffectName = value;
NotifyOfPropertyChange(() => ActiveEffectName);
}
}
public void Handle(ActiveEffectChanged message)
{
var effectDisplay = message.ActiveEffect.Length > 0 ? message.ActiveEffect : "none";
ActiveEffectName = $"Active effect: {effectDisplay}";
}
public void Handle(ToggleEnabled message)
{
NotifyOfPropertyChange(() => Enabled);
@ -99,7 +126,9 @@ namespace Artemis.ViewModels.Flyouts
protected override void HandleOpen()
{
SelectedKeyboardProvider = MainManager.KeyboardManager.ActiveKeyboard?.Name;
SelectedKeyboardProvider = General.Default.LastKeyboard.Length > 0
? General.Default.LastKeyboard
: "None";
}
}
}

View File

@ -1,7 +1,6 @@
using System;
using System.Linq;
using System.Windows;
using System.Linq;
using Artemis.Managers;
using Artemis.Services;
using Artemis.ViewModels.Flyouts;
using Caliburn.Micro;
@ -16,8 +15,10 @@ namespace Artemis.ViewModels
public ShellViewModel()
{
var dialogService = new MetroDialogService(this);
IEventAggregator events = new EventAggregator();
MainManager = new MainManager(events);
MainManager = new MainManager(events, dialogService);
DisplayName = "Artemis";
_welcomeVm = new WelcomeViewModel {DisplayName = "Welcome"};
@ -49,5 +50,10 @@ namespace Artemis.ViewModels
{
Flyouts.First().IsOpen = !Flyouts.First().IsOpen;
}
public void CloseSettings()
{
Flyouts.First().IsOpen = false;
}
}
}

View File

@ -1,13 +1,10 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows;
using Artemis.Events;
using Artemis.Properties;
using Artemis.Settings;
using Artemis.Utilities;
using Caliburn.Micro;
using Newtonsoft.Json.Linq;
using Application = System.Windows.Application;
using Screen = Caliburn.Micro.Screen;
namespace Artemis.ViewModels
{
@ -16,17 +13,10 @@ namespace Artemis.ViewModels
private readonly ShellViewModel _shellViewModel;
private readonly IWindowManager _windowManager;
private string _activeIcon;
private bool _checkedForUpdate;
private bool _enabled;
private string _toggleText;
/*
* NOTE: In this sample the system tray view-model doesn't receive any notification
* when the other window gets closed by pressing the top right 'x'.
* Thus no property notification is invoked, and system tray context-menu appears
* out of sync, still allowing 'Hide' and disabling 'Show'.
* Given the purpose of the sample - integrating Caliburn.Micro with WPF NotifyIcon -
* syncing the two view-models is not of interest here.
* */
public SystemTrayViewModel(IWindowManager windowManager, ShellViewModel shellViewModel)
{
@ -35,8 +25,10 @@ namespace Artemis.ViewModels
_shellViewModel.MainManager.Events.Subscribe(this);
_shellViewModel.MainManager.EnableProgram();
_checkedForUpdate = false;
//ActiveIcon = "../logo.ico";
// TODO: Check if show on startup is enabled, if so, show window.
if (General.Default.ShowOnStartup)
ShowWindow();
}
public bool CanShowWindow => !_shellViewModel.IsActive;
@ -52,10 +44,21 @@ namespace Artemis.ViewModels
_enabled = value;
ToggleText = _enabled ? "Disable Artemis" : "Enable Artemis";
ActiveIcon = _enabled ? "../Resources/logo.ico" : "../Resources/logo-disabled.ico";
NotifyOfPropertyChange(() => Enabled);
}
}
public string ActiveIcon
{
get { return _activeIcon; }
set
{
_activeIcon = value;
NotifyOfPropertyChange();
}
}
public string ToggleText
{
get { return _toggleText; }
@ -93,18 +96,17 @@ namespace Artemis.ViewModels
if (!CanShowWindow)
return;
if (!_checkedForUpdate)
{
_checkedForUpdate = true;
var updateTask = new Task(Updater.CheckForUpdate);
updateTask.Start();
}
// manually show the next window view-model
_windowManager.ShowWindow(_shellViewModel);
NotifyOfPropertyChange(() => CanShowWindow);
NotifyOfPropertyChange(() => CanHideWindow);
if (_checkedForUpdate)
return;
_checkedForUpdate = true;
Updater.CheckForUpdate(_shellViewModel.MainManager.DialogService);
}

View File

@ -6,7 +6,7 @@
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:cal="http://www.caliburnproject.org"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
d:DesignHeight="600" d:DesignWidth="300"
Width="300">
<UserControl.Resources>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
@ -24,6 +24,8 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
@ -32,7 +34,7 @@
Content="Enable Artemis:" />
<controls:ToggleSwitch Grid.Row="0" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125"
IsChecked="{Binding Path=Enabled, Mode=TwoWay}"/>
IsChecked="{Binding Path=Enabled, Mode=TwoWay}" />
<!-- Startup with Windows -->
<Label Grid.Row="1" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
@ -41,38 +43,52 @@
IsChecked="{Binding Path=GeneralSettings.Autorun, Mode=TwoWay}"
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125" />
<!-- Keyboard selection -->
<!-- Show on startup -->
<Label Grid.Row="2" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
Content="Show on startup:" />
<controls:ToggleSwitch Grid.Row="2" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
IsChecked="{Binding Path=GeneralSettings.ShowOnStartup, Mode=TwoWay}"
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125" />
<!-- Keyboard selection -->
<Label Grid.Row="3" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
Content="Keyboard:" />
<ComboBox Grid.Row="2" Grid.Column="1" x:Name="KeyboardProviders" Margin="10" VerticalAlignment="Center"
<ComboBox Grid.Row="3" Grid.Column="1" x:Name="KeyboardProviders" Margin="10" VerticalAlignment="Center"
HorizontalAlignment="Right"
Width="140" />
<!-- TODO: Ugly -->
<!-- Gamestate port -->
<Label Grid.Row="3" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
<Label Grid.Row="4" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
Content="Gamestate server port:" />
<controls:NumericUpDown Grid.Row="3" Grid.Column="1" Margin="10" VerticalAlignment="Center"
<controls:NumericUpDown Grid.Row="4" Grid.Column="1" Margin="10" VerticalAlignment="Center"
HorizontalAlignment="Right" Width="120"
Value="{Binding Path=GeneralSettings.GamestatePort, Mode=TwoWay}" />
<!-- Updates check -->
<Label Grid.Row="5" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
Content="Check for updates:" />
<controls:ToggleSwitch Grid.Row="5" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125"
IsChecked="{Binding Path=GeneralSettings.CheckForUpdates, Mode=TwoWay}" />
<!-- Update pointers -->
<Label Grid.Row="4" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
<Label Grid.Row="6" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
Content="Download pointers:" />
<controls:ToggleSwitch Grid.Row="4" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
<controls:ToggleSwitch Grid.Row="6" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125"
IsChecked="{Binding Path=GeneralSettings.EnablePointersUpdate, Mode=TwoWay}" />
<!-- Buttons -->
<Button Grid.Row="5" Grid.Column="0" Margin="10" x:Name="ResetSettings" Content="Reset settings"
<Button Grid.Row="7" Grid.Column="0" Margin="10" x:Name="ResetSettings" Content="Reset settings"
VerticalAlignment="Center" HorizontalAlignment="Left" Width="120"
Style="{DynamicResource SquareButtonStyle}" />
<Button Grid.Row="5" Grid.Column="1" Margin="10" x:Name="SaveSettings" Content="Save changes"
<Button Grid.Row="7" Grid.Column="1" Margin="10" x:Name="SaveSettings" Content="Save changes"
VerticalAlignment="Center" HorizontalAlignment="Right" Width="120"
Style="{DynamicResource SquareButtonStyle}" />
<!-- Version -->
<Grid Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Margin="10" VerticalAlignment="Bottom">
<Grid Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" Margin="10" VerticalAlignment="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
@ -81,11 +97,14 @@
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Artemis 1.0.1" VerticalAlignment="Center"
<TextBlock Grid.Row="0" Grid.ColumnSpan="2" x:Name="ActiveEffectName" />
<TextBlock Grid.Row="1" Grid.Column="0" Text="Artemis 1.0.2" VerticalAlignment="Center"
HorizontalAlignment="Left" />
<Button Grid.Row="0" Grid.Column="1" Focusable="False" Style="{StaticResource AccentedSquareButtonStyle}"
<Button Grid.Row="1" Grid.Column="1" Focusable="False"
Style="{StaticResource AccentedSquareButtonStyle}"
cal:Message.Attach="[Action NavigateTo('https://github.com/SpoinkyNL/Artemis')]"
Content="View on GitHub" Margin="5,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Right" />
Content="View on GitHub" Margin="5,0,0,0" VerticalAlignment="Center"
HorizontalAlignment="Right" />
</Grid>
</Grid>
</UserControl>

View File

@ -5,10 +5,12 @@
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"
dialogs:DialogParticipation.Register="{Binding RelativeSource={RelativeSource Self}, Path=DataContext}"
mc:Ignorable="d"
Title="Artemis" Height="670" Width="690"
MinWidth="500" MinHeight="400"
GlowBrush="{DynamicResource AccentColorBrush}" Icon="/Artemis;component/logo.ico">
GlowBrush="{DynamicResource AccentColorBrush}" Icon="../logo.ico">
<!-- Bit of extra code to use a different icon than in the taskbar -->
<Controls:MetroWindow.IconTemplate>
<DataTemplate>
@ -62,7 +64,7 @@
<ResourceDictionary
Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
</Grid.Resources>
<TabControl Margin="0,10,10,10" TabStripPlacement="Left" x:Name="Items">
<TabControl Margin="0,10,10,10" TabStripPlacement="Left" x:Name="Items" cal:Message.Attach="[Event GotFocus] = [Action CloseSettings]">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding DisplayName}" />

View File

@ -24,7 +24,7 @@
<!-- the application main system tray icon -->
<tb:TaskbarIcon x:Key="SystemTrayIcon"
IconSource="../logo.ico"
IconSource="{Binding Path=ActiveIcon, Mode=OneWay}"
ToolTipText="Artemis"
cal:Message.Attach="[Event TrayMouseDoubleClick] = [Action ShowWindow]"
ContextMenu="{StaticResource MainSysTrayMenu}" />

View File

@ -28,8 +28,8 @@
</Label>
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
TextWrapping="Wrap" HorizontalAlignment="Left"
MaxWidth="520" TextAlignment="Justify">
TextWrapping="Wrap" HorizontalAlignment="Left"
MaxWidth="520" TextAlignment="Justify">
Hello, <LineBreak /><LineBreak />
Thanks a bunch for downloading this application. You're going to enjoy this! :)<LineBreak />
<LineBreak />

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Select a Product Configuration -->
<InstallShieldProductConfiguration>Express</InstallShieldProductConfiguration>
<!-- Select a Visual Studio Configuration / InstallShield Release -->
<Configuration>Debug</Configuration>
<InstallShieldRelease>$(Configuration)</InstallShieldRelease>
</PropertyGroup>
<ItemGroup>
<!-- The InstallShieldProject item selects the project to build -->
<InstallShieldProject Include="$(MSBuildProjectDirectory)\$(MSBuildProjectName).isl"/>
<!-- The InstallShieldReleaseFlags sets Release Flags -->
<!--<InstallShieldReleaseFlags Include=""/>-->
<!-- The InstallShieldMergeModulePath specifies what directories are
searched for Merge Modules -->
<!--<InstallShieldMergeModulePath Include=""/>-->
</ItemGroup>
<ItemGroup>
<!-- The ProjectReference items refer to any Visual Studio solutions you want to automatically probe for Project Output Groups. -->
</ItemGroup>
<ItemGroup>
<!-- The TaggedOutputs items allow you to explicitly add extra files to output groups. Each item must include both Name and OutputGroup, as well as TargetPath metadata values. -->
<!--<TaggedOutputs Include="C:\My Test Exe.exe">
<Name>My Test Project</Name>
<OutputGroup>Primary output</OutputGroup>
<TargetPath>My Test Exe.exe</TargetPath>
</TaggedOutputs> -->
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\InstallShield\2015Limited\InstallShield.targets"/>
</Project>