1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
This commit is contained in:
SpoinkyNL 2016-03-10 09:23:30 +01:00
commit 96eb3c1e6a
9 changed files with 360 additions and 39 deletions

View File

@ -36,6 +36,24 @@
<setting name="ShowHealth" serializeAs="String"> <setting name="ShowHealth" serializeAs="String">
<value>True</value> <value>True</value>
</setting> </setting>
<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>
<setting name="ShowDead" serializeAs="String">
<value>True</value>
</setting>
<setting name="MainColor" serializeAs="String">
<value>#FFFF0000</value>
</setting>
<setting name="ManaColor" serializeAs="String">
<value>#FF0000FF</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">

View File

@ -74,19 +74,24 @@ namespace Artemis.KeyboardProviders.Corsair
Height = 7; Height = 7;
Width = 24; Width = 24;
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(1, 0), new Point(1, 20))); KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(1, 0), new Point(1, 20)));
KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(2, 21), new Point(7, 25)));
break; break;
case "K70 RGB": case "K70 RGB":
Height = 7; Height = 7;
Width = 21; Width = 21;
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(1, 0), new Point(1, 16))); KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(1, 0), new Point(1, 16)));
KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(2, 17), new Point(7, 21)));
break; break;
case "K65 RGB": case "K65 RGB":
Height = 7; Height = 7;
Width = 18; Width = 18;
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(1, 0), new Point(1, 16)));
KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(2, 17), new Point(7, 21)));
break; break;
case "STRAFE RGB": case "STRAFE RGB":
Height = 7; Height = 7;
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(1, 0), new Point(1, 16))); KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(1, 0), new Point(1, 16)));
KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(2, 17), new Point(7, 21)));
Width = 22; Width = 22;
break; break;
} }

View File

@ -16,7 +16,11 @@ namespace Artemis.KeyboardProviders.Logitech
"If needed, you can select a different keyboard in Artemis under settings."; "If needed, you can select a different keyboard in Artemis under settings.";
Height = 6; Height = 6;
Width = 21; Width = 21;
KeyboardRegions = new List<KeyboardRegion> {new KeyboardRegion("TopRow", new Point(0, 0), new Point(0, 16))}; KeyboardRegions = new List<KeyboardRegion>
{
new KeyboardRegion("TopRow", new Point(0, 0), new Point(0, 16)),
new KeyboardRegion("NumPad", new Point(0, 17), new Point(0, 25))
};
} }
public override bool CanEnable() public override bool CanEnable()

View File

