From ee579a5f958185f1777301b28533a867b84d63a3 Mon Sep 17 00:00:00 2001 From: Aytackydln Date: Wed, 26 Jun 2024 01:12:02 +0200 Subject: [PATCH] fix Dota 2 game state --- .../Project-Aurora/Profiles/Dota 2/Control_Dota2.xaml.cs | 8 ++++---- .../Project-Aurora/Profiles/Dota 2/GSI/Nodes/Map.cs | 4 ++-- .../Project-Aurora/Profiles/Dota 2/GSI/Nodes/Player.cs | 6 +++--- .../Profiles/Dota 2/Layers/Dota2BackgroundLayerHandler.cs | 6 +++--- .../Profiles/Dota 2/Layers/Dota2RespawnLayerHandler.cs | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Project-Aurora/Project-Aurora/Profiles/Dota 2/Control_Dota2.xaml.cs b/Project-Aurora/Project-Aurora/Profiles/Dota 2/Control_Dota2.xaml.cs index d7bff275b..793ff2f32 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Dota 2/Control_Dota2.xaml.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Dota 2/Control_Dota2.xaml.cs @@ -42,9 +42,9 @@ private void Control_Dota2_ProfileChanged(object? sender, EventArgs e) private void SetSettings() { if (preview_team.HasItems) return; - preview_team.Items.Add(PlayerTeam.None); - preview_team.Items.Add(PlayerTeam.Dire); - preview_team.Items.Add(PlayerTeam.Radiant); + preview_team.Items.Add(DotaPlayerTeam.None); + preview_team.Items.Add(DotaPlayerTeam.Dire); + preview_team.Items.Add(DotaPlayerTeam.Radiant); } private void preview_respawn_timer_Tick(object? sender, EventArgs e) @@ -93,7 +93,7 @@ private void unpatch_button_Click(object? sender, RoutedEventArgs e) private void preview_team_SelectionChanged(object? sender, SelectionChangedEventArgs e) { - (_profileManager.Config.Event.GameState as GameStateDota2).Player.Team = (PlayerTeam)preview_team.SelectedItem; + (_profileManager.Config.Event.GameState as GameStateDota2).Player.Team = (DotaPlayerTeam)preview_team.SelectedItem; } private void preview_health_slider_ValueChanged(object? sender, RoutedPropertyChangedEventArgs e) diff --git a/Project-Aurora/Project-Aurora/Profiles/Dota 2/GSI/Nodes/Map.cs b/Project-Aurora/Project-Aurora/Profiles/Dota 2/GSI/Nodes/Map.cs index 27f264647..0c9824161 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Dota 2/GSI/Nodes/Map.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Dota 2/GSI/Nodes/Map.cs @@ -66,7 +66,7 @@ public enum DOTA_GameState /// /// Enum list for each player team /// -public enum PlayerTeam +public enum DotaPlayerTeam { /// /// Undefined @@ -140,7 +140,7 @@ public class Map_Dota2 /// [JsonPropertyName("win_team")] [JsonConverter(typeof(JsonStringEnumConverter))] - public PlayerTeam Win_team { get; set; } + public DotaPlayerTeam Win_team { get; set; } /// /// The name of the custom game diff --git a/Project-Aurora/Project-Aurora/Profiles/Dota 2/GSI/Nodes/Player.cs b/Project-Aurora/Project-Aurora/Profiles/Dota 2/GSI/Nodes/Player.cs index 388dc7578..fd1b8c077 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Dota 2/GSI/Nodes/Player.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Dota 2/GSI/Nodes/Player.cs @@ -5,7 +5,7 @@ namespace AuroraRgb.Profiles.Dota_2.GSI.Nodes; /// /// Enum for various player activities /// -public enum PlayerActivity +public enum DotaPlayerActivity { /// /// Undefined @@ -45,7 +45,7 @@ public class PlayerDota2 /// Player's current activity state /// [JsonConverter(typeof(JsonStringEnumConverter))] - public PlayerActivity Activity { get; set; } + public DotaPlayerActivity Activity { get; set; } /// /// Player's amount of kills @@ -82,7 +82,7 @@ public class PlayerDota2 /// [JsonPropertyName("team_name")] [JsonConverter(typeof(JsonStringEnumConverter))] - public PlayerTeam Team { get; set; } + public DotaPlayerTeam Team { get; set; } /// /// Player's amount of gold diff --git a/Project-Aurora/Project-Aurora/Profiles/Dota 2/Layers/Dota2BackgroundLayerHandler.cs b/Project-Aurora/Project-Aurora/Profiles/Dota 2/Layers/Dota2BackgroundLayerHandler.cs index 0062ca82c..4363cec99 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Dota 2/Layers/Dota2BackgroundLayerHandler.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Dota 2/Layers/Dota2BackgroundLayerHandler.cs @@ -99,12 +99,12 @@ public override EffectLayer Render(IGameState state) var bgColor = dota2State.Player.Team switch { - PlayerTeam.Dire => Properties.DireColor, - PlayerTeam.Radiant => Properties.RadiantColor, + DotaPlayerTeam.Dire => Properties.DireColor, + DotaPlayerTeam.Radiant => Properties.RadiantColor, _ => Properties.DefaultColor }; - if (dota2State.Player.Team is PlayerTeam.Dire or PlayerTeam.Radiant) + if (dota2State.Player.Team is DotaPlayerTeam.Dire or DotaPlayerTeam.Radiant) { if (_dimBgAt <= dota2State.Map.GameTime || !dota2State.Hero.IsAlive) { diff --git a/Project-Aurora/Project-Aurora/Profiles/Dota 2/Layers/Dota2RespawnLayerHandler.cs b/Project-Aurora/Project-Aurora/Profiles/Dota 2/Layers/Dota2RespawnLayerHandler.cs index eb6da1e28..a48bdab40 100644 --- a/Project-Aurora/Project-Aurora/Profiles/Dota 2/Layers/Dota2RespawnLayerHandler.cs +++ b/Project-Aurora/Project-Aurora/Profiles/Dota 2/Layers/Dota2RespawnLayerHandler.cs @@ -67,7 +67,7 @@ public override EffectLayer Render(IGameState state) { if (state is not GameStateDota2 dota2State) return EffectLayer.EmptyLayer; - if (dota2State.Player.Team is PlayerTeam.Undefined or PlayerTeam.None || + if (dota2State.Player.Team is DotaPlayerTeam.Undefined or DotaPlayerTeam.None || dota2State.Hero.IsAlive) return EffectLayer.EmptyLayer; var percent = dota2State.Hero.SecondsToRespawn > 5 ? 0.0 : 1.0 - dota2State.Hero.SecondsToRespawn / 5.0; if (!(percent > 0)) return EffectLayer.EmptyLayer;