mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Merge branch 'development' of https://github.com/SpoinkyNL/Artemis.git
This commit is contained in:
commit
73303e72ea
@ -45,9 +45,6 @@
|
|||||||
<setting name="ShowDayCycle" serializeAs="String">
|
<setting name="ShowDayCycle" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="CanCastItem" serializeAs="String">
|
|
||||||
<value>True</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="ShowMana" serializeAs="String">
|
<setting name="ShowMana" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</setting>
|
</setting>
|
||||||
@ -60,6 +57,15 @@
|
|||||||
<setting name="ManaColor" serializeAs="String">
|
<setting name="ManaColor" serializeAs="String">
|
||||||
<value>#FF0000FF</value>
|
<value>#FF0000FF</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="KeyboardLayout" serializeAs="String">
|
||||||
|
<value>Default</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="AbilityReadyColor" serializeAs="String">
|
||||||
|
<value>#FF00FF00</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="AbilityCooldownColor" serializeAs="String">
|
||||||
|
<value>#FF6A5ACD</value>
|
||||||
|
</setting>
|
||||||
</Artemis.Modules.Games.Dota2.Dota2>
|
</Artemis.Modules.Games.Dota2.Dota2>
|
||||||
<Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay>
|
<Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay>
|
||||||
<setting name="Enabled" serializeAs="String">
|
<setting name="Enabled" serializeAs="String">
|
||||||
|
|||||||
@ -74,23 +74,27 @@ namespace Artemis.KeyboardProviders.Corsair
|
|||||||
Width = 24;
|
Width = 24;
|
||||||
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(20, 1)));
|
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("NumPad", new Point(21, 2), new Point(25, 7)));
|
||||||
|
KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(5, 3), new Point(8, 3)));
|
||||||
break;
|
break;
|
||||||
case "K70 RGB":
|
case "K70 RGB":
|
||||||
Height = 7;
|
Height = 7;
|
||||||
Width = 21;
|
Width = 21;
|
||||||
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(16, 1)));
|
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("NumPad", new Point(17, 2), new Point(21, 7)));
|
||||||
|
KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(2, 3), new Point(5, 3)));
|
||||||
break;
|
break;
|
||||||
case "K65 RGB":
|
case "K65 RGB":
|
||||||
Height = 7;
|
Height = 7;
|
||||||
Width = 18;
|
Width = 18;
|
||||||
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(16, 1)));
|
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("NumPad", new Point(17, 2), new Point(20, 7)));
|
||||||
|
KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(2, 3), new Point(5, 3)));
|
||||||
break;
|
break;
|
||||||
case "STRAFE RGB":
|
case "STRAFE RGB":
|
||||||
Height = 7;
|
Height = 7;
|
||||||
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(16, 1)));
|
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("NumPad", new Point(17, 2), new Point(21, 7)));
|
||||||
|
KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(2, 3), new Point(5, 3)));
|
||||||
Width = 22;
|
Width = 22;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,8 +23,9 @@ namespace Artemis.KeyboardProviders.Logitech
|
|||||||
KeyboardRegions = new List<KeyboardRegion>
|
KeyboardRegions = new List<KeyboardRegion>
|
||||||
{
|
{
|
||||||
new KeyboardRegion("TopRow", new Point(0, 0), new Point(16, 0)),
|
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()
|
public override bool CanEnable()
|
||||||
|
|||||||
@ -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.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
@ -142,5 +130,41 @@ namespace Artemis.Modules.Games.Dota2 {
|
|||||||
this["ManaColor"] = value;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,9 +17,6 @@
|
|||||||
<Setting Name="ShowDayCycle" Type="System.Boolean" Scope="User">
|
<Setting Name="ShowDayCycle" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="CanCastItem" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="ShowMana" Type="System.Boolean" Scope="User">
|
<Setting Name="ShowMana" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
@ -32,5 +29,14 @@
|
|||||||
<Setting Name="ManaColor" Type="System.Windows.Media.Color" Scope="User">
|
<Setting Name="ManaColor" Type="System.Windows.Media.Color" Scope="User">
|
||||||
<Value Profile="(Default)">#FF0000FF</Value>
|
<Value Profile="(Default)">#FF0000FF</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="KeyboardLayout" Type="System.String" Scope="User">
|
||||||
|
<Value Profile="(Default)">Default</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="AbilityReadyColor" Type="System.Windows.Media.Color" Scope="User">
|
||||||
|
<Value Profile="(Default)">#FF00FF00</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="AbilityCooldownColor" Type="System.Windows.Media.Color" Scope="User">
|
||||||
|
<Value Profile="(Default)">#FF6A5ACD</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@ -3,6 +3,8 @@ using System.Collections.Generic;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Windows.Forms.VisualStyles;
|
||||||
|
using System.Windows.Media;
|
||||||
using Artemis.KeyboardProviders;
|
using Artemis.KeyboardProviders;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
@ -10,13 +12,14 @@ using Artemis.Utilities;
|
|||||||
using Artemis.Utilities.GameState;
|
using Artemis.Utilities.GameState;
|
||||||
using Artemis.Utilities.Keyboard;
|
using Artemis.Utilities.Keyboard;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Color = System.Drawing.Color;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Dota2
|
namespace Artemis.Modules.Games.Dota2
|
||||||
{
|
{
|
||||||
internal class Dota2Model : GameModel
|
internal class Dota2Model : GameModel
|
||||||
{
|
{
|
||||||
private KeyboardRegion _keyPad;
|
private KeyboardRegion _keyPad;
|
||||||
|
private KeyboardRegion _abilityKeys;
|
||||||
private KeyboardRegion _topRow;
|
private KeyboardRegion _topRow;
|
||||||
|
|
||||||
public Dota2Model(MainManager mainManager, Dota2Settings settings) : base(mainManager)
|
public Dota2Model(MainManager mainManager, Dota2Settings settings) : base(mainManager)
|
||||||
@ -41,6 +44,7 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
Initialized = false;
|
Initialized = false;
|
||||||
_topRow = MainManager.KeyboardManager.ActiveKeyboard.KeyboardRegions.First(r => r.RegionName == "TopRow");
|
_topRow = MainManager.KeyboardManager.ActiveKeyboard.KeyboardRegions.First(r => r.RegionName == "TopRow");
|
||||||
_keyPad = MainManager.KeyboardManager.ActiveKeyboard.KeyboardRegions.First(r => r.RegionName == "NumPad");
|
_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
|
HealthRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard
|
||||||
, 0
|
, 0
|
||||||
, _topRow.BottomRight.Y*Scale
|
, _topRow.BottomRight.Y*Scale
|
||||||
@ -68,22 +72,103 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
|
|
||||||
DayCycleRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard
|
DayCycleRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard
|
||||||
, _keyPad.TopLeft.X*Scale
|
, _keyPad.TopLeft.X*Scale
|
||||||
, _keyPad.TopLeft.Y*Scale
|
, _keyPad.BottomRight.Y*Scale
|
||||||
, new List<Color>()
|
, new List<Color>()
|
||||||
, LinearGradientMode.Horizontal)
|
, LinearGradientMode.Horizontal)
|
||||||
{
|
{
|
||||||
Height = _keyPad.GetRectangle().Height*Scale,
|
Height = _keyPad.GetRectangle().Height*Scale,
|
||||||
Width = _keyPad.GetRectangle().Width*Scale
|
Width = _keyPad.GetRectangle().Width*Scale
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SetAbilityKeys();
|
||||||
|
|
||||||
MainManager.GameStateWebServer.GameDataReceived += HandleGameData;
|
MainManager.GameStateWebServer.GameDataReceived += HandleGameData;
|
||||||
Initialized = true;
|
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<Color>(),
|
||||||
|
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<Color>(),
|
||||||
|
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<Color>(),
|
||||||
|
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<Color>(),
|
||||||
|
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<Color>(),
|
||||||
|
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<Color>(),
|
||||||
|
LinearGradientMode.Horizontal)
|
||||||
|
{
|
||||||
|
Height = Scale,
|
||||||
|
Width = Scale
|
||||||
|
};
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
if (D2Json == null)
|
if (D2Json == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Settings.ShowDead && D2Json?.hero?.alive != null && !D2Json.hero.alive)
|
if (Settings.ShowDead && D2Json?.hero?.alive != null && !D2Json.hero.alive)
|
||||||
{
|
{
|
||||||
UpdateLifeStatus();
|
UpdateLifeStatus();
|
||||||
@ -98,8 +183,7 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
UpdateDay();
|
UpdateDay();
|
||||||
if (Settings.ShowMana)
|
if (Settings.ShowMana)
|
||||||
UpdateMana();
|
UpdateMana();
|
||||||
if (Settings.CanCastItem)
|
|
||||||
UpdateItems();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateMainColor()
|
private void UpdateMainColor()
|
||||||
@ -133,7 +217,6 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
|
|
||||||
var timeLeft = 240 - D2Json.map.clock_time%240;
|
var timeLeft = 240 - D2Json.map.clock_time%240;
|
||||||
var timePercentage = 100.00/240*timeLeft;
|
var timePercentage = 100.00/240*timeLeft;
|
||||||
var test = _keyPad.GetRectangle().Width;
|
|
||||||
DayCycleRectangle.Width = (int) (_keyPad.GetRectangle().Width*Scale/100.00*timePercentage);
|
DayCycleRectangle.Width = (int) (_keyPad.GetRectangle().Width*Scale/100.00*timePercentage);
|
||||||
DayCycleRectangle.Colors = D2Json.map.daytime
|
DayCycleRectangle.Colors = D2Json.map.daytime
|
||||||
? new List<Color> {Color.Yellow}
|
? new List<Color> {Color.Yellow}
|
||||||
@ -150,16 +233,19 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
ManaRectangle.Width = (int) Math.Floor(_topRow.GetRectangle().Width*Scale/100.00*manaPercent);
|
ManaRectangle.Width = (int) Math.Floor(_topRow.GetRectangle().Width*Scale/100.00*manaPercent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateItems()
|
|
||||||
{
|
|
||||||
//throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateAbilities()
|
private void UpdateAbilities()
|
||||||
{
|
{
|
||||||
//Console.WriteLine();
|
if (AbilityKeysRectangles == null)
|
||||||
|
return;
|
||||||
//Update keys according to the abilities they take.
|
|
||||||
|
AbilityKeysRectangles[0].Colors = D2Json?.abilities?.ability0?.can_cast == true ? new List<Color>
|
||||||
|
{ ColorHelpers.ToDrawingColor(Settings.AbilityReadyColor) } : new List<Color> { ColorHelpers.ToDrawingColor(Settings.AbilityCooldownColor) };
|
||||||
|
AbilityKeysRectangles[1].Colors = D2Json?.abilities?.ability1?.can_cast == true ? new List<Color>
|
||||||
|
{ ColorHelpers.ToDrawingColor(Settings.AbilityReadyColor) } : new List<Color> { ColorHelpers.ToDrawingColor(Settings.AbilityCooldownColor) };
|
||||||
|
AbilityKeysRectangles[2].Colors = D2Json?.abilities?.ability2?.can_cast == true ? new List<Color>
|
||||||
|
{ ColorHelpers.ToDrawingColor(Settings.AbilityReadyColor) } : new List<Color> { ColorHelpers.ToDrawingColor(Settings.AbilityCooldownColor) };
|
||||||
|
AbilityKeysRectangles[3].Colors = D2Json?.abilities?.ability3?.can_cast == true ? new List<Color>
|
||||||
|
{ ColorHelpers.ToDrawingColor(Settings.AbilityReadyColor) } : new List<Color> { ColorHelpers.ToDrawingColor(Settings.AbilityCooldownColor) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -191,6 +277,8 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
HealthRectangle.Draw(g);
|
HealthRectangle.Draw(g);
|
||||||
ManaRectangle.Draw(g);
|
ManaRectangle.Draw(g);
|
||||||
DayCycleRectangle.Draw(g);
|
DayCycleRectangle.Draw(g);
|
||||||
|
foreach (var key in AbilityKeysRectangles)
|
||||||
|
key.Draw(g);
|
||||||
}
|
}
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
@ -217,7 +305,8 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
public KeyboardRectangle EventRectangle { get; set; }
|
public KeyboardRectangle EventRectangle { get; set; }
|
||||||
public KeyboardRectangle DayCycleRectangle { get; set; }
|
public KeyboardRectangle DayCycleRectangle { get; set; }
|
||||||
public KeyboardRectangle ManaRectangle { get; set; }
|
public KeyboardRectangle ManaRectangle { get; set; }
|
||||||
|
public KeyboardRectangle[] AbilityKeysRectangles = new KeyboardRectangle[4];
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,31 +21,36 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
public string GameDirectory { get; set; }
|
public string GameDirectory { get; set; }
|
||||||
public bool CanCastAbility { get; set; }
|
public bool CanCastAbility { get; set; }
|
||||||
public bool ShowHealth { get; set; }
|
public bool ShowHealth { get; set; }
|
||||||
public bool ShowDayCycle { get; set; }
|
public bool ShowDayCycle { get; set; }
|
||||||
public bool CanCastItem { get; set; }
|
|
||||||
public bool ShowMana { get; set; }
|
public bool ShowMana { get; set; }
|
||||||
public bool ShowDead { get; set; }
|
public bool ShowDead { get; set; }
|
||||||
public Color MainColor { get; set; }
|
public Color MainColor { get; set; }
|
||||||
public Color ManaColor { get; set; }
|
public Color ManaColor { get; set; }
|
||||||
|
public string KeyboardLayout { get; set; }
|
||||||
|
public Color AbilityCooldownColor { get; set; }
|
||||||
|
public Color AbilityReadyColor { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
public override void Load()
|
public override void Load()
|
||||||
{
|
{
|
||||||
|
KeyboardLayout = Dota2.Default.KeyboardLayout;
|
||||||
MainColor = Dota2.Default.MainColor;
|
MainColor = Dota2.Default.MainColor;
|
||||||
ManaColor = Dota2.Default.ManaColor;
|
ManaColor = Dota2.Default.ManaColor;
|
||||||
ShowHealth = Dota2.Default.ShowHealth;
|
ShowHealth = Dota2.Default.ShowHealth;
|
||||||
CanCastAbility = Dota2.Default.CanCastAbility;
|
CanCastAbility = Dota2.Default.CanCastAbility;
|
||||||
Enabled = Dota2.Default.Enabled;
|
Enabled = Dota2.Default.Enabled;
|
||||||
GameDirectory = Dota2.Default.GameDirectory;
|
GameDirectory = Dota2.Default.GameDirectory;
|
||||||
CanCastItem = Dota2.Default.CanCastItem;
|
|
||||||
ShowDayCycle = Dota2.Default.ShowDayCycle;
|
ShowDayCycle = Dota2.Default.ShowDayCycle;
|
||||||
ShowMana = Dota2.Default.ShowMana;
|
ShowMana = Dota2.Default.ShowMana;
|
||||||
ShowDead = Dota2.Default.ShowDead;
|
ShowDead = Dota2.Default.ShowDead;
|
||||||
|
AbilityReadyColor = Dota2.Default.AbilityReadyColor;
|
||||||
|
AbilityCooldownColor = Dota2.Default.AbilityCooldownColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Save()
|
public override void Save()
|
||||||
{
|
{
|
||||||
|
Dota2.Default.KeyboardLayout = KeyboardLayout;
|
||||||
Dota2.Default.MainColor = MainColor;
|
Dota2.Default.MainColor = MainColor;
|
||||||
Dota2.Default.ManaColor = ManaColor;
|
Dota2.Default.ManaColor = ManaColor;
|
||||||
Dota2.Default.ShowDayCycle = ShowDayCycle;
|
Dota2.Default.ShowDayCycle = ShowDayCycle;
|
||||||
@ -53,9 +58,10 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
Dota2.Default.CanCastAbility = CanCastAbility;
|
Dota2.Default.CanCastAbility = CanCastAbility;
|
||||||
Dota2.Default.Enabled = Enabled;
|
Dota2.Default.Enabled = Enabled;
|
||||||
Dota2.Default.GameDirectory = GameDirectory;
|
Dota2.Default.GameDirectory = GameDirectory;
|
||||||
Dota2.Default.CanCastItem = CanCastItem;
|
|
||||||
Dota2.Default.ShowMana = ShowMana;
|
Dota2.Default.ShowMana = ShowMana;
|
||||||
Dota2.Default.ShowDead = ShowDead;
|
Dota2.Default.ShowDead = ShowDead;
|
||||||
|
Dota2.Default.AbilityCooldownColor = AbilityCooldownColor;
|
||||||
|
Dota2.Default.AbilityReadyColor = AbilityReadyColor;
|
||||||
|
|
||||||
Dota2.Default.Save();
|
Dota2.Default.Save();
|
||||||
}
|
}
|
||||||
@ -66,12 +72,14 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
Enabled = true;
|
Enabled = true;
|
||||||
GameDirectory = string.Empty;
|
GameDirectory = string.Empty;
|
||||||
|
|
||||||
|
KeyboardLayout = "Default";
|
||||||
MainColor = Color.FromArgb(255,255,0,0);
|
MainColor = Color.FromArgb(255,255,0,0);
|
||||||
ManaColor = Color.FromArgb(255,0,0,255);
|
ManaColor = Color.FromArgb(255,0,0,255);
|
||||||
|
AbilityCooldownColor = Color.FromArgb(255,106,90,205);
|
||||||
|
AbilityReadyColor = Color.FromArgb(255, 0, 255, 0);
|
||||||
ShowHealth = true;
|
ShowHealth = true;
|
||||||
CanCastAbility = true;
|
CanCastAbility = true;
|
||||||
ShowDayCycle = true;
|
ShowDayCycle = true;
|
||||||
CanCastItem = true;
|
|
||||||
ShowMana = true;
|
ShowMana = true;
|
||||||
ShowDead = true;
|
ShowDead = true;
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="495" d:DesignWidth="635">
|
d:DesignHeight="495" d:DesignWidth="635">
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Margin="0,0,0,-19">
|
||||||
<Grid Margin="15, 5, 15, 5">
|
<Grid Margin="15, 5, 15, 5">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
@ -26,6 +26,8 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||||
@ -61,84 +63,104 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Main Color -->
|
<!-- Main Color -->
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" Width="114" VerticalAlignment="Center"
|
<TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" Width="114" VerticalAlignment="Center"
|
||||||
Height="16" Margin="0,8">
|
Height="16" Margin="0,8">
|
||||||
Main keyboard color
|
Main keyboard color
|
||||||
</TextBlock>
|
|
||||||
<xctk:ColorPicker x:Name="MainColor"
|
|
||||||
SelectedColor="{Binding Path=GameSettings.MainColor, Mode=TwoWay}"
|
|
||||||
Grid.Row="2" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
|
||||||
|
|
||||||
<!-- Abilities Display -->
|
|
||||||
<TextBlock Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
|
||||||
Height="16" Margin="0,10,0,9">
|
|
||||||
Castable abilities
|
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.CanCastAbility, Mode=TwoWay}"
|
<xctk:ColorPicker x:Name="MainColor"
|
||||||
Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
SelectedColor="{Binding Path=GameSettings.MainColor, Mode=TwoWay}"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Grid.Row="2" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
|
|
||||||
|
<!-- Ability Ready Color -->
|
||||||
|
<TextBlock Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left" Width="114" VerticalAlignment="Center"
|
||||||
|
Height="16" Margin="0,8">
|
||||||
|
Ability Ready Color
|
||||||
|
</TextBlock>
|
||||||
|
<xctk:ColorPicker x:Name="AbilityReadyColor"
|
||||||
|
SelectedColor="{Binding Path=GameSettings.AbilityReadyColor, Mode=TwoWay}"
|
||||||
|
Grid.Row="3" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
|
|
||||||
|
<!-- Ability on Cooldown Color -->
|
||||||
|
<TextBlock Grid.Row="4" Grid.Column="0" HorizontalAlignment="Left" Width="147" VerticalAlignment="Center"
|
||||||
|
Height="16" Margin="0,8">
|
||||||
|
Ability on Cooldown Color
|
||||||
|
</TextBlock>
|
||||||
|
<xctk:ColorPicker x:Name="AbilityCooldownColor"
|
||||||
|
SelectedColor="{Binding Path=GameSettings.AbilityCooldownColor, Mode=TwoWay}"
|
||||||
|
Grid.Row="4" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
|
|
||||||
|
<!-- Abilities Display -->
|
||||||
|
<TextBlock Grid.Row="5" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
||||||
|
Height="16" Margin="0,10,0,9">
|
||||||
|
Keyboard Template
|
||||||
|
</TextBlock>
|
||||||
|
<ComboBox Grid.Row="5" Grid.Column="1" x:Name="KeyboardLayouts" ItemsSource="{Binding Path=KeyboardLayouts}" SelectedIndex="{Binding Path=GameSettings.KeyboardLayout}" VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Width="109" Margin="0,6,0,7" />
|
||||||
|
|
||||||
<!-- Items Display -->
|
<!-- Items Display -->
|
||||||
<TextBlock Grid.Row="4" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
<TextBlock Grid.Row="6" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
||||||
Height="16" Margin="0,10,0,9">
|
Height="16" Margin="0,10,0,9">
|
||||||
Castable items
|
Castable Abilities
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.CanCastItem, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.CanCastAbility, Mode=TwoWay}"
|
||||||
Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
Grid.Row="6" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|
||||||
<!-- Health Display -->
|
<!-- Health Display -->
|
||||||
<TextBlock Grid.Row="5" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
<TextBlock Grid.Row="7" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
||||||
Height="16" Margin="0,10,0,9">
|
Height="16" Margin="0,10,0,9">
|
||||||
Display health
|
Display health
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowHealth, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowHealth, Mode=TwoWay}"
|
||||||
Grid.Row="5" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
Grid.Row="7" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|
||||||
<!-- Mana Display-->
|
<!-- Mana Display-->
|
||||||
<TextBlock Grid.Row="6" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
<TextBlock Grid.Row="8" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
||||||
Height="16" Margin="0,10,0,9">
|
Height="16" Margin="0,10,0,9">
|
||||||
Display mana
|
Display mana
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowMana, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowMana, Mode=TwoWay}"
|
||||||
Grid.Row="6" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
Grid.Row="8" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|
||||||
<!-- Mana Color -->
|
<!-- Mana Color -->
|
||||||
<TextBlock Grid.Row="7" Grid.Column="0" HorizontalAlignment="Left" Width="114" VerticalAlignment="Center"
|
<TextBlock Grid.Row="9" Grid.Column="0" HorizontalAlignment="Left" Width="114" VerticalAlignment="Center"
|
||||||
Height="16" Margin="0,8">
|
Height="16" Margin="0,8">
|
||||||
Mana color
|
Mana color
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<xctk:ColorPicker x:Name="ManaColor"
|
<xctk:ColorPicker x:Name="ManaColor"
|
||||||
SelectedColor="{Binding Path=GameSettings.ManaColor, Mode=TwoWay}"
|
SelectedColor="{Binding Path=GameSettings.ManaColor, Mode=TwoWay}"
|
||||||
Grid.Row="7" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
Grid.Row="9" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
|
|
||||||
<!-- Daytime Display -->
|
<!-- Daytime Display -->
|
||||||
<TextBlock Grid.Row="8" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
<TextBlock Grid.Row="10" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
||||||
Height="16" Margin="0,10,0,9">
|
Height="16" Margin="0,10,0,9">
|
||||||
Display day/night
|
Display day/night
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowDayCycle, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowDayCycle, Mode=TwoWay}"
|
||||||
Grid.Row="8" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
Grid.Row="10" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|
||||||
<!-- Dead Display -->
|
<!-- Dead Display -->
|
||||||
<TextBlock Grid.Row="9" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
<TextBlock Grid.Row="11" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
||||||
Height="16" Margin="0,10,0,9">
|
Height="16" Margin="0,10,0,9">
|
||||||
Display gray when dead
|
Display gray when dead
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowDead, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowDead, Mode=TwoWay}"
|
||||||
Grid.Row="9" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
Grid.Row="11" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<StackPanel Grid.Column="0" Grid.Row="11" Orientation="Horizontal" VerticalAlignment="Bottom">
|
<StackPanel Grid.Column="0" Grid.Row="12" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||||
Style="{DynamicResource SquareButtonStyle}" />
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||||
|
|||||||
@ -2,8 +2,10 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
|
using Artemis.Models;
|
||||||
using Artemis.Properties;
|
using Artemis.Properties;
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
|
using Caliburn.Micro;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Dota2
|
namespace Artemis.Modules.Games.Dota2
|
||||||
{
|
{
|
||||||
@ -11,6 +13,7 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
{
|
{
|
||||||
public Dota2ViewModel(MainManager mainManager)
|
public Dota2ViewModel(MainManager mainManager)
|
||||||
{
|
{
|
||||||
|
|
||||||
MainManager = mainManager;
|
MainManager = mainManager;
|
||||||
GameSettings = new Dota2Settings();
|
GameSettings = new Dota2Settings();
|
||||||
|
|
||||||
@ -19,6 +22,14 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
PlaceConfigFile();
|
PlaceConfigFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BindableCollection<string> KeyboardLayouts
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new BindableCollection<string>(new[] {"Default","MMO","WASD","League of Legends","Heros of Newearth","Smite"});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string Name => "Dota 2";
|
public static string Name => "Dota 2";
|
||||||
public string Content => "Dota 2 Content";
|
public string Content => "Dota 2 Content";
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user