From 40b25e74723db5edf8eec669d4340e2e0435a076 Mon Sep 17 00:00:00 2001 From: Brian Nguyen Date: Sat, 16 Apr 2016 19:00:48 +0700 Subject: [PATCH 01/39] 1.0.0.2 --- Core/Events/Dash.cs | 7 +---- Core/Extensions/SharpDX/Vector2Extensions.cs | 26 --------------- Core/Extensions/SharpDX/Vector3Extensions.cs | 27 +--------------- Core/Extensions/Unit.cs | 10 +++--- Core/Math/Geometry.cs | 12 +++---- Core/UI/IMenu/Values/MenuSliderButton.cs | 1 + Core/Utils/Invulnerable.cs | 22 +++++++------ Core/Utils/Render.cs | 2 +- Core/Wrappers/Items.cs | 6 ++-- Core/Wrappers/Map.cs | 2 +- Core/Wrappers/Spells/Spell.cs | 8 ++--- Resources/Data/Gapclosers.json | 33 +++++++++++++++++--- 12 files changed, 60 insertions(+), 96 deletions(-) diff --git a/Core/Events/Dash.cs b/Core/Events/Dash.cs index 5160a07..c71d00d 100644 --- a/Core/Events/Dash.cs +++ b/Core/Events/Dash.cs @@ -76,12 +76,7 @@ public static DashArgs GetDashInfo(this Obj_AI_Base unit) public static bool IsDashing(this Obj_AI_Base unit) { DashArgs value; - if (DetectedDashes.TryGetValue(unit.NetworkId, out value) && unit.Path.Length != 0) - { - return value.EndTick != 0; - } - - return false; + return DetectedDashes.TryGetValue(unit.NetworkId, out value) && unit.Path.Length != 0 && value.EndTick != 0; } #endregion diff --git a/Core/Extensions/SharpDX/Vector2Extensions.cs b/Core/Extensions/SharpDX/Vector2Extensions.cs index d826138..9bde79b 100644 --- a/Core/Extensions/SharpDX/Vector2Extensions.cs +++ b/Core/Extensions/SharpDX/Vector2Extensions.cs @@ -635,32 +635,6 @@ public static List ToVector3(this List path) return path.Select(point => point.ToVector3()).ToList(); } - /// - /// Transforms an extended Vector2 into a Vector4. - /// - /// SharpDX Vector2 - /// Float Z-axis (default = 0f) - /// Float W-axis (default = 0f) - /// The - public static Vector4 ToVector4(this Vector2 vector2, float z = 0f, float w = 1f) - { - return new Vector4(vector2, z, w); - } - - /// - /// Transforms an extended Vector2 List into a Vector4 List. - /// - /// - /// The path. - /// - /// - /// Vector4 List - /// - public static List ToVector4(this List path) - { - return path.Select(point => point.ToVector4()).ToList(); - } - /// /// Calculates movement collision between two vectors points. /// diff --git a/Core/Extensions/SharpDX/Vector3Extensions.cs b/Core/Extensions/SharpDX/Vector3Extensions.cs index 50afa6c..88445e1 100644 --- a/Core/Extensions/SharpDX/Vector3Extensions.cs +++ b/Core/Extensions/SharpDX/Vector3Extensions.cs @@ -254,7 +254,7 @@ public static bool IsUnderEnemyTurret(this Vector3 position) /// public static bool IsValid(this Vector3 vector3) { - return vector3 != Vector3.Zero; + return vector3.ToVector2().IsValid(); } /// @@ -404,31 +404,6 @@ public static List ToVector2(this List path) return path.Select(point => point.ToVector2()).ToList(); } - /// - /// Transforms an extended Vector3 into a Vector4. - /// - /// SharpDX Vector3 - /// Float W-axis (default = 0f) - /// The - public static Vector4 ToVector4(this Vector3 vector3, float w = 1f) - { - return new Vector4(vector3, w); - } - - /// - /// Transforms an extended Vector3 List into a Vector4 List. - /// - /// - /// The path. - /// - /// - /// Vector4 List - /// - public static List ToVector4(this List path) - { - return path.Select(point => point.ToVector4()).ToList(); - } - #endregion } } \ No newline at end of file diff --git a/Core/Extensions/Unit.cs b/Core/Extensions/Unit.cs index c9cb402..593594f 100644 --- a/Core/Extensions/Unit.cs +++ b/Core/Extensions/Unit.cs @@ -464,7 +464,7 @@ public static bool IsValidTarget( bool checkTeam = true, Vector3 from = default(Vector3)) { - if (unit == null || !unit.IsValid || unit.IsDead || !unit.IsVisible || !unit.IsTargetable + if (unit == null || !unit.IsValid || !unit.IsVisible || unit.IsDead || !unit.IsTargetable || unit.IsInvulnerable) { return false; @@ -482,11 +482,9 @@ public static bool IsValidTarget( return false; } - var unitPosition = @base?.ServerPosition ?? unit.Position; - - return @from.IsValid() - ? @from.DistanceSquared(unitPosition) < range * range - : GameObjects.Player.DistanceSquared(unitPosition) < range * range; + return + (@from.IsValid() ? @from : GameObjects.Player.ServerPosition).DistanceSquared( + @base?.ServerPosition ?? unit.Position) < range * range; } #endregion diff --git a/Core/Math/Geometry.cs b/Core/Math/Geometry.cs index 6f21cc8..093bb54 100644 --- a/Core/Math/Geometry.cs +++ b/Core/Math/Geometry.cs @@ -36,9 +36,9 @@ public static class Geometry /// Centered Flags /// Vector2 center position of the rendering object on the rectangle. public static Vector2 GetCenter( - this SharpDX.Rectangle rectangle, + this Rectangle rectangle, Sprite sprite, - SharpDX.Rectangle dimensions, + Rectangle dimensions, CenteredFlags flags) { var x = 0; @@ -81,11 +81,7 @@ public static Vector2 GetCenter( /// The Text /// Centered Flags /// Returns the center position of the text on the rectangle. - public static Vector2 GetCenteredText( - this SharpDX.Rectangle rectangle, - Sprite sprite, - string text, - CenteredFlags flags) + public static Vector2 GetCenteredText(this Rectangle rectangle, Sprite sprite, string text, CenteredFlags flags) { return rectangle.GetCenter(sprite, Constants.LeagueSharpFont.MeasureText(sprite, text, 0), flags); } @@ -100,7 +96,7 @@ public static Vector2 GetCenteredText( /// Centered Flags /// Returns the center position of the text on the rectangle. public static Vector2 GetCenteredText( - this SharpDX.Rectangle rectangle, + this Rectangle rectangle, Sprite sprite, Font font, string text, diff --git a/Core/UI/IMenu/Values/MenuSliderButton.cs b/Core/UI/IMenu/Values/MenuSliderButton.cs index ee64c2b..bda55ac 100644 --- a/Core/UI/IMenu/Values/MenuSliderButton.cs +++ b/Core/UI/IMenu/Values/MenuSliderButton.cs @@ -92,6 +92,7 @@ public MenuSliderButton( this.MinValue = minValue; this.MaxValue = maxValue; this.SValue = value; + this.BValue = bValue; this.original = value; this.bOriginal = bValue; } diff --git a/Core/Utils/Invulnerable.cs b/Core/Utils/Invulnerable.cs index 499ed03..0b30317 100644 --- a/Core/Utils/Invulnerable.cs +++ b/Core/Utils/Invulnerable.cs @@ -24,8 +24,6 @@ namespace LeagueSharp.SDK.Core.Utils using System.Collections.ObjectModel; using System.Linq; - using LeagueSharp.SDK; - #endregion /// @@ -57,21 +55,23 @@ static Invulnerable() ChampionName = "Alistar", CheckFunction = (target, type) => - GameObjects.Player.CountEnemyHeroesInRange(GameObjects.Player.GetRealAutoAttackRange()) > 1 + GameObjects.Player.CountEnemyHeroesInRange( + GameObjects.Player.GetRealAutoAttackRange()) > 1 }, new InvulnerableEntry("Meditate") { ChampionName = "MasterYi", CheckFunction = (target, type) => - GameObjects.Player.CountEnemyHeroesInRange(GameObjects.Player.GetRealAutoAttackRange()) > 1 + GameObjects.Player.CountEnemyHeroesInRange( + GameObjects.Player.GetRealAutoAttackRange()) > 1 }, new InvulnerableEntry("UndyingRage") { ChampionName = "Tryndamere", MinHealthPercent = 1, CheckFunction = (target, type) => target.HealthPercent <= 5 }, - new InvulnerableEntry("Kayle") { ChampionName = "JudicatorIntervention", IsShield = true }, + new InvulnerableEntry("JudicatorIntervention") { IsShield = true }, new InvulnerableEntry("fizztrickslamsounddummy") { ChampionName = "Fizz" }, new InvulnerableEntry("VladimirSanguinePool") { ChampionName = "Vladimir" }, new InvulnerableEntry("FioraW") { ChampionName = "Fiora" }, @@ -79,11 +79,13 @@ static Invulnerable() { ChampionName = "Jax", DamageType = DamageType.Physical }, new InvulnerableEntry("BlackShield") { IsShield = true, DamageType = DamageType.Magical }, new InvulnerableEntry("BansheesVeil") { IsShield = true, DamageType = DamageType.Magical }, - new InvulnerableEntry("SivirE") - { ChampionName = "Sivir", IsShield = true, MinHealthPercent = 0 }, - new InvulnerableEntry("ShroudofDarkness") { ChampionName = "Nocturne", IsShield = true }, + new InvulnerableEntry("SivirE") { ChampionName = "Sivir", IsShield = true }, + new InvulnerableEntry("NocturneShroudofDarkness") { ChampionName = "Nocturne", IsShield = true }, new InvulnerableEntry("KindredrNoDeathBuff") - { MinHealthPercent = 10, CheckFunction = (target, type) => target.HealthPercent <= 10 } + { + ChampionName = "Kindred", MinHealthPercent = 10, + CheckFunction = (target, type) => target.HealthPercent <= 10 + } }); } @@ -279,4 +281,4 @@ public InvulnerableEntry(string buffName) #endregion } -} +} \ No newline at end of file diff --git a/Core/Utils/Render.cs b/Core/Utils/Render.cs index 0b13894..df572f7 100644 --- a/Core/Utils/Render.cs +++ b/Core/Utils/Render.cs @@ -621,7 +621,7 @@ public static void DrawCircle( Vector3 position, float radius, Color color, - int width = 5, + int width = 3, bool zDeep = false) { try diff --git a/Core/Wrappers/Items.cs b/Core/Wrappers/Items.cs index 34ab1e0..4fb9576 100644 --- a/Core/Wrappers/Items.cs +++ b/Core/Wrappers/Items.cs @@ -80,7 +80,7 @@ public static bool CanUseItem(int id) /// public static InventorySlot GetWardSlot() { - var wardIds = new[] { 3340, 3363, 2049, 2045, 2301, 2302, 2303, 3711, 1408, 1409, 1410, 1411, 3932, 2043 }; + var wardIds = new[] { 2049, 2045, 2301, 2302, 2303, 3711, 1408, 1409, 1410, 1411, 3932, 3340, 2043 }; return (from wardId in wardIds where CanUseItem(wardId) select GameObjects.Player.InventoryItems.FirstOrDefault(slot => slot.Id == (ItemId)wardId)) @@ -200,7 +200,7 @@ public static bool UseItem(int id, Vector2 position) /// public static bool UseItem(int id, Vector3 position) { - return position != Vector3.Zero + return position.IsValid() && GameObjects.Player.InventoryItems.Where(slot => slot.Id == (ItemId)id) .Select(slot => GameObjects.Player.Spellbook.CastSpell(slot.SpellSlot, position)) .FirstOrDefault(); @@ -459,7 +459,7 @@ public bool IsInRange(Vector2 position) /// public bool IsInRange(Vector3 position) { - return GameObjects.Player.ServerPosition.DistanceSquared(position) < this.RangeSqr; + return GameObjects.Player.DistanceSquared(position) < this.RangeSqr; } /// diff --git a/Core/Wrappers/Map.cs b/Core/Wrappers/Map.cs index 9fe37bd..a44aa6d 100644 --- a/Core/Wrappers/Map.cs +++ b/Core/Wrappers/Map.cs @@ -32,7 +32,7 @@ public class Map #region Static Fields [ResourceImport("Data.Map.json")] - private static Dictionary MapById = new Dictionary(); + private static readonly Dictionary MapById = new Dictionary(); /// /// Map by ID list. diff --git a/Core/Wrappers/Spells/Spell.cs b/Core/Wrappers/Spells/Spell.cs index 0c49c37..34901bd 100644 --- a/Core/Wrappers/Spells/Spell.cs +++ b/Core/Wrappers/Spells/Spell.cs @@ -183,7 +183,7 @@ public Vector3 From { get { - return !this.@from.ToVector2().IsValid() ? GameObjects.Player.ServerPosition : this.@from; + return !this.@from.IsValid() ? GameObjects.Player.ServerPosition : this.@from; } set @@ -276,9 +276,7 @@ public Vector3 RangeCheckFrom { get { - return !this.rangeCheckFrom.ToVector2().IsValid() - ? GameObjects.Player.ServerPosition - : this.rangeCheckFrom; + return !this.rangeCheckFrom.IsValid() ? GameObjects.Player.ServerPosition : this.rangeCheckFrom; } set @@ -888,7 +886,7 @@ public PredictionOutput GetPrediction( Obj_AI_Base unit, bool aoe = false, float overrideRange = -1, - CollisionableObjects collisionable = CollisionableObjects.Heroes | CollisionableObjects.Minions) + CollisionableObjects collisionable = CollisionableObjects.Minions | CollisionableObjects.YasuoWall) { return Movement.GetPrediction( diff --git a/Resources/Data/Gapclosers.json b/Resources/Data/Gapclosers.json index 842af3b..3d6a430 100644 --- a/Resources/Data/Gapclosers.json +++ b/Resources/Data/Gapclosers.json @@ -29,6 +29,11 @@ "Slot": "E", "SpellName": "ekkoeattack" }, + "Elise": { + "SkillType": "Targeted", + "Slot": "Q", + "SpellName": "elisespiderqcast" + }, "Elise": { "SkillType": "Targeted", "Slot": "E", @@ -49,6 +54,11 @@ "Slot": "E", "SpellName": "gnare" }, + "Gnar": { + "SkillType": "Skillshot", + "Slot": "E", + "SpellName": "gnarbige" + }, "Gragas": { "SkillType": "Skillshot", "Slot": "E", @@ -94,11 +104,21 @@ "Slot": "R", "SpellName": "riftwalk" }, + "Khazix": { + "SkillType": "Skillshot", + "Slot": "E", + "SpellName": "khazixe" + }, "Khazix": { "SkillType": "Skillshot", "Slot": "E", "SpellName": "khazixelong" }, + "LeBlanc": { + "SkillType": "Skillshot", + "Slot": "W", + "SpellName": "leblancslide" + }, "LeBlanc": { "SkillType": "Skillshot", "Slot": "R", @@ -134,6 +154,11 @@ "Slot": "E", "SpellName": "monkeykingnimbus" }, + "Pantheon": { + "SkillType": "Targeted", + "Slot": "W", + "SpellName": "pantheon_leapbash" + }, "Pantheon": { "SkillType": "Skillshot", "Slot": "R", @@ -204,9 +229,9 @@ "Slot": "E", "SpellName": "zace" }, - "Ziggs": { - "SkillType": "Skillshot", - "Slot": "W", - "SpellName": "ziggswtoggle" + "Zed": { + "SkillType": "Targeted", + "Slot": "R", + "SpellName": "zedr" } } \ No newline at end of file From c17c845db2d697bceb3abab84d97295fa6aaa737 Mon Sep 17 00:00:00 2001 From: Brian Nguyen Date: Sat, 16 Apr 2016 19:56:50 +0700 Subject: [PATCH 02/39] 1.0.0.2 --- Core/Math/Prediction/Movement.cs | 325 ++++++++++++++++++------------- Properties/AssemblyInfo.cs | 4 +- 2 files changed, 191 insertions(+), 138 deletions(-) diff --git a/Core/Math/Prediction/Movement.cs b/Core/Math/Prediction/Movement.cs index de41f75..5b88703 100644 --- a/Core/Math/Prediction/Movement.cs +++ b/Core/Math/Prediction/Movement.cs @@ -93,33 +93,6 @@ public static PredictionOutput GetPrediction(PredictionInput input) #region Methods - /// - /// Calculates the position to cast a spell according to unit movement. - /// - /// PredictionInput type - /// Additional Speed (Multiplicative) - /// The - internal static PredictionOutput GetAdvancedPrediction(PredictionInput input, float additionalSpeed = 0) - { - var speed = Math.Abs(additionalSpeed) < float.Epsilon ? input.Speed : input.Speed * additionalSpeed; - - if (Math.Abs(speed - int.MaxValue) < float.Epsilon) - { - speed = 90000; - } - - var unit = input.Unit; - var position = PositionAfter(unit, 1, unit.MoveSpeed - 100); - var prediction = position + (speed * (input.Delay / 1000)); - - return new PredictionOutput() - { - UnitPosition = new Vector3(position.X, position.Y, unit.ServerPosition.Z), - CastPosition = new Vector3(prediction.X, prediction.Y, unit.ServerPosition.Z), - Hitchance = HitChance.High - }; - } - /// /// Returns Dashing Prediction /// @@ -131,17 +104,19 @@ internal static PredictionOutput GetDashingPrediction(PredictionInput input) { var dashData = input.Unit.GetDashInfo(); var result = new PredictionOutput { Input = input }; - input.Delay += 0.1f; // Normal dashes. if (!dashData.IsBlink) { + var endP = dashData.EndPos; + // Mid air: var dashPred = GetPositionOnPath( input, - new List { input.Unit.ServerPosition.ToVector2(), dashData.Path.Last() }, + new List { input.Unit.ServerPosition.ToVector2(), endP }, dashData.Speed); - if (dashPred.Hitchance >= HitChance.High) + if (dashPred.Hitchance >= HitChance.High + && dashPred.UnitPosition.ToVector2().Distance(input.Unit.Position.ToVector2(), endP, true) < 200) { dashPred.CastPosition = dashPred.UnitPosition; dashPred.Hitchance = HitChance.Dashing; @@ -151,20 +126,19 @@ internal static PredictionOutput GetDashingPrediction(PredictionInput input) // At the end of the dash: if (dashData.Path.PathLength() > 200) { - var endP = dashData.Path.Last(); - var timeToPoint = input.Delay + (input.From.Distance(endP) / input.Speed); + var timeToPoint = input.Delay / 2f + input.From.Distance(endP) / input.Speed - 0.25f; if (timeToPoint - <= (input.Unit.Distance(endP) / dashData.Speed) + (input.RealRadius / input.Unit.MoveSpeed)) + <= input.Unit.Distance(endP) / dashData.Speed + input.RealRadius / input.Unit.MoveSpeed) { return new PredictionOutput { - CastPosition = endP.ToVector3(), UnitPosition = endP.ToVector3(), + Input = input, CastPosition = endP.ToVector3(), UnitPosition = endP.ToVector3(), Hitchance = HitChance.Dashing }; } } - result.CastPosition = dashData.Path.Last().ToVector3(); + result.CastPosition = endP.ToVector3(); result.UnitPosition = result.CastPosition; // Figure out where the unit is going. @@ -183,22 +157,20 @@ internal static PredictionOutput GetDashingPrediction(PredictionInput input) /// output internal static PredictionOutput GetImmobilePrediction(PredictionInput input, double remainingImmobileT) { - var timeToReachTargetPosition = input.Delay + (input.Unit.Distance(input.From) / input.Speed); - - if (timeToReachTargetPosition <= remainingImmobileT + (input.RealRadius / input.Unit.MoveSpeed)) + var result = new PredictionOutput + { + Input = input, CastPosition = input.Unit.ServerPosition, + UnitPosition = input.Unit.ServerPosition, Hitchance = HitChance.High + }; + var timeToReachTargetPosition = input.Delay + input.Unit.Distance(input.From) / input.Speed; + + if (timeToReachTargetPosition <= remainingImmobileT + input.RealRadius / input.Unit.MoveSpeed) { - return new PredictionOutput - { - CastPosition = input.Unit.ServerPosition, UnitPosition = input.Unit.Position, - Hitchance = HitChance.Immobile - }; + result.UnitPosition = input.Unit.Position; + result.Hitchance = HitChance.Immobile; } - return new PredictionOutput - { - Input = input, CastPosition = input.Unit.ServerPosition, - UnitPosition = input.Unit.ServerPosition, Hitchance = HitChance.High - }; + return result; } /// @@ -212,7 +184,7 @@ internal static PredictionOutput GetImmobilePrediction(PredictionInput input, do /// output internal static PredictionOutput GetPositionOnPath(PredictionInput input, List path, float speed = -1) { - speed = (Math.Abs(speed - (-1)) < float.Epsilon) ? input.Unit.MoveSpeed : speed; + speed = Math.Abs(speed - -1) < float.Epsilon ? input.Unit.MoveSpeed : speed; if (path.Count <= 1) { @@ -224,12 +196,12 @@ internal static PredictionOutput GetPositionOnPath(PredictionInput input, List= (input.Delay * speed) - input.RealRadius - && Math.Abs(input.Speed - float.MaxValue) < float.Epsilon) + if (pLength >= dist && Math.Abs(input.Speed - float.MaxValue) < float.Epsilon) { - var tDistance = (input.Delay * speed) - input.RealRadius; + var tDistance = dist; for (var i = 0; i < path.Count - 1; i++) { @@ -241,12 +213,12 @@ internal static PredictionOutput GetPositionOnPath(PredictionInput input, List= (input.Delay * speed) - input.RealRadius - && Math.Abs(input.Speed - float.MaxValue) > float.Epsilon) + if (pLength >= dist && Math.Abs(input.Speed - float.MaxValue) > float.Epsilon) { - path = path.CutPath(Math.Max(0, (input.Delay * speed) - input.RealRadius)); + var tDistance = dist; + if ((input.Type == SkillshotType.SkillshotLine || input.Type == SkillshotType.SkillshotCone) + && input.Unit.DistanceSquared(input.From) < 200 * 200) + { + tDistance = input.Delay * speed; + } + path = path.CutPath(Math.Max(0, tDistance)); var tT = 0f; for (var i = 0; i < path.Count - 1; i++) { @@ -274,14 +251,19 @@ internal static PredictionOutput GetPositionOnPath(PredictionInput input, List= tT && t <= tT + tB) { - var p = pos + (input.RealRadius * direction); + if (pos.DistanceSquared(b) < 20) + { + break; + } + + var p = pos + input.RealRadius * direction; if (input.Type == SkillshotType.SkillshotLine) { @@ -310,12 +292,9 @@ internal static PredictionOutput GetPositionOnPath(PredictionInput input, List @@ -331,8 +310,6 @@ internal static PredictionOutput GetPositionOnPath(PredictionInput input, List internal static PredictionOutput GetPrediction(PredictionInput input, bool ft, bool checkCollision) { - PredictionOutput result = null; - if (!input.Unit.IsValidTarget(float.MaxValue, false)) { return new PredictionOutput(); @@ -341,7 +318,7 @@ internal static PredictionOutput GetPrediction(PredictionInput input, bool ft, b if (ft) { // Increase the delay due to the latency and server tick: - input.Delay += (Game.Ping / 2000f) + 0.06f; + input.Delay += Game.Ping / 2000f + 0.06f; if (input.AoE) { @@ -356,6 +333,8 @@ internal static PredictionOutput GetPrediction(PredictionInput input, bool ft, b return new PredictionOutput { Input = input }; } + PredictionOutput result = null; + // Unit is dashing. if (input.Unit.IsDashing()) { @@ -374,7 +353,7 @@ internal static PredictionOutput GetPrediction(PredictionInput input, bool ft, b // Normal prediction if (result == null) { - result = GetAdvancedPrediction(input); + result = GetStandardPrediction(input); } // Check if the unit position is in range @@ -382,7 +361,7 @@ internal static PredictionOutput GetPrediction(PredictionInput input, bool ft, b { if (result.Hitchance >= HitChance.High && input.RangeCheckFrom.DistanceSquared(input.Unit.Position) - > Math.Pow(input.Range + (input.RealRadius * 3 / 4), 2)) + > Math.Pow(input.Range + input.RealRadius * 3 / 4, 2)) { result.Hitchance = HitChance.Medium; } @@ -393,29 +372,34 @@ internal static PredictionOutput GetPrediction(PredictionInput input, bool ft, b result.Hitchance = HitChance.OutOfRange; } - if (input.RangeCheckFrom.DistanceSquared(result.CastPosition) > Math.Pow(input.Range, 2)) + if (input.RangeCheckFrom.DistanceSquared(result.CastPosition) > Math.Pow(input.Range, 2) + && result.Hitchance != HitChance.OutOfRange) { - if (result.Hitchance != HitChance.OutOfRange) - { - result.CastPosition = input.RangeCheckFrom - + (input.Range - * (result.UnitPosition - input.RangeCheckFrom).Normalized().SetZ()); - } - else - { - result.Hitchance = HitChance.OutOfRange; - } + result.CastPosition = input.RangeCheckFrom + + input.Range + * (result.UnitPosition - input.RangeCheckFrom).ToVector2() + .Normalized() + .ToVector3(); } } + // Calc hitchance again + if (result.Hitchance == HitChance.High) + { + result.Hitchance = GetHitChance(input); + } + // Check for collision if (checkCollision && input.Collision) { - var positions = new List { result.UnitPosition, result.CastPosition, input.Unit.Position }; + var positions = new List { result.UnitPosition, input.Unit.Position }; var originalUnit = input.Unit; result.CollisionObjects = Collision.GetCollision(positions, input); - result.CollisionObjects.RemoveAll(x => x.NetworkId == originalUnit.NetworkId); - result.Hitchance = result.CollisionObjects.Count > 0 ? HitChance.Collision : result.Hitchance; + result.CollisionObjects.RemoveAll(x => x.Compare(originalUnit)); + if (result.CollisionObjects.Count > 0) + { + result.Hitchance = HitChance.Collision; + } } return result; @@ -438,44 +422,7 @@ internal static PredictionOutput GetStandardPrediction(PredictionInput input) speed /= 1.5f; } - var result = GetPositionOnPath(input, input.Unit.GetWaypoints(), speed); - - if (result.Hitchance >= HitChance.High && input.Unit is Obj_AI_Hero) - { - } - - return result; - } - - /// - /// Calculates the unit position after "t" - /// - /// Unit to track - /// Track time - /// Speed of unit - /// The of the after position - internal static Vector2 PositionAfter(Obj_AI_Base unit, float t, float speed = float.MaxValue) - { - var distance = t * speed; - var path = unit.GetWaypoints(); - - for (var i = 0; i < path.Count - 1; i++) - { - var a = path[i]; - var b = path[i + 1]; - var d = a.Distance(b); - - if (d < distance) - { - distance -= d; - } - else - { - return a + (distance * (b - a).Normalized()); - } - } - - return path[path.Count - 1]; + return GetPositionOnPath(input, input.Unit.GetWaypoints(), speed); } /// @@ -488,13 +435,123 @@ internal static double UnitIsImmobileUntil(Obj_AI_Base unit) var result = unit.Buffs.Where( buff => - buff.IsActive && Game.Time <= buff.EndTime - && (buff.Type == BuffType.Charm || buff.Type == BuffType.Knockup || buff.Type == BuffType.Stun - || buff.Type == BuffType.Suppression || buff.Type == BuffType.Snare)) + buff.IsValid + && (buff.Type == BuffType.Knockup || buff.Type == BuffType.Snare || buff.Type == BuffType.Stun + || buff.Type == BuffType.Suppression)) .Aggregate(0d, (current, buff) => Math.Max(current, buff.EndTime)); return result - Game.Time; } + private static double GetAngle(Vector2 from, Vector2 to, Vector2 wayPoint) + { + if (to == wayPoint) + { + return 60; + } + var a = Math.Pow(wayPoint.X - from.X, 2) + Math.Pow(wayPoint.Y - from.Y, 2); + var b = Math.Pow(from.X - to.X, 2) + Math.Pow(from.Y - to.Y, 2); + var c = Math.Pow(wayPoint.X - to.X, 2) + Math.Pow(wayPoint.Y - to.Y, 2); + return Math.Cos((a + b - c) / (2 * Math.Sqrt(a) * Math.Sqrt(b))) * 180 / Math.PI; + } + + private static HitChance GetHitChance(PredictionInput input) + { + var hero = input.Unit as Obj_AI_Hero; + + if (hero == null || input.Radius <= 1f) + { + return HitChance.VeryHigh; + } + + if (hero.IsCastingInterruptableSpell(true) || hero.IsRecalling()) + { + return HitChance.VeryHigh; + } + + if (hero.Path.Length > 0 != hero.IsMoving) + { + return HitChance.Medium; + } + + var wayPoint = input.Unit.GetWaypoints().Last(); + var distUnitToWay = hero.Distance(wayPoint); + var distUnitToFrom = hero.Distance(input.From); + var distFromToWay = input.From.Distance(wayPoint); + var delay = input.Delay + + (Math.Abs(input.Speed - float.MaxValue) < float.Epsilon ? 0 : distUnitToFrom / input.Speed); + var moveArea = hero.MoveSpeed * delay; + var fixRange = moveArea * 0.4f; + var minPath = 900 + moveArea; + var moveAngle = 31d; + + if (input.Radius > 70) + { + moveAngle++; + } + else if (input.Radius <= 60) + { + moveAngle--; + } + + if (input.Delay < 0.3) + { + moveAngle++; + } + + if (GamePath.PathTracker.GetCurrentPath(input.Unit).Time < 0.1d) + { + fixRange = moveArea * 0.3f; + minPath = 700 + moveArea; + moveAngle += 1.5; + } + + if (input.Type == SkillshotType.SkillshotCircle) + { + fixRange -= input.Radius / 2; + } + + if (distFromToWay <= distUnitToFrom) + { + if (distUnitToFrom > input.Range - fixRange) + { + return HitChance.Medium; + } + } + else if (distUnitToWay > 350) + { + moveAngle += 1.5; + } + + if (distUnitToFrom < 250 || hero.MoveSpeed < 250 || distFromToWay < 250) + { + return HitChance.VeryHigh; + } + + if (distUnitToWay > minPath) + { + return HitChance.VeryHigh; + } + + if (hero.HealthPercent < 20 || GameObjects.Player.HealthPercent < 20) + { + return HitChance.VeryHigh; + } + + if (GetAngle(input.From.ToVector2(), hero.ServerPosition.ToVector2(), wayPoint) < moveAngle + && distUnitToWay > 260) + { + return HitChance.VeryHigh; + } + + if (input.Type == SkillshotType.SkillshotCircle + && GamePath.PathTracker.GetCurrentPath(input.Unit).Time < 0.1d && distUnitToWay > fixRange) + { + return HitChance.VeryHigh; + } + + return HitChance.High; + } + #endregion } @@ -683,6 +740,11 @@ public Vector3 CastPosition /// public HitChance Hitchance { get; set; } = HitChance.Impossible; + /// + /// Gets or sets the input. + /// + public PredictionInput Input { get; set; } + /// /// Gets or sets where the unit is going to be when the skill-shot reaches his position. /// @@ -700,15 +762,6 @@ public Vector3 UnitPosition } #endregion - - #region Properties - - /// - /// Gets or sets the input. - /// - internal PredictionInput Input { get; set; } - - #endregion } #endregion diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0805317..200ac73 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -29,6 +29,6 @@ [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("e4860c36-20f0-4ca9-ad94-aa71eae94e8e")] -[assembly: AssemblyVersion("1.0.0.1")] -[assembly: AssemblyFileVersion("1.0.0.1")] +[assembly: AssemblyVersion("1.0.0.2")] +[assembly: AssemblyFileVersion("1.0.0.2")] [assembly: NeutralResourcesLanguage("en")] \ No newline at end of file From 6118c73ceab6df516bfba762c19084b02d4bb45b Mon Sep 17 00:00:00 2001 From: ChewyMoon Date: Sun, 17 Apr 2016 22:03:23 -0400 Subject: [PATCH 03/39] Adjusted namespaces, updated Damage, Interrupter, Gapcloser, and TargetSelector to use L# Data. Updated files to use C# 6. --- Core/Bootstrap.cs | 4 + Core/Constants.cs | 2 +- Core/Enumerations/CastStates.cs | 2 +- Core/Enumerations/CastTypes.cs | 100 ---- Core/Enumerations/CenteredFlags.cs | 2 +- Core/Enumerations/CollisionableObjects.cs | 53 -- Core/Enumerations/DangerLevel.cs | 40 -- Core/Enumerations/DrawType.cs | 2 +- Core/Enumerations/GapcloserType.cs | 35 -- Core/Enumerations/HealthPredictionType.cs | 2 +- Core/Enumerations/HitChance.cs | 2 +- Core/Enumerations/JungleType.cs | 2 +- Core/Enumerations/KeyBindType.cs | 2 +- Core/Enumerations/LogLevel.cs | 2 +- Core/Enumerations/MinionTypes.cs | 2 +- Core/Enumerations/NotificationIconType.cs | 2 +- Core/Enumerations/OrbwalkingMode.cs | 2 +- Core/Enumerations/OrbwalkingType.cs | 2 +- Core/Enumerations/PerformanceType.cs | 2 +- Core/Enumerations/SkillshotDetectionType.cs | 2 +- Core/Enumerations/SkillshotType.cs | 2 +- Core/Enumerations/SpellTags.cs | 135 ------ Core/Enumerations/SpellType.cs | 105 ---- Core/Enumerations/TeleportStatus.cs | 2 +- Core/Enumerations/TeleportType.cs | 2 +- Core/Enumerations/TurretType.cs | 2 +- Core/Enumerations/WindowsMessages.cs | 2 +- Core/Events/Dash.cs | 4 +- Core/Events/Events.cs | 2 +- Core/Events/Gapcloser.cs | 40 +- Core/Events/InterruptableSpell.cs | 118 +---- Core/Events/Load.cs | 4 +- Core/Events/Stealth.cs | 2 +- Core/Events/Teleport.cs | 4 +- Core/Events/Turret.cs | 4 +- Core/Extensions/Enumerable.cs | 6 +- Core/Extensions/Extensions.cs | 4 +- Core/Extensions/SharpDX/Generic.cs | 2 +- Core/Extensions/SharpDX/Vector2Extensions.cs | 9 +- Core/Extensions/SharpDX/Vector3Extensions.cs | 7 +- Core/Extensions/Unit.cs | 7 +- Core/GameObjects.cs | 5 +- Core/Math/Collision.cs | 8 +- Core/Math/ConvexHull.cs | 2 +- Core/Math/Geometry.cs | 4 +- Core/Math/Polygons/ArcPoly.cs | 4 +- Core/Math/Polygons/CirclePoly.cs | 4 +- Core/Math/Polygons/LinePoly.cs | 4 +- Core/Math/Polygons/Polygon.cs | 5 +- Core/Math/Polygons/RectanglePoly.cs | 4 +- Core/Math/Polygons/RingPoly.cs | 4 +- Core/Math/Polygons/SectorPoly.cs | 4 +- Core/Math/Prediction/Cluster.cs | 6 +- Core/Math/Prediction/GamePath.cs | 4 +- Core/Math/Prediction/Health.cs | 4 +- Core/Math/Prediction/Movement.cs | 9 +- Core/UI/IMenu/ColorSpectrum.cs | 454 +++++++++--------- Core/UI/IMenu/MenuManager.cs | 2 + Core/UI/IMenu/Skins/Blue/BlueBool.cs | 3 + Core/UI/IMenu/Skins/Blue/BlueButton.cs | 7 +- Core/UI/IMenu/Skins/Blue/BlueColorPicker.cs | 15 +- Core/UI/IMenu/Skins/Blue/BlueKeyBind.cs | 3 + Core/UI/IMenu/Skins/Blue/BlueList.cs | 3 + Core/UI/IMenu/Skins/Blue/BlueMenu.cs | 3 + Core/UI/IMenu/Skins/Blue/BlueSeparator.cs | 2 + Core/UI/IMenu/Skins/Blue/BlueSlider.cs | 3 + Core/UI/IMenu/Skins/Blue/BlueSliderButton.cs | 3 + Core/UI/IMenu/Skins/Blue/BlueTextures.cs | 8 +- Core/UI/IMenu/Skins/Blue2/BlueList2.cs | 3 + Core/UI/IMenu/Skins/Blue2/BlueMenu2.cs | 3 + Core/UI/IMenu/Skins/Blue2/BlueSeparator2.cs | 2 + Core/UI/IMenu/Skins/Blue2/BlueSlider2.cs | 2 + .../UI/IMenu/Skins/Blue2/BlueSliderButton2.cs | 2 + Core/UI/IMenu/Skins/Blue2/BlueTextures2.cs | 8 +- Core/UI/IMenu/Skins/Colored/ColoredBool.cs | 3 + Core/UI/IMenu/Skins/Colored/ColoredButton.cs | 3 + .../IMenu/Skins/Colored/ColoredColorPicker.cs | 15 +- Core/UI/IMenu/Skins/Colored/ColoredKeyBind.cs | 3 + Core/UI/IMenu/Skins/Colored/ColoredList.cs | 3 + Core/UI/IMenu/Skins/Colored/ColoredMenu.cs | 49 +- .../Skins/Colored/ColoredMenuSettings.cs | 36 +- .../IMenu/Skins/Colored/ColoredSeparator.cs | 2 + Core/UI/IMenu/Skins/Colored/ColoredSlider.cs | 3 + .../Skins/Colored/ColoredSliderButton.cs | 3 + .../UI/IMenu/Skins/Colored/ColoredTextures.cs | 8 +- Core/UI/IMenu/Skins/Default/DefaultBool.cs | 4 + Core/UI/IMenu/Skins/Default/DefaultButton.cs | 4 + .../IMenu/Skins/Default/DefaultColorPicker.cs | 4 + Core/UI/IMenu/Skins/Default/DefaultKeyBind.cs | 4 + Core/UI/IMenu/Skins/Default/DefaultList.cs | 4 + Core/UI/IMenu/Skins/Default/DefaultMenu.cs | 4 + .../IMenu/Skins/Default/DefaultSeparator.cs | 3 + Core/UI/IMenu/Skins/Default/DefaultSlider.cs | 4 + .../Skins/Default/DefaultSliderButton.cs | 4 + Core/UI/IMenu/Skins/Light/LightBool.cs | 3 + Core/UI/IMenu/Skins/Light/LightButton.cs | 7 +- Core/UI/IMenu/Skins/Light/LightColorPicker.cs | 15 +- Core/UI/IMenu/Skins/Light/LightKeyBind.cs | 3 + Core/UI/IMenu/Skins/Light/LightList.cs | 3 + Core/UI/IMenu/Skins/Light/LightMenu.cs | 3 + .../UI/IMenu/Skins/Light/LightMenuSettings.cs | 18 +- Core/UI/IMenu/Skins/Light/LightSeparator.cs | 2 + Core/UI/IMenu/Skins/Light/LightSlider.cs | 3 + .../UI/IMenu/Skins/Light/LightSliderButton.cs | 3 + Core/UI/IMenu/Skins/Light/LightTextures.cs | 8 +- .../IMenu/Skins/Light2/LightColorPicker2.cs | 15 +- Core/UI/IMenu/Skins/Light2/LightList2.cs | 3 + Core/UI/IMenu/Skins/Light2/LightMenu2.cs | 3 + .../IMenu/Skins/Light2/LightMenuSettings2.cs | 18 +- Core/UI/IMenu/Skins/Light2/LightSeparator2.cs | 2 + Core/UI/IMenu/Skins/Light2/LightSlider2.cs | 2 + .../IMenu/Skins/Light2/LightSliderButton2.cs | 2 + Core/UI/IMenu/Skins/Light2/LightTextures2.cs | 8 +- Core/UI/IMenu/Skins/Tech/TechBool.cs | 3 + Core/UI/IMenu/Skins/Tech/TechButton.cs | 7 +- Core/UI/IMenu/Skins/Tech/TechColorPicker.cs | 15 +- Core/UI/IMenu/Skins/Tech/TechKeyBind.cs | 3 + Core/UI/IMenu/Skins/Tech/TechList.cs | 3 + Core/UI/IMenu/Skins/Tech/TechMenu.cs | 3 + Core/UI/IMenu/Skins/Tech/TechMenuSettings.cs | 36 +- Core/UI/IMenu/Skins/Tech/TechSeparator.cs | 2 + Core/UI/IMenu/Skins/Tech/TechSlider.cs | 3 + Core/UI/IMenu/Skins/Tech/TechSliderButton.cs | 3 + Core/UI/IMenu/Skins/Tech/TechTextures.cs | 14 +- Core/UI/IMenu/Values/MenuKeyBind.cs | 2 + Core/UI/IMenu/Values/MenuSliderButton.cs | 8 +- Core/UI/Notifications/ANotification.cs | 4 +- Core/UI/Notifications/Notification.cs | 5 +- Core/UI/Notifications/NotificationIcons.cs | 6 +- Core/UI/Notifications/Notifications.cs | 6 +- Core/UI/Utils.cs | 10 +- Core/Utils/ActionQueue.cs | 2 + Core/Utils/AutoAttack.cs | 2 + Core/Utils/Cache.cs | 1 + Core/Utils/CallbackPerformance.cs | 1 + Core/Utils/DynamicInitializer.cs | 1 + Core/Utils/Invulnerable.cs | 3 + Core/Utils/Jungle.cs | 1 + Core/Utils/Logging.cs | 1 + Core/Utils/MathUtils.cs | 3 + Core/Utils/Minion.cs | 5 + Core/Utils/Performance.cs | 1 + Core/Utils/Render.cs | 3 + Core/Utils/ResourceLoader.cs | 2 + Core/Utils/Storage.cs | 1 + Core/Utils/WeightedRandom.cs | 2 + Core/Utils/WindowsKeys.cs | 1 + Core/Variables.cs | 3 +- Core/Wrappers/Damages/Damage.cs | 5 + Core/Wrappers/Damages/DamageJson.cs | 365 -------------- Core/Wrappers/Damages/DamageLibrary.cs | 65 +-- Core/Wrappers/Damages/DamagePassives.cs | 2 + Core/Wrappers/Items.cs | 5 +- Core/Wrappers/Map.cs | 2 +- Core/Wrappers/Orbwalking/Orbwalker.cs | 5 +- Core/Wrappers/Orbwalking/OrbwalkerBase.cs | 6 +- Core/Wrappers/Orbwalking/OrbwalkerSelector.cs | 6 +- .../Wrappers/Spells/Database/SpellDatabase.cs | 2 +- .../Spells/Database/SpellDatabaseEntry.cs | 5 +- Core/Wrappers/Spells/LastCast.cs | 2 +- .../Spells/LastCastPacketSentEntry.cs | 2 +- Core/Wrappers/Spells/LastCastedSpellEntry.cs | 2 +- Core/Wrappers/Spells/Spell.cs | 18 +- Core/Wrappers/Spells/SpellTypes/BaseSpell.cs | 6 +- Core/Wrappers/Spells/SpellTypes/Skillshot.cs | 6 +- .../Spells/SpellTypes/SkillshotCircle.cs | 11 +- .../Spells/SpellTypes/SkillshotCone.cs | 9 +- .../Spells/SpellTypes/SkillshotLine.cs | 11 +- .../Spells/SpellTypes/SkillshotMissile.cs | 7 +- .../Spells/SpellTypes/SkillshotMissileArc.cs | 11 +- .../SpellTypes/SkillshotMissileCircle.cs | 11 +- .../Spells/SpellTypes/SkillshotMissileLine.cs | 12 +- .../Spells/SpellTypes/SkillshotRing.cs | 11 +- Core/Wrappers/Spells/SpellTypes/Targeted.cs | 8 +- .../Spells/SpellTypes/TargetedMissile.cs | 8 +- Core/Wrappers/Spells/Tracker/Detector.cs | 11 +- .../Spells/Tracker/Skillshots/_ZiggsR.cs | 5 +- Core/Wrappers/Spells/Tracker/Tracker.cs | 8 +- .../TargetSelector/HeroVisibleEntry.cs | 2 +- .../TargetSelector/ITargetSelectorMode.cs | 2 +- Core/Wrappers/TargetSelector/Modes/Closest.cs | 5 +- .../TargetSelector/Modes/IWeightItem.cs | 2 +- .../TargetSelector/Modes/LeastHealth.cs | 2 +- .../TargetSelector/Modes/LessAttacksToKill.cs | 2 +- .../TargetSelector/Modes/LessCastsToKill.cs | 2 +- .../TargetSelector/Modes/MostAbilityPower.cs | 2 +- .../TargetSelector/Modes/MostAttackDamage.cs | 2 +- .../TargetSelector/Modes/NearMouse.cs | 5 +- .../Wrappers/TargetSelector/Modes/Priority.cs | 10 +- .../TargetSelector/Modes/PriorityCategory.cs | 47 -- Core/Wrappers/TargetSelector/Modes/Weight.cs | 2 +- .../TargetSelector/Modes/WeightItemWrapper.cs | 2 +- .../Modes/Weights/AbilityPower.cs | 2 +- .../TargetSelector/Modes/Weights/Aggro.cs | 2 +- .../Modes/Weights/AttackDamage.cs | 2 +- .../Modes/Weights/CrowdControl.cs | 2 +- .../TargetSelector/Modes/Weights/FocusMe.cs | 2 +- .../TargetSelector/Modes/Weights/Gold.cs | 2 +- .../TargetSelector/Modes/Weights/Killable.cs | 2 +- .../TargetSelector/Modes/Weights/LowHealth.cs | 2 +- .../Modes/Weights/LowResists.cs | 2 +- .../Modes/Weights/ShortDistanceCursor.cs | 4 +- .../Modes/Weights/ShortDistancePlayer.cs | 4 +- .../TargetSelector/Modes/Weights/TeamFocus.cs | 2 +- .../Wrappers/TargetSelector/TargetSelector.cs | 7 +- .../TargetSelector/TargetSelectorDrawing.cs | 6 +- .../TargetSelector/TargetSelectorHumanizer.cs | 2 +- .../TargetSelector/TargetSelectorMode.cs | 4 +- .../TargetSelector/TargetSelectorSelected.cs | 6 +- LeagueSharp.SDK.csproj | 22 +- Properties/AssemblyInfo.cs | 13 +- Third_Party/MoreLinq/Acquire.cs | 2 +- Third_Party/MoreLinq/Batch.cs | 6 +- Third_Party/MoreLinq/Concat.cs | 4 +- Third_Party/MoreLinq/Consume.cs | 2 +- Third_Party/MoreLinq/DistinctBy.cs | 4 +- Third_Party/MoreLinq/EquiZip.cs | 6 +- Third_Party/MoreLinq/ExceptBy.cs | 6 +- Third_Party/MoreLinq/Fold.cs | 2 +- Third_Party/MoreLinq/ForEach.cs | 8 +- Third_Party/MoreLinq/Generate.cs | 2 +- Third_Party/MoreLinq/GenerateByIndex.cs | 2 +- Third_Party/MoreLinq/GroupAdjacent.cs | 10 +- Third_Party/MoreLinq/MaxBy.cs | 4 +- Third_Party/MoreLinq/MinBy.cs | 4 +- Third_Party/MoreLinq/OrderedMerge.cs | 16 +- Third_Party/MoreLinq/Pad.cs | 10 +- Third_Party/MoreLinq/Pairwise.cs | 4 +- Third_Party/MoreLinq/Pipe.cs | 4 +- Third_Party/MoreLinq/PreScan.cs | 4 +- Third_Party/MoreLinq/Prepend.cs | 2 +- Third_Party/MoreLinq/Scan.cs | 8 +- Third_Party/MoreLinq/SingleOrFallback.cs | 4 +- Third_Party/MoreLinq/SkipUntil.cs | 4 +- Third_Party/MoreLinq/Split.cs | 14 +- Third_Party/MoreLinq/TakeEvery.cs | 4 +- Third_Party/MoreLinq/TakeLast.cs | 2 +- Third_Party/MoreLinq/TakeUntil.cs | 4 +- Third_Party/MoreLinq/ToDataTable.cs | 22 +- Third_Party/MoreLinq/ToDelimitedString.cs | 2 +- Third_Party/MoreLinq/ToHashSet.cs | 2 +- Third_Party/MoreLinq/Trace.cs | 6 +- Third_Party/MoreLinq/Zip.cs | 6 +- Third_Party/MoreLinq/ZipLongest.cs | 6 +- packages.config | 4 +- 245 files changed, 911 insertions(+), 1853 deletions(-) delete mode 100644 Core/Enumerations/CastTypes.cs delete mode 100644 Core/Enumerations/CollisionableObjects.cs delete mode 100644 Core/Enumerations/DangerLevel.cs delete mode 100644 Core/Enumerations/GapcloserType.cs delete mode 100644 Core/Enumerations/SpellTags.cs delete mode 100644 Core/Enumerations/SpellType.cs delete mode 100644 Core/Wrappers/Damages/DamageJson.cs delete mode 100644 Core/Wrappers/TargetSelector/Modes/PriorityCategory.cs diff --git a/Core/Bootstrap.cs b/Core/Bootstrap.cs index 3806293..351d53c 100644 --- a/Core/Bootstrap.cs +++ b/Core/Bootstrap.cs @@ -21,9 +21,13 @@ namespace LeagueSharp.SDK using System.Security.Permissions; using System.Threading; + using LeagueSharp.SDK.Core; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.UI; using LeagueSharp.SDK.Core.UI.IMenu; using LeagueSharp.SDK.Core.UI.IMenu.Customizer; using LeagueSharp.SDK.Core.Utils; + using LeagueSharp.SDK.Core.Wrappers; using LeagueSharp.SDK.Core.Wrappers.Damages; /// diff --git a/Core/Constants.cs b/Core/Constants.cs index 5fb2118..1c57a1b 100644 --- a/Core/Constants.cs +++ b/Core/Constants.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core { using System; using System.IO; diff --git a/Core/Enumerations/CastStates.cs b/Core/Enumerations/CastStates.cs index e7d3d89..3f10e4a 100644 --- a/Core/Enumerations/CastStates.cs +++ b/Core/Enumerations/CastStates.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// Cast States diff --git a/Core/Enumerations/CastTypes.cs b/Core/Enumerations/CastTypes.cs deleted file mode 100644 index be49891..0000000 --- a/Core/Enumerations/CastTypes.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// Copyright (c) 2015 LeagueSharp. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// - -namespace LeagueSharp.SDK -{ - /// - /// Indicates how a spell can be casted - /// - public enum CastType - { - /// - /// The spell can be casted on an enemy champion - /// - EnemyChampions, - - /// - /// The spell can be casted on an enemy minion - /// - EnemyMinions, - - /// - /// The spell can be casted on an enemy tower - /// - EnemyTurrets, - - /// - /// The spell can be casted on an ally champion - /// - AllyChampions, - - /// - /// The spell can be casted on an ally minion - /// - AllyMinions, - - /// - /// The spell can be casted on an ally turret - /// - AllyTurrets, - - /// - /// The spell can be casted only on pets. - /// - HeroPets, - - /// - /// The spell can be casted on a position - /// - Position, - - /// - /// The spell can be casted in a direction - /// - Direction, - - /// - /// The spell can be casted on self - /// - Self, - - /// - /// The spell is a charging spell - /// - Charging, - - /// - /// The spell is a toggleable spell - /// - Toggle, - - /// - /// The spell is a channel - /// - Channel, - - /// - /// The spell is activable - /// - Activate, - - /// - /// The spell can't be casted - /// - ImpossibleToCast - } -} diff --git a/Core/Enumerations/CenteredFlags.cs b/Core/Enumerations/CenteredFlags.cs index 4f4c480..f6dea4e 100644 --- a/Core/Enumerations/CenteredFlags.cs +++ b/Core/Enumerations/CenteredFlags.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { using System; diff --git a/Core/Enumerations/CollisionableObjects.cs b/Core/Enumerations/CollisionableObjects.cs deleted file mode 100644 index ee64efe..0000000 --- a/Core/Enumerations/CollisionableObjects.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) 2015 LeagueSharp. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// - -namespace LeagueSharp.SDK -{ - using System; - - /// - /// Collision-able Objects Flags - /// - [Flags] - public enum CollisionableObjects - { - /// - /// Minion Collision-able Flag - /// - Minions = 1 << 0, - - /// - /// Hero Collision-able Flag - /// - Heroes = 1 << 1, - - /// - /// Yasuo's Wall Collision-able Flag - /// - YasuoWall = 1 << 2, - - /// - /// Braum's Shield Collision-able Flag - /// - BraumShield = 1 << 3, - - /// - /// Wall Collision-able Flag - /// - Walls = 1 << 4 - } -} \ No newline at end of file diff --git a/Core/Enumerations/DangerLevel.cs b/Core/Enumerations/DangerLevel.cs deleted file mode 100644 index d5dea05..0000000 --- a/Core/Enumerations/DangerLevel.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// Copyright (c) 2015 LeagueSharp. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// - -namespace LeagueSharp.SDK -{ - /// - /// The danger level of the spell. - /// - public enum DangerLevel - { - /// - /// Low danger level - /// - Low, - - /// - /// Medium danger level, should be interrupted - /// - Medium, - - /// - /// High danger level, definitely should be interrupted - /// - High - } -} \ No newline at end of file diff --git a/Core/Enumerations/DrawType.cs b/Core/Enumerations/DrawType.cs index 93d98f4..fb3508e 100644 --- a/Core/Enumerations/DrawType.cs +++ b/Core/Enumerations/DrawType.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { using System; diff --git a/Core/Enumerations/GapcloserType.cs b/Core/Enumerations/GapcloserType.cs deleted file mode 100644 index 46aee8c..0000000 --- a/Core/Enumerations/GapcloserType.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// Copyright (c) 2015 LeagueSharp. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// - -namespace LeagueSharp.SDK -{ - /// - /// Gapcloser Spell Type - /// - public enum GapcloserType - { - /// - /// Skillshot Spell - /// - Skillshot, - - /// - /// Targeted Spell - /// - Targeted - } -} \ No newline at end of file diff --git a/Core/Enumerations/HealthPredictionType.cs b/Core/Enumerations/HealthPredictionType.cs index 54f2d5f..a4f3630 100644 --- a/Core/Enumerations/HealthPredictionType.cs +++ b/Core/Enumerations/HealthPredictionType.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// Name enumerations of health prediction types diff --git a/Core/Enumerations/HitChance.cs b/Core/Enumerations/HitChance.cs index 1101bd8..1735d7c 100644 --- a/Core/Enumerations/HitChance.cs +++ b/Core/Enumerations/HitChance.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// Skillshot HitChance diff --git a/Core/Enumerations/JungleType.cs b/Core/Enumerations/JungleType.cs index 1f5382b..d813a2c 100644 --- a/Core/Enumerations/JungleType.cs +++ b/Core/Enumerations/JungleType.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// The jungle mob types. diff --git a/Core/Enumerations/KeyBindType.cs b/Core/Enumerations/KeyBindType.cs index b960971..91df039 100644 --- a/Core/Enumerations/KeyBindType.cs +++ b/Core/Enumerations/KeyBindType.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// Key Bind Type for Menu. diff --git a/Core/Enumerations/LogLevel.cs b/Core/Enumerations/LogLevel.cs index 6b63fef..2e5c803 100644 --- a/Core/Enumerations/LogLevel.cs +++ b/Core/Enumerations/LogLevel.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// The level of the information being logged diff --git a/Core/Enumerations/MinionTypes.cs b/Core/Enumerations/MinionTypes.cs index 88b2b7a..89a8ba5 100644 --- a/Core/Enumerations/MinionTypes.cs +++ b/Core/Enumerations/MinionTypes.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { using System; diff --git a/Core/Enumerations/NotificationIconType.cs b/Core/Enumerations/NotificationIconType.cs index dd0ad93..a4767fb 100644 --- a/Core/Enumerations/NotificationIconType.cs +++ b/Core/Enumerations/NotificationIconType.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// The notification icon type. diff --git a/Core/Enumerations/OrbwalkingMode.cs b/Core/Enumerations/OrbwalkingMode.cs index 707fd35..8d515ac 100644 --- a/Core/Enumerations/OrbwalkingMode.cs +++ b/Core/Enumerations/OrbwalkingMode.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// Orbwalker Modes diff --git a/Core/Enumerations/OrbwalkingType.cs b/Core/Enumerations/OrbwalkingType.cs index 6360935..410a232 100644 --- a/Core/Enumerations/OrbwalkingType.cs +++ b/Core/Enumerations/OrbwalkingType.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// Orbwalker Process Type diff --git a/Core/Enumerations/PerformanceType.cs b/Core/Enumerations/PerformanceType.cs index 76143c9..010d91e 100644 --- a/Core/Enumerations/PerformanceType.cs +++ b/Core/Enumerations/PerformanceType.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// Performance Type to log. diff --git a/Core/Enumerations/SkillshotDetectionType.cs b/Core/Enumerations/SkillshotDetectionType.cs index f2d58c7..a112fd3 100644 --- a/Core/Enumerations/SkillshotDetectionType.cs +++ b/Core/Enumerations/SkillshotDetectionType.cs @@ -1,4 +1,4 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { public enum SkillshotDetectionType { diff --git a/Core/Enumerations/SkillshotType.cs b/Core/Enumerations/SkillshotType.cs index d5c3cb2..2e7d9e2 100644 --- a/Core/Enumerations/SkillshotType.cs +++ b/Core/Enumerations/SkillshotType.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// Skillshot Type Enumeration diff --git a/Core/Enumerations/SpellTags.cs b/Core/Enumerations/SpellTags.cs deleted file mode 100644 index 2f0dbfd..0000000 --- a/Core/Enumerations/SpellTags.cs +++ /dev/null @@ -1,135 +0,0 @@ -// -// Copyright (c) 2015 LeagueSharp. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// - -namespace LeagueSharp.SDK -{ - /// - /// Properties that a spell can have - /// - public enum SpellTags - { - /// - /// The spell deals damage - /// - Damage, - - /// - /// The spell's effects are AoE - /// - AoE, - - /// - /// The spell applies on-hit effects. - /// - AppliesOnHitEffects, - - /// - /// The spell applies CC - /// - CrowdControl, - - /// - /// The spell applies a shield on the target - /// - Shield, - - /// - /// The spell can heal - /// - Heal, - - /// - /// The spell makes the target enter a stasis state (invulnerable) - /// - Stasis, - - /// - /// The spell leaves a mark than can subsequently be proc'd to deal additional damage - /// - LeavesMark, - - /// - /// The spell can detonate a previously left mark. - /// - CanDetonateMark, - - /// - /// The spell modifies the champion's other spells (nida/jayce/elise ult) - /// - Transformation, - - /// - /// The spell is a dash - /// - Dash, - - /// - /// The spell is a blink - /// - Blink, - - /// - /// The spell teleports the champion - /// - Teleport, - - /// - /// The spell amplifies the damage dealt by attacks or spells - /// - DamageAmplifier, - - /// - /// The spell increases health/armor/mr - /// - DefensiveBuff, - - /// - /// The spell increases the target's movement speed - /// - MovementSpeedAmplifier, - - /// - /// The spell increases the target's Attack Speed - /// - AttackSpeedAmplifier, - - /// - /// The spell increases the target's Attack Range - /// - AttackRangeModifier, - - /// - /// The spell applies a spellshield - /// - SpellShield, - - /// - /// The spell removes all CC from target - /// - RemoveCrowdControl, - - /// - /// The spell grants vision of the target area. - /// - GrantsVision, - - /// - /// The spell can be interrupted - /// - Interruptable - } -} \ No newline at end of file diff --git a/Core/Enumerations/SpellType.cs b/Core/Enumerations/SpellType.cs deleted file mode 100644 index 612616c..0000000 --- a/Core/Enumerations/SpellType.cs +++ /dev/null @@ -1,105 +0,0 @@ -// -// Copyright (c) 2015 LeagueSharp. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// - -namespace LeagueSharp.SDK -{ - /// - /// SpellType enumeration - /// - public enum SpellType - { - /// - /// The spell is a Circle Skillshot - /// - SkillshotCircle, - - /// - /// The spell is a Circle Skillshot that leaves a Missile - /// - SkillshotMissileCircle, - - /// - /// The spell is a Line Skillshot - /// - SkillshotLine, - - /// - /// The spell is a Line Skillshot that creates a Missile - /// - SkillshotMissileLine, - - /// - /// The spell is a Cone Skillshot - /// - SkillshotCone, - - /// - /// The spell is a Cone Skillshot that leaves a Missile - /// - SkillshotMissileCone, - - /// - /// The spell is an Arc Skillshot (Diana Q) - /// - SkillshotMissileArc, - - /// - /// The spell is a Ring Skillshot (Veigar E) - /// - SkillshotRing, - - /// - /// The spell is an Arc Skillshot - /// - SkillshotArc, - - /// - /// The spell is Targeted - /// - Targeted, - - /// - /// The spell is Targeted and has a missile. - /// - TargetedMissile, - - /// - /// The spell can be toggled on/off - /// - Toggled, - - /// - /// The spell can be activated, after which it lasts for a while (Vayne R, Olaf R) - /// - Activated, - - /// - /// The spell does nothing else but contain a passive (Vayne W, Mini Gnar W) - /// - Passive, - - /// - /// The spell is casted to a position like a skillshot but does undodgeable / random damage. Ezreal E, Ahri R... - /// - Position, - - /// - /// The spell must specify a start point and an end point (Viktor E, Rumble R) - /// - Vector - } -} \ No newline at end of file diff --git a/Core/Enumerations/TeleportStatus.cs b/Core/Enumerations/TeleportStatus.cs index 039cb44..4bc9111 100644 --- a/Core/Enumerations/TeleportStatus.cs +++ b/Core/Enumerations/TeleportStatus.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// The teleport status. diff --git a/Core/Enumerations/TeleportType.cs b/Core/Enumerations/TeleportType.cs index 4fc0d4d..689c598 100644 --- a/Core/Enumerations/TeleportType.cs +++ b/Core/Enumerations/TeleportType.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// The teleport type. diff --git a/Core/Enumerations/TurretType.cs b/Core/Enumerations/TurretType.cs index e275c92..393431d 100644 --- a/Core/Enumerations/TurretType.cs +++ b/Core/Enumerations/TurretType.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { /// /// The turret type. diff --git a/Core/Enumerations/WindowsMessages.cs b/Core/Enumerations/WindowsMessages.cs index a13e81e..8366e7a 100644 --- a/Core/Enumerations/WindowsMessages.cs +++ b/Core/Enumerations/WindowsMessages.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Enumerations { using System; using System.Diagnostics.CodeAnalysis; diff --git a/Core/Events/Dash.cs b/Core/Events/Dash.cs index c71d00d..b4e2c9f 100644 --- a/Core/Events/Dash.cs +++ b/Core/Events/Dash.cs @@ -15,13 +15,15 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Events { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; /// diff --git a/Core/Events/Events.cs b/Core/Events/Events.cs index 1782561..eca46c0 100644 --- a/Core/Events/Events.cs +++ b/Core/Events/Events.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Events { using System; diff --git a/Core/Events/Gapcloser.cs b/Core/Events/Gapcloser.cs index 48d1be2..5961b49 100644 --- a/Core/Events/Gapcloser.cs +++ b/Core/Events/Gapcloser.cs @@ -15,14 +15,18 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Events { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; - using LeagueSharp.SDK.Core.Utils; + using LeagueSharp.Data; + using LeagueSharp.Data.DataTypes; + using LeagueSharp.Data.Enumerations; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; using SharpDX; @@ -39,10 +43,9 @@ public static partial class Events private static readonly List ActiveSpellsList = new List(); /// - /// Gets or sets the spells. + /// Gets the spell list. /// - [ResourceImport("Data.Gapclosers.json")] - private static readonly Dictionary SpellsList = new Dictionary(); + private static IReadOnlyDictionary SpellsList => Data.Get().SpellsList; #endregion @@ -65,7 +68,7 @@ public static partial class Events /// /// Gets the spells. /// - public static IEnumerable GapCloserSpells => SpellsList.Values; + public static IEnumerable GapCloserSpells => SpellsList.Values; #endregion @@ -129,31 +132,6 @@ private static void EventGapcloser() #endregion - /// - /// GapCloser Data Container - /// - public struct GapCloser - { - #region Fields - - /// - /// Spell Type - /// - public GapcloserType SkillType { get; set; } - - /// - /// Spell Slot - /// - public SpellSlot Slot { get; set; } - - /// - /// Spell Name - /// - public string SpellName { get; set; } - - #endregion - } - /// /// GapCloser Data Container /// diff --git a/Core/Events/InterruptableSpell.cs b/Core/Events/InterruptableSpell.cs index 621a72f..986214d 100644 --- a/Core/Events/InterruptableSpell.cs +++ b/Core/Events/InterruptableSpell.cs @@ -15,13 +15,17 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Events { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; + using LeagueSharp.Data; + using LeagueSharp.Data.DataTypes; + using LeagueSharp.Data.Enumerations; + using LeagueSharp.SDK.Core.Enumerations; using LeagueSharp.SDK.Core.Utils; /// @@ -43,18 +47,18 @@ public static partial class Events /// /// Gets the casting interruptible spell dictionary. /// - public static IReadOnlyDictionary CastingInterruptableSpell + public static IReadOnlyDictionary CastingInterruptableSpell => CastingInterruptableSpellDictionary; /// /// Gets the interruptible spells dictionary. /// - public static IReadOnlyList GlobalInterruptableSpells => GlobalInterruptableSpellsList; + public static IReadOnlyList GlobalInterruptableSpells => GlobalInterruptableSpellsList; /// /// Gets the interruptible spells dictionary. /// - public static IReadOnlyDictionary> InterruptableSpells + public static IReadOnlyDictionary> InterruptableSpells => InterruptableSpellsDictionary; #endregion @@ -64,22 +68,19 @@ public static IReadOnlyDictionary> Interrup /// /// Gets or sets the casting interrupt-able spell. /// - private static Dictionary CastingInterruptableSpellDictionary { get; set; } = - new Dictionary(); + private static Dictionary CastingInterruptableSpellDictionary { get; set; } = + new Dictionary(); /// - /// Gets or sets the interrupt-able spells. + /// Gets gets or sets the interrupt-able spells. /// - [ResourceImport("Data.InterruptableSpells.json")] - private static Dictionary> InterruptableSpellsDictionary { get; set; } = - new Dictionary>(); + private static Dictionary> InterruptableSpellsDictionary + => Data.Get().InterruptableSpells.ToDictionary(x => x.Key, y => y.Value); /// - /// Gets the global interruptable spells list. + /// Gets or sets gets the global interruptable spells list. /// - [ResourceImport("Data.GlobalInterruptableSpellsList.json")] - private static List GlobalInterruptableSpellsList { get; set; } = - new List(); + private static List GlobalInterruptableSpellsList => Data.Get().GlobalInterruptableSpells.ToList(); #endregion @@ -101,7 +102,7 @@ public static InterruptableTargetEventArgs GetInterruptableTargetData(Obj_AI_Her return null; } - InterruptableSpellData value; + InterruptableSpellDataEntry value; if (CastingInterruptableSpellDictionary.TryGetValue(target.NetworkId, out value)) { return new InterruptableTargetEventArgs( @@ -228,93 +229,6 @@ private static void EventInterruptableSpell(Spellbook sender) #endregion - /// - /// Interrupt-able Spell Data - /// - public class InterruptableSpellData - { - #region Constructors and Destructors - - /// - /// Initializes a new instance of the class. - /// - public InterruptableSpellData() - { - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// Spell Slot - /// - /// - /// Danger Level - /// - /// - /// Does movement interrupt the spell - /// - public InterruptableSpellData(SpellSlot slot, DangerLevel dangerLevel, bool movementInterrupts = true) - { - this.Slot = slot; - this.DangerLevel = dangerLevel; - this.MovementInterrupts = movementInterrupts; - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// Spell Name - /// - /// - /// Danger Level - /// - /// - /// The slot. - /// - /// - /// Does movement interrupt the spell - /// - public InterruptableSpellData( - string name, - DangerLevel dangerLevel, - SpellSlot slot = SpellSlot.Unknown, - bool movementInterrupts = true) - { - this.Name = name; - this.DangerLevel = dangerLevel; - this.Slot = slot; - this.MovementInterrupts = movementInterrupts; - } - - #endregion - - #region Public Properties - - /// - /// Gets the danger level. - /// - public DangerLevel DangerLevel { get; set; } - - /// - /// Gets a value indicating whether movement interrupts. - /// - public bool MovementInterrupts { get; set; } - - /// - /// Gets the name. - /// - public string Name { get; set; } - - /// - /// Gets the slot. - /// - public SpellSlot Slot { get; set; } - - #endregion - } - /// /// Class that represents the event arguments for /// diff --git a/Core/Events/Load.cs b/Core/Events/Load.cs index 6c5cb6f..6e3c4c4 100644 --- a/Core/Events/Load.cs +++ b/Core/Events/Load.cs @@ -15,12 +15,14 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Events { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; + + using LeagueSharp.SDK.Core.Enumerations; using LeagueSharp.SDK.Core.Utils; /// diff --git a/Core/Events/Stealth.cs b/Core/Events/Stealth.cs index 1dfc580..2191529 100644 --- a/Core/Events/Stealth.cs +++ b/Core/Events/Stealth.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Events { using System; using System.Reflection; diff --git a/Core/Events/Teleport.cs b/Core/Events/Teleport.cs index f72e501..56b55f2 100644 --- a/Core/Events/Teleport.cs +++ b/Core/Events/Teleport.cs @@ -15,12 +15,14 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Events { using System; using System.Collections.Generic; using System.Reflection; + using LeagueSharp.SDK.Core.Enumerations; + /// /// Teleport class, contains Teleport even which is triggered on recalls, teleports and shen or twisted fate /// ultimates. diff --git a/Core/Events/Turret.cs b/Core/Events/Turret.cs index 2cc1cdd..a4bdbf0 100644 --- a/Core/Events/Turret.cs +++ b/Core/Events/Turret.cs @@ -15,13 +15,15 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Events { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; + using LeagueSharp.SDK.Core.Extensions; + /// /// Turret tracker and event handler. /// diff --git a/Core/Extensions/Enumerable.cs b/Core/Extensions/Enumerable.cs index e50db03..e35ccb5 100644 --- a/Core/Extensions/Enumerable.cs +++ b/Core/Extensions/Enumerable.cs @@ -15,12 +15,16 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Extensions { using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; + + using global::SharpDX; + + using LeagueSharp.SDK.Core.Enumerations; using LeagueSharp.SDK.Core.Utils; using SharpDX; diff --git a/Core/Extensions/Extensions.cs b/Core/Extensions/Extensions.cs index 71b5bed..ff6103f 100644 --- a/Core/Extensions/Extensions.cs +++ b/Core/Extensions/Extensions.cs @@ -15,12 +15,14 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Extensions { using System.IO; using System.Runtime.Serialization.Json; using System.Text; + using LeagueSharp.SDK.Core; + public static partial class Extensions { #region Public Methods and Operators diff --git a/Core/Extensions/SharpDX/Generic.cs b/Core/Extensions/SharpDX/Generic.cs index 1f2de90..e2b1bc6 100644 --- a/Core/Extensions/SharpDX/Generic.cs +++ b/Core/Extensions/SharpDX/Generic.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Extensions.SharpDX { using global::SharpDX; diff --git a/Core/Extensions/SharpDX/Vector2Extensions.cs b/Core/Extensions/SharpDX/Vector2Extensions.cs index 9bde79b..dada8c5 100644 --- a/Core/Extensions/SharpDX/Vector2Extensions.cs +++ b/Core/Extensions/SharpDX/Vector2Extensions.cs @@ -15,13 +15,14 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Extensions.SharpDX { using System; using System.Collections.Generic; using System.Linq; - - using SharpDX; + using Core; + using Core.Extensions; + using global::SharpDX; /// /// SharpDX/Vector2 Extensions. @@ -891,7 +892,7 @@ internal MovementCollisionInfo(float collisionTime, Vector2 collisionPosition) } /// - /// Holds info for the method. + /// Holds info for the method. /// public struct IntersectionResult { diff --git a/Core/Extensions/SharpDX/Vector3Extensions.cs b/Core/Extensions/SharpDX/Vector3Extensions.cs index 88445e1..b3a66ab 100644 --- a/Core/Extensions/SharpDX/Vector3Extensions.cs +++ b/Core/Extensions/SharpDX/Vector3Extensions.cs @@ -15,13 +15,16 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Extensions.SharpDX { using System; using System.Collections.Generic; using System.Linq; - using SharpDX; + using global::SharpDX; + + using LeagueSharp.SDK.Core; + using LeagueSharp.SDK.Core.Extensions; /// /// SharpDX/Vector3 Extensions diff --git a/Core/Extensions/Unit.cs b/Core/Extensions/Unit.cs index 593594f..1e1224f 100644 --- a/Core/Extensions/Unit.cs +++ b/Core/Extensions/Unit.cs @@ -15,11 +15,16 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Extensions { using System; using System.Linq; + using global::SharpDX; + + using LeagueSharp.SDK.Core; + using LeagueSharp.SDK.Core.Enumerations; + using SharpDX; /// diff --git a/Core/GameObjects.cs b/Core/GameObjects.cs index f939fa4..ab20ef0 100644 --- a/Core/GameObjects.cs +++ b/Core/GameObjects.cs @@ -15,12 +15,13 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core { using System; using System.Collections.Generic; using System.Linq; + using LeagueSharp.SDK.Core.Enumerations; using LeagueSharp.SDK.Core.Utils; /// @@ -437,7 +438,7 @@ internal static void Initialize() initialized = true; - Events.OnLoad += (sender, args) => + Events.Events.OnLoad += (sender, args) => { Player = ObjectManager.Player; diff --git a/Core/Math/Collision.cs b/Core/Math/Collision.cs index 8982df6..1cbfa93 100644 --- a/Core/Math/Collision.cs +++ b/Core/Math/Collision.cs @@ -15,13 +15,19 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math { using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; + using LeagueSharp.Data.Enumerations; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math.Prediction; + using SharpDX; /// diff --git a/Core/Math/ConvexHull.cs b/Core/Math/ConvexHull.cs index 9ad91a9..258aace 100644 --- a/Core/Math/ConvexHull.cs +++ b/Core/Math/ConvexHull.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math { using System; using System.Collections.Generic; diff --git a/Core/Math/Geometry.cs b/Core/Math/Geometry.cs index 093bb54..ece9e9e 100644 --- a/Core/Math/Geometry.cs +++ b/Core/Math/Geometry.cs @@ -15,8 +15,10 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math { + using LeagueSharp.SDK.Core.Enumerations; + using SharpDX; using SharpDX.Direct3D9; diff --git a/Core/Math/Polygons/ArcPoly.cs b/Core/Math/Polygons/ArcPoly.cs index 16eab31..3b49288 100644 --- a/Core/Math/Polygons/ArcPoly.cs +++ b/Core/Math/Polygons/ArcPoly.cs @@ -15,10 +15,12 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Polygons { using System; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; /// diff --git a/Core/Math/Polygons/CirclePoly.cs b/Core/Math/Polygons/CirclePoly.cs index bffc1f4..adb5a3d 100644 --- a/Core/Math/Polygons/CirclePoly.cs +++ b/Core/Math/Polygons/CirclePoly.cs @@ -15,10 +15,12 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Polygons { using System; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; /// diff --git a/Core/Math/Polygons/LinePoly.cs b/Core/Math/Polygons/LinePoly.cs index 19e1e1f..7e27c3a 100644 --- a/Core/Math/Polygons/LinePoly.cs +++ b/Core/Math/Polygons/LinePoly.cs @@ -15,8 +15,10 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Polygons { + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; /// diff --git a/Core/Math/Polygons/Polygon.cs b/Core/Math/Polygons/Polygon.cs index a44ac1a..0df69ae 100644 --- a/Core/Math/Polygons/Polygon.cs +++ b/Core/Math/Polygons/Polygon.cs @@ -15,12 +15,13 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Polygons { using System.Collections.Generic; using System.Linq; using LeagueSharp.SDK.Clipper; + using LeagueSharp.SDK.Core.Extensions.SharpDX; using SharpDX; @@ -128,7 +129,7 @@ public bool IsInside(GameObject gameObject) public bool IsOutside(Vector2 point) { var p = new IntPoint(point.X, point.Y); - return Clipper.Clipper.PointInPolygon(p, this.ToClipperPath()) != 1; + return Clipper.PointInPolygon(p, this.ToClipperPath()) != 1; } /// diff --git a/Core/Math/Polygons/RectanglePoly.cs b/Core/Math/Polygons/RectanglePoly.cs index 182bf94..2ee63a3 100644 --- a/Core/Math/Polygons/RectanglePoly.cs +++ b/Core/Math/Polygons/RectanglePoly.cs @@ -15,8 +15,10 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Polygons { + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; /// diff --git a/Core/Math/Polygons/RingPoly.cs b/Core/Math/Polygons/RingPoly.cs index ffa6ce2..0d30a5b 100644 --- a/Core/Math/Polygons/RingPoly.cs +++ b/Core/Math/Polygons/RingPoly.cs @@ -15,10 +15,12 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Polygons { using System; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; /// diff --git a/Core/Math/Polygons/SectorPoly.cs b/Core/Math/Polygons/SectorPoly.cs index 49a4835..4be65a6 100644 --- a/Core/Math/Polygons/SectorPoly.cs +++ b/Core/Math/Polygons/SectorPoly.cs @@ -15,10 +15,12 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Polygons { using System; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; /// diff --git a/Core/Math/Prediction/Cluster.cs b/Core/Math/Prediction/Cluster.cs index 50bc402..1a5fade 100644 --- a/Core/Math/Prediction/Cluster.cs +++ b/Core/Math/Prediction/Cluster.cs @@ -15,11 +15,15 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Prediction { using System.Collections.Generic; using System.Linq; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; /// diff --git a/Core/Math/Prediction/GamePath.cs b/Core/Math/Prediction/GamePath.cs index d8cdc82..2b79e19 100644 --- a/Core/Math/Prediction/GamePath.cs +++ b/Core/Math/Prediction/GamePath.cs @@ -15,12 +15,14 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Prediction { using System; using System.Collections.Generic; using System.Linq; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; /// diff --git a/Core/Math/Prediction/Health.cs b/Core/Math/Prediction/Health.cs index 71151de..ea71de3 100644 --- a/Core/Math/Prediction/Health.cs +++ b/Core/Math/Prediction/Health.cs @@ -15,12 +15,14 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Prediction { using System; using System.Collections.Generic; using System.Linq; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; using LeagueSharp.SDK.Core.Utils; using LeagueSharp.SDK.Core.Wrappers.Damages; diff --git a/Core/Math/Prediction/Movement.cs b/Core/Math/Prediction/Movement.cs index 5b88703..544c58e 100644 --- a/Core/Math/Prediction/Movement.cs +++ b/Core/Math/Prediction/Movement.cs @@ -15,16 +15,23 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Math.Prediction { using System; using System.Collections.Generic; using System.Linq; + using LeagueSharp.Data.Enumerations; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Events; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; using LeagueSharp.SDK.Core.Utils; using SharpDX; + using Collision = LeagueSharp.SDK.Core.Math.Collision; + /// /// Calculates a prediction based off data values given by the source input and converts it into a output prediction /// for movement, containing spell casting position and unit position in 3D-Space. diff --git a/Core/UI/IMenu/ColorSpectrum.cs b/Core/UI/IMenu/ColorSpectrum.cs index bc7e363..3fff391 100644 --- a/Core/UI/IMenu/ColorSpectrum.cs +++ b/Core/UI/IMenu/ColorSpectrum.cs @@ -1,17 +1,16 @@ -using System; - -namespace LeagueSharp.SDK.Core.UI.IMenu +namespace LeagueSharp.SDK.Core.UI.IMenu { + using System; using System.Drawing; - using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; using LeagueSharp.SDK.Core.Utils; using SharpDX; using SharpDX.Direct3D9; using Color = System.Drawing.Color; - using Math = System.Math; internal class ColorSpectrum { @@ -84,9 +83,10 @@ public class ColorBox #region Constructors and Destructors /// - /// Init the ColorBox + /// Initializes a new instance of the class. /// /// The size of the new ColorBox + /// if set to true the ColorBox will be disabled. public ColorBox(Size size, bool disabled = false) { this.mHsl = new Hsl { H = 1, S = 1, L = 1 }; @@ -168,7 +168,7 @@ public enum Orientation /// Vertical Orientation /// Vertical - }; + } #endregion @@ -262,18 +262,20 @@ public void ColorBoxMouseDown(WindowsKeys args) { x = 0; } + if (x > (this.mWidth - 4)) { - x = (this.mWidth - 4); + x = this.mWidth - 4; } if (y < 0) { y = 0; } + if (y > (this.mHeight - 4)) { - y = (this.mHeight - 4); + y = this.mHeight - 4; } this.mMarkerX = x; @@ -284,10 +286,7 @@ public void ColorBoxMouseDown(WindowsKeys args) this.ResetHslrgb(); // Reset the color - if (this.ColorBoxScrolled != null) - { - this.ColorBoxScrolled(); - } + this.ColorBoxScrolled?.Invoke(); } } @@ -306,18 +305,20 @@ public void ColorBoxMouseMove(WindowsKeys args) { x = 0; } + if (x > (this.mWidth - 4)) { - x = (this.mWidth - 4); + x = this.mWidth - 4; } if (y < 0) { y = 0; } + if (y > (this.mHeight - 4)) { - y = (this.mHeight - 4); + y = this.mHeight - 4; } this.mMarkerX = x; @@ -328,10 +329,7 @@ public void ColorBoxMouseMove(WindowsKeys args) this.ResetHslrgb(); // Reset the color - if (this.ColorBoxScrolled != null) - { - this.ColorBoxScrolled(); - } + this.ColorBoxScrolled?.Invoke(); } } @@ -351,18 +349,20 @@ public void ColorBoxMouseUp(WindowsKeys args) { x = 0; } + if (x > (this.mWidth - 4)) { - x = (this.mWidth - 4); + x = this.mWidth - 4; } if (y < 0) { y = 0; } + if (y > (this.mHeight - 4)) { - y = (this.mHeight - 4); + y = this.mHeight - 4; } this.mMarkerX = x; @@ -373,10 +373,7 @@ public void ColorBoxMouseUp(WindowsKeys args) this.ResetHslrgb(); // Reset the color - if (this.ColorBoxScrolled != null) - { - this.ColorBoxScrolled(); - } + this.ColorBoxScrolled?.Invoke(); } } @@ -522,12 +519,9 @@ private void DrawStyleHue() { var hslStart = new Hsl(); var hslEnd = new Hsl(); - if ((this.mHsl == null)) + if (this.mHsl == null) { - this.mHsl = new Hsl(); - this.mHsl.H = 1; - this.mHsl.S = 1; - this.mHsl.L = 1; + this.mHsl = new Hsl { H = 1, S = 1, L = 1 }; this.mRgb = Utilities.HslToRgb(this.mHsl); } @@ -713,18 +707,20 @@ private void DrawMarker(int x, int y, bool unconditional) { x = 0; } + if (x > (this.mWidth - 4)) { - x = (this.mWidth - 4); + x = this.mWidth - 4; } if (y < 0) { x = 0; } + if (y > (this.mHeight - 4)) { - y = (this.mHeight - 4); + y = this.mHeight - 4; } if (this.mMarkerY == y & this.mMarkerX == x & !unconditional) @@ -744,14 +740,7 @@ private void DrawMarker(int x, int y, bool unconditional) } else if ((hsl.H < Convert.ToDouble(26d / 360d)) | (hsl.H > Convert.ToDouble(200d / 360d))) { - if (hsl.S > Convert.ToDouble(70d / 255d)) - { - this.mMarkerColor = Color.White; - } - else - { - this.mMarkerColor = Color.Black; - } + this.mMarkerColor = hsl.S > Convert.ToDouble(70d / 255d) ? Color.White : Color.Black; } else { @@ -947,7 +936,7 @@ public class VerticalColorSlider /// /// The line. /// - private static readonly SharpDX.Direct3D9.Line Line = new SharpDX.Direct3D9.Line(Drawing.Direct3DDevice) { GLLines = true }; + private static readonly Line Line = new Line(Drawing.Direct3DDevice) { GLLines = true }; #endregion @@ -993,16 +982,13 @@ public class VerticalColorSlider #region Constructors and Destructors /// - /// Init the VerticalColorSlider + /// Initializes a new instance of the class. /// - /// - /// + /// The size. + /// if set to true the VerticalColorSlider will be disabled. public VerticalColorSlider(Size size, bool disabled = false) { - this.mHsl = new Hsl(); - this.mHsl.H = 1; - this.mHsl.S = 1; - this.mHsl.L = 1; + this.mHsl = new Hsl { H = 1, S = 1, L = 1 }; this.mRgb = Utilities.HslToRgb(this.mHsl); this.mEDrawStyle = EDrawStyle.Hue; @@ -1158,92 +1144,94 @@ public Color Rgb /// Gets fired when the left mouse button is pressed /// /// Keys - public void VerticalColorSlider_MouseDown(WindowsKeys args) + public void VerticalColorSliderMouseDown(WindowsKeys args) { - if (args.Msg == WindowsMessages.LBUTTONDOWN && !this.mDisabled) + if (args.Msg != WindowsMessages.LBUTTONDOWN || this.mDisabled) { - this.mDragging = true; + return; + } - var y = (int)args.Cursor.Y - (int)this.Position.Y; - y -= 4; - if (y < 0) - { - y = 0; - } - if (y > (this.mHeight - 9)) - { - y = (this.mHeight - 9); - } + this.mDragging = true; - this.ArrowPos = y; + var y = (int)args.Cursor.Y - (int)this.Position.Y; + y -= 4; - this.DrawSlider(y, false); - this.ResetHslrgb(); - if (this.ColorSliderScroll != null) - { - this.ColorSliderScroll(); - } + if (y < 0) + { + y = 0; } + + if (y > (this.mHeight - 9)) + { + y = this.mHeight - 9; + } + + this.ArrowPos = y; + + this.DrawSlider(y, false); + this.ResetHslrgb(); + this.ColorSliderScroll?.Invoke(); } /// /// Gets fired when the mouse is moved and pressed before /// /// Keys - public void VerticalColorSlider_MouseMove(WindowsKeys args) + public void VerticalColorSliderMouseMove(WindowsKeys args) { - if (this.mDragging && args.Msg == WindowsMessages.MOUSEMOVE && !this.mDisabled) + if (!this.mDragging || args.Msg != WindowsMessages.MOUSEMOVE || this.mDisabled) { - var y = (int)args.Cursor.Y - (int)this.Position.Y; - y -= 4; - if (y < 0) - { - y = 0; - } - if (y > (this.mHeight - 9)) - { - y = (this.mHeight - 9); - } + return; + } - this.ArrowPos = y; - this.DrawSlider(y, false); - this.ResetHslrgb(); - if (this.ColorSliderScroll != null) - { - this.ColorSliderScroll(); - } + var y = (int)args.Cursor.Y - (int)this.Position.Y; + y -= 4; + + if (y < 0) + { + y = 0; + } + + if (y > (this.mHeight - 9)) + { + y = this.mHeight - 9; } + + this.ArrowPos = y; + this.DrawSlider(y, false); + this.ResetHslrgb(); + this.ColorSliderScroll?.Invoke(); } /// /// Gets fired when the mouse is released and pressed before /// /// Keys - public void VerticalColorSlider_MouseUp(WindowsKeys args) + public void VerticalColorSliderMouseUp(WindowsKeys args) { - if (this.mDragging && args.Msg == WindowsMessages.LBUTTONUP && !this.mDisabled) + if (!this.mDragging || args.Msg != WindowsMessages.LBUTTONUP || this.mDisabled) { - this.mDragging = false; + return; + } - var y = (int)args.Cursor.Y - (int)this.Position.Y; - y -= 4; - if (y < 0) - { - y = 0; - } - if (y > (this.mHeight - 9)) - { - y = (this.mHeight - 9); - } + this.mDragging = false; - this.ArrowPos = y; - this.DrawSlider(y, false); - this.ResetHslrgb(); - if (this.ColorSliderScroll != null) - { - this.ColorSliderScroll(); - } + var y = (int)args.Cursor.Y - (int)this.Position.Y; + y -= 4; + if (y < 0) + { + y = 0; + } + + if (y > (this.mHeight - 9)) + { + y = this.mHeight - 9; } + + this.ArrowPos = y; + this.DrawSlider(y, false); + this.ResetHslrgb(); + this.ColorSliderScroll?.Invoke(); } #endregion @@ -1269,6 +1257,7 @@ private void DrawStyleBlue() }, col.ToSharpDxColor()); } + Line.End(); } @@ -1291,6 +1280,7 @@ private void DrawStyleGreen() }, col.ToSharpDxColor()); } + Line.End(); } @@ -1299,10 +1289,8 @@ private void DrawStyleGreen() /// private void DrawStyleHue() { - var hsl = new Hsl(); + var hsl = new Hsl { S = 1, L = 1 }; - hsl.S = 1; - hsl.L = 1; Line.Begin(); for (var iCx = 0; iCx <= this.mHeight - 9; iCx++) { @@ -1317,6 +1305,7 @@ private void DrawStyleHue() }, col.ToSharpDxColor()); } + Line.End(); } @@ -1325,10 +1314,8 @@ private void DrawStyleHue() /// private void DrawStyleLuminance() { - var hsl = new Hsl(); + var hsl = new Hsl { H = this.mHsl.H, S = this.mHsl.S }; - hsl.H = this.mHsl.H; - hsl.S = this.mHsl.S; Line.Begin(); for (var iCx = 0; iCx <= this.mHeight - 9; iCx++) { @@ -1343,6 +1330,7 @@ private void DrawStyleLuminance() }, col.ToSharpDxColor()); } + Line.End(); } @@ -1365,6 +1353,7 @@ private void DrawStyleRed() }, col.ToSharpDxColor()); } + Line.End(); } @@ -1373,10 +1362,8 @@ private void DrawStyleRed() /// private void DrawStyleSaturation() { - var hsl = new Hsl(); + var hsl = new Hsl { H = this.mHsl.H, L = this.mHsl.L }; - hsl.H = this.mHsl.H; - hsl.L = this.mHsl.L; Line.Begin(); for (var iCx = 0; iCx <= this.mHeight - 9; iCx++) { @@ -1391,6 +1378,7 @@ private void DrawStyleSaturation() }, col.ToSharpDxColor()); } + Line.End(); } @@ -1476,9 +1464,10 @@ private void DrawSlider(int position, bool unconditional) { position = 0; } + if (position > (this.mHeight - 9)) { - position = (this.mHeight - 9); + position = this.mHeight - 9; } if (this.ArrowPos == position & !unconditional) @@ -1610,7 +1599,7 @@ public class VerticalAlphaSlider /// /// The line. /// - private static readonly SharpDX.Direct3D9.Line Line = new SharpDX.Direct3D9.Line(Drawing.Direct3DDevice) { GLLines = true }; + private static readonly Line Line = new Line(Drawing.Direct3DDevice) { GLLines = true }; #endregion @@ -1624,7 +1613,7 @@ public class VerticalAlphaSlider /// /// Defines the Display Style /// - private EDrawStyle mEDrawStyle = EDrawStyle.Brightness; + private EDrawStyle mEDrawStyle; /// /// Height of the ColorBox @@ -1656,15 +1645,13 @@ public class VerticalAlphaSlider #region Constructors and Destructors /// - /// Init the VerticalAlphaSlider + /// Initializes a new instance of the class. /// - /// + /// The size. + /// if set to true the VerticalAlphaSlider will be disabled. public VerticalAlphaSlider(Size size, bool disabled = false) { - this.mHsl = new Hsl(); - this.mHsl.H = 1; - this.mHsl.S = 0; - this.mHsl.L = 1; + this.mHsl = new Hsl { H = 1, S = 0, L = 1 }; this.mRgb = Utilities.HslToRgb(this.mHsl); this.mEDrawStyle = EDrawStyle.Brightness; @@ -1790,6 +1777,7 @@ public Color Rgb { return this.mRgb; } + set { this.mRgb = value; @@ -1821,70 +1809,71 @@ public Color Rgb /// Gets fired when the left mouse button is pressed /// /// Keys - public void VerticalAlphaSlider_MouseDown(WindowsKeys args) + public void VerticalAlphaSliderMouseDown(WindowsKeys args) { - if (args.Msg == WindowsMessages.LBUTTONDOWN && !mDisabled) + if (args.Msg != WindowsMessages.LBUTTONDOWN || this.mDisabled) { - this.mBDragging = true; + return; + } - var y = (int)args.Cursor.Y - (int)this.Position.Y; - y -= 4; - if (y < 0) - { - y = 0; - } - if (y > (this.mHeight - 9)) - { - y = (this.mHeight - 9); - } + this.mBDragging = true; - this.ArrowPos = y; + var y = (int)args.Cursor.Y - (int)this.Position.Y; + y -= 4; + if (y < 0) + { + y = 0; + } - this.DrawSlider(y, false); - this.ResetHslrgb(); - if (this.AlphaSliderScroll != null) - { - this.AlphaSliderScroll(); - } + if (y > (this.mHeight - 9)) + { + y = this.mHeight - 9; } + + this.ArrowPos = y; + + this.DrawSlider(y, false); + this.ResetHslrgb(); + this.AlphaSliderScroll?.Invoke(); } /// /// Gets fired when the mouse is moved and pressed before /// /// Keys - public void VerticalAlphaSlider_MouseMove(WindowsKeys args) + public void VerticalAlphaSliderMouseMove(WindowsKeys args) { - if (this.mBDragging && args.Msg == WindowsMessages.MOUSEMOVE && !mDisabled) + if (!this.mBDragging || args.Msg != WindowsMessages.MOUSEMOVE || this.mDisabled) { - var y = (int)args.Cursor.Y - (int)this.Position.Y; - y -= 4; - if (y < 0) - { - y = 0; - } - if (y > (this.mHeight - 9)) - { - y = (this.mHeight - 9); - } + return; + } - this.ArrowPos = y; - this.DrawSlider(y, false); - this.ResetHslrgb(); - if (this.AlphaSliderScroll != null) - { - this.AlphaSliderScroll(); - } + var y = (int)args.Cursor.Y - (int)this.Position.Y; + y -= 4; + + if (y < 0) + { + y = 0; + } + + if (y > (this.mHeight - 9)) + { + y = this.mHeight - 9; } + + this.ArrowPos = y; + this.DrawSlider(y, false); + this.ResetHslrgb(); + this.AlphaSliderScroll?.Invoke(); } /// /// Gets fired when the mouse is released and pressed before /// /// Keys - public void VerticalAlphaSlider_MouseUp(WindowsKeys args) + public void VerticalAlphaSliderMouseUp(WindowsKeys args) { - if (this.mBDragging && args.Msg == WindowsMessages.LBUTTONUP && !mDisabled) + if (this.mBDragging && args.Msg == WindowsMessages.LBUTTONUP && !this.mDisabled) { this.mBDragging = false; @@ -1894,18 +1883,16 @@ public void VerticalAlphaSlider_MouseUp(WindowsKeys args) { y = 0; } + if (y > (this.mHeight - 9)) { - y = (this.mHeight - 9); + y = this.mHeight - 9; } this.ArrowPos = y; this.DrawSlider(y, false); this.ResetHslrgb(); - if (this.AlphaSliderScroll != null) - { - this.AlphaSliderScroll(); - } + this.AlphaSliderScroll?.Invoke(); } } @@ -1932,6 +1919,7 @@ private void DrawStyleBlue() }, col.ToSharpDxColor()); } + Line.End(); } @@ -1954,6 +1942,7 @@ private void DrawStyleGreen() }, col.ToSharpDxColor()); } + Line.End(); } @@ -1962,10 +1951,8 @@ private void DrawStyleGreen() /// private void DrawStyleHue() { - var hsl = new Hsl(); + var hsl = new Hsl { S = 1, L = 1 }; - hsl.S = 1; - hsl.L = 1; Line.Begin(); for (var iCx = 0; iCx <= this.mHeight - 9; iCx++) { @@ -1980,6 +1967,7 @@ private void DrawStyleHue() }, col.ToSharpDxColor()); } + Line.End(); } @@ -1988,10 +1976,8 @@ private void DrawStyleHue() /// private void DrawStyleLuminance() { - var hsl = new Hsl(); + var hsl = new Hsl { H = this.mHsl.H, S = this.mHsl.S }; - hsl.H = this.mHsl.H; - hsl.S = this.mHsl.S; Line.Begin(); for (var iCx = 0; iCx <= this.mHeight - 9; iCx++) { @@ -2006,6 +1992,7 @@ private void DrawStyleLuminance() }, col.ToSharpDxColor()); } + Line.End(); } @@ -2028,6 +2015,7 @@ private void DrawStyleRed() }, col.ToSharpDxColor()); } + Line.End(); } @@ -2036,10 +2024,8 @@ private void DrawStyleRed() /// private void DrawStyleSaturation() { - var hsl = new Hsl(); + var hsl = new Hsl { H = this.mHsl.H, L = this.mHsl.L }; - hsl.H = this.mHsl.H; - hsl.L = this.mHsl.L; Line.Begin(); for (var iCx = 0; iCx <= this.mHeight - 9; iCx++) { @@ -2054,6 +2040,7 @@ private void DrawStyleSaturation() }, col.ToSharpDxColor()); } + Line.End(); } @@ -2139,9 +2126,10 @@ private void DrawSlider(int position, bool unconditional) { position = 0; } + if (position > (this.mHeight - 9)) { - position = (this.mHeight - 9); + position = this.mHeight - 9; } if (this.ArrowPos == position & !unconditional) @@ -2317,8 +2305,7 @@ public Color ModifySaturation(Color c, double saturation) /// New color public Color SetBrightness(Color c, double brightness) { - var hsl = new Hsl(); - hsl.L = brightness; + var hsl = new Hsl { L = brightness }; return Utilities.HslToRgb(hsl); } @@ -2330,8 +2317,7 @@ public Color SetBrightness(Color c, double brightness) /// New color public Color SetHue(Color c, double hue) { - var hsl = new Hsl(); - hsl.H = hue; + var hsl = new Hsl { H = hue }; return Utilities.HslToRgb(hsl); } @@ -2343,8 +2329,7 @@ public Color SetHue(Color c, double hue) /// New color public Color SetSaturation(Color c, double saturation) { - var hsl = new Hsl(); - hsl.S = saturation; + var hsl = new Hsl { S = saturation }; return Utilities.HslToRgb(hsl); } @@ -2585,22 +2570,20 @@ internal static class Utilities /// /// Converts the CMYK color format to RGB /// - /// - /// Converted color + /// The cmyk. + /// + /// Converted color + /// public static Color CmykToRgb(Cmyk cmyk) { - var red = 0; - var green = 0; - var blue = 0; - // To convert CMYK to RGB we first have to convert CMYK to CMY var cyan = (cmyk.C * (1 - cmyk.K)) + cmyk.K; var magenta = (cmyk.M * (1 - cmyk.K)) + cmyk.K; var yellow = (cmyk.Y * (1 - cmyk.K)) + cmyk.K; - red = Convert.ToInt32(Math.Round(cyan * 255d)); - green = Convert.ToInt32(Math.Round(magenta * 255d)); - blue = Convert.ToInt32(Math.Round(yellow * 255d)); + var red = Convert.ToInt32(Math.Round(cyan * 255d)); + var green = Convert.ToInt32(Math.Round(magenta * 255d)); + var blue = Convert.ToInt32(Math.Round(yellow * 255d)); return Color.FromArgb(red, green, blue); } @@ -2608,57 +2591,64 @@ public static Color CmykToRgb(Cmyk cmyk) /// /// Converts the HSL color format to RGB /// - /// - /// Converted color + /// The HSL. + /// + /// Converted color + /// public static Color HslToRgb(Hsl hsl) { - var max = 0; - var min = 0; - var mid = 0; - double q = 0; + int mid; - max = Convert.ToInt32(Math.Round(hsl.L * 255d)); - min = Convert.ToInt32(Math.Round((1.0d - hsl.S) * (hsl.L / 1.0d) * 255d)); - q = Convert.ToDouble((max - min) / 255d); + var max = Convert.ToInt32(Math.Round(hsl.L * 255d)); + var min = Convert.ToInt32(Math.Round((1.0d - hsl.S) * (hsl.L / 1.0d) * 255d)); + var q = Convert.ToDouble((max - min) / 255d); if (hsl.H >= 0 & hsl.H <= (1d / 6d)) { - mid = Convert.ToInt32(Math.Round(((hsl.H - 0d) * q) * 1530 + min)); + mid = Convert.ToInt32(Math.Round((((hsl.H - 0d) * q) * 1530) + min)); return Color.FromArgb(max, mid, min); } + if (hsl.H <= (1d / 3d)) { - mid = Convert.ToInt32(Math.Round(-((hsl.H - Convert.ToDouble(1d / 6d)) * q) * 1530 + max)); + mid = Convert.ToInt32(Math.Round((-((hsl.H - Convert.ToDouble(1d / 6d)) * q) * 1530) + max)); return Color.FromArgb(mid, max, min); } + if (hsl.H <= 0.5) { - mid = Convert.ToInt32(Math.Round(((hsl.H - Convert.ToDouble(1d / 3d)) * q) * 1530 + min)); + mid = Convert.ToInt32(Math.Round((((hsl.H - Convert.ToDouble(1d / 3d)) * q) * 1530) + min)); return Color.FromArgb(min, max, mid); } + if (hsl.H <= (2d / 3d)) { - mid = Convert.ToInt32(Math.Round(-((hsl.H - 0.5d) * q) * 1530 + max)); + mid = Convert.ToInt32(Math.Round((-((hsl.H - 0.5d) * q) * 1530) + max)); return Color.FromArgb(min, mid, max); } + if (hsl.H <= (5d / 6d)) { - mid = Convert.ToInt32(Math.Round(((hsl.H - Convert.ToDouble(2d / 3d)) * q) * 1530 + min)); + mid = Convert.ToInt32(Math.Round((((hsl.H - Convert.ToDouble(2d / 3d)) * q) * 1530) + min)); return Color.FromArgb(mid, min, max); } - if (hsl.H <= 1.0) + + if (!(hsl.H <= 1.0)) { - mid = Convert.ToInt32(Math.Round(-((hsl.H - (5d / 6d)) * q) * 1530 + max)); - return Color.FromArgb(max, min, mid); + return Color.FromArgb(0, 0, 0); } - return Color.FromArgb(0, 0, 0); + + mid = Convert.ToInt32(Math.Round((-((hsl.H - (5d / 6d)) * q) * 1530) + max)); + return Color.FromArgb(max, min, mid); } /// /// Converts the RGB color format to CMYK /// - /// - /// Converted color + /// The color. + /// + /// Converted color + /// public static Cmyk RgbToCmyk(Color c) { var cmyk = new Cmyk(); @@ -2693,16 +2683,14 @@ public static Cmyk RgbToCmyk(Color c) /// /// Converts the RGB color format to HSL /// - /// + /// The color /// Converted color public static Hsl RgbToHsl(Color c) { var hsl = new Hsl(); - var max = 0; - var min = 0; - var diff = 0; - var sum = 0; + int max; + int min; // Of the RBG Values - assign the highest value to _Max and the lowest to _min if (c.R > c.G) @@ -2715,44 +2703,30 @@ public static Hsl RgbToHsl(Color c) max = c.G; min = c.R; } + if (c.B > max) { max = c.B; } + if (c.B < min) { min = c.B; } - diff = max - min; - sum = max + min; + var diff = max - min; // Luminance (aka Brightness) hsl.L = Convert.ToDouble(max / 255d); // Saturation - if (max == 0) - { - hsl.S = 0; - } - else - { - hsl.S = Convert.ToDouble(diff / (double)max); - } + hsl.S = max == 0 ? 0 : Convert.ToDouble(diff / (double)max); // Hue // R is situated at the angle of 360 eller noll degrees // G vid 120 degrees // B vid 240 degrees - double q = 0; - if (diff == 0) - { - q = 0; - } - else - { - q = Convert.ToDouble(60d / diff); - } + var q = diff == 0 ? 0 : Convert.ToDouble(60d / diff); if (max == Convert.ToInt32(c.R)) { diff --git a/Core/UI/IMenu/MenuManager.cs b/Core/UI/IMenu/MenuManager.cs index 1992ac0..d131313 100644 --- a/Core/UI/IMenu/MenuManager.cs +++ b/Core/UI/IMenu/MenuManager.cs @@ -24,6 +24,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu using System.Windows.Forms; using Core.Utils; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using SharpDX.Direct3D9; using Skins; diff --git a/Core/UI/IMenu/Skins/Blue/BlueBool.cs b/Core/UI/IMenu/Skins/Blue/BlueBool.cs index 12ff09e..0b8cc0b 100644 --- a/Core/UI/IMenu/Skins/Blue/BlueBool.cs +++ b/Core/UI/IMenu/Skins/Blue/BlueBool.cs @@ -22,6 +22,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Blue/BlueButton.cs b/Core/UI/IMenu/Skins/Blue/BlueButton.cs index 3b0d93d..d9a6755 100644 --- a/Core/UI/IMenu/Skins/Blue/BlueButton.cs +++ b/Core/UI/IMenu/Skins/Blue/BlueButton.cs @@ -22,6 +22,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; @@ -181,9 +184,9 @@ public override void OnWndProc(WindowsKeys args) if (args.Cursor.IsUnderRectangle(rect.X, rect.Y, rect.Width, rect.Height)) { this.Component.Hovering = true; - if (args.Msg == WindowsMessages.LBUTTONDOWN && this.Component.Action != null) + if (args.Msg == WindowsMessages.LBUTTONDOWN) { - this.Component.Action(); + this.Component.Action?.Invoke(); } } else diff --git a/Core/UI/IMenu/Skins/Blue/BlueColorPicker.cs b/Core/UI/IMenu/Skins/Blue/BlueColorPicker.cs index 7d83162..fc060c3 100644 --- a/Core/UI/IMenu/Skins/Blue/BlueColorPicker.cs +++ b/Core/UI/IMenu/Skins/Blue/BlueColorPicker.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue using System.Drawing; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Abstracts; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; @@ -380,11 +383,11 @@ public override void OnWndProc(WindowsKeys args) } else if (this.InteractingVerticalColorSlider) { - this.verticalColorSlider.VerticalColorSlider_MouseMove(args); + this.verticalColorSlider.VerticalColorSliderMouseMove(args); } else if (this.InteractingVerticalAlphaSlider) { - this.verticalAlphaSlider.VerticalAlphaSlider_MouseMove(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseMove(args); } } } @@ -399,12 +402,12 @@ public override void OnWndProc(WindowsKeys args) if (this.InteractingVerticalColorSlider) { this.InteractingVerticalColorSlider = false; - this.verticalColorSlider.VerticalColorSlider_MouseUp(args); + this.verticalColorSlider.VerticalColorSliderMouseUp(args); } if (this.InteractingVerticalAlphaSlider) { this.InteractingVerticalAlphaSlider = false; - this.verticalAlphaSlider.VerticalAlphaSlider_MouseUp(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseUp(args); } } @@ -433,7 +436,7 @@ public override void OnWndProc(WindowsKeys args) this.VerticalColorSliderBoundaries().Height)) { this.InteractingVerticalColorSlider = true; - this.verticalColorSlider.VerticalColorSlider_MouseDown(args); + this.verticalColorSlider.VerticalColorSliderMouseDown(args); } else if (args.Cursor.IsUnderRectangle( this.VerticalAlphaSliderBoundaries().X, @@ -442,7 +445,7 @@ public override void OnWndProc(WindowsKeys args) this.VerticalAlphaSliderBoundaries().Height)) { this.InteractingVerticalAlphaSlider = true; - this.verticalAlphaSlider.VerticalAlphaSlider_MouseDown(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseDown(args); } else if (args.Cursor.IsUnderRectangle( this.ApplyButtonBoundaries().X, diff --git a/Core/UI/IMenu/Skins/Blue/BlueKeyBind.cs b/Core/UI/IMenu/Skins/Blue/BlueKeyBind.cs index aa90a4d..dc9ee25 100644 --- a/Core/UI/IMenu/Skins/Blue/BlueKeyBind.cs +++ b/Core/UI/IMenu/Skins/Blue/BlueKeyBind.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue using System.Windows.Forms; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Blue/BlueList.cs b/Core/UI/IMenu/Skins/Blue/BlueList.cs index f88817a..3d7bba5 100644 --- a/Core/UI/IMenu/Skins/Blue/BlueList.cs +++ b/Core/UI/IMenu/Skins/Blue/BlueList.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue using System.Collections.Generic; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Blue/BlueMenu.cs b/Core/UI/IMenu/Skins/Blue/BlueMenu.cs index 800eec4..d354fd0 100644 --- a/Core/UI/IMenu/Skins/Blue/BlueMenu.cs +++ b/Core/UI/IMenu/Skins/Blue/BlueMenu.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue using System.Linq; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Customizer; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Blue/BlueSeparator.cs b/Core/UI/IMenu/Skins/Blue/BlueSeparator.cs index 139702c..d734303 100644 --- a/Core/UI/IMenu/Skins/Blue/BlueSeparator.cs +++ b/Core/UI/IMenu/Skins/Blue/BlueSeparator.cs @@ -22,6 +22,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Blue/BlueSlider.cs b/Core/UI/IMenu/Skins/Blue/BlueSlider.cs index 43de56a..137ba1d 100644 --- a/Core/UI/IMenu/Skins/Blue/BlueSlider.cs +++ b/Core/UI/IMenu/Skins/Blue/BlueSlider.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Blue/BlueSliderButton.cs b/Core/UI/IMenu/Skins/Blue/BlueSliderButton.cs index bf244b3..b80437d 100644 --- a/Core/UI/IMenu/Skins/Blue/BlueSliderButton.cs +++ b/Core/UI/IMenu/Skins/Blue/BlueSliderButton.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Blue/BlueTextures.cs b/Core/UI/IMenu/Skins/Blue/BlueTextures.cs index ae9496d..035f4bf 100644 --- a/Core/UI/IMenu/Skins/Blue/BlueTextures.cs +++ b/Core/UI/IMenu/Skins/Blue/BlueTextures.cs @@ -53,13 +53,7 @@ private BlueTextures() } } - public BlueTextureWrapper this[BlueTexture textureType] - { - get - { - return this.textures[textureType]; - } - } + public BlueTextureWrapper this[BlueTexture textureType] => this.textures[textureType]; private BlueTextureWrapper BuildTexture(Image bmp, int height, int width) { diff --git a/Core/UI/IMenu/Skins/Blue2/BlueList2.cs b/Core/UI/IMenu/Skins/Blue2/BlueList2.cs index 0ddf6b0..ea5b487 100644 --- a/Core/UI/IMenu/Skins/Blue2/BlueList2.cs +++ b/Core/UI/IMenu/Skins/Blue2/BlueList2.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue2 using System.Collections.Generic; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Blue2/BlueMenu2.cs b/Core/UI/IMenu/Skins/Blue2/BlueMenu2.cs index cadce52..9690cf6 100644 --- a/Core/UI/IMenu/Skins/Blue2/BlueMenu2.cs +++ b/Core/UI/IMenu/Skins/Blue2/BlueMenu2.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue2 using System.Linq; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Customizer; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Blue2/BlueSeparator2.cs b/Core/UI/IMenu/Skins/Blue2/BlueSeparator2.cs index 2d1d55f..34eec37 100644 --- a/Core/UI/IMenu/Skins/Blue2/BlueSeparator2.cs +++ b/Core/UI/IMenu/Skins/Blue2/BlueSeparator2.cs @@ -22,6 +22,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue2 { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue; using LeagueSharp.SDK.Core.UI.IMenu.Values; diff --git a/Core/UI/IMenu/Skins/Blue2/BlueSlider2.cs b/Core/UI/IMenu/Skins/Blue2/BlueSlider2.cs index fc6b106..6357c47 100644 --- a/Core/UI/IMenu/Skins/Blue2/BlueSlider2.cs +++ b/Core/UI/IMenu/Skins/Blue2/BlueSlider2.cs @@ -24,6 +24,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue2 using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue; using LeagueSharp.SDK.Core.UI.IMenu.Values; diff --git a/Core/UI/IMenu/Skins/Blue2/BlueSliderButton2.cs b/Core/UI/IMenu/Skins/Blue2/BlueSliderButton2.cs index 787b838..35c6613 100644 --- a/Core/UI/IMenu/Skins/Blue2/BlueSliderButton2.cs +++ b/Core/UI/IMenu/Skins/Blue2/BlueSliderButton2.cs @@ -24,6 +24,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue2 using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Blue; using LeagueSharp.SDK.Core.UI.IMenu.Values; diff --git a/Core/UI/IMenu/Skins/Blue2/BlueTextures2.cs b/Core/UI/IMenu/Skins/Blue2/BlueTextures2.cs index 35e45ae..972cced 100644 --- a/Core/UI/IMenu/Skins/Blue2/BlueTextures2.cs +++ b/Core/UI/IMenu/Skins/Blue2/BlueTextures2.cs @@ -54,13 +54,7 @@ private BlueTextures2() } } - public BlueTextureWrapper this[BlueTexture2 textureType] - { - get - { - return this.textures[textureType]; - } - } + public BlueTextureWrapper this[BlueTexture2 textureType] => this.textures[textureType]; private BlueTextureWrapper BuildTexture(Image bmp, int height, int width) { diff --git a/Core/UI/IMenu/Skins/Colored/ColoredBool.cs b/Core/UI/IMenu/Skins/Colored/ColoredBool.cs index 2088011..294a279 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredBool.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredBool.cs @@ -22,6 +22,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Colored { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Colored/ColoredButton.cs b/Core/UI/IMenu/Skins/Colored/ColoredButton.cs index d4628bb..b0bb4e0 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredButton.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredButton.cs @@ -22,6 +22,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Colored { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Colored/ColoredColorPicker.cs b/Core/UI/IMenu/Skins/Colored/ColoredColorPicker.cs index 20a047d..860d4f4 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredColorPicker.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredColorPicker.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Colored using System.Drawing; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Abstracts; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; @@ -380,11 +383,11 @@ public override void OnWndProc(WindowsKeys args) } else if (this.InteractingVerticalColorSlider) { - this.verticalColorSlider.VerticalColorSlider_MouseMove(args); + this.verticalColorSlider.VerticalColorSliderMouseMove(args); } else if (this.InteractingVerticalAlphaSlider) { - this.verticalAlphaSlider.VerticalAlphaSlider_MouseMove(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseMove(args); } } } @@ -399,12 +402,12 @@ public override void OnWndProc(WindowsKeys args) if (this.InteractingVerticalColorSlider) { this.InteractingVerticalColorSlider = false; - this.verticalColorSlider.VerticalColorSlider_MouseUp(args); + this.verticalColorSlider.VerticalColorSliderMouseUp(args); } if (this.InteractingVerticalAlphaSlider) { this.InteractingVerticalAlphaSlider = false; - this.verticalAlphaSlider.VerticalAlphaSlider_MouseUp(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseUp(args); } } @@ -433,7 +436,7 @@ public override void OnWndProc(WindowsKeys args) this.VerticalColorSliderBoundaries().Height)) { this.InteractingVerticalColorSlider = true; - this.verticalColorSlider.VerticalColorSlider_MouseDown(args); + this.verticalColorSlider.VerticalColorSliderMouseDown(args); } else if (args.Cursor.IsUnderRectangle( this.VerticalAlphaSliderBoundaries().X, @@ -442,7 +445,7 @@ public override void OnWndProc(WindowsKeys args) this.VerticalAlphaSliderBoundaries().Height)) { this.InteractingVerticalAlphaSlider = true; - this.verticalAlphaSlider.VerticalAlphaSlider_MouseDown(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseDown(args); } else if (args.Cursor.IsUnderRectangle( this.ApplyButtonBoundaries().X, diff --git a/Core/UI/IMenu/Skins/Colored/ColoredKeyBind.cs b/Core/UI/IMenu/Skins/Colored/ColoredKeyBind.cs index b9aeba6..aae1b0e 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredKeyBind.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredKeyBind.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Colored using System.Windows.Forms; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Colored/ColoredList.cs b/Core/UI/IMenu/Skins/Colored/ColoredList.cs index b721a41..256b4a5 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredList.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredList.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Colored using System.Collections.Generic; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Colored/ColoredMenu.cs b/Core/UI/IMenu/Skins/Colored/ColoredMenu.cs index 72bc145..170e6b3 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredMenu.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredMenu.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Colored using System.Linq; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Customizer; using LeagueSharp.SDK.Core.Utils; @@ -135,37 +138,29 @@ public override void Draw() .GetCenteredText(null, MenuSettings.Font, this.Component.DisplayName, CenteredFlags.VerticalCenter) .Y; - if (this.Component.Toggled) - { - MenuSettings.Font.DrawText( - MenuManager.Instance.Sprite, - this.Component.DisplayName, - (int)(position.X + MenuSettings.ContainerTextOffset), - centerY, - new ColorBGRA(237, 245, 254, 255)); - } - else - { - MenuSettings.Font.DrawText( - MenuManager.Instance.Sprite, - this.Component.DisplayName, - (int)(position.X + MenuSettings.ContainerTextOffset), - centerY, - MenuSettings.TextColor); - } + MenuSettings.Font.DrawText( + MenuManager.Instance.Sprite, + this.Component.DisplayName, + (int)(position.X + MenuSettings.ContainerTextOffset), + centerY, + this.Component.Toggled ? new ColorBGRA(237, 245, 254, 255) : MenuSettings.TextColor); MenuManager.Instance.DrawDelayed( - delegate + () => { var symbolCenterY = - (int) - ColoredUtilities.GetContainerRectangle(this.Component) - .GetCenteredText(null, ColoredMenuSettings.FontMenuSymbol, this.Component.DisplayName, CenteredFlags.VerticalCenter) - .Y; + (int) + ColoredUtilities.GetContainerRectangle(this.Component) + .GetCenteredText( + null, + ColoredMenuSettings.FontMenuSymbol, + this.Component.DisplayName, + CenteredFlags.VerticalCenter) + .Y; Utils.DrawCircleFilled( (position.X + this.Component.MenuWidth - MenuSettings.ContainerTextMarkWidth - - MenuSettings.ContainerTextMarkOffset) + 4, + - MenuSettings.ContainerTextMarkOffset) + 4, symbolCenterY + 11, 6, 0, @@ -178,9 +173,11 @@ public override void Draw() "›", (int) (position.X + this.Component.MenuWidth - MenuSettings.ContainerTextMarkWidth - - MenuSettings.ContainerTextMarkOffset) + 1, + - MenuSettings.ContainerTextMarkOffset) + 1, symbolCenterY, - this.Component.Components.Count > 0 ? ColoredMenuSettings.TextCaptionColor : MenuSettings.ContainerSeparatorColor); + this.Component.Components.Count > 0 + ? ColoredMenuSettings.TextCaptionColor + : MenuSettings.ContainerSeparatorColor); }); if (this.Component.Toggled) diff --git a/Core/UI/IMenu/Skins/Colored/ColoredMenuSettings.cs b/Core/UI/IMenu/Skins/Colored/ColoredMenuSettings.cs index eea3326..d159cd5 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredMenuSettings.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredMenuSettings.cs @@ -35,16 +35,6 @@ public class ColoredMenuSettings : MenuSettings { #region Static Fields - /// - /// Local Caption Font. - /// - private static Font fontCaption; - - /// - /// Local Caption Font. - /// - private static Font fontMenuSymbol; - #endregion #region Constructors and Destructors @@ -97,34 +87,12 @@ static ColoredMenuSettings() /// /// Gets or sets the Global Caption Font. /// - public static Font FontCaption - { - get - { - return fontCaption; - } - - set - { - fontCaption = value; - } - } + public static Font FontCaption { get; set; } /// /// Gets or sets the Global Symbol Menu Font. /// - public static Font FontMenuSymbol - { - get - { - return fontMenuSymbol; - } - - set - { - fontMenuSymbol = value; - } - } + public static Font FontMenuSymbol { get; set; } /// /// Gets or sets the Global Text Caption Color. diff --git a/Core/UI/IMenu/Skins/Colored/ColoredSeparator.cs b/Core/UI/IMenu/Skins/Colored/ColoredSeparator.cs index af08fd6..3be6e05 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredSeparator.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredSeparator.cs @@ -24,6 +24,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Colored using System; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; using SharpDX; diff --git a/Core/UI/IMenu/Skins/Colored/ColoredSlider.cs b/Core/UI/IMenu/Skins/Colored/ColoredSlider.cs index 5184566..b0956c7 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredSlider.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredSlider.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Colored using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Colored/ColoredSliderButton.cs b/Core/UI/IMenu/Skins/Colored/ColoredSliderButton.cs index ad6b43f..00c2078 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredSliderButton.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredSliderButton.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Colored using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Colored/ColoredTextures.cs b/Core/UI/IMenu/Skins/Colored/ColoredTextures.cs index 23f6c79..6c69d00 100644 --- a/Core/UI/IMenu/Skins/Colored/ColoredTextures.cs +++ b/Core/UI/IMenu/Skins/Colored/ColoredTextures.cs @@ -53,13 +53,7 @@ private ColoredTextures() } } - public ColoredTextureWrapper this[ColoredTexture textureType] - { - get - { - return this.textures[textureType]; - } - } + public ColoredTextureWrapper this[ColoredTexture textureType] => this.textures[textureType]; private ColoredTextureWrapper BuildTexture(Image bmp, int height, int width) { diff --git a/Core/UI/IMenu/Skins/Default/DefaultBool.cs b/Core/UI/IMenu/Skins/Default/DefaultBool.cs index 4c660de..9a75481 100644 --- a/Core/UI/IMenu/Skins/Default/DefaultBool.cs +++ b/Core/UI/IMenu/Skins/Default/DefaultBool.cs @@ -19,6 +19,10 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Default { using Core.Utils; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; + using SharpDX; using SharpDX.Direct3D9; using Values; diff --git a/Core/UI/IMenu/Skins/Default/DefaultButton.cs b/Core/UI/IMenu/Skins/Default/DefaultButton.cs index e5555cf..388b828 100644 --- a/Core/UI/IMenu/Skins/Default/DefaultButton.cs +++ b/Core/UI/IMenu/Skins/Default/DefaultButton.cs @@ -19,6 +19,10 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Default { using Core.Utils; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; + using SharpDX; using SharpDX.Direct3D9; using Values; diff --git a/Core/UI/IMenu/Skins/Default/DefaultColorPicker.cs b/Core/UI/IMenu/Skins/Default/DefaultColorPicker.cs index c036d46..7f4dc48 100644 --- a/Core/UI/IMenu/Skins/Default/DefaultColorPicker.cs +++ b/Core/UI/IMenu/Skins/Default/DefaultColorPicker.cs @@ -20,6 +20,10 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Default using Abstracts; using Core.Utils; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; + using SharpDX; using SharpDX.Direct3D9; using Values; diff --git a/Core/UI/IMenu/Skins/Default/DefaultKeyBind.cs b/Core/UI/IMenu/Skins/Default/DefaultKeyBind.cs index adcfd88..1fa601c 100644 --- a/Core/UI/IMenu/Skins/Default/DefaultKeyBind.cs +++ b/Core/UI/IMenu/Skins/Default/DefaultKeyBind.cs @@ -20,6 +20,10 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Default using System.Windows.Forms; using Core.Utils; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; + using SharpDX; using SharpDX.Direct3D9; using Values; diff --git a/Core/UI/IMenu/Skins/Default/DefaultList.cs b/Core/UI/IMenu/Skins/Default/DefaultList.cs index daf7ca8..1ad8b9d 100644 --- a/Core/UI/IMenu/Skins/Default/DefaultList.cs +++ b/Core/UI/IMenu/Skins/Default/DefaultList.cs @@ -20,6 +20,10 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Default using System.Collections.Generic; using Core.Utils; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; + using SharpDX; using SharpDX.Direct3D9; using Values; diff --git a/Core/UI/IMenu/Skins/Default/DefaultMenu.cs b/Core/UI/IMenu/Skins/Default/DefaultMenu.cs index 394b509..f66dced 100644 --- a/Core/UI/IMenu/Skins/Default/DefaultMenu.cs +++ b/Core/UI/IMenu/Skins/Default/DefaultMenu.cs @@ -21,6 +21,10 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Default using Core.Utils; using Customizer; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; + using SharpDX; using SharpDX.Direct3D9; diff --git a/Core/UI/IMenu/Skins/Default/DefaultSeparator.cs b/Core/UI/IMenu/Skins/Default/DefaultSeparator.cs index c5b0f44..9c762a9 100644 --- a/Core/UI/IMenu/Skins/Default/DefaultSeparator.cs +++ b/Core/UI/IMenu/Skins/Default/DefaultSeparator.cs @@ -19,6 +19,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Default { using Core.Utils; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; + using Values; /// diff --git a/Core/UI/IMenu/Skins/Default/DefaultSlider.cs b/Core/UI/IMenu/Skins/Default/DefaultSlider.cs index fa68f11..28e171f 100644 --- a/Core/UI/IMenu/Skins/Default/DefaultSlider.cs +++ b/Core/UI/IMenu/Skins/Default/DefaultSlider.cs @@ -21,6 +21,10 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Default using System.Globalization; using Core.Utils; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; + using SharpDX; using SharpDX.Direct3D9; using Values; diff --git a/Core/UI/IMenu/Skins/Default/DefaultSliderButton.cs b/Core/UI/IMenu/Skins/Default/DefaultSliderButton.cs index d2f7a77..2cb31e5 100644 --- a/Core/UI/IMenu/Skins/Default/DefaultSliderButton.cs +++ b/Core/UI/IMenu/Skins/Default/DefaultSliderButton.cs @@ -21,6 +21,10 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Default using System.Globalization; using Core.Utils; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; + using SharpDX; using SharpDX.Direct3D9; using Values; diff --git a/Core/UI/IMenu/Skins/Light/LightBool.cs b/Core/UI/IMenu/Skins/Light/LightBool.cs index 9f20c84..a017513 100644 --- a/Core/UI/IMenu/Skins/Light/LightBool.cs +++ b/Core/UI/IMenu/Skins/Light/LightBool.cs @@ -22,6 +22,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Light/LightButton.cs b/Core/UI/IMenu/Skins/Light/LightButton.cs index 2131e85..84f5e6e 100644 --- a/Core/UI/IMenu/Skins/Light/LightButton.cs +++ b/Core/UI/IMenu/Skins/Light/LightButton.cs @@ -22,6 +22,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; @@ -167,9 +170,9 @@ public override void OnWndProc(WindowsKeys args) if (args.Cursor.IsUnderRectangle(rect.X, rect.Y, rect.Width, rect.Height)) { this.Component.Hovering = true; - if (args.Msg == WindowsMessages.LBUTTONDOWN && this.Component.Action != null) + if (args.Msg == WindowsMessages.LBUTTONDOWN) { - this.Component.Action(); + this.Component.Action?.Invoke(); } } else diff --git a/Core/UI/IMenu/Skins/Light/LightColorPicker.cs b/Core/UI/IMenu/Skins/Light/LightColorPicker.cs index 1595093..af7831c 100644 --- a/Core/UI/IMenu/Skins/Light/LightColorPicker.cs +++ b/Core/UI/IMenu/Skins/Light/LightColorPicker.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light using System.Drawing; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Abstracts; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; @@ -380,11 +383,11 @@ public override void OnWndProc(WindowsKeys args) } else if (this.InteractingVerticalColorSlider) { - this.verticalColorSlider.VerticalColorSlider_MouseMove(args); + this.verticalColorSlider.VerticalColorSliderMouseMove(args); } else if (this.InteractingVerticalAlphaSlider) { - this.verticalAlphaSlider.VerticalAlphaSlider_MouseMove(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseMove(args); } } } @@ -399,12 +402,12 @@ public override void OnWndProc(WindowsKeys args) if (this.InteractingVerticalColorSlider) { this.InteractingVerticalColorSlider = false; - this.verticalColorSlider.VerticalColorSlider_MouseUp(args); + this.verticalColorSlider.VerticalColorSliderMouseUp(args); } if (this.InteractingVerticalAlphaSlider) { this.InteractingVerticalAlphaSlider = false; - this.verticalAlphaSlider.VerticalAlphaSlider_MouseUp(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseUp(args); } } @@ -433,7 +436,7 @@ public override void OnWndProc(WindowsKeys args) this.VerticalColorSliderBoundaries().Height)) { this.InteractingVerticalColorSlider = true; - this.verticalColorSlider.VerticalColorSlider_MouseDown(args); + this.verticalColorSlider.VerticalColorSliderMouseDown(args); } else if (args.Cursor.IsUnderRectangle( this.VerticalAlphaSliderBoundaries().X, @@ -442,7 +445,7 @@ public override void OnWndProc(WindowsKeys args) this.VerticalAlphaSliderBoundaries().Height)) { this.InteractingVerticalAlphaSlider = true; - this.verticalAlphaSlider.VerticalAlphaSlider_MouseDown(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseDown(args); } else if (args.Cursor.IsUnderRectangle( this.ApplyButtonBoundaries().X, diff --git a/Core/UI/IMenu/Skins/Light/LightKeyBind.cs b/Core/UI/IMenu/Skins/Light/LightKeyBind.cs index f4d17c8..8b9c669 100644 --- a/Core/UI/IMenu/Skins/Light/LightKeyBind.cs +++ b/Core/UI/IMenu/Skins/Light/LightKeyBind.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light using System.Windows.Forms; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Light/LightList.cs b/Core/UI/IMenu/Skins/Light/LightList.cs index 15073fd..c58c356 100644 --- a/Core/UI/IMenu/Skins/Light/LightList.cs +++ b/Core/UI/IMenu/Skins/Light/LightList.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light using System.Collections.Generic; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Light/LightMenu.cs b/Core/UI/IMenu/Skins/Light/LightMenu.cs index 543aa48..7d66724 100644 --- a/Core/UI/IMenu/Skins/Light/LightMenu.cs +++ b/Core/UI/IMenu/Skins/Light/LightMenu.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light using System.Linq; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Customizer; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Light/LightMenuSettings.cs b/Core/UI/IMenu/Skins/Light/LightMenuSettings.cs index fba9ee0..61fa789 100644 --- a/Core/UI/IMenu/Skins/Light/LightMenuSettings.cs +++ b/Core/UI/IMenu/Skins/Light/LightMenuSettings.cs @@ -35,11 +35,6 @@ public class LightMenuSettings : MenuSettings { #region Static Fields - /// - /// Local Caption Font. - /// - private static Font fontCaption; - #endregion #region Constructors and Destructors @@ -80,18 +75,7 @@ static LightMenuSettings() /// /// Gets or sets the Global Caption Font. /// - public static Font FontCaption - { - get - { - return fontCaption; - } - - set - { - fontCaption = value; - } - } + public static Font FontCaption { get; set; } /// /// Gets or sets the Global Text Caption Color. diff --git a/Core/UI/IMenu/Skins/Light/LightSeparator.cs b/Core/UI/IMenu/Skins/Light/LightSeparator.cs index 2df22dd..e415b16 100644 --- a/Core/UI/IMenu/Skins/Light/LightSeparator.cs +++ b/Core/UI/IMenu/Skins/Light/LightSeparator.cs @@ -22,6 +22,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Light/LightSlider.cs b/Core/UI/IMenu/Skins/Light/LightSlider.cs index 04c74d9..c7dfc7b 100644 --- a/Core/UI/IMenu/Skins/Light/LightSlider.cs +++ b/Core/UI/IMenu/Skins/Light/LightSlider.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Light/LightSliderButton.cs b/Core/UI/IMenu/Skins/Light/LightSliderButton.cs index abaae0e..c5149bb 100644 --- a/Core/UI/IMenu/Skins/Light/LightSliderButton.cs +++ b/Core/UI/IMenu/Skins/Light/LightSliderButton.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Light/LightTextures.cs b/Core/UI/IMenu/Skins/Light/LightTextures.cs index cf61cf9..e2b09e4 100644 --- a/Core/UI/IMenu/Skins/Light/LightTextures.cs +++ b/Core/UI/IMenu/Skins/Light/LightTextures.cs @@ -53,13 +53,7 @@ private LightTextures() } } - public BlueTextureWrapper this[LightTexture textureType] - { - get - { - return this.textures[textureType]; - } - } + public BlueTextureWrapper this[LightTexture textureType] => this.textures[textureType]; private BlueTextureWrapper BuildTexture(Image bmp, int height, int width) { diff --git a/Core/UI/IMenu/Skins/Light2/LightColorPicker2.cs b/Core/UI/IMenu/Skins/Light2/LightColorPicker2.cs index 13d89db..2cf15a5 100644 --- a/Core/UI/IMenu/Skins/Light2/LightColorPicker2.cs +++ b/Core/UI/IMenu/Skins/Light2/LightColorPicker2.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light2 using System.Drawing; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Abstracts; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Light; using LeagueSharp.SDK.Core.UI.IMenu.Values; @@ -381,11 +384,11 @@ public override void OnWndProc(WindowsKeys args) } else if (this.InteractingVerticalColorSlider) { - this.verticalColorSlider.VerticalColorSlider_MouseMove(args); + this.verticalColorSlider.VerticalColorSliderMouseMove(args); } else if (this.InteractingVerticalAlphaSlider) { - this.verticalAlphaSlider.VerticalAlphaSlider_MouseMove(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseMove(args); } } } @@ -400,12 +403,12 @@ public override void OnWndProc(WindowsKeys args) if (this.InteractingVerticalColorSlider) { this.InteractingVerticalColorSlider = false; - this.verticalColorSlider.VerticalColorSlider_MouseUp(args); + this.verticalColorSlider.VerticalColorSliderMouseUp(args); } if (this.InteractingVerticalAlphaSlider) { this.InteractingVerticalAlphaSlider = false; - this.verticalAlphaSlider.VerticalAlphaSlider_MouseUp(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseUp(args); } } @@ -434,7 +437,7 @@ public override void OnWndProc(WindowsKeys args) this.VerticalColorSliderBoundaries().Height)) { this.InteractingVerticalColorSlider = true; - this.verticalColorSlider.VerticalColorSlider_MouseDown(args); + this.verticalColorSlider.VerticalColorSliderMouseDown(args); } else if (args.Cursor.IsUnderRectangle( this.VerticalAlphaSliderBoundaries().X, @@ -443,7 +446,7 @@ public override void OnWndProc(WindowsKeys args) this.VerticalAlphaSliderBoundaries().Height)) { this.InteractingVerticalAlphaSlider = true; - this.verticalAlphaSlider.VerticalAlphaSlider_MouseDown(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseDown(args); } else if (args.Cursor.IsUnderRectangle( this.ApplyButtonBoundaries().X, diff --git a/Core/UI/IMenu/Skins/Light2/LightList2.cs b/Core/UI/IMenu/Skins/Light2/LightList2.cs index 4b5b485..0baa26b 100644 --- a/Core/UI/IMenu/Skins/Light2/LightList2.cs +++ b/Core/UI/IMenu/Skins/Light2/LightList2.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light2 using System.Collections.Generic; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Light; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Light2/LightMenu2.cs b/Core/UI/IMenu/Skins/Light2/LightMenu2.cs index b045cad..180bc51 100644 --- a/Core/UI/IMenu/Skins/Light2/LightMenu2.cs +++ b/Core/UI/IMenu/Skins/Light2/LightMenu2.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light2 using System.Linq; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Customizer; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Light; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Light2/LightMenuSettings2.cs b/Core/UI/IMenu/Skins/Light2/LightMenuSettings2.cs index 375a4b1..be05409 100644 --- a/Core/UI/IMenu/Skins/Light2/LightMenuSettings2.cs +++ b/Core/UI/IMenu/Skins/Light2/LightMenuSettings2.cs @@ -69,11 +69,6 @@ static LightMenuSettings2() #region Static Fields - /// - /// Local Caption Font. - /// - private static Font fontCaption; - #endregion #region Constructors and Destructors @@ -85,18 +80,7 @@ static LightMenuSettings2() /// /// Gets or sets the Global Caption Font. /// - public static Font FontCaption - { - get - { - return fontCaption; - } - - set - { - fontCaption = value; - } - } + public static Font FontCaption { get; set; } /// /// Gets or sets the Global Text Caption Color. diff --git a/Core/UI/IMenu/Skins/Light2/LightSeparator2.cs b/Core/UI/IMenu/Skins/Light2/LightSeparator2.cs index e078a45..3e1fa87 100644 --- a/Core/UI/IMenu/Skins/Light2/LightSeparator2.cs +++ b/Core/UI/IMenu/Skins/Light2/LightSeparator2.cs @@ -22,6 +22,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light2 { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Light; using LeagueSharp.SDK.Core.UI.IMenu.Values; diff --git a/Core/UI/IMenu/Skins/Light2/LightSlider2.cs b/Core/UI/IMenu/Skins/Light2/LightSlider2.cs index 8450e02..682938d 100644 --- a/Core/UI/IMenu/Skins/Light2/LightSlider2.cs +++ b/Core/UI/IMenu/Skins/Light2/LightSlider2.cs @@ -24,6 +24,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light2 using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Light; using LeagueSharp.SDK.Core.UI.IMenu.Values; diff --git a/Core/UI/IMenu/Skins/Light2/LightSliderButton2.cs b/Core/UI/IMenu/Skins/Light2/LightSliderButton2.cs index 5ab61ef..5b86cae 100644 --- a/Core/UI/IMenu/Skins/Light2/LightSliderButton2.cs +++ b/Core/UI/IMenu/Skins/Light2/LightSliderButton2.cs @@ -24,6 +24,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Light2 using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Skins.Light; using LeagueSharp.SDK.Core.UI.IMenu.Values; diff --git a/Core/UI/IMenu/Skins/Light2/LightTextures2.cs b/Core/UI/IMenu/Skins/Light2/LightTextures2.cs index b520e22..2e06337 100644 --- a/Core/UI/IMenu/Skins/Light2/LightTextures2.cs +++ b/Core/UI/IMenu/Skins/Light2/LightTextures2.cs @@ -54,13 +54,7 @@ private LightTextures2() } } - public BlueTextureWrapper this[LightTexture2 textureType] - { - get - { - return this.textures[textureType]; - } - } + public BlueTextureWrapper this[LightTexture2 textureType] => this.textures[textureType]; private BlueTextureWrapper BuildTexture(Image bmp, int height, int width) { diff --git a/Core/UI/IMenu/Skins/Tech/TechBool.cs b/Core/UI/IMenu/Skins/Tech/TechBool.cs index db2055c..df8b086 100644 --- a/Core/UI/IMenu/Skins/Tech/TechBool.cs +++ b/Core/UI/IMenu/Skins/Tech/TechBool.cs @@ -22,6 +22,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Tech { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Tech/TechButton.cs b/Core/UI/IMenu/Skins/Tech/TechButton.cs index 52e1742..1d3257c 100644 --- a/Core/UI/IMenu/Skins/Tech/TechButton.cs +++ b/Core/UI/IMenu/Skins/Tech/TechButton.cs @@ -22,6 +22,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Tech { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; @@ -163,9 +166,9 @@ public override void OnWndProc(WindowsKeys args) if (args.Cursor.IsUnderRectangle(rect.X, rect.Y, rect.Width, rect.Height)) { this.Component.Hovering = true; - if (args.Msg == WindowsMessages.LBUTTONDOWN && this.Component.Action != null) + if (args.Msg == WindowsMessages.LBUTTONDOWN) { - this.Component.Action(); + this.Component.Action?.Invoke(); } } else diff --git a/Core/UI/IMenu/Skins/Tech/TechColorPicker.cs b/Core/UI/IMenu/Skins/Tech/TechColorPicker.cs index 028a9f4..5097b7c 100644 --- a/Core/UI/IMenu/Skins/Tech/TechColorPicker.cs +++ b/Core/UI/IMenu/Skins/Tech/TechColorPicker.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Tech using System.Drawing; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Abstracts; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; @@ -380,11 +383,11 @@ public override void OnWndProc(WindowsKeys args) } else if (this.InteractingVerticalColorSlider) { - this.verticalColorSlider.VerticalColorSlider_MouseMove(args); + this.verticalColorSlider.VerticalColorSliderMouseMove(args); } else if (this.InteractingVerticalAlphaSlider) { - this.verticalAlphaSlider.VerticalAlphaSlider_MouseMove(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseMove(args); } } } @@ -399,12 +402,12 @@ public override void OnWndProc(WindowsKeys args) if (this.InteractingVerticalColorSlider) { this.InteractingVerticalColorSlider = false; - this.verticalColorSlider.VerticalColorSlider_MouseUp(args); + this.verticalColorSlider.VerticalColorSliderMouseUp(args); } if (this.InteractingVerticalAlphaSlider) { this.InteractingVerticalAlphaSlider = false; - this.verticalAlphaSlider.VerticalAlphaSlider_MouseUp(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseUp(args); } } @@ -433,7 +436,7 @@ public override void OnWndProc(WindowsKeys args) this.VerticalColorSliderBoundaries().Height)) { this.InteractingVerticalColorSlider = true; - this.verticalColorSlider.VerticalColorSlider_MouseDown(args); + this.verticalColorSlider.VerticalColorSliderMouseDown(args); } else if (args.Cursor.IsUnderRectangle( this.VerticalAlphaSliderBoundaries().X, @@ -442,7 +445,7 @@ public override void OnWndProc(WindowsKeys args) this.VerticalAlphaSliderBoundaries().Height)) { this.InteractingVerticalAlphaSlider = true; - this.verticalAlphaSlider.VerticalAlphaSlider_MouseDown(args); + this.verticalAlphaSlider.VerticalAlphaSliderMouseDown(args); } else if (args.Cursor.IsUnderRectangle( this.ApplyButtonBoundaries().X, diff --git a/Core/UI/IMenu/Skins/Tech/TechKeyBind.cs b/Core/UI/IMenu/Skins/Tech/TechKeyBind.cs index a1d5237..7d77d94 100644 --- a/Core/UI/IMenu/Skins/Tech/TechKeyBind.cs +++ b/Core/UI/IMenu/Skins/Tech/TechKeyBind.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Tech using System.Windows.Forms; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Tech/TechList.cs b/Core/UI/IMenu/Skins/Tech/TechList.cs index 4f7afea..b99a6b2 100644 --- a/Core/UI/IMenu/Skins/Tech/TechList.cs +++ b/Core/UI/IMenu/Skins/Tech/TechList.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Tech using System.Collections.Generic; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Tech/TechMenu.cs b/Core/UI/IMenu/Skins/Tech/TechMenu.cs index d2da792..67d8a9d 100644 --- a/Core/UI/IMenu/Skins/Tech/TechMenu.cs +++ b/Core/UI/IMenu/Skins/Tech/TechMenu.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Tech using System.Linq; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Customizer; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Tech/TechMenuSettings.cs b/Core/UI/IMenu/Skins/Tech/TechMenuSettings.cs index 869fd65..3ed2b4d 100644 --- a/Core/UI/IMenu/Skins/Tech/TechMenuSettings.cs +++ b/Core/UI/IMenu/Skins/Tech/TechMenuSettings.cs @@ -35,16 +35,6 @@ public class TechMenuSettings : MenuSettings { #region Static Fields - /// - /// Local Caption Font. - /// - private static Font fontCaption; - - /// - /// Local Caption Font. - /// - private static Font fontMenuSymbol; - #endregion #region Constructors and Destructors @@ -110,34 +100,12 @@ static TechMenuSettings() /// /// Gets or sets the Global Caption Font. /// - public static Font FontCaption - { - get - { - return fontCaption; - } - - set - { - fontCaption = value; - } - } + public static Font FontCaption { get; set; } /// /// Gets or sets the Global Symbol Menu Font. /// - public static Font FontMenuSymbol - { - get - { - return fontMenuSymbol; - } - - set - { - fontMenuSymbol = value; - } - } + public static Font FontMenuSymbol { get; set; } /// /// Gets or sets the Global Text Caption Color. diff --git a/Core/UI/IMenu/Skins/Tech/TechSeparator.cs b/Core/UI/IMenu/Skins/Tech/TechSeparator.cs index ea68cf8..aca92fc 100644 --- a/Core/UI/IMenu/Skins/Tech/TechSeparator.cs +++ b/Core/UI/IMenu/Skins/Tech/TechSeparator.cs @@ -23,6 +23,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Tech { using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; using SharpDX.Direct3D9; diff --git a/Core/UI/IMenu/Skins/Tech/TechSlider.cs b/Core/UI/IMenu/Skins/Tech/TechSlider.cs index f493b3b..4a8c5f3 100644 --- a/Core/UI/IMenu/Skins/Tech/TechSlider.cs +++ b/Core/UI/IMenu/Skins/Tech/TechSlider.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Tech using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Tech/TechSliderButton.cs b/Core/UI/IMenu/Skins/Tech/TechSliderButton.cs index 40568e4..dc0a177 100644 --- a/Core/UI/IMenu/Skins/Tech/TechSliderButton.cs +++ b/Core/UI/IMenu/Skins/Tech/TechSliderButton.cs @@ -25,6 +25,9 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Tech using System.Globalization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/IMenu/Skins/Tech/TechTextures.cs b/Core/UI/IMenu/Skins/Tech/TechTextures.cs index f54db80..e5447a5 100644 --- a/Core/UI/IMenu/Skins/Tech/TechTextures.cs +++ b/Core/UI/IMenu/Skins/Tech/TechTextures.cs @@ -19,13 +19,11 @@ // A custom implementation of // // -------------------------------------------------------------------------------------------------------------------- -using System.Collections.Generic; -using System.Linq; - namespace LeagueSharp.SDK.Core.UI.IMenu.Skins.Tech { + using System.Collections.Generic; using System.Drawing; - + using System.Linq; using LeagueSharp.SDK.Properties; using SharpDX.Direct3D9; @@ -53,13 +51,7 @@ private TechTextures() } } - public TechTextureWrapper this[TechTexture textureType] - { - get - { - return this.textures[textureType]; - } - } + public TechTextureWrapper this[TechTexture textureType] => this.textures[textureType]; private TechTextureWrapper BuildTexture(Image bmp, int height, int width) { diff --git a/Core/UI/IMenu/Values/MenuKeyBind.cs b/Core/UI/IMenu/Values/MenuKeyBind.cs index 536f9f6..fcf9106 100644 --- a/Core/UI/IMenu/Values/MenuKeyBind.cs +++ b/Core/UI/IMenu/Values/MenuKeyBind.cs @@ -23,6 +23,8 @@ namespace LeagueSharp.SDK.Core.UI.IMenu.Values using System.Windows.Forms; using Core.Utils; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using Skins; using MenuItem = MenuItem; diff --git a/Core/UI/IMenu/Values/MenuSliderButton.cs b/Core/UI/IMenu/Values/MenuSliderButton.cs index 20aa66a..89f1c98 100644 --- a/Core/UI/IMenu/Values/MenuSliderButton.cs +++ b/Core/UI/IMenu/Values/MenuSliderButton.cs @@ -133,13 +133,7 @@ protected MenuSliderButton(SerializationInfo info, StreamingContext context) /// /// Gets the Slider Value if Button is active. /// - public int Value - { - get - { - return this.SValue != this.MinValue && this.BValue ? this.value : -1; - } - } + public int Value => this.SValue != this.MinValue && this.BValue ? this.value : -1; /// /// Gets or sets the Slider Current Value. diff --git a/Core/UI/Notifications/ANotification.cs b/Core/UI/Notifications/ANotification.cs index e8b536b..fdd771c 100644 --- a/Core/UI/Notifications/ANotification.cs +++ b/Core/UI/Notifications/ANotification.cs @@ -15,9 +15,9 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.UI { - using Core.Utils; + using LeagueSharp.SDK.Core.Utils; using SharpDX; diff --git a/Core/UI/Notifications/Notification.cs b/Core/UI/Notifications/Notification.cs index f8170cd..3be6ad4 100644 --- a/Core/UI/Notifications/Notification.cs +++ b/Core/UI/Notifications/Notification.cs @@ -15,12 +15,15 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.UI { using System; using System.Collections.Generic; using System.Drawing; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; using LeagueSharp.SDK.Core.Utils; using LeagueSharp.SDK.Properties; diff --git a/Core/UI/Notifications/NotificationIcons.cs b/Core/UI/Notifications/NotificationIcons.cs index 78f5460..c2ca501 100644 --- a/Core/UI/Notifications/NotificationIcons.cs +++ b/Core/UI/Notifications/NotificationIcons.cs @@ -15,12 +15,14 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.UI { using System.Collections.Generic; using System.Drawing; using System.Linq; - using Properties; + + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Properties; using SharpDX.Direct3D9; diff --git a/Core/UI/Notifications/Notifications.cs b/Core/UI/Notifications/Notifications.cs index 5c70f33..1f5b839 100644 --- a/Core/UI/Notifications/Notifications.cs +++ b/Core/UI/Notifications/Notifications.cs @@ -15,12 +15,16 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.UI { using System; using System.Collections.Generic; using System.Linq; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Events; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; using LeagueSharp.SDK.Core.UI.IMenu; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/UI/Utils.cs b/Core/UI/Utils.cs index 6f1502c..c454697 100644 --- a/Core/UI/Utils.cs +++ b/Core/UI/Utils.cs @@ -345,15 +345,7 @@ public static void DrawBoxBordered(float x, float y, float w, float h, float bor /// Corner Color public static void DrawBoxRounded(float x, float y, float w, float h, float radius, bool smoothing, Color color, Color bcolor, Color? ccolor = null) { - Color cornerColor; - if (!ccolor.HasValue) - { - cornerColor = bcolor; - } - else - { - cornerColor = ccolor.Value; - } + var cornerColor = ccolor ?? bcolor; DrawBoxFilled(x + radius, y + radius, w - 2 * radius - 1, h - 2 * radius - 1, color); // Center rect. DrawBoxFilled(x + radius, y, w - 2 * radius - 1, radius, color); // Top rect. diff --git a/Core/Utils/ActionQueue.cs b/Core/Utils/ActionQueue.cs index 3b0f8b9..c97a545 100644 --- a/Core/Utils/ActionQueue.cs +++ b/Core/Utils/ActionQueue.cs @@ -6,6 +6,8 @@ using System.Reflection; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; /// /// Queues actions. diff --git a/Core/Utils/AutoAttack.cs b/Core/Utils/AutoAttack.cs index 23352ac..acdda98 100644 --- a/Core/Utils/AutoAttack.cs +++ b/Core/Utils/AutoAttack.cs @@ -20,6 +20,8 @@ namespace LeagueSharp.SDK.Core.Utils using System; using System.Linq; + using LeagueSharp.SDK.Core.Extensions; + /// /// AutoAttack utility class. /// diff --git a/Core/Utils/Cache.cs b/Core/Utils/Cache.cs index 82b0405..f653c03 100644 --- a/Core/Utils/Cache.cs +++ b/Core/Utils/Cache.cs @@ -23,6 +23,7 @@ namespace LeagueSharp.SDK.Core.Utils using System.Runtime.Caching; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; /// /// Provides an implementation of ObjectCache, for any object. Check for diff --git a/Core/Utils/CallbackPerformance.cs b/Core/Utils/CallbackPerformance.cs index 33bc027..95b50f2 100644 --- a/Core/Utils/CallbackPerformance.cs +++ b/Core/Utils/CallbackPerformance.cs @@ -22,6 +22,7 @@ namespace LeagueSharp.SDK.Core.Utils using System.Runtime.CompilerServices; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; /// /// Performance class, measures how much time does a function takes to execute. diff --git a/Core/Utils/DynamicInitializer.cs b/Core/Utils/DynamicInitializer.cs index 3cf36d9..9e9530e 100644 --- a/Core/Utils/DynamicInitializer.cs +++ b/Core/Utils/DynamicInitializer.cs @@ -23,6 +23,7 @@ namespace LeagueSharp.SDK.Core.Utils using System.Reflection.Emit; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; #endregion diff --git a/Core/Utils/Invulnerable.cs b/Core/Utils/Invulnerable.cs index 0b30317..9b7e7c4 100644 --- a/Core/Utils/Invulnerable.cs +++ b/Core/Utils/Invulnerable.cs @@ -24,6 +24,9 @@ namespace LeagueSharp.SDK.Core.Utils using System.Collections.ObjectModel; using System.Linq; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; + #endregion /// diff --git a/Core/Utils/Jungle.cs b/Core/Utils/Jungle.cs index c045c4d..a7b6278 100644 --- a/Core/Utils/Jungle.cs +++ b/Core/Utils/Jungle.cs @@ -21,6 +21,7 @@ namespace LeagueSharp.SDK.Core.Utils using System.Text.RegularExpressions; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; /// /// The jungle utility class, provides utils for jungle related items. diff --git a/Core/Utils/Logging.cs b/Core/Utils/Logging.cs index 0135be7..c3de2f2 100644 --- a/Core/Utils/Logging.cs +++ b/Core/Utils/Logging.cs @@ -22,6 +22,7 @@ namespace LeagueSharp.SDK.Core.Utils using System.Runtime.CompilerServices; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; /// /// Logging class for LeagueSharp.SDK, used to log output data into a file and the console. diff --git a/Core/Utils/MathUtils.cs b/Core/Utils/MathUtils.cs index 1099a9e..7837ccc 100644 --- a/Core/Utils/MathUtils.cs +++ b/Core/Utils/MathUtils.cs @@ -23,6 +23,9 @@ namespace LeagueSharp.SDK.Core.Utils using Clipper; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math.Polygons; + using SharpDX; /// diff --git a/Core/Utils/Minion.cs b/Core/Utils/Minion.cs index 58fa532..e2f7132 100644 --- a/Core/Utils/Minion.cs +++ b/Core/Utils/Minion.cs @@ -21,6 +21,11 @@ namespace LeagueSharp.SDK.Core.Utils using System.Linq; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math; + using LeagueSharp.SDK.Core.Math.Prediction; using SharpDX; diff --git a/Core/Utils/Performance.cs b/Core/Utils/Performance.cs index 770a8d0..c65189e 100644 --- a/Core/Utils/Performance.cs +++ b/Core/Utils/Performance.cs @@ -22,6 +22,7 @@ namespace LeagueSharp.SDK.Core.Utils using System.Runtime.CompilerServices; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; /// /// Performance block class, for block method performance logging. diff --git a/Core/Utils/Render.cs b/Core/Utils/Render.cs index df572f7..2857b88 100644 --- a/Core/Utils/Render.cs +++ b/Core/Utils/Render.cs @@ -8,6 +8,9 @@ using System.Linq; using System.Threading; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; using SharpDX.Direct3D9; diff --git a/Core/Utils/ResourceLoader.cs b/Core/Utils/ResourceLoader.cs index d842f53..9fa90c0 100644 --- a/Core/Utils/ResourceLoader.cs +++ b/Core/Utils/ResourceLoader.cs @@ -22,6 +22,8 @@ namespace LeagueSharp.SDK.Core.Utils using System.Linq; using System.Reflection; + using LeagueSharp.SDK.Core.Enumerations; + internal static class ResourceLoader { public static void Initialize() diff --git a/Core/Utils/Storage.cs b/Core/Utils/Storage.cs index 79ad77c..3480ca3 100644 --- a/Core/Utils/Storage.cs +++ b/Core/Utils/Storage.cs @@ -26,6 +26,7 @@ namespace LeagueSharp.SDK.Core.Utils using System.Runtime.Serialization; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; /// /// The storage, main purpose is to save share-able settings between assemblies. diff --git a/Core/Utils/WeightedRandom.cs b/Core/Utils/WeightedRandom.cs index f835942..006a5af 100644 --- a/Core/Utils/WeightedRandom.cs +++ b/Core/Utils/WeightedRandom.cs @@ -21,6 +21,8 @@ namespace LeagueSharp.SDK.Core.Utils using System.Collections.Generic; using System.Linq; + using LeagueSharp.SDK.Core.Extensions; + /// /// Weighted Random, contains useful extensions for randomizer. /// diff --git a/Core/Utils/WindowsKeys.cs b/Core/Utils/WindowsKeys.cs index dd8eb38..aca62d4 100644 --- a/Core/Utils/WindowsKeys.cs +++ b/Core/Utils/WindowsKeys.cs @@ -21,6 +21,7 @@ namespace LeagueSharp.SDK.Core.Utils using System.Windows.Forms; using LeagueSharp.SDK; + using LeagueSharp.SDK.Core.Enumerations; using SharpDX; diff --git a/Core/Variables.cs b/Core/Variables.cs index 2eb4ca0..aa9f6ca 100644 --- a/Core/Variables.cs +++ b/Core/Variables.cs @@ -15,11 +15,12 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core { using System; using LeagueSharp.SDK.Core.UI.IMenu; + using LeagueSharp.SDK.Core.Wrappers; /// /// Variables of the LeagueSharp development kit. diff --git a/Core/Wrappers/Damages/Damage.cs b/Core/Wrappers/Damages/Damage.cs index ea1f5fc..85d12ad 100644 --- a/Core/Wrappers/Damages/Damage.cs +++ b/Core/Wrappers/Damages/Damage.cs @@ -21,6 +21,11 @@ namespace LeagueSharp.SDK.Core.Wrappers.Damages using System.Linq; using System.Text.RegularExpressions; + using LeagueSharp.Data.DataTypes; + using LeagueSharp.Data.Enumerations; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; + using Utils; /// diff --git a/Core/Wrappers/Damages/DamageJson.cs b/Core/Wrappers/Damages/DamageJson.cs deleted file mode 100644 index 92ebf74..0000000 --- a/Core/Wrappers/Damages/DamageJson.cs +++ /dev/null @@ -1,365 +0,0 @@ -// -// Copyright (c) 2015 LeagueSharp. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// - -namespace LeagueSharp.SDK.Core.Wrappers.Damages -{ - using System.Collections.Generic; - - /// - /// Damage wrapper class, contains functions to calculate estimated damage to a unit and also provides damage details. - /// - public static partial class Damage - { - #region Enums - - /// - /// The Damage Scaling Target Type enumeration. - /// - public enum DamageScalingTarget - { - /// - /// The Source target type. - /// - Source, - - /// - /// The Target target type. - /// - Target - } - - /// - /// The Damage Scaling Type enumeration. - /// - public enum DamageScalingType - { - /// - /// The Bonus Attack Points scaling type. - /// - BonusAttackPoints, - - /// - /// The Ability Points scaling type. - /// - AbilityPoints, - - /// - /// The Attack Points scaling type. - /// - AttackPoints, - - /// - /// The Max Health scaling type. - /// - MaxHealth, - - /// - /// The Current Health scaling type. - /// - CurrentHealth, - - /// - /// The Missing Health scaling type. - /// - MissingHealth, - - /// - /// The Bonus Health scaling type. - /// - BonusHealth, - - /// - /// The Armor scaling type. - /// - Armor, - - /// - /// The Mana scaling type. - /// - MaxMana - } - - /// - /// The Damage Stage enumeration. - /// - public enum DamageStage - { - /// - /// The Default stage. - /// - Default, - - /// - /// The WayBack stage. - /// - WayBack, - - /// - /// The Detonation stage. - /// - Detonation, - - /// - /// The Damage Per Second stage. - /// - DamagePerSecond, - - /// - /// The Second Form stage. - /// - SecondForm, - - /// - /// The Second Cast stage. - /// - SecondCast, - - /// - /// The Buff stage. - /// - Buff, - - /// - /// The Empowered stage. - /// - Empowered - } - - /// - /// - public enum SpellEffectType - { - /// - /// - None, - - /// - /// - AoE, - - /// - /// - Single, - - /// - /// - OverTime, - - /// - /// - Attack - } - - #endregion - - /// - /// The Champion Damage class container. - /// - internal class ChampionDamage - { - #region Public Properties - - /// - /// Gets the 'E' spell damage classes. - /// - public List E { get; set; } - - /// - /// Gets the 'Q' spell damage classes. - /// - public List Q { get; set; } - - /// - /// Gets the 'R' spell damage classes. - /// - public List R { get; set; } - - /// - /// Gets the 'W' spell damage classes. - /// - public List W { get; set; } - - #endregion - - #region Public Methods and Operators - - /// - /// Resolves the spell damage classes entry through the SpellSlot component. - /// - /// - /// The SpellSlot. - /// - /// - /// The spell damage classes of the requested Spell Slot. - /// - public IEnumerable GetSlot(SpellSlot slot) - { - switch (slot) - { - case SpellSlot.Q: - return this.Q; - case SpellSlot.W: - return this.W; - case SpellSlot.E: - return this.E; - case SpellSlot.R: - return this.R; - } - - return null; - } - - #endregion - } - - /// - /// The Champion Damage Spell class container. - /// - internal class ChampionDamageSpell - { - #region Public Properties - - /// - /// Gets the Spell Data. - /// - public ChampionDamageSpellData SpellData { get; set; } - - /// - /// Gets the Spell Stage. - /// - public DamageStage Stage { get; set; } - - #endregion - } - - /// - /// The Champion Damage Spell Bonus class container. - /// - internal class ChampionDamageSpellBonus - { - #region Public Properties - - public List BonusDamageOnMinion { get; set; } - - /// - /// Gets the Damage Percentages. - /// - public List DamagePercentages { get; set; } - - /// - /// Gets the Damage Type. - /// - public DamageType DamageType { get; set; } - - public List MaxDamageOnMinion { get; set; } - - public List MinDamage { get; set; } - - public double ScalePer100Ad { get; set; } - - public double ScalePer100Ap { get; set; } - - public double ScalePer100BonusAd { get; set; } - - /// - /// Gets the Scaling Buff. - /// - public string ScalingBuff { get; set; } - - /// - /// Gets the Scaling Buff Offset. - /// - public int ScalingBuffOffset { get; set; } - - /// - /// Gets the Scaling Buff Target. - /// - public DamageScalingTarget ScalingBuffTarget { get; set; } - - /// - /// Gets the Scaling Target Type. - /// - public DamageScalingTarget ScalingTarget { get; set; } - - /// - /// Gets the Scaling Type. - /// - public DamageScalingType ScalingType { get; set; } - - #endregion - } - - /// - /// The Champion Damage Spell Data class container. - /// - internal class ChampionDamageSpellData - { - #region Public Properties - - public List BonusDamageOnMinion { get; set; } - - /// - /// Gets the Bonus Damages. - /// - public List BonusDamages { get; set; } - - /// - /// Gets the Main Damages. - /// - public List Damages { get; set; } - - public List DamagesPerLvl { get; set; } - - /// - /// Gets the Damage Type. - /// - public DamageType DamageType { get; set; } - - public bool IsApplyOnHit { get; set; } - - public bool IsModifiedDamage { get; set; } - - public List MaxDamageOnMinion { get; set; } - - public double ScalePerTargetMissHealth { get; set; } - - /// - /// Gets the Scaling Slot. - /// - public SpellSlot ScaleSlot { get; set; } = SpellSlot.Unknown; - - /// - /// Gets the Scaling Buff. - /// - public string ScalingBuff { get; set; } - - /// - /// Gets the Scaling Buff Offset. - /// - public int ScalingBuffOffset { get; set; } - - /// - /// Gets the Scaling Buff Target. - /// - public DamageScalingTarget ScalingBuffTarget { get; set; } - - public SpellEffectType SpellEffectType { get; set; } - - #endregion - } - } -} \ No newline at end of file diff --git a/Core/Wrappers/Damages/DamageLibrary.cs b/Core/Wrappers/Damages/DamageLibrary.cs index 4819959..b338d15 100644 --- a/Core/Wrappers/Damages/DamageLibrary.cs +++ b/Core/Wrappers/Damages/DamageLibrary.cs @@ -20,36 +20,26 @@ namespace LeagueSharp.SDK.Core.Wrappers.Damages using System; using System.Collections.Generic; using System.Linq; - using System.Security.Permissions; - using System.Text; - using Utils; - using Properties; - - using Newtonsoft.Json; - using Newtonsoft.Json.Linq; + using LeagueSharp.Data; + using LeagueSharp.Data.DataTypes; + using LeagueSharp.Data.Enumerations; + using LeagueSharp.SDK.Core.Events; /// /// Damage wrapper class, contains functions to calculate estimated damage to a unit and also provides damage details. /// public static partial class Damage { - #region Static Fields - - /// - /// The damage version files. - /// - private static readonly IDictionary DamageFiles = new Dictionary - { { "6.7", Resources._6_7 } }; - - #endregion - #region Properties /// - /// Gets the Damage Collection. + /// Gets or sets the Damage Collection. /// - internal static IDictionary DamageCollection { get; } = + /// + /// The damage collection. + /// + internal static IReadOnlyDictionary DamageCollection { get; set; } = new Dictionary(); #endregion @@ -66,46 +56,11 @@ internal static void Initialize(Version gameVersion) { Events.OnLoad += (sender, args) => { - OnLoad(gameVersion); + DamageCollection = Data.Get().Damage; CreatePassives(); }; } - /// - /// Creates the damage collection. - /// - /// - /// The converted s of damages into a dictionary collection. - /// - [PermissionSet(SecurityAction.Assert, Unrestricted = true)] - private static void CreateDamages(IDictionary damages) - { - foreach (var champion in GameObjects.Heroes.Select(h => h.ChampionName).Distinct()) - { - JToken value; - if (damages.TryGetValue(champion, out value)) - { - DamageCollection.Add(champion, JsonConvert.DeserializeObject(value.ToString())); - } - } - } - - private static void OnLoad(Version version) - { - var versionString = $"{version.Major}.{version.Minor}"; - - var fileBytes = DamageFiles.ContainsKey(versionString) - ? DamageFiles[versionString] - : DamageFiles.OrderByDescending(o => o.Key).FirstOrDefault().Value; - if (fileBytes != null) - { - CreateDamages(JObject.Parse(Encoding.Default.GetString(fileBytes))); - return; - } - - Logging.Write()(LogLevel.Fatal, "No suitable damage library is available."); - } - /// /// Resolves the spell bonus damage. /// diff --git a/Core/Wrappers/Damages/DamagePassives.cs b/Core/Wrappers/Damages/DamagePassives.cs index 6d96737..44b4d16 100644 --- a/Core/Wrappers/Damages/DamagePassives.cs +++ b/Core/Wrappers/Damages/DamagePassives.cs @@ -20,6 +20,8 @@ namespace LeagueSharp.SDK.Core.Wrappers.Damages using System; using System.Collections.Generic; using System.Linq; + using Data.Enumerations; + using LeagueSharp.SDK.Core.Extensions; /// /// Damage wrapper class, contains functions to calculate estimated damage to a unit and also provides damage details. diff --git a/Core/Wrappers/Items.cs b/Core/Wrappers/Items.cs index 4fb9576..53859bd 100644 --- a/Core/Wrappers/Items.cs +++ b/Core/Wrappers/Items.cs @@ -15,12 +15,15 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System; using System.Collections.Generic; using System.Linq; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; /// diff --git a/Core/Wrappers/Map.cs b/Core/Wrappers/Map.cs index a44aa6d..e03bda5 100644 --- a/Core/Wrappers/Map.cs +++ b/Core/Wrappers/Map.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System.Collections.Generic; diff --git a/Core/Wrappers/Orbwalking/Orbwalker.cs b/Core/Wrappers/Orbwalking/Orbwalker.cs index f9c5576..a97d634 100644 --- a/Core/Wrappers/Orbwalking/Orbwalker.cs +++ b/Core/Wrappers/Orbwalking/Orbwalker.cs @@ -15,12 +15,15 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System; using System.Linq; using System.Windows.Forms; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; using LeagueSharp.SDK.Core.Wrappers.Damages; diff --git a/Core/Wrappers/Orbwalking/OrbwalkerBase.cs b/Core/Wrappers/Orbwalking/OrbwalkerBase.cs index 9c4b2aa..3c1f19a 100644 --- a/Core/Wrappers/Orbwalking/OrbwalkerBase.cs +++ b/Core/Wrappers/Orbwalking/OrbwalkerBase.cs @@ -15,11 +15,15 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System; using System.Reflection; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Events; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; using LeagueSharp.SDK.Core.Utils; using SharpDX; diff --git a/Core/Wrappers/Orbwalking/OrbwalkerSelector.cs b/Core/Wrappers/Orbwalking/OrbwalkerSelector.cs index 5b1bd9c..996e020 100644 --- a/Core/Wrappers/Orbwalking/OrbwalkerSelector.cs +++ b/Core/Wrappers/Orbwalking/OrbwalkerSelector.cs @@ -15,12 +15,16 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System; using System.Collections.Generic; using System.Linq; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math.Prediction; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; using LeagueSharp.SDK.Core.Wrappers.Damages; diff --git a/Core/Wrappers/Spells/Database/SpellDatabase.cs b/Core/Wrappers/Spells/Database/SpellDatabase.cs index d9a43c6..f582575 100644 --- a/Core/Wrappers/Spells/Database/SpellDatabase.cs +++ b/Core/Wrappers/Spells/Database/SpellDatabase.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System; using System.Collections.Generic; diff --git a/Core/Wrappers/Spells/Database/SpellDatabaseEntry.cs b/Core/Wrappers/Spells/Database/SpellDatabaseEntry.cs index 6fcbe65..75b87ce 100644 --- a/Core/Wrappers/Spells/Database/SpellDatabaseEntry.cs +++ b/Core/Wrappers/Spells/Database/SpellDatabaseEntry.cs @@ -15,8 +15,11 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { + using LeagueSharp.Data.Enumerations; + using LeagueSharp.SDK.Core.Enumerations; + /// /// The spell database entry. /// diff --git a/Core/Wrappers/Spells/LastCast.cs b/Core/Wrappers/Spells/LastCast.cs index 2d3c85f..8527c9f 100644 --- a/Core/Wrappers/Spells/LastCast.cs +++ b/Core/Wrappers/Spells/LastCast.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System.Collections.Generic; diff --git a/Core/Wrappers/Spells/LastCastPacketSentEntry.cs b/Core/Wrappers/Spells/LastCastPacketSentEntry.cs index 252adb6..2d7689b 100644 --- a/Core/Wrappers/Spells/LastCastPacketSentEntry.cs +++ b/Core/Wrappers/Spells/LastCastPacketSentEntry.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { /// /// The last cast packet sent entry. diff --git a/Core/Wrappers/Spells/LastCastedSpellEntry.cs b/Core/Wrappers/Spells/LastCastedSpellEntry.cs index f84432e..7efd4fe 100644 --- a/Core/Wrappers/Spells/LastCastedSpellEntry.cs +++ b/Core/Wrappers/Spells/LastCastedSpellEntry.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { /// /// Holds information about the last casted spell a unit did. diff --git a/Core/Wrappers/Spells/Spell.cs b/Core/Wrappers/Spells/Spell.cs index 34901bd..8f1f15b 100644 --- a/Core/Wrappers/Spells/Spell.cs +++ b/Core/Wrappers/Spells/Spell.cs @@ -15,17 +15,23 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System; using System.Collections.Generic; using System.Linq; + using LeagueSharp.Data.Enumerations; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math.Prediction; using LeagueSharp.SDK.Core.Utils; using LeagueSharp.SDK.Core.Wrappers.Damages; using SharpDX; + /// /// Spell Container /// @@ -350,10 +356,10 @@ public bool CanCast(Obj_AI_Base unit) /// /// The Target /// - /// The of the spell. + /// The of the spell. /// /// Can spell kill target - public bool CanKill(Obj_AI_Base unit, Damage.DamageStage stage = Damage.DamageStage.Default) + public bool CanKill(Obj_AI_Base unit, DamageStage stage = DamageStage.Default) { return unit.IsValidTarget() && this.GetDamage(unit, stage) > unit.Health; } @@ -758,7 +764,7 @@ public FarmLocation GetCircularFarmLocation(List minionPositions, float /// public List GetCollision(Vector2 fromVector2, List to, float delayOverride = -1) { - return SDK.Collision.GetCollision( + return Core.Math.Collision.GetCollision( to.Select(h => h.ToVector3()).ToList(), new PredictionInput { @@ -774,12 +780,12 @@ public List GetCollision(Vector2 fromVector2, List to, flo /// The target. /// /// - /// The of the spell. + /// The of the spell. /// /// /// The damage value to target unit. /// - public float GetDamage(Obj_AI_Base target, Damage.DamageStage stage = Damage.DamageStage.Default) + public float GetDamage(Obj_AI_Base target, DamageStage stage = DamageStage.Default) { return (float)GameObjects.Player.GetSpellDamage(target, this.Slot, stage); } diff --git a/Core/Wrappers/Spells/SpellTypes/BaseSpell.cs b/Core/Wrappers/Spells/SpellTypes/BaseSpell.cs index 6791ed6..7ad7c4a 100644 --- a/Core/Wrappers/Spells/SpellTypes/BaseSpell.cs +++ b/Core/Wrappers/Spells/SpellTypes/BaseSpell.cs @@ -1,7 +1,11 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { using System; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using SharpDX; using Color = System.Drawing.Color; diff --git a/Core/Wrappers/Spells/SpellTypes/Skillshot.cs b/Core/Wrappers/Spells/SpellTypes/Skillshot.cs index 5d15247..03dc209 100644 --- a/Core/Wrappers/Spells/SpellTypes/Skillshot.cs +++ b/Core/Wrappers/Spells/SpellTypes/Skillshot.cs @@ -1,12 +1,12 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { using System; using System.Collections.Generic; - using System.ComponentModel; using LeagueSharp.SDK.Clipper; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; using LeagueSharp.SDK.Core.Utils; - using LeagueSharp.SDK.Core.Wrappers.Spells.SpellTypes; using SharpDX; diff --git a/Core/Wrappers/Spells/SpellTypes/SkillshotCircle.cs b/Core/Wrappers/Spells/SpellTypes/SkillshotCircle.cs index 3db7181..5cdbe1a 100644 --- a/Core/Wrappers/Spells/SpellTypes/SkillshotCircle.cs +++ b/Core/Wrappers/Spells/SpellTypes/SkillshotCircle.cs @@ -1,13 +1,6 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { - using System; - using System.Collections.Generic; - using System.ComponentModel; - - using LeagueSharp.SDK.Clipper; - using LeagueSharp.SDK.Core.Utils; - - using SharpDX; + using LeagueSharp.SDK.Core.Math.Polygons; public class SkillshotCircle : Skillshot { diff --git a/Core/Wrappers/Spells/SpellTypes/SkillshotCone.cs b/Core/Wrappers/Spells/SpellTypes/SkillshotCone.cs index 29a99ec..f5320a9 100644 --- a/Core/Wrappers/Spells/SpellTypes/SkillshotCone.cs +++ b/Core/Wrappers/Spells/SpellTypes/SkillshotCone.cs @@ -1,13 +1,8 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { using System; - using System.Collections.Generic; - using System.ComponentModel; - using LeagueSharp.SDK.Clipper; - using LeagueSharp.SDK.Core.Utils; - - using SharpDX; + using LeagueSharp.SDK.Core.Math.Polygons; public class SkillshotCone : SkillshotMissile { diff --git a/Core/Wrappers/Spells/SpellTypes/SkillshotLine.cs b/Core/Wrappers/Spells/SpellTypes/SkillshotLine.cs index c74ec81..2257b03 100644 --- a/Core/Wrappers/Spells/SpellTypes/SkillshotLine.cs +++ b/Core/Wrappers/Spells/SpellTypes/SkillshotLine.cs @@ -1,13 +1,6 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { - using System; - using System.Collections.Generic; - using System.ComponentModel; - - using LeagueSharp.SDK.Clipper; - using LeagueSharp.SDK.Core.Utils; - - using SharpDX; + using LeagueSharp.SDK.Core.Math.Polygons; public class SkillshotLine : SkillshotMissile { diff --git a/Core/Wrappers/Spells/SpellTypes/SkillshotMissile.cs b/Core/Wrappers/Spells/SpellTypes/SkillshotMissile.cs index 0463c34..c76c3b1 100644 --- a/Core/Wrappers/Spells/SpellTypes/SkillshotMissile.cs +++ b/Core/Wrappers/Spells/SpellTypes/SkillshotMissile.cs @@ -1,11 +1,6 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { using System; - using System.Collections.Generic; - using System.ComponentModel; - - using LeagueSharp.SDK.Clipper; - using LeagueSharp.SDK.Core.Utils; using SharpDX; diff --git a/Core/Wrappers/Spells/SpellTypes/SkillshotMissileArc.cs b/Core/Wrappers/Spells/SpellTypes/SkillshotMissileArc.cs index ef9af00..31e0b42 100644 --- a/Core/Wrappers/Spells/SpellTypes/SkillshotMissileArc.cs +++ b/Core/Wrappers/Spells/SpellTypes/SkillshotMissileArc.cs @@ -1,13 +1,6 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { - using System; - using System.Collections.Generic; - using System.ComponentModel; - - using LeagueSharp.SDK.Clipper; - using LeagueSharp.SDK.Core.Utils; - - using SharpDX; + using LeagueSharp.SDK.Core.Math.Polygons; public class SkillshotMissileArc : SkillshotMissile { diff --git a/Core/Wrappers/Spells/SpellTypes/SkillshotMissileCircle.cs b/Core/Wrappers/Spells/SpellTypes/SkillshotMissileCircle.cs index bf66030..3e0d39a 100644 --- a/Core/Wrappers/Spells/SpellTypes/SkillshotMissileCircle.cs +++ b/Core/Wrappers/Spells/SpellTypes/SkillshotMissileCircle.cs @@ -1,13 +1,6 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { - using System; - using System.Collections.Generic; - using System.ComponentModel; - - using LeagueSharp.SDK.Clipper; - using LeagueSharp.SDK.Core.Utils; - - using SharpDX; + using LeagueSharp.SDK.Core.Math.Polygons; public class SkillshotMissileCircle : SkillshotMissile { diff --git a/Core/Wrappers/Spells/SpellTypes/SkillshotMissileLine.cs b/Core/Wrappers/Spells/SpellTypes/SkillshotMissileLine.cs index 7a067a1..5d8d25d 100644 --- a/Core/Wrappers/Spells/SpellTypes/SkillshotMissileLine.cs +++ b/Core/Wrappers/Spells/SpellTypes/SkillshotMissileLine.cs @@ -1,13 +1,7 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { - using System; - using System.Collections.Generic; - using System.ComponentModel; - - using LeagueSharp.SDK.Clipper; - using LeagueSharp.SDK.Core.Utils; - - using SharpDX; + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Math.Polygons; public class SkillshotMissileLine : SkillshotMissile { diff --git a/Core/Wrappers/Spells/SpellTypes/SkillshotRing.cs b/Core/Wrappers/Spells/SpellTypes/SkillshotRing.cs index 2e6cd8b..226d82c 100644 --- a/Core/Wrappers/Spells/SpellTypes/SkillshotRing.cs +++ b/Core/Wrappers/Spells/SpellTypes/SkillshotRing.cs @@ -1,13 +1,6 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { - using System; - using System.Collections.Generic; - using System.ComponentModel; - - using LeagueSharp.SDK.Clipper; - using LeagueSharp.SDK.Core.Utils; - - using SharpDX; + using LeagueSharp.SDK.Core.Math.Polygons; public class SkillshotRing : SkillshotMissile { diff --git a/Core/Wrappers/Spells/SpellTypes/Targeted.cs b/Core/Wrappers/Spells/SpellTypes/Targeted.cs index 83434ef..30641dd 100644 --- a/Core/Wrappers/Spells/SpellTypes/Targeted.cs +++ b/Core/Wrappers/Spells/SpellTypes/Targeted.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace LeagueSharp.SDK.Core.Wrappers.Spells.SpellTypes +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { class Targeted { diff --git a/Core/Wrappers/Spells/SpellTypes/TargetedMissile.cs b/Core/Wrappers/Spells/SpellTypes/TargetedMissile.cs index 01fdb94..1486c20 100644 --- a/Core/Wrappers/Spells/SpellTypes/TargetedMissile.cs +++ b/Core/Wrappers/Spells/SpellTypes/TargetedMissile.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace LeagueSharp.SDK.Core.Wrappers.Spells.SpellTypes +namespace LeagueSharp.SDK.Core.Wrappers.SpellTypes { class TargetedMissile { diff --git a/Core/Wrappers/Spells/Tracker/Detector.cs b/Core/Wrappers/Spells/Tracker/Detector.cs index 9b2463b..46b8589 100644 --- a/Core/Wrappers/Spells/Tracker/Detector.cs +++ b/Core/Wrappers/Spells/Tracker/Detector.cs @@ -1,13 +1,14 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.Tracker { using System; - using System.Collections.Generic; - using System.Runtime.CompilerServices; - using System.Runtime.Remoting.Messaging; using System.Security.Permissions; + using LeagueSharp.Data.Enumerations; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; using LeagueSharp.SDK.Core.Utils; - using LeagueSharp.SDK.Core.Wrappers.Spells.SpellTypes; + using LeagueSharp.SDK.Core.Wrappers.SpellTypes; using SharpDX; diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_ZiggsR.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_ZiggsR.cs index dc149fa..7c06b06 100644 --- a/Core/Wrappers/Spells/Tracker/Skillshots/_ZiggsR.cs +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_ZiggsR.cs @@ -1,5 +1,8 @@ -namespace LeagueSharp.SDK.Core.Wrappers.Spells.Tracker.Skillshots +namespace LeagueSharp.SDK.Core.Wrappers.Tracker.Skillshots { + using LeagueSharp.SDK.Core.Extensions.SharpDX; + using LeagueSharp.SDK.Core.Wrappers.SpellTypes; + public class _ZiggsR : Skillshot { #region Constructors and Destructors diff --git a/Core/Wrappers/Spells/Tracker/Tracker.cs b/Core/Wrappers/Spells/Tracker/Tracker.cs index ac7a62c..e2db493 100644 --- a/Core/Wrappers/Spells/Tracker/Tracker.cs +++ b/Core/Wrappers/Spells/Tracker/Tracker.cs @@ -1,12 +1,12 @@ -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers.Tracker { using System; using System.Collections.Generic; - using System.Runtime.CompilerServices; - using System.Runtime.Remoting.Messaging; - using System.Security.Permissions; + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions.SharpDX; using LeagueSharp.SDK.Core.Utils; + using LeagueSharp.SDK.Core.Wrappers.SpellTypes; public class Tracker { diff --git a/Core/Wrappers/TargetSelector/HeroVisibleEntry.cs b/Core/Wrappers/TargetSelector/HeroVisibleEntry.cs index 365a8ac..2c0ee07 100644 --- a/Core/Wrappers/TargetSelector/HeroVisibleEntry.cs +++ b/Core/Wrappers/TargetSelector/HeroVisibleEntry.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { /// /// The hero visible entry container. diff --git a/Core/Wrappers/TargetSelector/ITargetSelectorMode.cs b/Core/Wrappers/TargetSelector/ITargetSelectorMode.cs index fce83f5..616680d 100644 --- a/Core/Wrappers/TargetSelector/ITargetSelectorMode.cs +++ b/Core/Wrappers/TargetSelector/ITargetSelectorMode.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System.Collections.Generic; diff --git a/Core/Wrappers/TargetSelector/Modes/Closest.cs b/Core/Wrappers/TargetSelector/Modes/Closest.cs index a24bfc5..b02bc4a 100644 --- a/Core/Wrappers/TargetSelector/Modes/Closest.cs +++ b/Core/Wrappers/TargetSelector/Modes/Closest.cs @@ -15,11 +15,12 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { using System.Collections.Generic; using System.Linq; - + + using LeagueSharp.SDK.Core.Extensions; using LeagueSharp.SDK.Core.UI.IMenu; /// diff --git a/Core/Wrappers/TargetSelector/Modes/IWeightItem.cs b/Core/Wrappers/TargetSelector/Modes/IWeightItem.cs index b68b88c..8939b0b 100644 --- a/Core/Wrappers/TargetSelector/Modes/IWeightItem.cs +++ b/Core/Wrappers/TargetSelector/Modes/IWeightItem.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { /// /// Interface for weight item diff --git a/Core/Wrappers/TargetSelector/Modes/LeastHealth.cs b/Core/Wrappers/TargetSelector/Modes/LeastHealth.cs index 631174e..a19ea60 100644 --- a/Core/Wrappers/TargetSelector/Modes/LeastHealth.cs +++ b/Core/Wrappers/TargetSelector/Modes/LeastHealth.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { using System.Collections.Generic; using System.Linq; diff --git a/Core/Wrappers/TargetSelector/Modes/LessAttacksToKill.cs b/Core/Wrappers/TargetSelector/Modes/LessAttacksToKill.cs index 523ae53..53f41a1 100644 --- a/Core/Wrappers/TargetSelector/Modes/LessAttacksToKill.cs +++ b/Core/Wrappers/TargetSelector/Modes/LessAttacksToKill.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { using System.Collections.Generic; using System.Linq; diff --git a/Core/Wrappers/TargetSelector/Modes/LessCastsToKill.cs b/Core/Wrappers/TargetSelector/Modes/LessCastsToKill.cs index 527dc12..7b2b3e2 100644 --- a/Core/Wrappers/TargetSelector/Modes/LessCastsToKill.cs +++ b/Core/Wrappers/TargetSelector/Modes/LessCastsToKill.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { #region diff --git a/Core/Wrappers/TargetSelector/Modes/MostAbilityPower.cs b/Core/Wrappers/TargetSelector/Modes/MostAbilityPower.cs index 1d9aabb..427c446 100644 --- a/Core/Wrappers/TargetSelector/Modes/MostAbilityPower.cs +++ b/Core/Wrappers/TargetSelector/Modes/MostAbilityPower.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { using System.Collections.Generic; using System.Linq; diff --git a/Core/Wrappers/TargetSelector/Modes/MostAttackDamage.cs b/Core/Wrappers/TargetSelector/Modes/MostAttackDamage.cs index 0383ab9..046f807 100644 --- a/Core/Wrappers/TargetSelector/Modes/MostAttackDamage.cs +++ b/Core/Wrappers/TargetSelector/Modes/MostAttackDamage.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { using System.Collections.Generic; using System.Linq; diff --git a/Core/Wrappers/TargetSelector/Modes/NearMouse.cs b/Core/Wrappers/TargetSelector/Modes/NearMouse.cs index e255215..0ecf91a 100644 --- a/Core/Wrappers/TargetSelector/Modes/NearMouse.cs +++ b/Core/Wrappers/TargetSelector/Modes/NearMouse.cs @@ -15,11 +15,12 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { using System.Collections.Generic; using System.Linq; - + + using LeagueSharp.SDK.Core.Extensions; using LeagueSharp.SDK.Core.UI.IMenu; /// diff --git a/Core/Wrappers/TargetSelector/Modes/Priority.cs b/Core/Wrappers/TargetSelector/Modes/Priority.cs index 933e57b..fd0eccd 100644 --- a/Core/Wrappers/TargetSelector/Modes/Priority.cs +++ b/Core/Wrappers/TargetSelector/Modes/Priority.cs @@ -15,12 +15,14 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { using System; using System.Collections.Generic; using System.Linq; + using LeagueSharp.Data; + using LeagueSharp.Data.DataTypes; using LeagueSharp.SDK.Core.UI.IMenu; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; @@ -28,7 +30,6 @@ namespace LeagueSharp.SDK.Modes /// /// The priority Mode. /// - [ResourceImport] public class Priority : ITargetSelectorMode { #region Constants @@ -50,10 +51,11 @@ public class Priority : ITargetSelectorMode /// /// The priority categories /// - public static IReadOnlyList PriorityCategories => PriorityCategoriesList; + public static IReadOnlyList PriorityCategories => PriorityCategoriesList; [ResourceImport("Data.Priority.json")] - private static List PriorityCategoriesList = new List(); + private static IReadOnlyList PriorityCategoriesList + => Data.Get().PriorityCategories; #endregion diff --git a/Core/Wrappers/TargetSelector/Modes/PriorityCategory.cs b/Core/Wrappers/TargetSelector/Modes/PriorityCategory.cs deleted file mode 100644 index 4433814..0000000 --- a/Core/Wrappers/TargetSelector/Modes/PriorityCategory.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// Copyright (c) 2015 LeagueSharp. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// - -namespace LeagueSharp.SDK.Modes -{ - using System.Collections.Generic; - - /// - /// Category class for Priorities - /// - public class PriorityCategory - { - #region Public Properties - - /// - /// Gets or sets the champions. - /// - /// - /// The champions. - /// - public HashSet Champions { get; set; } - - /// - /// Gets or sets the value. - /// - /// - /// The value. - /// - public int Value { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/Core/Wrappers/TargetSelector/Modes/Weight.cs b/Core/Wrappers/TargetSelector/Modes/Weight.cs index 145c0cd..735e37e 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weight.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weight.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { using System; using System.Collections.Generic; diff --git a/Core/Wrappers/TargetSelector/Modes/WeightItemWrapper.cs b/Core/Wrappers/TargetSelector/Modes/WeightItemWrapper.cs index 6e5a0db..b695426 100644 --- a/Core/Wrappers/TargetSelector/Modes/WeightItemWrapper.cs +++ b/Core/Wrappers/TargetSelector/Modes/WeightItemWrapper.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes +namespace LeagueSharp.SDK.Core.Wrappers.Modes { using System; diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/AbilityPower.cs b/Core/Wrappers/TargetSelector/Modes/Weights/AbilityPower.cs index deeb36b..dc9a308 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/AbilityPower.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/AbilityPower.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { using System.Linq; diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/Aggro.cs b/Core/Wrappers/TargetSelector/Modes/Weights/Aggro.cs index f33740b..1c3df27 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/Aggro.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/Aggro.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/AttackDamage.cs b/Core/Wrappers/TargetSelector/Modes/Weights/AttackDamage.cs index a97b0b7..51283e2 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/AttackDamage.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/AttackDamage.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { #region diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/CrowdControl.cs b/Core/Wrappers/TargetSelector/Modes/Weights/CrowdControl.cs index 3fee9ac..076e4e3 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/CrowdControl.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/CrowdControl.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { #region diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/FocusMe.cs b/Core/Wrappers/TargetSelector/Modes/Weights/FocusMe.cs index e1752fa..8ed210b 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/FocusMe.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/FocusMe.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { #region diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/Gold.cs b/Core/Wrappers/TargetSelector/Modes/Weights/Gold.cs index 9fd450e..81e256a 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/Gold.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/Gold.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { /// /// Acquired Gold diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/Killable.cs b/Core/Wrappers/TargetSelector/Modes/Weights/Killable.cs index 07b1483..c12aeda 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/Killable.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/Killable.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { using LeagueSharp.SDK.Core.Wrappers.Damages; diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/LowHealth.cs b/Core/Wrappers/TargetSelector/Modes/Weights/LowHealth.cs index 1f9ab90..8cde6fc 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/LowHealth.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/LowHealth.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { /// /// Low Health diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/LowResists.cs b/Core/Wrappers/TargetSelector/Modes/Weights/LowResists.cs index 464fae5..1c38764 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/LowResists.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/LowResists.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { /// /// Low Resists diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/ShortDistanceCursor.cs b/Core/Wrappers/TargetSelector/Modes/Weights/ShortDistanceCursor.cs index 84397b0..ad487bd 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/ShortDistanceCursor.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/ShortDistanceCursor.cs @@ -15,8 +15,10 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { + using LeagueSharp.SDK.Core.Extensions; + /// /// Short Distance to Cursor /// diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/ShortDistancePlayer.cs b/Core/Wrappers/TargetSelector/Modes/Weights/ShortDistancePlayer.cs index 0c451f9..4899da9 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/ShortDistancePlayer.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/ShortDistancePlayer.cs @@ -15,8 +15,10 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { + using LeagueSharp.SDK.Core.Extensions; + /// /// Short Distance to Player /// diff --git a/Core/Wrappers/TargetSelector/Modes/Weights/TeamFocus.cs b/Core/Wrappers/TargetSelector/Modes/Weights/TeamFocus.cs index 958a37f..25d3549 100644 --- a/Core/Wrappers/TargetSelector/Modes/Weights/TeamFocus.cs +++ b/Core/Wrappers/TargetSelector/Modes/Weights/TeamFocus.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK.Modes.Weights +namespace LeagueSharp.SDK.Core.Wrappers.Modes.Weights { using System; using System.Linq; diff --git a/Core/Wrappers/TargetSelector/TargetSelector.cs b/Core/Wrappers/TargetSelector/TargetSelector.cs index 3486b1a..e75de02 100644 --- a/Core/Wrappers/TargetSelector/TargetSelector.cs +++ b/Core/Wrappers/TargetSelector/TargetSelector.cs @@ -15,12 +15,15 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System; using System.Collections.Generic; using System.Linq; - + + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Events; + using LeagueSharp.SDK.Core.Extensions; using LeagueSharp.SDK.Core.UI.IMenu; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/Wrappers/TargetSelector/TargetSelectorDrawing.cs b/Core/Wrappers/TargetSelector/TargetSelectorDrawing.cs index 536f896..97abbed 100644 --- a/Core/Wrappers/TargetSelector/TargetSelectorDrawing.cs +++ b/Core/Wrappers/TargetSelector/TargetSelectorDrawing.cs @@ -15,16 +15,18 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System; using System.Collections.Generic; using System.Linq; + using LeagueSharp.SDK.Core.Extensions; + using LeagueSharp.SDK.Core.Extensions.SharpDX; using LeagueSharp.SDK.Core.UI.IMenu; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; - using LeagueSharp.SDK.Modes; + using LeagueSharp.SDK.Core.Wrappers.Modes; using SharpDX; diff --git a/Core/Wrappers/TargetSelector/TargetSelectorHumanizer.cs b/Core/Wrappers/TargetSelector/TargetSelectorHumanizer.cs index 8fea46f..1706c5e 100644 --- a/Core/Wrappers/TargetSelector/TargetSelectorHumanizer.cs +++ b/Core/Wrappers/TargetSelector/TargetSelectorHumanizer.cs @@ -15,7 +15,7 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { #region diff --git a/Core/Wrappers/TargetSelector/TargetSelectorMode.cs b/Core/Wrappers/TargetSelector/TargetSelectorMode.cs index 595a44c..2190076 100644 --- a/Core/Wrappers/TargetSelector/TargetSelectorMode.cs +++ b/Core/Wrappers/TargetSelector/TargetSelectorMode.cs @@ -15,13 +15,15 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Reflection; + + using LeagueSharp.SDK.Core.Enumerations; using LeagueSharp.SDK.Core.UI.IMenu; using LeagueSharp.SDK.Core.UI.IMenu.Values; using LeagueSharp.SDK.Core.Utils; diff --git a/Core/Wrappers/TargetSelector/TargetSelectorSelected.cs b/Core/Wrappers/TargetSelector/TargetSelectorSelected.cs index dddb8b8..45829a6 100644 --- a/Core/Wrappers/TargetSelector/TargetSelectorSelected.cs +++ b/Core/Wrappers/TargetSelector/TargetSelectorSelected.cs @@ -15,10 +15,12 @@ // along with this program. If not, see http://www.gnu.org/licenses/ // -namespace LeagueSharp.SDK +namespace LeagueSharp.SDK.Core.Wrappers { using System.Linq; - + + using LeagueSharp.SDK.Core.Enumerations; + using LeagueSharp.SDK.Core.Extensions; using LeagueSharp.SDK.Core.UI.IMenu; using LeagueSharp.SDK.Core.UI.IMenu.Values; diff --git a/LeagueSharp.SDK.csproj b/LeagueSharp.SDK.csproj index 532c026..2ab1c2c 100644 --- a/LeagueSharp.SDK.csproj +++ b/LeagueSharp.SDK.csproj @@ -51,8 +51,11 @@ C:\Program Files (x86)\LeagueSharp\System\LeagueSharp.dll - - packages\Newtonsoft.Json.8.0.1-beta4\lib\net45\Newtonsoft.Json.dll + + C:\Program Files (x86)\LeagueSharp\System\LeagueSharp.Data.dll + + + packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll True @@ -79,12 +82,8 @@ - - - - @@ -97,8 +96,6 @@ - - @@ -276,7 +273,6 @@ - @@ -309,7 +305,6 @@ - @@ -385,13 +380,13 @@ - + @@ -415,6 +410,11 @@ Designer + + + + +