diff --git a/Artemis/Artemis/Artemis.csproj b/Artemis/Artemis/Artemis.csproj
index 12aa1c42e..5592755fb 100644
--- a/Artemis/Artemis/Artemis.csproj
+++ b/Artemis/Artemis/Artemis.csproj
@@ -232,6 +232,7 @@
True
+
True
True
diff --git a/Artemis/Artemis/Models/EffectModel.cs b/Artemis/Artemis/Models/EffectModel.cs
index 27a1fac9b..72679de3e 100644
--- a/Artemis/Artemis/Models/EffectModel.cs
+++ b/Artemis/Artemis/Models/EffectModel.cs
@@ -5,6 +5,8 @@ namespace Artemis.Models
{
public abstract class EffectModel : IDisposable
{
+ public delegate void SettingsUpdateHandler(EffectSettings settings);
+
public MainModel MainModel;
public string Name;
@@ -13,6 +15,8 @@ namespace Artemis.Models
MainModel = mainModel;
}
+ public event SettingsUpdateHandler SettingsUpdateEvent;
+
public abstract void Dispose();
// Called on creation
diff --git a/Artemis/Artemis/Models/GameModel.cs b/Artemis/Artemis/Models/GameModel.cs
index 8a30ac30f..b1addf204 100644
--- a/Artemis/Artemis/Models/GameModel.cs
+++ b/Artemis/Artemis/Models/GameModel.cs
@@ -2,7 +2,7 @@
{
public abstract class GameModel : EffectModel
{
- public abstract bool Enabled();
+ public bool Enabled;
public string ProcessName;
protected GameModel(MainModel mainModel) : base(mainModel)
diff --git a/Artemis/Artemis/Models/MainModel.cs b/Artemis/Artemis/Models/MainModel.cs
index 82a2b0417..63fc3f3fa 100644
--- a/Artemis/Artemis/Models/MainModel.cs
+++ b/Artemis/Artemis/Models/MainModel.cs
@@ -111,7 +111,7 @@ namespace Artemis.Models
// Game models are only used if they are enabled
var gameModel = effectModel as GameModel;
if (gameModel != null)
- if (!gameModel.Enabled())
+ if (!gameModel.Enabled)
return;
if (ActiveEffect != null && effectModel.Name == ActiveEffect.Name)
@@ -204,8 +204,15 @@ namespace Artemis.Models
if (process.HasExited)
continue;
- ChangeEffect(effectModel);
- foundProcess = true;
+ // If the active effect is a disabled game model, disable it
+ var model = ActiveEffect as GameModel;
+ if (model != null && !model.Enabled)
+ LoadLastEffect();
+ else
+ {
+ ChangeEffect(effectModel);
+ foundProcess = true;
+ }
}
// If no game process is found, but the active effect still belongs to a game,
diff --git a/Artemis/Artemis/Models/OverlayModel.cs b/Artemis/Artemis/Models/OverlayModel.cs
index bd0646fa4..11988a1f1 100644
--- a/Artemis/Artemis/Models/OverlayModel.cs
+++ b/Artemis/Artemis/Models/OverlayModel.cs
@@ -11,6 +11,7 @@ namespace Artemis.Models
{
}
+ // Overlay Enabled() and Dispose() is called when changing the Enabled value
public bool Enabled
{
get { return _enabled; }
diff --git a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
index 6f20c63ba..d7cef57e7 100644
--- a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
+++ b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
@@ -14,16 +14,17 @@ namespace Artemis.Modules.Games.CounterStrike
{
public class CounterStrikeModel : GameModel
{
- private readonly CounterStrikeSettings _settings;
-
public CounterStrikeModel(MainModel mainModel, CounterStrikeSettings settings) : base(mainModel)
{
- _settings = settings;
+ Settings = settings;
Name = "CounterStrike";
ProcessName = "csgo";
Scale = 4;
+ Enabled = Settings.Enabled;
}
+ public CounterStrikeSettings Settings { get; set; }
+
public KeyboardRectangle EventRect { get; set; }
public KeyboardRectangle TeamRect { get; set; }
public KeyboardRectangle AmmoRect { get; set; }
@@ -34,11 +35,6 @@ namespace Artemis.Modules.Games.CounterStrike
public int Scale { get; set; }
- public override bool Enabled()
- {
- return _settings.Enabled;
- }
-
public override void Dispose()
{
MainModel.GameStateWebServer.GameDataReceived -= HandleGameData;
@@ -50,9 +46,9 @@ namespace Artemis.Modules.Games.CounterStrike
AmmoRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, 0, new List(),
LinearGradientMode.Horizontal) {Height = Scale, ContainedBrush = false};
TeamRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, 1, new List(),
- LinearGradientMode.Horizontal) {Height = (MainModel.ActiveKeyboard.Height*Scale) - Scale};
+ LinearGradientMode.Horizontal) {Height = MainModel.ActiveKeyboard.Height*Scale - Scale};
EventRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, 1, new List(),
- LinearGradientMode.Horizontal) {Height = (MainModel.ActiveKeyboard.Height*Scale) - Scale};
+ LinearGradientMode.Horizontal) {Height = MainModel.ActiveKeyboard.Height*Scale - Scale};
MainModel.GameStateWebServer.GameDataReceived += HandleGameData;
}
@@ -61,15 +57,15 @@ namespace Artemis.Modules.Games.CounterStrike
if (CsJson == null)
return;
- if (_settings.AmmoEnabled)
+ if (Settings.AmmoEnabled)
UpdateAmmo();
- if (_settings.TeamColorEnabled)
+ if (Settings.TeamColorEnabled)
UpdateTeam();
- if (_settings.LowHpEnabled)
+ if (Settings.LowHpEnabled)
UpdateHealth();
- if (_settings.FlashEnabled)
+ if (Settings.FlashEnabled)
UpdateFlash();
- if (_settings.SmokeEnabled)
+ if (Settings.SmokeEnabled)
UpdateSmoke();
}
@@ -82,7 +78,7 @@ namespace Artemis.Modules.Games.CounterStrike
if (health > 25 || health < 1)
return;
- TeamRect.Colors = new List {Color.Red, Color.OrangeRed, Color.Red, Color.OrangeRed };
+ TeamRect.Colors = new List {Color.Red, Color.OrangeRed, Color.Red, Color.OrangeRed};
}
private void UpdateSmoke()
@@ -93,9 +89,9 @@ namespace Artemis.Modules.Games.CounterStrike
var smoked = CsJson["player"]["state"]["smoked"].Value();
if (smoked == 0 && !DrawingSmoke)
return;
-
+
EventRect.Colors = new List {Color.FromArgb(smoked, 255, 255, 255)};
- DrawingSmoke = (smoked != 0);
+ DrawingSmoke = smoked != 0;
}
private void UpdateFlash()
@@ -108,7 +104,7 @@ namespace Artemis.Modules.Games.CounterStrike
return;
EventRect.Colors = new List {Color.FromArgb(flashed, 255, 255, 255)};
- DrawingFlash = (flashed != 0);
+ DrawingFlash = flashed != 0;
}
private void UpdateTeam()
@@ -150,11 +146,11 @@ namespace Artemis.Modules.Games.CounterStrike
return;
var ammoPercentage = (int) Math.Ceiling(100.00/maxAmmo)*ammo;
- AmmoRect.Width = ((int) Math.Floor((16/100.00)*ammoPercentage))*Scale;
+ AmmoRect.Width = (int) Math.Floor(16/100.00*ammoPercentage)*Scale;
AmmoRect.Colors = new List
{
- ColorHelpers.ToDrawingColor(_settings.AmmoMainColor),
- ColorHelpers.ToDrawingColor(_settings.AmmoSecondaryColor)
+ ColorHelpers.ToDrawingColor(Settings.AmmoMainColor),
+ ColorHelpers.ToDrawingColor(Settings.AmmoSecondaryColor)
};
// Low ammo indicator
diff --git a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeSettings.cs b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeSettings.cs
index 75be4ac51..d29f47922 100644
--- a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeSettings.cs
+++ b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeSettings.cs
@@ -22,7 +22,7 @@ namespace Artemis.Modules.Games.CounterStrike
public bool SmokeEnabled { get; set; }
public bool LowHpEnabled { get; set; }
- public override sealed void Load()
+ public sealed override void Load()
{
Enabled = CounterStrike.Default.Enabled;
GameDirectory = CounterStrike.Default.GameDirectory;
@@ -37,7 +37,7 @@ namespace Artemis.Modules.Games.CounterStrike
LowHpEnabled = CounterStrike.Default.LowHpEnabled;
}
- public override sealed void Save()
+ public sealed override void Save()
{
CounterStrike.Default.Enabled = Enabled;
CounterStrike.Default.GameDirectory = GameDirectory;
@@ -54,7 +54,7 @@ namespace Artemis.Modules.Games.CounterStrike
CounterStrike.Default.Save();
}
- public override sealed void ToDefault()
+ public sealed override void ToDefault()
{
Enabled = true;
GameDirectory = string.Empty;
diff --git a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeView.xaml b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeView.xaml
index 937022705..724ebe87a 100644
--- a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeView.xaml
+++ b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeView.xaml
@@ -11,7 +11,7 @@
-
+
@@ -37,7 +37,9 @@
+ IsChecked="{Binding Path=CounterStrikeSettings.Enabled, Mode=TwoWay}"
+ Style="{DynamicResource MetroCircleToggleButtonStyle}"
+ cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
diff --git a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeViewModel.cs b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeViewModel.cs
index 6f5bcd90b..8ce25fd99 100644
--- a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeViewModel.cs
+++ b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeViewModel.cs
@@ -41,6 +41,25 @@ namespace Artemis.Modules.Games.CounterStrike
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};
@@ -70,19 +89,5 @@ namespace Artemis.Modules.Games.CounterStrike
CounterStrikeSettings.GameDirectory = string.Empty;
NotifyOfPropertyChange(() => CounterStrikeSettings);
}
-
- public void SaveSettings()
- {
- CounterStrikeSettings?.Save();
- }
-
- public void ResetSettings()
- {
- // TODO: Confirmation dialog (Generic MVVM approach)
- CounterStrikeSettings.ToDefault();
- NotifyOfPropertyChange(() => CounterStrikeSettings);
-
- SaveSettings();
- }
}
}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeague.settings b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeague.settings
index 58f5de73e..44ad08314 100644
--- a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeague.settings
+++ b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeague.settings
@@ -1,5 +1,7 @@
-
+
+
diff --git a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueModel.cs b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueModel.cs
index 8d19978cb..3fe1ae557 100644
--- a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueModel.cs
+++ b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueModel.cs
@@ -16,7 +16,6 @@ namespace Artemis.Modules.Games.RocketLeague
{
public class RocketLeagueModel : GameModel
{
- private readonly RocketLeagueSettings _settings;
private int _boostAmount;
private bool _boostGrowing;
private KeyboardRectangle _boostRect;
@@ -26,17 +25,14 @@ namespace Artemis.Modules.Games.RocketLeague
public RocketLeagueModel(MainModel mainModel, RocketLeagueSettings settings) : base(mainModel)
{
+ Settings = settings;
Name = "RocketLeague";
ProcessName = "RocketLeague";
Scale = 4;
-
- _settings = settings;
+ Enabled = Settings.Enabled;
}
- public override bool Enabled()
- {
- return _settings.Enabled;
- }
+ public RocketLeagueSettings Settings { get; set; }
public int Scale { get; set; }
@@ -49,8 +45,8 @@ namespace Artemis.Modules.Games.RocketLeague
{
_boostRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, 0, new List
{
- ColorHelpers.ToDrawingColor(_settings.MainColor),
- ColorHelpers.ToDrawingColor(_settings.SecondaryColor)
+ ColorHelpers.ToDrawingColor(Settings.MainColor),
+ ColorHelpers.ToDrawingColor(Settings.SecondaryColor)
}, LinearGradientMode.Horizontal);
MemoryHelpers.GetPointers();
@@ -80,11 +76,11 @@ namespace Artemis.Modules.Games.RocketLeague
if (_boostAmount > 100)
_boostAmount = 100;
- _boostRect.Width = (int) Math.Ceiling(((MainModel.ActiveKeyboard.Width*Scale)/100.00)*_boostAmount);
+ _boostRect.Width = (int) Math.Ceiling(MainModel.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
_boostRect.Colors = new List
{
- ColorHelpers.ToDrawingColor(_settings.MainColor),
- ColorHelpers.ToDrawingColor(_settings.SecondaryColor)
+ ColorHelpers.ToDrawingColor(Settings.MainColor),
+ ColorHelpers.ToDrawingColor(Settings.SecondaryColor)
};
Task.Run(() => GrowIfHigher());
@@ -102,7 +98,7 @@ namespace Artemis.Modules.Games.RocketLeague
var differenceStep = difference/amountOfSteps;
var differenceStepRest = difference%amountOfSteps;
_boostAmount = _previousBoost;
- _boostRect.Width = (int) Math.Ceiling(((MainModel.ActiveKeyboard.Width*Scale)/100.00)*_boostAmount);
+ _boostRect.Width = (int) Math.Ceiling(MainModel.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
for (var i = 0; i < amountOfSteps; i++)
{
@@ -110,10 +106,10 @@ namespace Artemis.Modules.Games.RocketLeague
{
differenceStepRest -= 1;
_boostAmount += 1;
- _boostRect.Width = (int) Math.Ceiling(((MainModel.ActiveKeyboard.Width*Scale)/100.00)*_boostAmount);
+ _boostRect.Width = (int) Math.Ceiling(MainModel.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
}
_boostAmount += differenceStep;
- _boostRect.Width = (int) Math.Ceiling(((MainModel.ActiveKeyboard.Width*Scale)/100.00)*_boostAmount);
+ _boostRect.Width = (int) Math.Ceiling(MainModel.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
Thread.Sleep(50);
}
diff --git a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueSettings.cs b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueSettings.cs
index 34de983a6..2947b8ae5 100644
--- a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueSettings.cs
+++ b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueSettings.cs
@@ -14,14 +14,14 @@ namespace Artemis.Modules.Games.RocketLeague
public Color MainColor { get; set; }
public Color SecondaryColor { get; set; }
- public override sealed void Load()
+ public sealed override void Load()
{
Enabled = RocketLeague.Default.Enabled;
MainColor = RocketLeague.Default.MainColor;
SecondaryColor = RocketLeague.Default.SecondaryColor;
}
- public override sealed void Save()
+ public sealed override void Save()
{
RocketLeague.Default.Enabled = Enabled;
RocketLeague.Default.MainColor = MainColor;
@@ -30,7 +30,7 @@ namespace Artemis.Modules.Games.RocketLeague
RocketLeague.Default.Save();
}
- public override sealed void ToDefault()
+ public sealed override void ToDefault()
{
Enabled = true;
MainColor = Color.FromArgb(255, 255, 80, 0);
diff --git a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueView.xaml b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueView.xaml
index dea114a08..de8718bc1 100644
--- a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueView.xaml
+++ b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueView.xaml
@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
+ xmlns:cal="http://www.caliburnproject.org"
mc:Ignorable="d"
d:DesignHeight="476.986" d:DesignWidth="538.772">
@@ -31,7 +32,9 @@
+ IsChecked="{Binding Path=RocketLeagueSettings.Enabled, Mode=TwoWay}"
+ Style="{DynamicResource MetroCircleToggleButtonStyle}"
+ cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
diff --git a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs
index 99035e2f5..9aaaf2c4a 100644
--- a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs
+++ b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs
@@ -51,5 +51,10 @@ namespace Artemis.Modules.Games.RocketLeague
SaveSettings();
}
+
+ public void ToggleEffect()
+ {
+ RocketLeagueModel.Enabled = _rocketLeagueSettings.Enabled;
+ }
}
}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Witcher3/RocketLeagueSettings.cs b/Artemis/Artemis/Modules/Games/Witcher3/RocketLeagueSettings.cs
new file mode 100644
index 000000000..88c560f5f
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/Witcher3/RocketLeagueSettings.cs
@@ -0,0 +1,31 @@
+using Artemis.Models;
+
+namespace Artemis.Modules.Games.Witcher3
+{
+ public class Witcher3Settings : EffectSettings
+ {
+ public Witcher3Settings()
+ {
+ Load();
+ }
+
+ public bool Enabled { get; set; }
+
+ public sealed override void Load()
+ {
+ Enabled = Witcher3.Default.Enabled;
+ }
+
+ public sealed override void Save()
+ {
+ Witcher3.Default.Enabled = Enabled;
+
+ Witcher3.Default.Save();
+ }
+
+ public sealed override void ToDefault()
+ {
+ Enabled = true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3Model.cs b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3Model.cs
index 74a6d2e97..ff23fd6b8 100644
--- a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3Model.cs
+++ b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3Model.cs
@@ -6,7 +6,6 @@ using System.Drawing.Drawing2D;
using System.IO;
using System.Text.RegularExpressions;
using Artemis.Models;
-using Artemis.Modules.Games.RocketLeague;
using Artemis.Utilities.Keyboard;
namespace Artemis.Modules.Games.Witcher3
@@ -18,22 +17,21 @@ namespace Artemis.Modules.Games.Witcher3
private KeyboardRectangle _signRect;
private string _witcherSettings;
- public Witcher3Model(MainModel mainModel, RocketLeagueSettings settings) : base(mainModel)
+ public Witcher3Model(MainModel mainModel, Witcher3Settings settings) : base(mainModel)
{
+ Settings = settings;
Name = "Witcher3";
ProcessName = "witcher3";
Scale = 4;
+ Enabled = Settings.Enabled;
_updateSw = new Stopwatch();
_signRegex = new Regex("ActiveSign=(.*)", RegexOptions.Compiled);
}
- public int Scale { get; set; }
+ public Witcher3Settings Settings { get; set; }
- public override bool Enabled()
- {
- return true; // TODO
- }
+ public int Scale { get; set; }
public override void Dispose()
{
diff --git a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml
index cdc90c8a4..3321b1567 100644
--- a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml
+++ b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml
@@ -3,19 +3,21 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
mc:Ignorable="d"
d:DesignHeight="386.842" d:DesignWidth="554.887">
-
+
+
+ Style="{DynamicResource SquareButtonStyle}" HorizontalAlignment="Left" Margin="0,20,0,0" />
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs
index 0da201790..adde2f453 100644
--- a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs
+++ b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs
@@ -2,24 +2,24 @@
using System.Linq;
using System.Windows.Forms;
using Artemis.Models;
-using Artemis.Modules.Games.RocketLeague;
+using Artemis.Properties;
using Screen = Caliburn.Micro.Screen;
namespace Artemis.Modules.Games.Witcher3
{
public class Witcher3ViewModel : Screen
{
- private RocketLeagueSettings _rocketLeagueSettings;
+ private Witcher3Settings _witcher3Settings;
public Witcher3ViewModel(MainModel mainModel)
{
MainModel = mainModel;
// Settings are loaded from file by class
- RocketLeagueSettings = new RocketLeagueSettings();
+ Witcher3Settings = new Witcher3Settings();
// Create effect model and add it to MainModel
- Witcher3Model = new Witcher3Model(mainModel, RocketLeagueSettings);
+ Witcher3Model = new Witcher3Model(mainModel, Witcher3Settings);
MainModel.EffectModels.Add(Witcher3Model);
}
@@ -28,14 +28,14 @@ namespace Artemis.Modules.Games.Witcher3
public MainModel MainModel { get; set; }
public Witcher3Model Witcher3Model { get; set; }
- public RocketLeagueSettings RocketLeagueSettings
+ public Witcher3Settings Witcher3Settings
{
- get { return _rocketLeagueSettings; }
+ get { return _witcher3Settings; }
set
{
- if (Equals(value, _rocketLeagueSettings)) return;
- _rocketLeagueSettings = value;
- NotifyOfPropertyChange(() => RocketLeagueSettings);
+ if (Equals(value, _witcher3Settings)) return;
+ _witcher3Settings = value;
+ NotifyOfPropertyChange(() => Witcher3Settings);
}
}
@@ -44,18 +44,23 @@ namespace Artemis.Modules.Games.Witcher3
if (Witcher3Model == null)
return;
- RocketLeagueSettings.Save();
+ Witcher3Settings.Save();
}
public void ResetSettings()
{
// TODO: Confirmation dialog (Generic MVVM approach)
- RocketLeagueSettings.ToDefault();
- NotifyOfPropertyChange(() => RocketLeagueSettings);
+ Witcher3Settings.ToDefault();
+ NotifyOfPropertyChange(() => Witcher3Settings);
SaveSettings();
}
+ public void ToggleEffect()
+ {
+ Witcher3Model.Enabled = _witcher3Settings.Enabled;
+ }
+
public void AutoInstall()
{
// Request The Witcher 3 folder
@@ -93,8 +98,9 @@ namespace Artemis.Modules.Games.Witcher3
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");
+ "Conflicting file: " + file.Remove(0, dialog.SelectedPath.Length) +
+ "\n\nOnce you press OK you will be taken to an instructions page.",
+ "Conflicting mod found");
return;
}
}
@@ -107,8 +113,10 @@ namespace Artemis.Modules.Games.Witcher3
Directory.CreateDirectory(dialog.SelectedPath + @"\bin\config\r4game\user_config_matrix\pc");
// Install the mod files
- File.WriteAllText(dialog.SelectedPath + @"\bin\config\r4game\user_config_matrix\pc\artemis.xml", Properties.Resources.artemis);
- File.WriteAllText(dialog.SelectedPath + @"\mods\modArtemis\content\scripts\game\player\playerWitcher.ws", Properties.Resources.playerWitcher);
+ File.WriteAllText(dialog.SelectedPath + @"\bin\config\r4game\user_config_matrix\pc\artemis.xml",
+ Resources.artemis);
+ File.WriteAllText(dialog.SelectedPath + @"\mods\modArtemis\content\scripts\game\player\playerWitcher.ws",
+ Resources.playerWitcher);
MessageBox.Show("The mod was successfully installed!", "Success");
}
diff --git a/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplay.cs b/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplay.cs
index 63ec78619..95b38b865 100644
--- a/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplay.cs
+++ b/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplay.cs
@@ -37,7 +37,7 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
},
LinearGradientMode.Horizontal)
{
- Width = (int) ((MainModel.ActiveKeyboard.Width/100.00)*Volume)*Scale,
+ Width = (int) ((MainModel.ActiveKeyboard.Width * Scale / 100.00)*Volume),
ContainedBrush = false
};
volumeRect.Draw(g);
diff --git a/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayModel.cs b/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayModel.cs
index b5b0925e2..22e7fc49e 100644
--- a/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayModel.cs
+++ b/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayModel.cs
@@ -10,8 +10,6 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
{
public class VolumeDisplayModel : OverlayModel
{
- private IKeyboardMouseEvents _mGlobalHook;
-
public VolumeDisplayModel(MainModel mainModel, VolumeDisplaySettings settings) : base(mainModel)
{
Settings = settings;
diff --git a/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayView.xaml b/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayView.xaml
index e5665ca12..c9f3d2af7 100644
--- a/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayView.xaml
+++ b/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayView.xaml
@@ -30,6 +30,7 @@
diff --git a/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayViewModel.cs b/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayViewModel.cs
index a1f0da0d3..5eb11307b 100644
--- a/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayViewModel.cs
+++ b/Artemis/Artemis/Modules/Overlays/VolumeDisplay/VolumeDisplayViewModel.cs
@@ -37,7 +37,7 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
public void ToggleEffect()
{
- VolumeDisplayModel.Enabled = VolumeDisplaySettings.Enabled;
+ VolumeDisplayModel.Enabled = _volumeDisplaySettings.Enabled;
}
public void SaveSettings()