private static void Drawing_OnEndScene(EventArgs args) { if (!小地图()) { return; } foreach (JungleCamp jungleCamp in _jungleCamps.Where(camp => camp.NextRespawnTime > 0)) { int timeClock = jungleCamp.NextRespawnTime - (int)Game.ClockTime; string time = Flowers.菜单.Item("JungleTimerFormat").GetValue <StringList>().SelectedIndex == 0 ? Huabian.FormatTime(timeClock) : timeClock.ToString(CultureInfo.InvariantCulture); Vector2 pos = Drawing.WorldToMinimap(jungleCamp.Position); if (timeClock >= 150) { Huabian.DrawText(_miniMapFont, time, (int)pos.X, (int)pos.Y - 8, SharpDX.Color.White); } if (timeClock < 150 && timeClock >= 100) { Huabian.DrawText(_miniMapFont, time, (int)pos.X, (int)pos.Y - 8, SharpDX.Color.LimeGreen); } if (timeClock < 100 && timeClock >= 50) { Huabian.DrawText(_miniMapFont, time, (int)pos.X, (int)pos.Y - 8, SharpDX.Color.Orange); } if (timeClock < 50) { Huabian.DrawText(_miniMapFont, time, (int)pos.X, (int)pos.Y - 8, SharpDX.Color.Red); } } }
private static void Game_OnGameUpdate(EventArgs args) { if (Flowers.菜单.Item("HealthActive").GetValue <bool>()) { foreach (Obj_AI_Turret turret in ObjectManager.Get <Obj_AI_Turret>()) { if ((turret.HealthPercentage() == 100)) { continue; } int health = 0; switch (Flowers.菜单.Item("TIHealth").GetValue <StringList>().SelectedIndex) { case 0: health = (int)turret.HealthPercentage(); break; case 1: health = (int)turret.Health; break; } Vector2 pos = Drawing.WorldToMinimap(turret.Position); var perHealth = (int)turret.HealthPercentage(); if (perHealth >= 75) { Huabian.DrawText1( Huabian.Text1, health.ToString(CultureInfo.InvariantCulture), (int)pos[0], (int)pos[1], SharpDX.Color.LimeGreen); } else if (perHealth < 75 && perHealth >= 50) { Huabian.DrawText1( Huabian.Text1, health.ToString(CultureInfo.InvariantCulture), (int)pos[0], (int)pos[1], SharpDX.Color.YellowGreen); } else if (perHealth < 50 && perHealth >= 25) { Huabian.DrawText1( Huabian.Text1, health.ToString(CultureInfo.InvariantCulture), (int)pos[0], (int)pos[1], SharpDX.Color.Orange); } else if (perHealth < 25) { Huabian.DrawText1( Huabian.Text1, health.ToString(CultureInfo.InvariantCulture), (int)pos[0], (int)pos[1], SharpDX.Color.Red); } } foreach (Obj_BarracksDampener inhibitor in ObjectManager.Get <Obj_BarracksDampener>()) { if (inhibitor.Health != 0 && (inhibitor.Health / inhibitor.MaxHealth) * 100 != 100) { Vector2 pos = Drawing.WorldToMinimap(inhibitor.Position); var health = (int)((inhibitor.Health / inhibitor.MaxHealth) * 100); if (health >= 75) { Huabian.DrawText1( Huabian.Text1, health.ToString(CultureInfo.InvariantCulture), (int)pos[0], (int)pos[1], SharpDX.Color.LimeGreen); } else if (health < 75 && health >= 50) { Huabian.DrawText1( Huabian.Text1, health.ToString(CultureInfo.InvariantCulture), (int)pos[0], (int)pos[1], SharpDX.Color.YellowGreen); } else if (health < 50 && health >= 25) { Huabian.DrawText1( Huabian.Text1, health.ToString(CultureInfo.InvariantCulture), (int)pos[0], (int)pos[1], SharpDX.Color.Orange); } else if (health < 25) { Huabian.DrawText1( Huabian.Text1, health.ToString(CultureInfo.InvariantCulture), (int)pos[0], (int)pos[1], SharpDX.Color.Red); } } } } }
internal static void Game_OnGameLoad(EventArgs args) { Drawing.OnDraw += Drawing_OnDraw; Huabian.InitializeCache(); }