mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +00:00
Merge branch 'development' of https://github.com/SpoinkyNL/Artemis.git
This commit is contained in:
commit
9304cec41c
@ -48,7 +48,7 @@
|
||||
<setting name="ShowMana" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="ShowDead" serializeAs="String">
|
||||
<setting name="ShowEvents" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="MainColor" serializeAs="String">
|
||||
|
||||
@ -98,12 +98,12 @@ namespace Artemis.Modules.Games.Dota2 {
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool ShowDead {
|
||||
public bool ShowEvents {
|
||||
get {
|
||||
return ((bool)(this["ShowDead"]));
|
||||
return ((bool)(this["ShowEvents"]));
|
||||
}
|
||||
set {
|
||||
this["ShowDead"] = value;
|
||||
this["ShowEvents"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<Setting Name="ShowMana" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="ShowDead" Type="System.Boolean" Scope="User">
|
||||
<Setting Name="ShowEvents" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="MainColor" Type="System.Windows.Media.Color" Scope="User">
|
||||
|
||||
@ -72,7 +72,7 @@ namespace Artemis.Modules.Games.Dota2
|
||||
|
||||
DayCycleRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard
|
||||
, _keyPad.TopLeft.X*Scale
|
||||
, _keyPad.BottomRight.Y*Scale
|
||||
, _keyPad.TopLeft.Y* Scale
|
||||
, new List<Color>()
|
||||
, LinearGradientMode.Horizontal)
|
||||
{
|
||||
@ -91,7 +91,8 @@ namespace Artemis.Modules.Games.Dota2
|
||||
#region Long Switch Statement for Keys
|
||||
switch (Settings.KeyboardLayout)
|
||||
{
|
||||
case "0": //default
|
||||
case "0":
|
||||
case "Default": //default
|
||||
case "4": //Heroes of newearth
|
||||
case "3": //League of Legends
|
||||
for (int i = 0; i < AbilityKeysRectangles.Length; i++)
|
||||
@ -167,20 +168,20 @@ namespace Artemis.Modules.Games.Dota2
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
if (D2Json == null)
|
||||
if (D2Json?.map == null)
|
||||
return;
|
||||
if (Settings.ShowDead && D2Json?.hero?.alive != null && !D2Json.hero.alive)
|
||||
{
|
||||
UpdateLifeStatus();
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateMainColor();
|
||||
if (Settings.ShowEvents)
|
||||
UpdateEvents();
|
||||
if (Settings.ShowDayCycle)
|
||||
UpdateDay();
|
||||
if (!D2Json.hero.alive)
|
||||
return;
|
||||
if (Settings.CanCastAbility)
|
||||
UpdateAbilities();
|
||||
if (Settings.ShowHealth)
|
||||
UpdateHealth();
|
||||
if (Settings.ShowDayCycle)
|
||||
UpdateDay();
|
||||
if (Settings.ShowMana)
|
||||
UpdateMana();
|
||||
|
||||
@ -193,15 +194,34 @@ namespace Artemis.Modules.Games.Dota2
|
||||
DayCycleRectangle.Colors = list;
|
||||
HealthRectangle.Colors = list;
|
||||
ManaRectangle.Colors = list;
|
||||
foreach (var key in AbilityKeysRectangles)
|
||||
key.Colors = list;
|
||||
}
|
||||
|
||||
private void UpdateLifeStatus()
|
||||
private void UpdateEvents()
|
||||
{
|
||||
var list = new List<Color> {Color.LightGray};
|
||||
List<Color> list = null;
|
||||
if (!D2Json.hero.alive)
|
||||
list = new List<Color> { Color.LightGray };
|
||||
else if (D2Json.hero.disarmed)
|
||||
list = new List<Color> { Color.Yellow };
|
||||
else if (D2Json.hero.hexed)
|
||||
list = new List<Color> { Color.Yellow };
|
||||
else if (D2Json.hero.silenced)
|
||||
list = new List<Color> { Color.Yellow };
|
||||
else if (D2Json.hero.stunned)
|
||||
list = new List<Color> { Color.Yellow };
|
||||
else if (D2Json.hero.magicimmune)
|
||||
list = new List<Color> { Color.Lime };
|
||||
if(list == null)
|
||||
return;
|
||||
|
||||
EventRectangle.Colors = list;
|
||||
DayCycleRectangle.Colors = list;
|
||||
HealthRectangle.Colors = list;
|
||||
ManaRectangle.Colors = list;
|
||||
foreach (var item in AbilityKeysRectangles)
|
||||
item.Colors = list;
|
||||
}
|
||||
|
||||
private void UpdateDay()
|
||||
@ -276,9 +296,12 @@ namespace Artemis.Modules.Games.Dota2
|
||||
EventRectangle.Draw(g);
|
||||
HealthRectangle.Draw(g);
|
||||
ManaRectangle.Draw(g);
|
||||
foreach (var item in AbilityKeysRectangles)
|
||||
{
|
||||
item.Draw(g);
|
||||
}
|
||||
DayCycleRectangle.Draw(g);
|
||||
foreach (var key in AbilityKeysRectangles)
|
||||
key.Draw(g);
|
||||
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ namespace Artemis.Modules.Games.Dota2
|
||||
public bool ShowHealth { get; set; }
|
||||
public bool ShowDayCycle { get; set; }
|
||||
public bool ShowMana { get; set; }
|
||||
public bool ShowDead { get; set; }
|
||||
public bool ShowEvents { get; set; }
|
||||
public Color MainColor { get; set; }
|
||||
public Color ManaColor { get; set; }
|
||||
public string KeyboardLayout { get; set; }
|
||||
@ -43,7 +43,7 @@ namespace Artemis.Modules.Games.Dota2
|
||||
GameDirectory = Dota2.Default.GameDirectory;
|
||||
ShowDayCycle = Dota2.Default.ShowDayCycle;
|
||||
ShowMana = Dota2.Default.ShowMana;
|
||||
ShowDead = Dota2.Default.ShowDead;
|
||||
ShowEvents = Dota2.Default.ShowEvents;
|
||||
AbilityReadyColor = Dota2.Default.AbilityReadyColor;
|
||||
AbilityCooldownColor = Dota2.Default.AbilityCooldownColor;
|
||||
}
|
||||
@ -59,7 +59,7 @@ namespace Artemis.Modules.Games.Dota2
|
||||
Dota2.Default.Enabled = Enabled;
|
||||
Dota2.Default.GameDirectory = GameDirectory;
|
||||
Dota2.Default.ShowMana = ShowMana;
|
||||
Dota2.Default.ShowDead = ShowDead;
|
||||
Dota2.Default.ShowEvents = ShowEvents;
|
||||
Dota2.Default.AbilityCooldownColor = AbilityCooldownColor;
|
||||
Dota2.Default.AbilityReadyColor = AbilityReadyColor;
|
||||
|
||||
@ -81,7 +81,7 @@ namespace Artemis.Modules.Games.Dota2
|
||||
CanCastAbility = true;
|
||||
ShowDayCycle = true;
|
||||
ShowMana = true;
|
||||
ShowDead = true;
|
||||
ShowEvents = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,9 +151,9 @@
|
||||
<!-- Dead Display -->
|
||||
<TextBlock Grid.Row="11" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
|
||||
Height="16" Margin="0,10,0,9">
|
||||
Display gray when dead
|
||||
Show events on the keyboard
|
||||
</TextBlock>
|
||||
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowDead, Mode=TwoWay}"
|
||||
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowEvents, Mode=TwoWay}"
|
||||
Grid.Row="11" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||
Margin="0,0,-5,0" Width="114" />
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user