public AbilityHolder(Ability ability) { Ability = ability; Handle = ability.Handle; Name = ability.Name; MaximumLevel = Ability.MaximumLevel; Owner = (Hero)ability.Owner; Id = Ability.Id; AbilityState = ability.AbilityState; Texture = Ability is Item ? Textures.GetItemTexture(ability.Name) : Textures.GetSpellTexture(ability.Name); Cooldown = Ability.Cooldown; IsUltimate = ability.AbilityType == AbilityType.Ultimate; IsHidden = ability.IsHidden; AbilitySlot = ability.AbilitySlot; Item = ability as Item; if (Item != null) { Cost = Item.Cost; } UpdateManager.BeginInvoke(async() => { while (ability.IsValid) { AbilityState = ability.AbilityState; Cooldown = Ability.Cooldown; IsHidden = ability.IsHidden; AbilitySlot = ability.AbilitySlot; await Task.Delay(300); } //Log.Debug($"[{Owner.Name}] end for -> {Id}"); }); }
/// <summary> /// Initializes a new instance of the <see cref="GreaterBash" /> class. /// </summary> /// <param name="ability"> /// The ability. /// </param> public GreaterBash(Ability ability) { this.ability = ability; this.unsuccessfulAttackCount = 1; this.abilityIcon = Drawing.GetTexture("materials/ensage_ui/spellicons/spirit_breaker_greater_bash"); this.iconSize = new Vector2(HUDInfo.GetHpBarSizeY() * 2); }
public Spell(Ability Ab) { Name = Ab.StoredName(); spell = Ab; Cd = spell.Cooldown; texture = Textures.GetItemTexture(Name); }
public Button(DotaTexture texture, bool onAttack, Ability ability, bool enable = false) { Ability = ability; Log.Debug("new button -> " + $"{texture.Name} -> for {(onAttack ? "Attack" : "Move")}"); Texture = texture; OnAttack = onAttack; Active = enable; }
/// <summary> /// </summary> /// <param name="position"></param> /// <param name="size"></param> /// <param name="texture"></param> public void AddElement(Vector2 position, Vector2 size, DotaTexture texture) { var element = new AMessageComponent(position, size, texture) { Parent = this, ComponentType = "DrawRect_Texture" }; this.components.Add(this.elements, element); this.elements++; }
public void OnLoad() { hero = ObjectManager.LocalHero; heroTeam = hero.Team; creeepTexture = Drawing.GetTexture( "materials/ensage_ui/heroes_horizontal/creep_" + (heroTeam == Team.Radiant ? "dire" : "radiant")); creepsData = new CreepsData(heroTeam); sleeper = new MultiSleeper(); }
public static void DrawBoxBordered( float x, float y, float w, float h, float borderWidth, DotaTexture texture, Color colorBorder) { Drawing.DrawRect(new Vector2(x, y), new Vector2(w, h), texture); DrawBox(x - borderWidth, y - borderWidth, w + 2 * borderWidth, h + borderWidth, borderWidth, colorBorder); }
public static void DrawBoxBordered( float x, float y, float w, float h, float borderWidth, DotaTexture texture, Color colorBorder) { Drawing.DrawRect(new Vector2(x, y), new Vector2(w, h), texture); DrawBox(x - borderWidth, y - borderWidth, w + 2 * borderWidth, h + borderWidth, borderWidth, colorBorder); }
/// <summary> /// Initializes a new instance of the <see cref="ChargeOfDarkness" /> class. /// </summary> /// <param name="ability"> /// The ability. /// </param> public ChargeOfDarkness(Ability ability) { this.ability = ability; this.speed = ability.GetProjectileSpeed(); this.sleeper = new Sleeper(); this.lastLevel = ability.Level; this.abilityIcon = Drawing.GetTexture("materials/ensage_ui/spellicons/spirit_breaker_charge_of_darkness"); this.iconSize = new Vector2(HUDInfo.GetHpBarSizeY() * 2); this.CastPoint = this.ability.FindCastPoint(); this.notification = new Notification( 5000, new Vector2(HUDInfo.ScreenSizeX(), (float)(HUDInfo.ScreenSizeY() / 2.3)), new Vector2(HUDInfo.ScreenSizeX() / 11, HUDInfo.ScreenSizeX() / 30)); }
private void DrawTextWithIcon(Vector2 textPos, Vector2 textSize, string endText, Color textClr, Color outLineClr, DotaTexture texture) { var measureText = Drawing.MeasureText(endText, "arial", textSize, FontFlags.DropShadow | FontFlags.AntiAlias); var rectSize = measureText + new Vector2(measureText.Y + 2, 0); Drawing.DrawRect(textPos, rectSize, new Color(100, 100, 100, 100)); Drawing.DrawText(endText, textPos + new Vector2(textSize.Y + 2, 0), textSize, textClr, FontFlags.DropShadow | FontFlags.AntiAlias); Drawing.DrawRect(textPos, new Vector2(measureText.Y), texture); Drawing.DrawRect(textPos, rectSize, outLineClr, true); }
public static Vector2 DrawBar(Vector2 pos, string text, Vector2 maxSize, DotaTexture texture, Color clr, Color color) { var textSize = Drawing.MeasureText(text, "Arial", new Vector2((float)(maxSize.Y * .7), 0), FontFlags.AntiAlias | FontFlags.StrikeOut); Drawing.DrawRect(pos, maxSize, texture); Drawing.DrawRect(pos, maxSize, color); var textPos = pos + new Vector2(maxSize.X / 2 - textSize.X / 2, maxSize.Y / 2 - textSize.Y / 2); Drawing.DrawText( text, "Arial", textPos, new Vector2(textSize.Y, 0), clr, FontFlags.AntiAlias | FontFlags.StrikeOut); Drawing.DrawRect(pos, maxSize, Color.Black, true); return(pos + new Vector2(0, maxSize.Y)); }
/// <summary> /// Initializes a new instance of the <see cref="PriorityIcon" /> class. /// </summary> /// <param name="name"> /// The name. /// </param> /// <param name="height"> /// The height. /// </param> /// <param name="enabled"> /// The enabled. /// </param> public PriorityIcon(string name, float height, bool enabled) { this.texture = name.Substring(0, "item".Length) == "item" ? Textures.GetTexture( "materials/ensage_ui/items/" + name.Substring("item_".Length) + ".vmat") : Textures.GetTexture("materials/ensage_ui/spellicons/" + name + ".vmat"); this.Height = height; this.Name = name; this.Item = this.Name.Contains("item"); this.priorityNumber = new DrawText { FontFlags = FontFlags.AntiAlias, Color = Color.White, Position = this.Position + new Vector2(4, 3) }; this.transition = new QuadEaseInOut(0.35); this.Hover = new QuadEaseInOut(0.35); this.Hover.Start(0, 40); this.Enabled = enabled; }
/// <summary> /// Initializes a new instance of the <see cref="PriorityIcon" /> class. /// </summary> /// <param name="name"> /// The name. /// </param> /// <param name="height"> /// The height. /// </param> /// <param name="enabled"> /// The enabled. /// </param> public PriorityIcon(string name, float height, bool enabled) { this.texture = name.Substring(0, "item".Length) == "item" ? Textures.GetTexture( "materials/ensage_ui/items/" + name.Substring("item_".Length) + ".vmat") : Textures.GetTexture("materials/ensage_ui/spellicons/" + name + ".vmat"); this.Height = height; this.Name = name; this.Item = this.Name.Contains("item"); this.priorityNumber = new DrawText { FontFlags = FontFlags.AntiAlias, Color = Color.White, Position = this.Position + new Vector2(4, 3) }; this.transition = new QuadEaseInOut(0.35); this.Hover = new QuadEaseInOut(0.35); this.Hover.Start(0, 40); this.Enabled = enabled; }
static FunctionWheel() { Circle = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/circle.vmat"); CircleBg = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/circle_bg.vmat"); CircleBg2 = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/circle_bg2.vmat"); CirclePtr = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/circle_pointer.vmat"); Cursor = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/cursor.vmat"); ArrowR = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/arrow_1.vmat"); ArrowRD = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/arrow_2.vmat"); ArrowD = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/arrow_3.vmat"); ArrowLD = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/arrow_4.vmat"); ArrowL = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/arrow_5.vmat"); ArrowLU = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/arrow_6.vmat"); ArrowU = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/arrow_7.vmat"); ArrowUR = Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/arrow_8.vmat"); ArrowTextures4 = new[] { ArrowU, ArrowR, ArrowD, ArrowL }; ArrowTextures8 = new[] { ArrowU, ArrowUR, ArrowR, ArrowRD, ArrowD, ArrowLD, ArrowL, ArrowLU }; }
public Spell(string name, float cooldown) { Name = name; Cd = cooldown; texture = Textures.GetItemTexture(Name); }
/// <summary> /// Initializes a new instance of the <see cref="DrawRect" /> class. /// </summary> /// <param name="texture"> /// The texture. /// </param> public DrawRect(DotaTexture texture) { this.Texture = texture; this.texture = true; }
public Spell(Ability ab) { Name = ab.StoredName(); _cd = ab.Cooldown; _texture = Textures.GetItemTexture(Name); }
public TargetFind() { sleeper = new Sleeper(); heroIcon = Drawing.GetTexture("materials/ensage_ui/miniheroes/lone_druid"); iconSize = new Vector2(HUDInfo.GetHpBarSizeY() * 2); }
public Element(ItemId itemBlackKingBar) { Texture = Textures.GetItemTexture(itemBlackKingBar.ToString()); Position = MenuManager.DrawBkbStatusPosition; Size = MenuManager.DrawBkbStatusSize; }
/// <summary> /// Initializes a new instance of the <see cref="DrawRect" /> class. /// </summary> /// <param name="texture"> /// The texture. /// </param> public DrawRect(DotaTexture texture) { this.Texture = texture; this.texture = true; }
public SummonSpiritBear(Ability ability) { this.ability = ability; abilityIcon = Drawing.GetTexture("materials/ensage_ui/spellicons/lone_druid_spirit_bear"); iconSize = new Vector2(HUDInfo.GetHpBarSizeY() * 2); }
/// <summary> /// </summary> /// <param name="position"></param> /// <param name="size"></param> /// <param name="texture"></param> public void AddElement(Vector2 position, Vector2 size, DotaTexture texture) { var element = new AMessageComponent(position, size, texture) { Parent = this, ComponentType = "DrawRect_Texture" }; this.components.Add(this.elements, element); this.elements++; }
/// <summary> /// </summary> /// <param name="position"></param> /// <param name="size"></param> /// <param name="texture"></param> public AMessageComponent(Vector2 position, Vector2 size, DotaTexture texture) { this.Position = position; this.Size = size; this.Texture = texture; }
/// <summary> /// </summary> /// <param name="position"></param> /// <param name="size"></param> /// <param name="texture"></param> public AMessageComponent(Vector2 position, Vector2 size, DotaTexture texture) { this.Position = position; this.Size = size; this.Texture = texture; }
public TargetFind() { this.sleeper = new Sleeper(); this.heroIcon = Drawing.GetTexture("materials/ensage_ui/miniheroes/huskar"); this.iconSize = new Vector2(HUDInfo.GetHpBarSizeY() * 2); }
public Spell(string name,float cooldown) { Name = name; _cd = cooldown; _texture = Textures.GetItemTexture(Name); }
public Spell(Ability ab) { Name = ab.StoredName(); _cd = ab.Cooldown; _texture = Textures.GetItemTexture(Name); }
public Rabid(Ability ability) { this.ability = ability; this.abilityIcon = Drawing.GetTexture("materials/ensage_ui/spellicons/lone_druid_rabid"); this.iconSize = new Vector2(HUDInfo.GetHpBarSizeY() * 2); }
public void OnLoad() { hero = ObjectManager.LocalHero; heroTeam = hero.Team; creeepTexture = Drawing.GetTexture( "materials/ensage_ui/heroes_horizontal/creep_" + (heroTeam == Team.Radiant ? "dire" : "radiant")); creepsData = new CreepsData(heroTeam); sleeper = new MultiSleeper(); }