コード例 #1
0
        public void ShowStats(int i)
        {
            //i = 0 hides stats, i = 1 shows stats
            if (i != 0)
            {
                i = 1;
                SetProgressBars();
            }
            else
            {
                Health.Text = "";
                Mana.Text   = "";
                LVL.Text    = "";
                XP.Text     = "";
            }
            Player.Opacity          = i;
            PlayerHealthBar.Opacity = i;
            PlayerImage.Opacity     = i;
            PlayerImageBox.Opacity  = i;
            PlayerManaBar.Opacity   = i;
            PlayerXPBar.Opacity     = i;
            EquipmentInfo.Opacity   = i;

            Atributes points = Stuff.FindCharacter(1).GetAtributes();

            if (i == 1)
            {
                InfoBox.Text = "Atributes:\n\nStrength: " + points.GetStrength()
                               + "\nVitality: " + points.GetVitality() + "\nAgility: " + points.GetAgility()
                               + "\nIntelligence: " + points.GetIntelligence() + "\nWillpower: " + points.GetWillpower()
                               + "\nLuck: " + points.GetLuck();
            }
            else
            {
                InfoBox.Text = "";
            }

            EquipmentSlots items = Stuff.FindCharacter(1).GetEquipment();

            for (int j = 1; j < 4; j++)
            {
                Image     itemImage = (Image)this.FindName("Item" + j);
                Rectangle rectangle = (Rectangle)this.FindName("Item" + j + "_Slot");
                if (j == 1)
                {
                    itemImage.Source = items.GetPrimary().GetSprite().Source;
                }
                else if (j == 2)
                {
                    itemImage.Source = items.GetSecondary().GetSprite().Source;
                }
                else
                {
                    itemImage.Source = items.GetArmor().GetSprite().Source;
                }
                itemImage.Opacity = i;
                rectangle.Opacity = i;
            }
        }