public static void LoadAbilityTexture(AbilityId id) { if (LoadedList.Contains(id.ToString())) { return; } LoadedList.Add(id.ToString()); Log.Debug($"Load from dota ability texture: {id}"); Render.LoadFromDota($"{id}", $@"resource\flash3\images\spellicons\{id}.png"); }
public static void LoadItemTexture(AbilityId id) { if (LoadedList.Contains(id.ToString())) { Log.Debug($"Already Loaded from dota item texture: {id}"); return; } LoadedList.Add(id.ToString()); var itemString = id.ToString().Remove(0, 5); Log.Debug($"Load from dota item texture: {itemString}"); Render.LoadFromDota($"{id}", $@"resource\flash3\images\items\{itemString}.png"); }
public static void LoadAbilityTexture(AbilityId id) { if (LoadedList.Contains(id.ToString())) { return; } LoadedList.Add(id.ToString()); Console.WriteLine($"Load from dota ability texture: {id}"); Render.LoadFromDota($"{id}", $@"panorama\images\spellicons\{id}_png.vtex_c"); /*Render.LoadFromFile(id.ToString(), * $@"{GamePath}\game\dota\materials\ensage_ui\spellicons\png\{id}.png");*/ //Render.LoadFromDota($"{id}", $@"resource\flash3\images\spellicons\{id}.png"); //Render.LoadFromDota($"{id}", $@"resource\flash3\images\spellicons\{id}.png"); }
public SpecialData(Entity talentOwner, AbilityId talentId) { try { this.talent = EntityManager9.BaseAbilities.FirstOrDefault(x => x.Id == talentId && x.Owner?.Handle == talentOwner.Handle); if (this.talent != null) { this.talentValue = this.talent.AbilitySpecialData.First(x => x.Name == "value").Value; this.getDataFunc = this.GetTalentValue; } else { this.getDataFunc = _ => 1; } } catch { this.getDataFunc = _ => 0; var ex = new BrokenAbilityException(talentId.ToString()); if (this.talent?.IsValid == true) { ex.Data["Ability"] = new { Ability = this.talent.Name }; } Logger.Error(ex); } }
public static void LoadItemTexture(AbilityId id) { if (LoadedList.Contains(id.ToString())) { return; } LoadedList.Add(id.ToString()); var itemString = id.ToString().Remove(0, 5); Console.WriteLine($"Load from dota item texture: {itemString}"); //Render.LoadFromDota($"{id}", $@"resource\flash3\images\items\{itemString}.png"); LoadFromDota($"{id}", $@"panorama\images\items\{itemString}_png.vtex_c"); /*Render.LoadFromFile(id.ToString(), * $@"{GamePath}\game\dota\materials\ensage_ui\items\png\{itemString}.png");*/ }
public Button(AbilityId id, TypeEnum type, bool isActive) { Id = id; TextureId = id.ToString(); Type = type; IsActive = isActive; }
public static Ability FindSpell322(this Unit unit, AbilityId abilityId, bool cache = false) { if (!cache) { return(unit.Spellbook.Spells.FirstOrDefault(x => x.GetAbilityId() == abilityId)); } Ability ability; var n = unit.Handle + abilityId.ToString(); if (!AbilityDictionary.TryGetValue(n, out ability) || ability == null || !ability.IsValid || Utils.SleepCheck("Common.FindSpell322." + abilityId)) { ability = unit.Spellbook.Spells.FirstOrDefault(x => x.GetAbilityId() == abilityId); if (AbilityDictionary.ContainsKey(n)) { AbilityDictionary[n] = ability; } else { AbilityDictionary.TryAdd(n, ability); } Utils.Sleep(1000, "Common.FindSpell322." + abilityId); } if (ability == null || !ability.IsValid) { return(null); } return(ability); }
public static void RemoveOldItem(AbilityId item) { var name = item.ToString(); Menu.Item("itemHeroEnable").GetValue <AbilityToggler>().Remove(name); Menu.Item("itemTempestEnable").GetValue <AbilityToggler>().Remove(name); Menu.Item("itemHero").GetValue <PriorityChanger>().Remove(name); Menu.Item("itemTempest").GetValue <PriorityChanger>().Remove(name); Printer.Log($"Remove old item -> {item}"); }
public static void AddNewItem(AbilityId item) { var name = item.ToString(); Menu.Item("itemHeroEnable").GetValue <AbilityToggler>().Add(name); Menu.Item("itemTempestEnable").GetValue <AbilityToggler>().Add(name); Menu.Item("itemHero").GetValue <PriorityChanger>().Add(name); Menu.Item("itemTempest").GetValue <PriorityChanger>().Add(name); Printer.Log($"Add new item -> {item}"); }
public Notification(Hero hero, Vector2 startPosition, AbilityId textureId, float maxTime) { Hero = hero; MaxTime = maxTime; State = StateType.Up; IsActive = true; StartPosition = startPosition + new Vector2(0, HUDInfo.TopPanelSizeY); CurrentPosition = StartPosition; TextureId = textureId.ToString(); MaxSize = StartPosition.Y + HUDInfo.TopPanelSizeY * 2.2f; }
public static bool IsRecipe(this AbilityId itemId) { if (Recipes.TryGetValue(itemId, out var value)) { return(value); } value = itemId.ToString().Contains("recipe"); Recipes[itemId] = value; return(value); }
// Token: 0x06000211 RID: 529 RVA: 0x0000358E File Offset: 0x0000178E public void AddAbility(AbilityId id, bool?value = null) { if (base.Renderer == null) { this.loadTextures.Add(id); } else { base.Renderer.TextureManager.LoadFromDota(id, false); } this.AddAbility(id.ToString(), value); }
public void AddAbility(AbilityId id, bool?value = null, int priority = 0) { if (this.Renderer == null) { this.loadTextures.Add(id); } else { this.Renderer.TextureManager.LoadAbilityFromDota(id); } this.AddAbility(id.ToString(), value, priority); }
// Token: 0x060000DD RID: 221 RVA: 0x00011290 File Offset: 0x0000F490 public void LoadFromDota(AbilityId abilityId, bool rounded = false) { try { string text = abilityId.ToString(); bool flag = abilityId < AbilityId.attribute_bonus; string arg = flag ? "items" : "spellicons"; string arg2 = flag ? text.Substring("item_".Length) : text; string file = string.Format("panorama\\images\\{0}\\{1}_png.vtex_c", arg, arg2); if (rounded) { text += "_rounded"; } this.LoadFromDota(text, file, flag ? 86 : 128, flag ? 64 : 128, rounded, 0, null); } catch (Exception exception) { Logger.Error(exception, null); } }
// Token: 0x06000428 RID: 1064 RVA: 0x0001DDF4 File Offset: 0x0001BFF4 public SpecialData(Entity talentOwner, AbilityId talentId) { try { this.talent = EntityManager9.BaseAbilities.FirstOrDefault(delegate(Ability x) { if (x.Id == talentId) { Entity owner = x.Owner; EntityHandle?entityHandle = (owner != null) ? new EntityHandle?(owner.Handle) : null; EntityHandle handle = talentOwner.Handle; return(entityHandle != null && (entityHandle == null || entityHandle.GetValueOrDefault() == handle)); } return(false); }); if (this.talent != null) { this.talentValue = this.talent.AbilitySpecialData.First((AbilitySpecialData x) => x.Name == "value").Value; this.getDataFunc = new Func <uint, float>(this.GetTalentValue); } else { this.getDataFunc = ((uint _) => 1f); } } catch { this.getDataFunc = ((uint _) => 0f); BrokenAbilityException ex = new BrokenAbilityException(talentId.ToString()); Ability ability = this.talent; if (ability != null && ability.IsValid) { ex.Data["Ability"] = new { Ability = this.talent.Name }; } Logger.Error(ex, null); } }
public static ShopFlags GetShopFlags(this AbilityId itemId) { if (ItemShopFlags.TryGetValue(itemId, out var flags)) { return(flags); } var itemName = itemId.ToString(); if (HasGlobalTag(itemName)) { flags |= ShopFlags.Base; } if (HasSecretShopFlag(itemName)) { flags |= ShopFlags.Secret; } if (HasSideShopFlag(itemName)) { flags |= ShopFlags.Side; if ((flags & ShopFlags.Secret) == 0) { flags |= ShopFlags.Base; } } if (flags == ShopFlags.None) { flags = ShopFlags.Base; } ItemShopFlags[itemId] = flags; return(flags); }
public static string GetName(this AbilityId prop) { var description = EnumHelper.GetAttributeOfType <DisplayAttribute>(prop); return(description?.Name ?? prop.ToString()); }
public static string GetDescription(this AbilityId prop) { DisplayAttribute description = prop.GetAttributeOfType <DisplayAttribute>(); return(description?.Description ?? prop.ToString()); }
public static bool IsAbilityEnabledTempest(AbilityId id) { return(GetToggle("spellTempest", id.ToString())); }
public static bool IsAbilityEnabled(AbilityId id) { return(GetToggle("spellHero", id.ToString())); }
/*public static bool IsItemEnabledTempest(ItemId id) => * GetToggle("itemTempestEnable", * id == ItemId.item_necronomicon_2 || id == ItemId.item_necronomicon_3 * ? ItemId.item_necronomicon.ToString() * : id == ItemId.item_dagon_2 || id == ItemId.item_dagon_3 || id == ItemId.item_dagon_4 || * id == ItemId.item_dagon_5 * ? ItemId.item_dagon.ToString() * : id == ItemId.item_diffusal_blade_2 ? ItemId.item_diffusal_blade.ToString() : id.ToString());*/ public static bool IsItemEnabledTempest(AbilityId id) { return(GetToggle("itemTempestEnable", id.ToString())); }
public static bool IsItemEnabled(AbilityId id) { return(GetToggle("itemHeroEnable", id.ToString())); }
private static bool GetToggle(string name, AbilityId item) { return(Menu.Item(name).GetValue <AbilityToggler>().IsEnabled(item.ToString())); }
private static uint GetPriority(string name, AbilityId item) { return(Menu.Item(name).GetValue <PriorityChanger>().GetPriority(item.ToString())); }
public void LoadAbilityFromDota(AbilityId abilityId, bool rounded = false) { this.LoadAbilityFromDota(abilityId.ToString(), rounded); }
private bool IsAbilityEnabled(AbilityId id) => Members.Menu.Item("Abilities").GetValue <AbilityToggler>().IsEnabled(id.ToString());
public Menu SetTexture(AbilityId id) { return(this.SetTexture(id.ToString())); }
public bool IsLinkenBreakerEnabled(AbilityId id) { return(Config.AbilitiesInCombo.GetValue <AbilityToggler>("Linken breaker: ").IsEnabled(id.ToString())); }
public bool IsAbilityEnabled(AbilityId id) { return(Config.AbilitiesInCombo.GetValue <AbilityToggler>("Abilities: ").IsEnabled(id.ToString())); }
public static string LocalizeName(AbilityId id) { return(LocalizeAbilityName(id.ToString())); }