private void UpdateIconFrame()
        {
            if (!_locked)
            {
                _iconFrame = _iconFrameUnlocked;
            }
            else
            {
                _iconFrame = _iconFrameLocked;
            }

            if (_achievementIcon != null)
            {
                _achievementIcon.SetFrame(_iconFrame);
            }
        }
Exemple #2
0
 public override void Update(GameTime gameTime)
 {
     base.Update(gameTime);
     if (oldScale != Main.inventoryScale)
     {
         oldScale = Main.inventoryScale; Recalculate();
     }
     if (!Main.dedServ)
     {
         Tynyran p = Main.LocalPlayer.Tyn();
         visible = Main.LocalPlayer.HeldItem.type == ItemType <HuntingHorn>();
         note1.SetFrame(new Rectangle(0, 24 * p.noteList[0], 32, 24));
         note2.SetFrame(new Rectangle(0, 24 * p.noteList[1], 32, 24));
         note3.SetFrame(new Rectangle(0, 24 * p.noteList[2], 32, 24));
         note4.SetFrame(new Rectangle(0, 24 * p.noteList[3], 32, 24));
     }
 }
Exemple #3
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            if (oldScale != Main.inventoryScale)
            {
                oldScale = Main.inventoryScale; Recalculate();
            }
            Tynyran tyn = Main.LocalPlayer.Tyn();

            visible = tyn.aether;
            if (visible)
            {
                float quotient = (float)Main.LocalPlayer.Tyn().aetherCharges / (float)Main.LocalPlayer.Tyn().maxAetherCharges;
                quotient            = Utils.Clamp(quotient, 0f, 1f);
                aetherOrbRect.Width = aetherOrbRect.Y = (int)(52 * quotient);
                AetherBar.SetFrame(aetherOrbRect);
            }
        }
Exemple #4
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            area.visible = visible;
            if (oldScale != Main.inventoryScale)
            {
                oldScale = Main.inventoryScale; Recalculate();
            }
            Tynyran tyn = Main.LocalPlayer.Tyn();

            visible = tyn.hemomancy;
            if (visible)
            {
                float quotient = (float)Main.LocalPlayer.Tyn().bloodLevel / (float)Main.LocalPlayer.Tyn().maxBloodLevel;
                quotient           = Utils.Clamp(quotient, 0f, 1f);
                bloodBarRect.Width = (int)(124 * quotient);
                bloodBar.SetFrame(bloodBarRect);
                if (!set)
                {
                    bloodUseRect.Width = 0;
                    bloodUse.SetFrame(bloodBarRect);
                    set = true;
                }
                if (!arraySet)
                {
                    bloodArray[2] = bloodArray[1];
                    bloodArray[1] = bloodArray[0];
                    bloodArray[0] = tyn.bloodLevel;
                    arraySet      = true;
                }
                if (tyn.bloodLevel < bloodArray[0])
                {
                    bloodArray[2] = bloodArray[1];
                    bloodArray[1] = bloodArray[0];
                    bloodArray[0] = tyn.bloodLevel;
                    cooldown      = 30;
                }
                else if (tyn.bloodLevel == bloodArray[0])
                {
                    if (cooldown > 0)
                    {
                        cooldown--;
                    }
                }
                if (cooldown == 0 && bloodUseRect.Width != bloodBarRect.Width)
                {
                    if ((bloodUseRect.Width - bloodBarRect.Width) * 0.05f < 1)
                    {
                        bloodUseRect.Width--;
                    }
                    else
                    {
                        bloodUseRect.Width -= (int)((bloodUseRect.Width - bloodBarRect.Width) * 0.05f);
                    }
                    bloodUse.SetFrame(bloodUseRect);
                }
                if (bloodBarRect.Width > bloodUseRect.Width)
                {
                    bloodUseRect.Width = bloodBarRect.Width;
                    bloodUse.SetFrame(bloodUseRect);
                }

                // if (prov.bloodAmp) bLFrame.SetImage(GetTexture("ProvidenceMod/UI/BloodUIFrameAmp"));
                // else bLFrame.SetImage(GetTexture("ProvidenceMod/UI/BloodUIFrame"));
            }
        }
Exemple #5
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            if (player == null)
            {
                player = Main.LocalPlayer.GetModPlayer <TervaniaPlayer>();
            }
            Vector2 MousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            {
                if (ePanel.ContainsPoint(MousePosition))
                {
                    Main.LocalPlayer.mouseInterface = true;
                    Main.HoverItem     = player.enchantedSoul;
                    Main.hoverItemName = player.enchantedSoul.Name;
                }

                int type = player.enchantedSoul.type;

                if (!ePanel.HasChild(eIcon) && player.enchantedSoul.modItem != null)
                {
                    eIcon = new UIImageFramed(Main.itemTexture[type], new Rectangle(0, 0, 36, 36));
                    eIcon.Left.Set(4, 0f);
                    eIcon.Top.Set(4, 0f);
                    eIcon.Width.Set(38, 0f);
                    eIcon.Height.Set(38, 0f);
                    ePanel.Append(eIcon);
                }
                if (Main.itemAnimations[type] != null)
                {
                    eIcon.SetFrame(Main.itemAnimations[type].GetFrame(Main.itemTexture[type]));
                }

                ePanel.Left.Set(496, 0f);
                ePanel.Top.Set(20, 0f);
            }

            {
                if (bPanel.ContainsPoint(MousePosition))
                {
                    Main.LocalPlayer.mouseInterface = true;
                    Main.HoverItem     = player.bulletSoul;
                    Main.hoverItemName = player.bulletSoul.Name;
                }

                int type = player.bulletSoul.type;

                if (!bPanel.HasChild(bIcon) && player.bulletSoul.modItem != null)
                {
                    bIcon = new UIImageFramed(Main.itemTexture[player.bulletSoul.type], new Rectangle(0, 0, 36, 36));
                    bIcon.Left.Set(4, 0f);
                    bIcon.Top.Set(4, 0f);
                    bIcon.Width.Set(38, 0f);
                    bIcon.Height.Set(38, 0f);
                    bPanel.Append(bIcon);
                }
                if (Main.itemAnimations[type] != null)
                {
                    bIcon.SetFrame(Main.itemAnimations[type].GetFrame(Main.itemTexture[type]));
                }

                bPanel.Left.Set(542, 0f);
                bPanel.Top.Set(20, 0f);
            }

            {
                if (gPanel.ContainsPoint(MousePosition))
                {
                    Main.LocalPlayer.mouseInterface = true;
                    Main.HoverItem     = player.guardianSoul;
                    Main.hoverItemName = player.guardianSoul.Name;
                }

                int type = player.guardianSoul.type;

                if (!gPanel.HasChild(gIcon) && player.guardianSoul.modItem != null)
                {
                    gIcon = new UIImageFramed(Main.itemTexture[player.guardianSoul.type], new Rectangle(0, 0, 36, 36));
                    gIcon.Left.Set(4, 0f);
                    gIcon.Top.Set(4, 0f);
                    gIcon.Width.Set(38, 0f);
                    gIcon.Height.Set(38, 0f);
                    gPanel.Append(gIcon);
                }
                if (Main.itemAnimations[type] != null)
                {
                    gIcon.SetFrame(Main.itemAnimations[type].GetFrame(Main.itemTexture[type]));
                }

                gPanel.Left.Set(588, 0f);
                gPanel.Top.Set(20, 0f);
            }

            Recalculate();
        }