diff --git a/Artemis/Artemis/App.config b/Artemis/Artemis/App.config
index ed8213822..a0f02cd68 100644
--- a/Artemis/Artemis/App.config
+++ b/Artemis/Artemis/App.config
@@ -45,9 +45,6 @@
True
-
- True
-
True
@@ -60,6 +57,15 @@
#FF0000FF
+
+ Default
+
+
+ #FF00FF00
+
+
+ #FF6A5ACD
+
diff --git a/Artemis/Artemis/KeyboardProviders/Corsair/CorsairRGB.cs b/Artemis/Artemis/KeyboardProviders/Corsair/CorsairRGB.cs
index 287e3d310..75926f094 100644
--- a/Artemis/Artemis/KeyboardProviders/Corsair/CorsairRGB.cs
+++ b/Artemis/Artemis/KeyboardProviders/Corsair/CorsairRGB.cs
@@ -74,23 +74,27 @@ namespace Artemis.KeyboardProviders.Corsair
Width = 24;
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(20, 1)));
KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(21, 2), new Point(25, 7)));
+ KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(5, 3), new Point(8, 3)));
break;
case "K70 RGB":
Height = 7;
Width = 21;
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(16, 1)));
KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(17, 2), new Point(21, 7)));
+ KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(2, 3), new Point(5, 3)));
break;
case "K65 RGB":
Height = 7;
Width = 18;
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(16, 1)));
KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(17, 2), new Point(20, 7)));
+ KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(2, 3), new Point(5, 3)));
break;
case "STRAFE RGB":
Height = 7;
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(16, 1)));
KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(17, 2), new Point(21, 7)));
+ KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(2, 3), new Point(5, 3)));
Width = 22;
break;
}
diff --git a/Artemis/Artemis/KeyboardProviders/Logitech/Orion.cs b/Artemis/Artemis/KeyboardProviders/Logitech/Orion.cs
index e6bb0cccc..eaeae906e 100644
--- a/Artemis/Artemis/KeyboardProviders/Logitech/Orion.cs
+++ b/Artemis/Artemis/KeyboardProviders/Logitech/Orion.cs
@@ -23,8 +23,9 @@ namespace Artemis.KeyboardProviders.Logitech
KeyboardRegions = new List
{
new KeyboardRegion("TopRow", new Point(0, 0), new Point(16, 0)),
- new KeyboardRegion("NumPad", new Point(17, 1), new Point(21, 6))
- };
+ new KeyboardRegion("NumPad", new Point(17, 1), new Point(21, 6)),
+ new KeyboardRegion("QWER", new Point(2, 2), new Point(5, 2))
+ };
}
public override bool CanEnable()
diff --git a/Artemis/Artemis/Modules/Games/Dota2/Dota2.Designer.cs b/Artemis/Artemis/Modules/Games/Dota2/Dota2.Designer.cs
index bcd46002b..ae346373b 100644
--- a/Artemis/Artemis/Modules/Games/Dota2/Dota2.Designer.cs
+++ b/Artemis/Artemis/Modules/Games/Dota2/Dota2.Designer.cs
@@ -83,18 +83,6 @@ namespace Artemis.Modules.Games.Dota2 {
}
}
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("True")]
- public bool CanCastItem {
- get {
- return ((bool)(this["CanCastItem"]));
- }
- set {
- this["CanCastItem"] = value;
- }
- }
-
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
@@ -142,5 +130,41 @@ namespace Artemis.Modules.Games.Dota2 {
this["ManaColor"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Default")]
+ public string KeyboardLayout {
+ get {
+ return ((string)(this["KeyboardLayout"]));
+ }
+ set {
+ this["KeyboardLayout"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("#FF00FF00")]
+ public global::System.Windows.Media.Color AbilityReadyColor {
+ get {
+ return ((global::System.Windows.Media.Color)(this["AbilityReadyColor"]));
+ }
+ set {
+ this["AbilityReadyColor"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("#FF6A5ACD")]
+ public global::System.Windows.Media.Color AbilityCooldownColor {
+ get {
+ return ((global::System.Windows.Media.Color)(this["AbilityCooldownColor"]));
+ }
+ set {
+ this["AbilityCooldownColor"] = value;
+ }
+ }
}
}
diff --git a/Artemis/Artemis/Modules/Games/Dota2/Dota2.settings b/Artemis/Artemis/Modules/Games/Dota2/Dota2.settings
index 064cc8115..473a385a3 100644
--- a/Artemis/Artemis/Modules/Games/Dota2/Dota2.settings
+++ b/Artemis/Artemis/Modules/Games/Dota2/Dota2.settings
@@ -17,9 +17,6 @@
True
-
- True
-
True
@@ -32,5 +29,14 @@
#FF0000FF
+
+ Default
+
+
+ #FF00FF00
+
+
+ #FF6A5ACD
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Dota2/Dota2Model.cs b/Artemis/Artemis/Modules/Games/Dota2/Dota2Model.cs
index 020ff945a..d8f3cdeb1 100644
--- a/Artemis/Artemis/Modules/Games/Dota2/Dota2Model.cs
+++ b/Artemis/Artemis/Modules/Games/Dota2/Dota2Model.cs
@@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
+using System.Windows.Forms.VisualStyles;
+using System.Windows.Media;
using Artemis.KeyboardProviders;
using Artemis.Managers;
using Artemis.Models;
@@ -10,13 +12,14 @@ using Artemis.Utilities;
using Artemis.Utilities.GameState;
using Artemis.Utilities.Keyboard;
using Newtonsoft.Json;
+using Color = System.Drawing.Color;
namespace Artemis.Modules.Games.Dota2
{
internal class Dota2Model : GameModel
{
private KeyboardRegion _keyPad;
-
+ private KeyboardRegion _abilityKeys;
private KeyboardRegion _topRow;
public Dota2Model(MainManager mainManager, Dota2Settings settings) : base(mainManager)
@@ -41,6 +44,7 @@ namespace Artemis.Modules.Games.Dota2
Initialized = false;
_topRow = MainManager.KeyboardManager.ActiveKeyboard.KeyboardRegions.First(r => r.RegionName == "TopRow");
_keyPad = MainManager.KeyboardManager.ActiveKeyboard.KeyboardRegions.First(r => r.RegionName == "NumPad");
+ _abilityKeys = MainManager.KeyboardManager.ActiveKeyboard.KeyboardRegions.First(r => r.RegionName == "QWER");
HealthRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard
, 0
, _topRow.BottomRight.Y*Scale
@@ -68,22 +72,103 @@ namespace Artemis.Modules.Games.Dota2
DayCycleRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard
, _keyPad.TopLeft.X*Scale
- , _keyPad.TopLeft.Y*Scale
+ , _keyPad.BottomRight.Y*Scale
, new List()
, LinearGradientMode.Horizontal)
{
Height = _keyPad.GetRectangle().Height*Scale,
Width = _keyPad.GetRectangle().Width*Scale
};
+
+ SetAbilityKeys();
+
MainManager.GameStateWebServer.GameDataReceived += HandleGameData;
Initialized = true;
}
+ private void SetAbilityKeys()
+ {
+ #region Long Switch Statement for Keys
+ switch (Settings.KeyboardLayout)
+ {
+ case "0": //default
+ case "4": //Heroes of newearth
+ case "3": //League of Legends
+ for (int i = 0; i < AbilityKeysRectangles.Length; i++)
+ {
+ AbilityKeysRectangles[i] = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard,
+ (_abilityKeys.TopLeft.X + i) * Scale - 2,
+ _abilityKeys.TopLeft.Y * Scale,
+ new List(),
+ LinearGradientMode.Horizontal)
+ {
+ Height = Scale,
+ Width = Scale
+ };
+ }
+ break;
+ case "2":
+ AbilityKeysRectangles[0] = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard,
+ (_abilityKeys.TopLeft.X * Scale) - 2,
+ _abilityKeys.TopLeft.Y * Scale,
+ new List(),
+ LinearGradientMode.Horizontal)
+ {
+ Height = Scale,
+ Width = Scale
+ };
+ AbilityKeysRectangles[1] = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard,
+ ((_abilityKeys.TopLeft.X + 2) * Scale) - 2,
+ _abilityKeys.TopLeft.Y * Scale,
+ new List(),
+ LinearGradientMode.Horizontal)
+ {
+ Height = Scale,
+ Width = Scale
+ };
+ AbilityKeysRectangles[2] = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard,
+ ((_abilityKeys.TopLeft.X +3) * Scale) - 2,
+ _abilityKeys.TopLeft.Y * Scale,
+ new List(),
+ LinearGradientMode.Horizontal)
+ {
+ Height = Scale,
+ Width = Scale
+ };
+ AbilityKeysRectangles[3] = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard,
+ ((_abilityKeys.TopLeft.X +3)* Scale) - 2,
+ (_abilityKeys.TopLeft.Y +1)* Scale,
+ new List(),
+ LinearGradientMode.Horizontal)
+ {
+ Height = Scale,
+ Width = Scale
+ };
+ break;
+ case "1": //MMO
+ case "5": //Smite
+ for (int i = 0; i < AbilityKeysRectangles.Length; i++)
+ {
+ AbilityKeysRectangles[i] = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard,
+ (_abilityKeys.TopLeft.X + i) * Scale - 3,
+ (_abilityKeys.TopLeft.Y-1) * Scale,
+ new List(),
+ LinearGradientMode.Horizontal)
+ {
+ Height = Scale,
+ Width = Scale
+ };
+ }
+ break;
+
+ }
+ #endregion
+ }
+
public override void Update()
{
if (D2Json == null)
return;
-
if (Settings.ShowDead && D2Json?.hero?.alive != null && !D2Json.hero.alive)
{
UpdateLifeStatus();
@@ -98,8 +183,7 @@ namespace Artemis.Modules.Games.Dota2
UpdateDay();
if (Settings.ShowMana)
UpdateMana();
- if (Settings.CanCastItem)
- UpdateItems();
+
}
private void UpdateMainColor()
@@ -133,7 +217,6 @@ namespace Artemis.Modules.Games.Dota2
var timeLeft = 240 - D2Json.map.clock_time%240;
var timePercentage = 100.00/240*timeLeft;
- var test = _keyPad.GetRectangle().Width;
DayCycleRectangle.Width = (int) (_keyPad.GetRectangle().Width*Scale/100.00*timePercentage);
DayCycleRectangle.Colors = D2Json.map.daytime
? new List {Color.Yellow}
@@ -150,16 +233,19 @@ namespace Artemis.Modules.Games.Dota2
ManaRectangle.Width = (int) Math.Floor(_topRow.GetRectangle().Width*Scale/100.00*manaPercent);
}
- private void UpdateItems()
- {
- //throw new NotImplementedException();
- }
-
private void UpdateAbilities()
{
- //Console.WriteLine();
-
- //Update keys according to the abilities they take.
+ if (AbilityKeysRectangles == null)
+ return;
+
+ AbilityKeysRectangles[0].Colors = D2Json?.abilities?.ability0?.can_cast == true ? new List
+ { ColorHelpers.ToDrawingColor(Settings.AbilityReadyColor) } : new List { ColorHelpers.ToDrawingColor(Settings.AbilityCooldownColor) };
+ AbilityKeysRectangles[1].Colors = D2Json?.abilities?.ability1?.can_cast == true ? new List
+ { ColorHelpers.ToDrawingColor(Settings.AbilityReadyColor) } : new List { ColorHelpers.ToDrawingColor(Settings.AbilityCooldownColor) };
+ AbilityKeysRectangles[2].Colors = D2Json?.abilities?.ability2?.can_cast == true ? new List
+ { ColorHelpers.ToDrawingColor(Settings.AbilityReadyColor) } : new List { ColorHelpers.ToDrawingColor(Settings.AbilityCooldownColor) };
+ AbilityKeysRectangles[3].Colors = D2Json?.abilities?.ability3?.can_cast == true ? new List
+ { ColorHelpers.ToDrawingColor(Settings.AbilityReadyColor) } : new List { ColorHelpers.ToDrawingColor(Settings.AbilityCooldownColor) };
}
@@ -191,6 +277,8 @@ namespace Artemis.Modules.Games.Dota2
HealthRectangle.Draw(g);
ManaRectangle.Draw(g);
DayCycleRectangle.Draw(g);
+ foreach (var key in AbilityKeysRectangles)
+ key.Draw(g);
}
return bitmap;
}
@@ -217,7 +305,8 @@ namespace Artemis.Modules.Games.Dota2
public KeyboardRectangle EventRectangle { get; set; }
public KeyboardRectangle DayCycleRectangle { get; set; }
public KeyboardRectangle ManaRectangle { get; set; }
-
+ public KeyboardRectangle[] AbilityKeysRectangles = new KeyboardRectangle[4];
#endregion
+
}
}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Dota2/Dota2Settings.cs b/Artemis/Artemis/Modules/Games/Dota2/Dota2Settings.cs
index 2332a99dd..2f4990db7 100644
--- a/Artemis/Artemis/Modules/Games/Dota2/Dota2Settings.cs
+++ b/Artemis/Artemis/Modules/Games/Dota2/Dota2Settings.cs
@@ -21,31 +21,36 @@ namespace Artemis.Modules.Games.Dota2
public string GameDirectory { get; set; }
public bool CanCastAbility { get; set; }
public bool ShowHealth { get; set; }
- public bool ShowDayCycle { get; set; }
- public bool CanCastItem { get; set; }
+ public bool ShowDayCycle { get; set; }
public bool ShowMana { get; set; }
public bool ShowDead { get; set; }
public Color MainColor { get; set; }
public Color ManaColor { get; set; }
+ public string KeyboardLayout { get; set; }
+ public Color AbilityCooldownColor { get; set; }
+ public Color AbilityReadyColor { get; set; }
#endregion
public override void Load()
{
+ KeyboardLayout = Dota2.Default.KeyboardLayout;
MainColor = Dota2.Default.MainColor;
ManaColor = Dota2.Default.ManaColor;
ShowHealth = Dota2.Default.ShowHealth;
CanCastAbility = Dota2.Default.CanCastAbility;
Enabled = Dota2.Default.Enabled;
GameDirectory = Dota2.Default.GameDirectory;
- CanCastItem = Dota2.Default.CanCastItem;
ShowDayCycle = Dota2.Default.ShowDayCycle;
ShowMana = Dota2.Default.ShowMana;
ShowDead = Dota2.Default.ShowDead;
+ AbilityReadyColor = Dota2.Default.AbilityReadyColor;
+ AbilityCooldownColor = Dota2.Default.AbilityCooldownColor;
}
public override void Save()
{
+ Dota2.Default.KeyboardLayout = KeyboardLayout;
Dota2.Default.MainColor = MainColor;
Dota2.Default.ManaColor = ManaColor;
Dota2.Default.ShowDayCycle = ShowDayCycle;
@@ -53,9 +58,10 @@ namespace Artemis.Modules.Games.Dota2
Dota2.Default.CanCastAbility = CanCastAbility;
Dota2.Default.Enabled = Enabled;
Dota2.Default.GameDirectory = GameDirectory;
- Dota2.Default.CanCastItem = CanCastItem;
Dota2.Default.ShowMana = ShowMana;
Dota2.Default.ShowDead = ShowDead;
+ Dota2.Default.AbilityCooldownColor = AbilityCooldownColor;
+ Dota2.Default.AbilityReadyColor = AbilityReadyColor;
Dota2.Default.Save();
}
@@ -66,12 +72,14 @@ namespace Artemis.Modules.Games.Dota2
Enabled = true;
GameDirectory = string.Empty;
+ KeyboardLayout = "Default";
MainColor = Color.FromArgb(255,255,0,0);
ManaColor = Color.FromArgb(255,0,0,255);
+ AbilityCooldownColor = Color.FromArgb(255,106,90,205);
+ AbilityReadyColor = Color.FromArgb(255, 0, 255, 0);
ShowHealth = true;
CanCastAbility = true;
ShowDayCycle = true;
- CanCastItem = true;
ShowMana = true;
ShowDead = true;
diff --git a/Artemis/Artemis/Modules/Games/Dota2/Dota2View.xaml b/Artemis/Artemis/Modules/Games/Dota2/Dota2View.xaml
index 5648d2de4..6ed3e5e9d 100644
--- a/Artemis/Artemis/Modules/Games/Dota2/Dota2View.xaml
+++ b/Artemis/Artemis/Modules/Games/Dota2/Dota2View.xaml
@@ -8,7 +8,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="495" d:DesignWidth="635">
-
+
@@ -26,6 +26,8 @@
+
+
@@ -61,84 +63,104 @@
-
-
- Main keyboard color
-
-
-
-
-
- Castable abilities
+
+
+ Main keyboard color
-
+
+
+
+
+ Ability Ready Color
+
+
+
+
+
+ Ability on Cooldown Color
+
+
+
+
+
+ Keyboard Template
+
+
-
- Castable items
+ Castable Abilities
-
-
Display health
-
Display mana
-
-
- Mana color
-
-
+
+ Mana color
+
+
-
Display day/night
-
Display gray when dead
-
+