public static void Prefix(InventoryGui __instance)
 {
     if (__instance.m_animator.GetBool("visible"))
     {
         SpellsBar.UpdateVisibility();
     }
 }
Example #2
0
 public static void Postfix(Inventory __instance)
 {
     if (__instance.m_name != "spellsBarInventory")
     {
         return;
     }
     SpellsBar.UpdateInventory();
 }
Example #3
0
 public static void AddCooldown(string name, int cooldown)
 {
     if (!configCooldownsEnabled.Value)
     {
         return;
     }
     activeCooldowns.Add(name, cooldown);
     SpellsBar.SetExtraTexts(name, cooldown);
 }
Example #4
0
 private void Awake()
 {
     _this = this;
     UnsetMostThings();
     LoadRunes();
     LoadClasses();
     SetupConfig();
     configFile = Config;
     SpellsBar.RegisterKeybinds();
 }
Example #5
0
 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();
 }
Example #6
0
 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();
 }
Example #7
0
        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;
            }
        }
Example #8
0
 public static void Postfix(Hud __instance)
 {
     SpellsBar.CreateHotkeysBar(__instance);
 }
 public static void Postfix(InventoryGui __instance)
 {
     SpellsBar.CreateInventoryBar(__instance);
     RunicPower.CreateCraftAllButton(__instance);
     RunicPower.CreateRankTabs(__instance);
 }
Example #10
0
 public static void Postfix(Player __instance, PieceTable buildPieces)
 {
     SpellsBar.UpdateVisibility(buildPieces == null);
 }
Example #11
0
        public static bool Prefix(Player __instance, int index)
        {
            var item = SpellsBar.GetSpellHotKeyItem(__instance, index - 1, true);

            return(item == null);
        }
Example #12
0
 public static void Postfix(Player __instance)
 {
     SpellsBar.UpdateInventory();
 }