@ -70,5 +70,77 @@ namespace Artemis.Modules.Games.Dota2 {
this["ShowHealth"] = value; this["ShowHealth"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool ShowDayCycle {
get {
return ((bool)(this["ShowDayCycle"]));
}
set {
this["ShowDayCycle"] = value;
}
}
[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")]
public bool ShowMana {
get {
return ((bool)(this["ShowMana"]));
}
set {
this["ShowMana"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool ShowDead {
get {
return ((bool)(this["ShowDead"]));
}
set {
this["ShowDead"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("#FFFF0000")]
public global::System.Windows.Media.Color MainColor {
get {
return ((global::System.Windows.Media.Color)(this["MainColor"]));
}
set {
this["MainColor"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("#FF0000FF")]
public global::System.Windows.Media.Color ManaColor {
get {
return ((global::System.Windows.Media.Color)(this["ManaColor"]));
}
set {
this["ManaColor"] = value;
}
}
} }
} }

View File

@ -14,5 +14,23 @@
<Setting Name="ShowHealth" Type="System.Boolean" Scope="User"> <Setting Name="ShowHealth" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value> <Value Profile="(Default)">True</Value>
</Setting> </Setting>
<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>
<Setting Name="ShowDead" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="MainColor" Type="System.Windows.Media.Color" Scope="User">
<Value Profile="(Default)">#FFFF0000</Value>
</Setting>
<Setting Name="ManaColor" Type="System.Windows.Media.Color" Scope="User">
<Value Profile="(Default)">#FF0000FF</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Globalization;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -13,6 +14,7 @@ using Artemis.Utilities.Keyboard;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Artemis.Modules.Games.Dota2; using Artemis.Modules.Games.Dota2;
using Artemis.Utilities;
namespace Artemis.Modules.Games.Dota2 namespace Artemis.Modules.Games.Dota2
{ {
@ -20,6 +22,7 @@ namespace Artemis.Modules.Games.Dota2
{ {
private KeyboardRegion _topRow; private KeyboardRegion _topRow;
private KeyboardRegion _keyPad;
public Dota2Model(MainManager mainManager, Dota2Settings settings) : base(mainManager) public Dota2Model(MainManager mainManager, Dota2Settings settings) : base(mainManager)
{ {
Settings = settings; Settings = settings;
@ -35,8 +38,10 @@ namespace Artemis.Modules.Games.Dota2
public Dota2Settings Settings { get; set; } public Dota2Settings Settings { get; set; }
public Dota2DataModel.Rootobject D2Json { get; set; } public Dota2DataModel.Rootobject D2Json { get; set; }
public int Scale { get; set; } public int Scale { get; set; }
public KeyboardRectangle HealthRect { get; set; } public KeyboardRectangle HealthRectangle { get; set; }
public KeyboardRectangle EventRectangle { get; set; }
public KeyboardRectangle DayCycleRectangle { get; set; }
public KeyboardRectangle ManaRectangle { get; set; }
#endregion #endregion
@ -50,10 +55,38 @@ 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");
HealthRect = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, _topRow.TopLeft.X, _keyPad = MainManager.KeyboardManager.ActiveKeyboard.KeyboardRegions.First(r => r.RegionName == "NumPad");
new List<Color>(), HealthRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard
LinearGradientMode.Horizontal) , 0
, _topRow.TopLeft.X
, new List<Color>()
, LinearGradientMode.Horizontal)
{ Height = Scale, ContainedBrush = false }; { Height = Scale, ContainedBrush = false };
ManaRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard
, 0
, _topRow.TopLeft.X+1
, new List<Color>()
, LinearGradientMode.Horizontal)
{ Height = Scale, ContainedBrush = false };
EventRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard
, 0
, _topRow.TopLeft.X + 2
, new List<Color>()
, LinearGradientMode.Horizontal )
{Height = MainManager.KeyboardManager.ActiveKeyboard.Height*Scale - Scale
, Width = MainManager.KeyboardManager.ActiveKeyboard.Width*Scale-Scale-12};
DayCycleRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard
, _keyPad.BottomRight.X * 3
, _keyPad.TopLeft.X
, new List<Color>()
, LinearGradientMode.Horizontal)
{
Height = MainManager.KeyboardManager.ActiveKeyboard.Height*Scale - Scale,
Width = MainManager.KeyboardManager.ActiveKeyboard.Width - (MainManager.KeyboardManager.ActiveKeyboard.Width * Scale - Scale - 12)
};
MainManager.GameStateWebServer.GameDataReceived += HandleGameData; MainManager.GameStateWebServer.GameDataReceived += HandleGameData;
Initialized = true; Initialized = true;
} }
@ -63,32 +96,107 @@ namespace Artemis.Modules.Games.Dota2
if (D2Json == null) if (D2Json == null)
return; return;
if (Settings.ShowDead && D2Json?.hero?.alive != null && !D2Json.hero.alive)
{
UpdateLifeStatus();
return;
}
UpdateMainColor();
if (Settings.CanCastAbility) if (Settings.CanCastAbility)
UpdateAbilities(); UpdateAbilities();
if (Settings.ShowHealth) if (Settings.ShowHealth)
UpdateHealth(); UpdateHealth();
if (Settings.ShowDayCycle)
UpdateDay();
if (Settings.ShowMana)
UpdateMana();
if (Settings.CanCastItem)
UpdateItems();
} }
private void UpdateHealth() private void UpdateMainColor()
{ {
var health = D2Json.hero.health_percent; var list = new List<Color> { ColorHelpers.ToDrawingColor(Settings.MainColor) };
if(health > 66) EventRectangle.Colors = list;
HealthRect.Colors = new List<Color> { Color.Lime }; DayCycleRectangle.Colors = list;
else if (health > 33) HealthRectangle.Colors = list;
HealthRect.Colors = new List<Color> {Color.Yellow}; ManaRectangle.Colors = list;
else }
HealthRect.Colors = new List<Color> {Color.Red};
private void UpdateLifeStatus()
{
var list = new List<Color> { Color.LightGray };
EventRectangle.Colors = list;
DayCycleRectangle.Colors = list;
HealthRectangle.Colors = list;
ManaRectangle.Colors = list;
} }
private void UpdateDay()
{
if (D2Json?.map?.daytime == null)
return;
if (D2Json.map.nightstalker_night)
{
DayCycleRectangle.Colors = new List<Color> { Color.Blue };
return;
}
var timeLeft = 240 - (D2Json.map.clock_time % 240);
double width = (int) ((MainManager.KeyboardManager.ActiveKeyboard.Width*Scale - (MainManager.KeyboardManager.ActiveKeyboard.Width * Scale - Scale*Scale)) * (timeLeft/240D)) ;
DayCycleRectangle.Width = (int) (width/2) > 1 ? (int)(width / 2)+1 : (int)(width / 2);
DayCycleRectangle.Colors = D2Json.map.daytime ? new List<Color> { Color.Yellow } : new List<Color> { Color.Blue };
}
private void UpdateMana()
{
if (D2Json?.hero == null || D2Json.hero.mana_percent == -1)
return;
var manaPercent = D2Json.hero.mana_percent;
ManaRectangle.Colors = new List<Color> { ColorHelpers.ToDrawingColor(Settings.ManaColor) };
ManaRectangle.Width = (int)Math.Floor(_topRow.BottomRight.Y / 100.00 * manaPercent) * Scale;
}
private void UpdateItems()
{
//throw new NotImplementedException();
}
private void UpdateAbilities() private void UpdateAbilities()
{ {
Console.WriteLine(); //Console.WriteLine();
//Update keys according to the abilities they take. //Update keys according to the abilities they take.
} }
private void UpdateHealth()
{
if (D2Json?.hero == null || D2Json.hero.health_percent == -1)
return;
var healthPercent = D2Json.hero.health_percent;
if(healthPercent > 66)
HealthRectangle.Colors = new List<Color> { Color.Lime };
else if (healthPercent > 33)
HealthRectangle.Colors = new List<Color> {Color.Yellow};
else
HealthRectangle.Colors = new List<Color> {Color.Red};
HealthRectangle.Width = (int)Math.Floor(_topRow.BottomRight.Y / 100.00 * healthPercent) * Scale;
}
public override Bitmap GenerateBitmap() public override Bitmap GenerateBitmap()
{ {
var bitmap = MainManager.KeyboardManager.ActiveKeyboard.KeyboardBitmap(Scale); var bitmap = MainManager.KeyboardManager.ActiveKeyboard.KeyboardBitmap(Scale);
@ -96,7 +204,11 @@ namespace Artemis.Modules.Games.Dota2
using (var g = Graphics.FromImage(bitmap)) using (var g = Graphics.FromImage(bitmap))
{ {
g.Clear(Color.Transparent); g.Clear(Color.Transparent);
HealthRect.Draw(g); EventRectangle.Draw(g);
HealthRectangle.Draw(g);
ManaRectangle.Draw(g);
DayCycleRectangle.Draw(g);
} }
return bitmap; return bitmap;
} }

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Media;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -20,33 +21,60 @@ 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 CanCastItem { get; set; }
public bool ShowMana { get; set; }
public bool ShowDead { get; set; }
public Color MainColor { get; set; }
public Color ManaColor { get; set; }
#endregion #endregion
public override void Load() public override void Load()
{ {
MainColor = Dota2.Default.MainColor;
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;
ShowMana = Dota2.Default.ShowMana;
ShowDead = Dota2.Default.ShowDead;
} }
public override void Save() public override void Save()
{ {
Dota2.Default.MainColor = MainColor;
Dota2.Default.ManaColor = ManaColor;
Dota2.Default.ShowDayCycle = ShowDayCycle;
Dota2.Default.ShowHealth = ShowHealth; Dota2.Default.ShowHealth = ShowHealth;
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.ShowDead = ShowDead;
Dota2.Default.Save(); Dota2.Default.Save();
} }
public override void ToDefault() public override void ToDefault()
{ {
Enabled = true;
GameDirectory = string.Empty;
MainColor = Color.FromArgb(255,255,0,0);
ManaColor = Color.FromArgb(255,0,0,255);
ShowHealth = true; ShowHealth = true;
CanCastAbility = true; CanCastAbility = true;
Enabled = false; ShowDayCycle = true;
GameDirectory = string.Empty; CanCastItem = true;
ShowMana = true;
ShowDead = true;
} }
} }
} }

