Exemple #1
0
        private static void HideUnusedIcons(CASHair ths)
        {
            List <Button> list = new List <Button>();
            int           num  = 0x0;
            int           num2 = 0x0;

            foreach (CASParts.Wrapper part in GetVisibleCASParts(CASLogic.GetSingleton(), BodyTypes.Hair))
            {
                if (CASHair.PartIsHat(part.mPart))
                {
                    num2++;
                }
                else
                {
                    num++;
                }
            }

            Button childByID = ths.GetChildByID(0x5dbb905, true) as Button;

            if (num > 0x0)
            {
                childByID.Visible = true;
                list.Add(childByID);
            }
            else
            {
                childByID.Visible = false;
            }

            childByID = ths.GetChildByID(0x5dbb906, true) as Button;
            if (num2 > 0x0)
            {
                childByID.Visible = true;
                list.Add(childByID);
            }
            else
            {
                childByID.Visible = false;
            }

            float count = list.Count;
            float num4  = (210f - ((count * 0.5f) * 42f)) - (((count - 1f) * 0.5f) * -2f);
            float num5  = num4;

            foreach (Button button2 in list)
            {
                button2.Position = new Vector2(num5, button2.Position.y);
                num5            += 40f;
            }
        }
Exemple #2
0
        private static void HideUnusedIcons(CASHair ths)
        {
            List<Button> list = new List<Button>();
            int num = 0x0;
            int num2 = 0x0;
            foreach (CASParts.Wrapper part in GetVisibleCASParts(CASLogic.GetSingleton(), BodyTypes.Hair))
            {
                if (CASHair.PartIsHat(part.mPart))
                {
                    num2++;
                }
                else
                {
                    num++;
                }
            }

            Button childByID = ths.GetChildByID(0x5dbb905, true) as Button;
            if (num > 0x0)
            {
                childByID.Visible = true;
                list.Add(childByID);
            }
            else
            {
                childByID.Visible = false;
            }

            childByID = ths.GetChildByID(0x5dbb906, true) as Button;
            if (num2 > 0x0)
            {
                childByID.Visible = true;
                list.Add(childByID);
            }
            else
            {
                childByID.Visible = false;
            }

            float count = list.Count;
            float num4 = (210f - ((count * 0.5f) * 42f)) - (((count - 1f) * 0.5f) * -2f);
            float num5 = num4;
            foreach (Button button2 in list)
            {
                button2.Position = new Vector2(num5, button2.Position.y);
                num5 += 40f;
            }
        }