public static void Prefix(InventoryGui __instance) { if (__instance.m_animator.GetBool("visible")) { SpellsBar.UpdateVisibility(); } }
public static void Postfix(Inventory __instance) { if (__instance.m_name != "spellsBarInventory") { return; } SpellsBar.UpdateInventory(); }
public static void AddCooldown(string name, int cooldown) { if (!configCooldownsEnabled.Value) { return; } activeCooldowns.Add(name, cooldown); SpellsBar.SetExtraTexts(name, cooldown); }
private void Awake() { _this = this; UnsetMostThings(); LoadRunes(); LoadClasses(); SetupConfig(); configFile = Config; SpellsBar.RegisterKeybinds(); }
public static void Recreate() { if (!configCooldownsEnabled.Value) { activeCooldowns.Clear(); } SpellsBar.RegisterKeybinds(); CreateCraftAllButton(null); CreateRankTabs(null); SpellsBar.ClearBindings(); SpellsBar.CreateHotkeysBar(null); SpellsBar.CreateInventoryBar(null); SpellsBar.UpdateInventory(); SpellsBar.UpdateVisibility(); }
public static void UnsetMostThings() { activeCooldowns = new Dictionary <string, int>(); rankButtons = new Dictionary <int, Button>(); tryAgain = false; tryAgainTime = 0f; tryAgainDuration = 0.25f; isCraftingAll = false; craftRank = 0; if (_this != null) { _this.tickCooldown = 0f; } SpellsBar.UnsetMostThings(); }
private void Update() { if (tryAgain) { tryAgainTime += Time.deltaTime; if (tryAgainTime >= tryAgainDuration) { tryAgain = false; TryRegisterRecipes(); } } if (Player.m_localPlayer?.TakeInput() == true) { SpellsBar.CheckInputs(); } tickCooldown += Time.deltaTime; if (tickCooldown >= 1f) { tickCooldown -= 1f; var keys = activeCooldowns.Keys; var newCooldowns = new Dictionary <string, int>(); foreach (var key in keys) { var cd = activeCooldowns[key] - 1; if (cd > 0) { newCooldowns[key] = cd; SpellsBar.SetExtraTexts(key, cd); } else { SpellsBar.SetExtraTexts(key, 0); } } activeCooldowns = newCooldowns; } }
public static void Postfix(Hud __instance) { SpellsBar.CreateHotkeysBar(__instance); }
public static void Postfix(InventoryGui __instance) { SpellsBar.CreateInventoryBar(__instance); RunicPower.CreateCraftAllButton(__instance); RunicPower.CreateRankTabs(__instance); }
public static void Postfix(Player __instance, PieceTable buildPieces) { SpellsBar.UpdateVisibility(buildPieces == null); }
public static bool Prefix(Player __instance, int index) { var item = SpellsBar.GetSpellHotKeyItem(__instance, index - 1, true); return(item == null); }
public static void Postfix(Player __instance) { SpellsBar.UpdateInventory(); }