1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00
This commit is contained in:
SpoinkyNL 2016-03-15 22:32:55 +01:00
commit 73303e72ea
9 changed files with 250 additions and 79 deletions

View File

@ -45,9 +45,6 @@
<setting name="ShowDayCycle" serializeAs="String">
<value>True</value>
</setting>
<setting name="CanCastItem" serializeAs="String">
<value>True</value>
</setting>
<setting name="ShowMana" serializeAs="String">
<value>True</value>
</setting>
@ -60,6 +57,15 @@
<setting name="ManaColor" serializeAs="String">
<value>#FF0000FF</value>
</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.Overlays.VolumeDisplay.VolumeDisplay>
<setting name="Enabled" serializeAs="String">

View File

@ -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;
}

View File

@ -23,8 +23,9 @@ namespace Artemis.KeyboardProviders.Logitech
KeyboardRegions = new List<KeyboardRegion>
{
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()

View File

@ -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;
}
}
}
}

View File

@ -17,9 +17,6 @@
<Setting Name="ShowDayCycle" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="CanCastItem" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="ShowMana" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
@ -32,5 +29,14 @@
<Setting Name="ManaColor" Type="System.Windows.Media.Color" Scope="User">
<Value Profile="(Default)">#FF0000FF</Value>
</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>
</SettingsFile>

View File

@ -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<Color>()
, 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<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()
{
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> {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<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);
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
}
}

View File

@ -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;

View File

@ -8,7 +8,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
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.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@ -26,6 +26,8 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
@ -61,84 +63,104 @@
</Grid>
</StackPanel>
<!-- Main Color -->
<TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" Width="114" VerticalAlignment="Center"
Height="16" Margin="0,8">
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
<!-- Main Color -->
<TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" Width="114" VerticalAlignment="Center"
Height="16" Margin="0,8">
Main keyboard color
</TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.CanCastAbility, Mode=TwoWay}"
Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
Margin="0,0,-5,0" Width="114" />
<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" />
<!-- 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 -->
<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">
Castable items
Castable Abilities
</TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.CanCastItem, Mode=TwoWay}"
Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.CanCastAbility, Mode=TwoWay}"
Grid.Row="6" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
Margin="0,0,-5,0" Width="114" />
<!-- 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">
Display health
</TextBlock>
<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" />
<!-- 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">
Display mana
</TextBlock>
<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" />
<!-- Mana Color -->
<TextBlock Grid.Row="7" Grid.Column="0" HorizontalAlignment="Left" Width="114" VerticalAlignment="Center"
Height="16" Margin="0,8">
Mana color
</TextBlock>
<xctk:ColorPicker x:Name="ManaColor"
SelectedColor="{Binding Path=GameSettings.ManaColor, Mode=TwoWay}"
Grid.Row="7" Grid.Column="1" Width="110" HorizontalAlignment="Right"
<!-- Mana Color -->
<TextBlock Grid.Row="9" Grid.Column="0" HorizontalAlignment="Left" Width="114" VerticalAlignment="Center"
Height="16" Margin="0,8">
Mana color
</TextBlock>
<xctk:ColorPicker x:Name="ManaColor"
SelectedColor="{Binding Path=GameSettings.ManaColor, Mode=TwoWay}"
Grid.Row="9" Grid.Column="1" Width="110" HorizontalAlignment="Right"
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
<!-- 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">
Display day/night
</TextBlock>
<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" />
<!-- 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">
Display gray when dead
</TextBlock>
<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" />
<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"
Style="{DynamicResource SquareButtonStyle}" />
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"

View File

@ -2,8 +2,10 @@
using System.IO;
using System.Windows.Forms;
using Artemis.Managers;
using Artemis.Models;
using Artemis.Properties;
using Artemis.ViewModels.Abstract;
using Caliburn.Micro;
namespace Artemis.Modules.Games.Dota2
{
@ -11,6 +13,7 @@ namespace Artemis.Modules.Games.Dota2
{
public Dota2ViewModel(MainManager mainManager)
{
MainManager = mainManager;
GameSettings = new Dota2Settings();
@ -19,6 +22,14 @@ namespace Artemis.Modules.Games.Dota2
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 string Content => "Dota 2 Content";