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 AddSkeletonForComponent(string skeletonName, AvatarComponent component, bool addBody) { ComponentSetDisplayAvatar avatar = new ComponentSetDisplayAvatar((component == null) ? "none" : component.Name, 0.0f); avatar.CreateBonesFromDataManager(skeletonName); avatar.Name = skeletonName; if (addBody) { avatar.Components.Add(AvatarComponentManager.Component("body", "Blue")); } if (component != null) { avatar.Components.Add(component); } avatar.SkinFromComponents(); avatar.RenderLayer = RenderLayer; AddItem(avatar); }
private void AddComponentSetDisplaySkeleton(AvatarComponentSet componentSet) { ComponentSetDisplayAvatar avatar = new ComponentSetDisplayAvatar(componentSet.Name, 0.0f); avatar.CreateBonesFromDataManager(componentSet.DisplaySkeleton); avatar.Name = componentSet.DisplaySkeleton; if (componentSet.Name != "body") { avatar.Components.Add(AvatarComponentManager.Component("body", "Blue")); } avatar.Components.Add((from c in componentSet.Components where c.Unlocked == true select c).First()); avatar.SkinFromComponents(); avatar.RenderLayer = RenderLayer; avatar.Annotation = componentSet.Name; AddItem(avatar); _selectableComponentSets.Add(componentSet); }