public void CreateContentForItemList(List<XElement> itemList, Profile.LockState lockState, float yPosition)
        {
            foreach (XElement el in itemList)
            {
                switch (el.Attribute("type").Value)
                {
                    case "area": CreateAreaDisplayItems(el.Attribute("name").Value, lockState, yPosition); break;
                    case "golden-ticket": CreateGoldenTicketDisplayItems(lockState, yPosition); break;
                    case "avatar-component": CreateAvatarComponentDisplayItems(el.Attribute("set").Value, el.Attribute("name").Value, lockState, yPosition); break;
                    case "avatar-costume": CreateAvatarCostumeDisplayItems(el.Attribute("name").Value, lockState, yPosition); break;
                }

                CreateIconForUnlockableItem(lockState, yPosition);
                yPosition += Unlock_Line_Height;
            }
        }
 private void CreateStaticIconForUnlockableItem(string textureName, Profile.LockState lockState, float yPosition)
 {
     _registerObject(
         new ImageContent(textureName, new Vector2(Unlock_Icon_X, yPosition))
         {
             FadeFraction = 0.0f,
             FadeFractionModifier = LockStateFadeModifier(lockState),
             Scale = Unlock_Icon_Scale
         });
 }
 private float LockStateFadeModifier(Profile.LockState lockState)
 {
     return (lockState == Profile.LockState.NewlyUnlocked ? 1.0f : 0.65f);
 }
 private void CreateIconForUnlockableItem(Profile.LockState lockState, float yPosition)
 {
     switch (lockState)
     {
         case Profile.LockState.NewlyUnlocked: CreatePopupTickForNewlyUnlockedItem(yPosition); break;
         case Profile.LockState.Locked: CreateStaticIconForUnlockableItem("icon-lock", lockState, yPosition); break;
         case Profile.LockState.Unlocked: CreateStaticIconForUnlockableItem("icon-tick", lockState, yPosition); break;
     }
 }
        private void CreateGoldenTicketDisplayItems(Profile.LockState lockState, float yPosition)
        {
            string messageText = Translator.Translation(string.Concat("ticket-", lockState).ToLower());
            if (lockState == Profile.LockState.FullVersionOnly) { messageText = Translator.Translation("buy full game to unlock"); }

            _registerObject(
                new TextContent(messageText, new Vector2(Unlock_Text_X, yPosition + Unlock_Text_Y_Offset))
                {
                    FadeFraction = 0.0f,
                    FadeFractionModifier = LockStateFadeModifier(lockState),
                    Alignment = TextWriter.Alignment.Left,
                    Scale = Unlock_Text_Scale
                });

            _registerObject(
                new ImageContentWithGlow("golden-ticket", new Vector2(Unlock_Image_X, yPosition), (lockState != Profile.LockState.NewlyUnlocked), 0.75f, 0.5f)
                {
                    FadeFraction = 0.0f,
                    FadeFractionModifier = LockStateFadeModifier(lockState)
                });
        }
        private void CreateAvatarCostumeDisplayItems(string costumeName, Profile.LockState lockState, float yPosition)
        {
            string name = string.Concat(costumeName, " costume");
            string messageText = Translator.Translation(string.Concat("item-", lockState).ToLower()).Replace("[ITEM]", Translator.Translation(name));
            if (lockState == Profile.LockState.FullVersionOnly) { messageText = Translator.Translation("buy full game to unlock"); }

            _registerObject(
                new TextContent(messageText, new Vector2(Unlock_Text_X, yPosition + Unlock_Text_Y_Offset))
                {
                    FadeFraction = 0.0f,
                    FadeFractionModifier = LockStateFadeModifier(lockState),
                    Alignment = TextWriter.Alignment.Left,
                    Scale = Unlock_Text_Scale
                });

            AvatarContent avatar = new AvatarContent(new Vector2(Unlock_Image_X, yPosition), Avatar_Costume_Display_Skeleton);
            avatar.AddComponent(AvatarComponentManager.Component("body", "Blue"));

            foreach (XElement el in AvatarComponentManager.CostumeComponents[costumeName].Elements("component"))
            {
                avatar.AddComponent(AvatarComponentManager.Component(el.Attribute("set").Value, el.Attribute("name").Value));
            }
            avatar.SkinSkeleton();
            avatar.FadeFraction = 0.0f;
            avatar.FadeFractionModifier = LockStateFadeModifier(lockState);
            avatar.Scale = 0.65f;
            _registerObject(avatar);
        }
        private void CreateAvatarComponentDisplayItems(string setName, string componentName, Profile.LockState lockState, float yPosition)
        {
            string name = string.Concat(componentName, " ", setName);
            string messageText = Translator.Translation(string.Concat("item-", lockState).ToLower()).Replace("[ITEM]", Translator.Translation(name));
            if (lockState == Profile.LockState.FullVersionOnly) { messageText = Translator.Translation("buy full game to unlock"); }

            _registerObject(
                new TextContent(messageText, new Vector2(Unlock_Text_X, yPosition + Unlock_Text_Y_Offset))
                {
                    FadeFraction = 0.0f,
                    FadeFractionModifier = LockStateFadeModifier(lockState),
                    Alignment = TextWriter.Alignment.Left,
                    Scale = Unlock_Text_Scale
                });

            AvatarComponent component = AvatarComponentManager.Component(setName, componentName);
            AvatarContent avatar = new AvatarContent(new Vector2(Unlock_Image_X, yPosition), AvatarComponentManager.DisplaySkeletonForSet(setName));

            if (setName != "body") { avatar.AddComponent(AvatarComponentManager.Component("body", "Blue")); }
            avatar.AddComponent(AvatarComponentManager.Component(setName, componentName));
            avatar.SkinSkeleton();
            avatar.FadeFraction = 0.0f;
            avatar.FadeFractionModifier = LockStateFadeModifier(lockState);
            avatar.Scale = 0.65f;
            _registerObject(avatar);
        }
        private void CreateAreaDisplayItems(string name, Profile.LockState lockState, float yPosition)
        {
            string messageText = Translator.Translation(string.Concat("area-", lockState).ToLower()).Replace("[AREA]", Translator.Translation(name));
            if (lockState == Profile.LockState.FullVersionOnly) { messageText = Translator.Translation("buy full game to unlock"); }

            _registerObject(
                new TextContent(messageText, new Vector2(Unlock_Text_X, yPosition + Unlock_Text_Y_Offset))
                {
                    FadeFraction = 0.0f,
                    FadeFractionModifier = LockStateFadeModifier(lockState),
                    Alignment = TextWriter.Alignment.Left,
                    Scale = Unlock_Text_Scale
                });

            _registerObject(
                new ImageContent("thumb-" + Profile.AreaSelectionTexture(name), new Vector2(Unlock_Image_X, yPosition))
                {
                    FadeFraction = 0.0f,
                    FadeFractionModifier = LockStateFadeModifier(lockState),
                    Scale = 0.5f
                });
        }