/// <summary> /// Loads this instance. /// </summary> public void Load() { if (!HeroManager.Enemies.Any()) { return; } this.teleportTexture = Resources.LP_Teleport.ToTexture(); var spawn = ObjectManager.Get <Obj_SpawnPoint>().FirstOrDefault(x => x.IsEnemy); this.spawnPoint = spawn != null ? spawn.Position : Vector3.Zero; foreach (var enemy in HeroManager.Enemies) { this.heroTextures[enemy.NetworkId] = (ImageLoader.Load("LP", enemy.ChampionName) ?? Resources.LP_Default).ToTexture(); var eStruct = new LastPositionStruct(enemy) { LastPosition = this.spawnPoint }; this.lastPositions.Add(eStruct); } Drawing.OnEndScene += this.OnDrawingEndScene; Obj_AI_Base.OnTeleport += this.OnObjAiBaseTeleport; Drawing.OnPreReset += args => { this.text.OnLostDevice(); }; Drawing.OnPostReset += args => { this.text.OnResetDevice(); }; this.sprite = MDrawing.GetSprite(); this.text = MDrawing.GetFont(getSliderItem(this.Menu, "LastPosition.FontSize")); this.line = MDrawing.GetLine(1); }
protected override void OnInitialize() { try { if (!GameObjects.EnemyHeroes.Any()) { OnUnload(null, new UnloadEventArgs(true)); return; } _teleportTexture = Resources.LP_Teleport.ToTexture(); var spawn = GameObjects.EnemySpawnPoints.FirstOrDefault(); _spawnPoint = spawn != null ? spawn.Position : Vector3.Zero; foreach (var enemy in GameObjects.EnemyHeroes) { _heroTextures[enemy.NetworkId] = (ImageLoader.Load("LP", enemy.ChampionName) ?? Resources.LP_Default).ToTexture(); var eStruct = new LastPositionStruct(enemy) { LastPosition = _spawnPoint }; _lastPositions.Add(eStruct); } base.OnInitialize(); } catch (Exception ex) { Global.Logger.AddItem(new LogItem(ex)); } }
/// <summary> /// Loads this instance. /// </summary> public void Load() { if (!HeroManager.Enemies.Any()) { return; } EloBuddy.SDK.Core.DelayAction(() => { var multiplicator = EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(1000, 1000, 0)).Distance(EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(2000, 1000, 0))) / 1000f; if (multiplicator <= float.Epsilon) { Load(); } else { MinimapMultiplicator = multiplicator; Vector2 leftUpper; Vector2 rightLower; if (Game.MapId == GameMapId.CrystalScar) { leftUpper = EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(0, 13800, 0)); rightLower = EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(13800, 0, 0)); } else { leftUpper = EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(0, 14800, 0)); rightLower = EloBuddy.SDK.Extensions.WorldToMinimap(new Vector3(14800, 0, 0)); } MinimapRectangle = new SharpDX.Rectangle((int)leftUpper.X, (int)leftUpper.Y, (int)(rightLower.X - leftUpper.X), (int)(rightLower.Y - leftUpper.Y)); this.teleportTexture = Resources.LP_Teleport.ToTexture(); var spawn = ObjectManager.Get <Obj_SpawnPoint>().FirstOrDefault(x => x.IsEnemy); this.spawnPoint = spawn != null ? spawn.Position : Vector3.Zero; foreach (var enemy in HeroManager.Enemies) { this.heroTextures[enemy.NetworkId] = (ImageLoader.Load("LP", enemy.ChampionName) ?? Resources.LP_Default).ToTexture(); var eStruct = new LastPositionStruct(enemy) { LastPosition = this.spawnPoint }; this.lastPositions.Add(eStruct); } Drawing.OnEndScene += this.OnDrawingEndScene; Teleport.OnTeleport += Teleport_OnTeleport; this.sprite = MDrawing.GetSprite(); this.text = MDrawing.GetFont(this.Menu.Item("LastPosition.FontSize").GetValue <Slider>().Value); this.line = MDrawing.GetLine(1); } }, 1000); }