View File

@ -5,8 +5,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cal="http://www.caliburnproject.org" xmlns:cal="http://www.caliburnproject.org"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls" xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="424" d:DesignWidth="635"> d:DesignHeight="495" d:DesignWidth="635">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<Grid Margin="15, 5, 15, 5"> <Grid Margin="15, 5, 15, 5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -23,13 +24,15 @@
<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">
<Label FontSize="20" HorizontalAlignment="Left"> <Label FontSize="20" HorizontalAlignment="Left">
<Label.Content> <Label.Content>
<AccessText TextWrapping="Wrap" <AccessText TextWrapping="Wrap"
Text="Shows various information Dota 2." /> Text="Shows game states and events from Dota 2." />
</Label.Content> </Label.Content>
</Label> </Label>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
@ -41,6 +44,8 @@
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" <StackPanel Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Grid.ColumnSpan="2" Margin="0,0,1,0"> Grid.ColumnSpan="2" Margin="0,0,1,0">
@ -56,30 +61,89 @@
</Grid> </Grid>
</StackPanel> </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 --> <!-- Abilities Display -->
<TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center" <TextBlock Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
Height="16" Margin="0,10,0,9"> Height="16" Margin="0,10,0,9">
Show abilities that can be cast. Castable abilities
</TextBlock> </TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.CanCastAbility, Mode=TwoWay}" <controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.CanCastAbility, Mode=TwoWay}"
Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
Margin="0,0,-5,0" Width="114" /> Margin="0,0,-5,0" Width="114" />
<!-- Items Display -->
<TextBlock Grid.Row="4" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
Height="16" Margin="0,10,0,9">
Castable items
</TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.CanCastItem, Mode=TwoWay}"
Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
Margin="0,0,-5,0" Width="114" />
<!-- Health Display --> <!-- Health Display -->
<TextBlock Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center" <TextBlock Grid.Row="5" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
Height="16" Margin="0,10,0,9"> Height="16" Margin="0,10,0,9">
Show health on F-Keys. Display health
</TextBlock> </TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowHealth, Mode=TwoWay}" <controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowHealth, Mode=TwoWay}"
Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No" Grid.Row="5" 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="9" Orientation="Horizontal" VerticalAlignment="Bottom"> <!-- Mana Display-->
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" <TextBlock Grid.Row="6" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
Style="{DynamicResource SquareButtonStyle}" /> Height="16" Margin="0,10,0,9">
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Display mana
Margin="10,0,0,0" </TextBlock>
Style="{DynamicResource SquareButtonStyle}" /> <controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowMana, Mode=TwoWay}"
Grid.Row="6" 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"
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
<!-- Daytime Display -->
<TextBlock Grid.Row="8" 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"
Margin="0,0,-5,0" Width="114" />
<!-- Dead Display -->
<TextBlock Grid.Row="9" 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"
Margin="0,0,-5,0" Width="114" />
<StackPanel Grid.Column="0" Grid.Row="11" 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"
Margin="10,0,0,0"
Style="{DynamicResource SquareButtonStyle}" />
</StackPanel> </StackPanel>

View File

@ -63,7 +63,7 @@ namespace Artemis.Modules.Games.Dota2
} }
MainManager.DialogService.ShowErrorMessageBox("Please select a valid Dota 2 directory\n\n" + MainManager.DialogService.ShowErrorMessageBox("Please select a valid Dota 2 directory\n\n" +
@"By default Dota 2 is in \SteamApps\common\Dota2"); @"By default Dota 2 is in \SteamApps\common\dota 2 beta");
((Dota2Settings)GameSettings).GameDirectory = string.Empty; ((Dota2Settings)GameSettings).GameDirectory = string.Empty;
NotifyOfPropertyChange(() => GameSettings); NotifyOfPropertyChange(() => GameSettings);