Exemple #1
0
        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);
        }
Exemple #2
0
        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(Profile.AreaSelectionTexture(name), new Vector2(Unlock_Image_X, yPosition))
            {
                FadeFraction         = 0.0f,
                FadeFractionModifier = LockStateFadeModifier(lockState),
                Scale = 0.1f
            });
        }
Exemple #3
0
        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)
            });
        }
Exemple #4
0
 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
     });
 }
Exemple #5
0
        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;
            }
        }
Exemple #6
0
        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;
            }
        }
Exemple #7
0
 private float LockStateFadeModifier(Profile.LockState lockState)
 {
     return(lockState == Profile.LockState.NewlyUnlocked ? 1.0f : 0.65f);
 }
Exemple #8
0
        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);
        }