public static void LoadSim3D(Sim sim, Outfit OutfHead, AppearanceType skin) { var Apr = new Appearance(ContentManager.GetResourceFromLongID(OutfHead.GetAppearance(skin))); var Bnd = new Binding(ContentManager.GetResourceFromLongID(Apr.BindingIDs[0])); sim.HeadTexture = GetOutfitTexture(Bnd.TextureAssetID); sim.HeadMesh = GetOutfitMesh(sim.SimSkeleton, Bnd.MeshAssetID); }
public Appearance(AppearanceType appearanceType, Format format, int imgNumber) { this.type = appearanceType; this.imgNumber = imgNumber; this.format = format; init(type, this.imgNumber); }
public static byte GetType(ChestTypeAttribute.ChestType chestType, AppearanceType appearanceType) { var type = (byte)chestType; type <<= 2; type += (byte)appearanceType; return(type); }
public void init(AppearanceType appearanceType, int imgNumber) { if (imgNumber == 4 && ((appearanceType == AppearanceType.Landscape) || (appearanceType == AppearanceType.Portrait))) { this.dimensions = new float[] { 1, 1 }; this.heightRatio = 2; return; } if (appearanceType == AppearanceType.Portrait && imgNumber == 6) { this.dimensions = new float[] { 1, 1, 1 }; this.heightRatio = 2; return; } if (appearanceType == AppearanceType.Portrait && imgNumber == 3) { this.dimensions = new float[] { 1, 1, 1 }; this.heightRatio = 1; return; } if (appearanceType == AppearanceType.Landscape && imgNumber == 6) { this.dimensions = new float[] { 1, 1 }; this.heightRatio = 3; return; } if (appearanceType == AppearanceType.Landscape && imgNumber == 3) { this.dimensions = new float[] { 1 }; this.heightRatio = 3; return; } if (appearanceType == AppearanceType.Magic && imgNumber == 4 && format.formatValue == "21x30 (cm)") { this.dimensions = new float[] { 1 }; this.heightRatio = 4; return; } if (appearanceType == AppearanceType.Magic && imgNumber == 6 && format.formatValue == "21x30 (cm)") { this.dimensions = new float[] { 1 }; this.heightRatio = 6; return; } if (appearanceType == AppearanceType.Magic && format.formatValue == "21x15 (cm)") { this.dimensions = new float[] { 1, 1, 1, 1 }; this.heightRatio = 1; return; } }
private void SavePDF_Click(object sender, EventArgs e) { string pdfName; PageSize pageSize = new PageSize(567f, 567f); pdfName = textBoxPDFName.Text; if (!(textBoxPDFName.Text.EndsWith(".pdf"))) { pdfName += ".pdf"; } AppearanceType appearanceType = AppearanceType.Portrait; string exportFile = Path.Combine(textBoxOutputPath.Text, pdfName); switch (comboBoxPages.Text) { case "3": imgNumber = 3; break; case "4": imgNumber = 4; break; case "6": imgNumber = 6; break; } switch (comboBoxAppearance.Text) { case "Portrait": appearanceType = AppearanceType.Portrait; break; case "Landscape": appearanceType = AppearanceType.Landscape; break; case "Magic Appearance": appearanceType = AppearanceType.Magic; break; } switch (comboBoxFormat.Text) { case "20x20 (cm)": pageSize = new PageSize(583.666f, 583.666f); appearance = new Appearance(appearanceType, formats.ElementAt(0), imgNumber); break; case "21x30 (cm)": pageSize = new PageSize(594.999f, 849.999f); appearance = new Appearance(appearanceType, formats.ElementAt(1), imgNumber); break; case "21x15 (cm)": pageSize = new PageSize(594.999f, 425.000f); appearance = new Appearance(appearanceType, formats.ElementAt(2), imgNumber); break; } PDFMaker.createDocument(listImages, appearance, pageSize, exportFile); }
public TreeAppearance(AppearanceType tree = null, MCGameObject obj = null) : base(tree, obj) { appearType = (VFXAppearanceType)tree; currentTexture = null; currentFrame = -1; currentRotation = 0; currentShapeTypeId = ActorStates.STATE_NORMAL; }
public GVAppearance(AppearanceType tree = null, MCGameObject obj = null) : base(tree, obj) { appearType = (GVAppearanceType)tree; currentTexture = null; currentFrame = -1; currentRotation = 0; currentShapeTypeId = GVActorStates.STATE_STOPPED; }
public EffectInstance(uint id, AppearanceType type) : base(id, type) { Phase = Constants.PhaseAsynchronous; foreach (var animator in _animators) { if (animator is Animation.LegacyAnimator legacyAnimator) { legacyAnimator.PhaseDuration = 75; } } }
public AppearanceFeatureModel(string name, AppearanceType type, string description = "", Availability availability = Availability.Common, List<Race> races = null, List<Gender> genders = null) { Name = name; AppearanceType = type; Description = description.NotNullOrEmpty() ? description : name; Availability = availability; var raceEnums = races ?? AllRaces; Races = string.Join("|", raceEnums); var genderEnums = genders ?? new List<Gender> {Gender.Female, Gender.Male}; Genders = string.Join("|", genderEnums); }
public ContentID GetAppearance(AppearanceType type) { switch (type) { case AppearanceType.Light: return new ContentID(LightAppearanceTypeID, LightAppearanceFileID); case AppearanceType.Medium: return new ContentID(MediumAppearanceTypeID, MediumAppearanceFileID); case AppearanceType.Dark: return new ContentID(DarkAppearanceTypeID, DarkAppearanceFileID); } return null; }
public ulong GetAppearance(AppearanceType type) { switch (type) { case AppearanceType.Light: return (ulong)LightAppearanceFileID << 32 | LightAppearanceTypeID; case AppearanceType.Medium: return (ulong)MediumAppearanceFileID << 32 | LightAppearanceTypeID; case AppearanceType.Dark: return (ulong)DarkAppearanceFileID << 32 | LightAppearanceTypeID; } return 0; }
public ContentID GetAppearance(AppearanceType type) { switch (type) { case AppearanceType.Light: return(new ContentID(LightAppearanceTypeID, LightAppearanceFileID)); case AppearanceType.Medium: return(new ContentID(MediumAppearanceTypeID, MediumAppearanceFileID)); case AppearanceType.Dark: return(new ContentID(DarkAppearanceTypeID, DarkAppearanceFileID)); } return(null); }
/// <summary>Initializes a new instance of the <see cref="T:System.Object"></see> class.</summary> public AppearanceEntry( AppearanceType type, uint id, uint primaryColor, uint secondaryColor, float quality, Material material) { Type = type; Id = id; PrimaryColor = primaryColor; SecondaryColor = secondaryColor; Quality = quality; Material = material; }
public ulong GetAppearance(AppearanceType type) { switch (type) { case AppearanceType.Light: return(LightAppearanceID); case AppearanceType.Medium: return(MediumAppearanceID); case AppearanceType.Dark: return(DarkAppearanceID); } return(0); }
public ulong GetAppearance(AppearanceType type) { switch (type) { case AppearanceType.Light: return((ulong)LightAppearanceFileID << 32 | LightAppearanceTypeID); case AppearanceType.Medium: return((ulong)MediumAppearanceFileID << 32 | LightAppearanceTypeID); case AppearanceType.Dark: return((ulong)DarkAppearanceFileID << 32 | LightAppearanceTypeID); } return(0); }
public ulong GetAppearance(AppearanceType type) { switch (type) { case AppearanceType.Light: return LightAppearanceID; case AppearanceType.Medium: return MediumAppearanceID; case AppearanceType.Dark: return DarkAppearanceID; } return 0; }
public override void Deserialize(BinaryReader reader) { base.Deserialize(reader); var anims = reader.ReadInt32(); Animations = new VMAnimationStateMarshal[anims]; for (int i = 0; i < anims; i++) Animations[i] = new VMAnimationStateMarshal(reader); var carry = reader.ReadBoolean(); if (carry) CarryAnimationState = new VMAnimationStateMarshal(reader); Name = reader.ReadString(); Message = reader.ReadString(); MessageTimeout = reader.ReadInt32(); var motCs = reader.ReadInt32(); MotiveChanges = new VMMotiveChange[motCs]; for (int i = 0; i < motCs; i++) { MotiveChanges[i] = new VMMotiveChange(); MotiveChanges[i].Deserialize(reader); } var pdats = reader.ReadInt32(); PersonData = new short[pdats]; for (int i = 0; i < pdats; i++) PersonData[i] = reader.ReadInt16(); var mdats = reader.ReadInt32(); MotiveData = new short[mdats]; for (int i = 0; i < mdats; i++) MotiveData[i] = reader.ReadInt16(); HandObject = reader.ReadInt16(); RadianDirection = reader.ReadSingle(); DefaultSuits = new VMAvatarDefaultSuits(reader); var aprs = reader.ReadInt32(); BoundAppearances = new string[aprs]; for (int i = 0; i < aprs; i++) BoundAppearances[i] = reader.ReadString(); BodyOutfit = reader.ReadUInt64(); HeadOutfit = reader.ReadUInt64(); SkinTone = (AppearanceType)reader.ReadByte(); }
private void SkinButton_OnButtonClick(UIElement button) { SelectedAppearanceButton.Selected = false; SelectedAppearanceButton = (UIButton)button; SelectedAppearanceButton.Selected = true; var type = AppearanceType.Light; if (button == SkinMediumButton) { type = AppearanceType.Medium; } else if (button == SkinDarkButton) { type = AppearanceType.Dark; } this.AppearanceType = type; RefreshCollections(); }
public VMAvatar(GameObject obj) : base(obj) { Name = "Sim"; WorldUI = new AvatarComponent(); BodyStrings = Object.Resource.Get <STR>(Object.OBJ.BodyStringID); SetAvatarType(BodyStrings); SkinTone = AppearanceType.Light; var avatarc = (AvatarComponent)WorldUI; avatarc.Avatar = Avatar; for (int i = 0; i < 16; i++) { MotiveChanges[i] = new VMMotiveChange(); MotiveChanges[i].Motive = (VMMotive)i; } }
public System.Xml.XmlElement Serialize(System.Xml.XmlDocument doc) { var result = doc.CreateElement("Avatar-Data"); result.AppendTextNode("AvatarID", ID.ToString()); result.AppendTextNode("Name", Name); result.AppendTextNode("Shard-Name", ShardName); //NEW: Appearance info result.AppendTextNode("Head", HeadOutfitID.ToString()); result.AppendTextNode("Body", BodyOutfitID.ToString()); result.AppendTextNode("Appearance", AppearanceType.ToString()); if (LotId.HasValue && LotLocation.HasValue && LotName != null) { result.AppendTextNode("LotId", LotId.Value.ToString()); result.AppendTextNode("LotName", LotName); result.AppendTextNode("LotLocation", LotLocation.Value.ToString()); } result.AppendTextNode("Description", Description); return(result); }
public AppearanceType GetAppearanceType(int AppearNumber) { //---------------------------------------------------------------- // The type of appearance is stored in the upper 8 bits of the // apprNum. To get the correct packet we mask off the top 8 bits // and store the number. To get the appearance type, we right shift // by 24. var appearanceClass = (AppearanceClass)(AppearNumber >> 24); //---------------------------------------------------- // If these top bits are wrong, return NULL if (appearanceClass == AppearanceClass.BASE_APPEARANCE) { return(null); } int appearanceNumber = AppearNumber & 0xFFFFFF; AppearanceType appearanceType = null; if (AppearanceTypeList.ContainsKey(appearanceNumber)) { appearanceType = AppearanceTypeList[appearanceNumber]; appearanceType.numUsers++; } else { var spriteFitData = spritePakFile.GetFileInner(appearanceNumber); if (spriteFitData == null) { return(null); } var spriteFitFile = new FITFile(spriteFitData); // 1,2,5,9,6,7,8,4 switch (appearanceClass) { case AppearanceClass.SPRITE_TREE: //1 Debug.Log("SPRITE_TREE" + AppearNumber + " -> " + appearanceNumber); // appearanceType = new Mech3DAppearanceType; // appearanceType.appearanceNum = appearanceNumber; // appearanceType.init(appearFile); //---------------------------------------- // We have a new one, add it to the list. // appearanceType.numUsers = 1; // AppearanceTypeList.Add(appearanceNumber, appearanceType); break; case AppearanceClass.VFX_APPEAR: //2 //Debug.Log("VFX APPEAR"+ AppearNumber + " -> " + appearanceNumber); appearanceType = new VFXAppearanceType(spriteFitFile); appearanceType.appearanceNum = appearanceNumber; appearanceType.appearanceClass = AppearanceClass.VFX_APPEAR; ((VFXAppearanceType)appearanceType).InitSprites(); //---------------------------------------- // We have a new one, add it to the list. appearanceType.numUsers = 1; AppearanceTypeList.Add(appearanceNumber, appearanceType); break; case AppearanceClass.GV_TYPE: //5 appearanceType = new GVAppearanceType(spriteFitFile); appearanceType.appearanceNum = appearanceNumber; appearanceType.appearanceClass = AppearanceClass.GV_TYPE; ((GVAppearanceType)appearanceType).InitSprites(); //---------------------------------------- // We have a new one, add it to the list. appearanceType.numUsers = 1; AppearanceTypeList.Add(appearanceNumber, appearanceType); break; case AppearanceClass.PU_TYPE: //9 //TODO specific appearance type for this one Debug.Log("PU_Type using GV Appearance"); appearanceType = new GVAppearanceType(spriteFitFile); appearanceType.appearanceNum = appearanceNumber; appearanceType.appearanceClass = AppearanceClass.GV_TYPE; ((GVAppearanceType)appearanceType).InitSprites(); //---------------------------------------- // We have a new one, add it to the list. appearanceType.numUsers = 1; AppearanceTypeList.Add(appearanceNumber, appearanceType); break; case AppearanceClass.ARM_APPEAR: //6 break; case AppearanceClass.BUILD_APPEAR: //7 // Debug.Log("BUIDLING " + AppearNumber + " -> " + appearanceNumber); appearanceType = new BuildAppearanceType(spriteFitFile); appearanceType.appearanceNum = appearanceNumber; appearanceType.appearanceClass = AppearanceClass.BUILD_APPEAR; ((BuildAppearanceType)appearanceType).InitSprites(); //---------------------------------------- // We have a new one, add it to the list. appearanceType.numUsers = 1; AppearanceTypeList.Add(appearanceNumber, appearanceType); break; case AppearanceClass.ELM_TREE: //8 break; case AppearanceClass.LINE_APPEAR: //4 break; default: break; } } return(appearanceType); }
/// <summary>Initializes a new instance of the <see cref="AppearanceEntry"/> class.</summary> /// <param name="type">The type.</param> /// <param name="id">The identifier.</param> public AppearanceEntry(AppearanceType type, uint id) { Type = type; Id = id; }
public ChestAttribute(int address, AppearanceType type = AppearanceType.Normal, params int[] additionalAddresses) { Addresses = additionalAddresses.Concat(new[] { address }).ToArray(); Type = type; }
public MissileInstance(uint id, AppearanceType type, UnityEngine.Vector3Int fromPosition, UnityEngine.Vector3Int toPosition) : base(id, type) { m_AnimationDelta = toPosition - fromPosition; if (m_AnimationDelta.x == 0) { if (m_AnimationDelta.y <= 0) { AnimationDirection = 0; } else { AnimationDirection = 4; } } else if (m_AnimationDelta.x > 0) { if (256 * m_AnimationDelta.y > 618 * m_AnimationDelta.x) { AnimationDirection = 4; } else if (256 * m_AnimationDelta.y > 106 * m_AnimationDelta.x) { AnimationDirection = 3; } else if (256 * m_AnimationDelta.y > -106 * m_AnimationDelta.x) { AnimationDirection = 2; } else if (256 * m_AnimationDelta.y > -618 * m_AnimationDelta.x) { AnimationDirection = 1; } else { AnimationDirection = 0; } } else if (-256 * m_AnimationDelta.y < 618 * m_AnimationDelta.x) { AnimationDirection = 4; } else if (-256 * m_AnimationDelta.y < 106 * m_AnimationDelta.x) { AnimationDirection = 5; } else if (-256 * m_AnimationDelta.y < -106 * m_AnimationDelta.x) { AnimationDirection = 6; } else if (-256 * m_AnimationDelta.y < -618 * m_AnimationDelta.x) { AnimationDirection = 7; } else { AnimationDirection = 0; } switch (AnimationDirection) { case 0: m_PatternX = 1; m_PatternY = 0; break; case 1: m_PatternX = 2; m_PatternY = 0; break; case 2: m_PatternX = 2; m_PatternY = 1; break; case 3: m_PatternX = 2; m_PatternY = 2; break; case 4: m_PatternX = 1; m_PatternY = 2; break; case 5: m_PatternX = 0; m_PatternY = 2; break; case 6: m_PatternX = 0; m_PatternY = 1; break; case 7: m_PatternX = 0; m_PatternY = 0; break; } double animationMagnitude = System.Math.Sqrt(m_AnimationDelta.x * m_AnimationDelta.x + m_AnimationDelta.y * m_AnimationDelta.y); double loc6 = System.Math.Sqrt(animationMagnitude) * 150; m_AnimationDelta.x = m_AnimationDelta.x * -Constants.FieldSize; m_AnimationDelta.y = m_AnimationDelta.y * -Constants.FieldSize; m_AnimationDelta.z = 0; m_AnimationSpeed = new UnityEngine.Vector3Int(m_AnimationDelta.x, m_AnimationDelta.y, (int)loc6); m_AnimationEnd = OpenTibiaUnity.TicksMillis + (int)loc6; m_Target = toPosition; m_Position = fromPosition; }
private void SavePDF_Click(object sender, EventArgs e) { string pdfName; PageSize pageSize = new PageSize(567f, 567f); pdfName = textBoxPDFName.Text; if (!(textBoxPDFName.Text.EndsWith(".pdf"))) { pdfName += ".pdf"; } AppearanceType appearanceType = AppearanceType.Portrait; string exportFile = Path.Combine(textBoxOutputPath.Text, pdfName); Format format = formats.ElementAt(0); switch (comboBoxPages.Text) { case "3": imgNumber = 3; break; case "4": imgNumber = 4; break; case "6": imgNumber = 6; break; } switch (comboBoxAppearance.Text) { case "Portrait": appearanceType = AppearanceType.Portrait; break; case "Landscape": appearanceType = AppearanceType.Landscape; break; case "Magic Appearance": appearanceType = AppearanceType.Magic; break; } switch (comboBoxFormat.Text) { case "20x20 (cm)": pageSize = new PageSize(583.999f, 583.999f); format = formats.ElementAt(0); appearance = new Appearance(appearanceType, formats.ElementAt(0), imgNumber); break; case "21x30 (cm)": pageSize = new PageSize(611.999f, 867.666f); format = formats.ElementAt(1); appearance = new Appearance(appearanceType, formats.ElementAt(1), imgNumber); break; case "21x15 (cm)": pageSize = new PageSize(611.999f, 441.999f); format = formats.ElementAt(2); appearance = new Appearance(appearanceType, formats.ElementAt(2), imgNumber); break; } if (checkBoxAppearance.Checked) { PDFMaker.createDocument(listImages, appearance, pageSize, exportFile, format); } else { PDFMaker.createDocument(listImages, appearance, pageSize, exportFile, format, true); } List <ImageSelection> imagesToDelete = new List <ImageSelection>(); foreach (ImageSelection garbage in listBoxImageFile.Items) { imagesToDelete.Add(garbage); } foreach (ImageSelection imageToDelete in imagesToDelete) { listBoxImageFile.Items.Remove(imageToDelete); foreach (ImageSelection image in listImages) { if (image.ToString() == imageToDelete.ToString()) { listImages.Remove(image); break; } } } labelNrImages.Text = "Images : " + listImages.Count; labelFullPages.Text = "Full Pages : " + (listImages.Count / imgNumber).ToString(); PDFMaker.setOrientation = false; }
public static Appearance GetAppearanceObject(this Outfit outfit, AppearanceType type) { return(SimCatalog.GetAppearance(outfit.GetAppearance(type))); }
public ObjectAppearance(AppearanceType tree = null, MCGameObject obj = null) : base(tree, obj) { }
/// <summary> /// Sets the creature's appearance type to the value specified (uses the APPEARANCE_TYPE_XXX constants) /// </summary> public static void SetCreatureAppearanceType(uint oCreature, AppearanceType nAppearanceType) { Internal.NativeFunctions.StackPushInteger(nAppearanceType.InternalValue); Internal.NativeFunctions.StackPushObject(oCreature); Internal.NativeFunctions.CallBuiltIn(765); }
public PersonSelectionEdit() { /** * Data */ MaleHeads = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_male_heads)); MaleOutfits = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_male)); FemaleHeads = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_female_heads)); FemaleOutfits = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_female)); /** * UI */ UIScript ui = null; if (GlobalSettings.Default.ScaleUI) { ui = this.RenderScript("personselectionedit.uis"); this.Scale800x600 = true; } else { ui = this.RenderScript("personselectionedit" + (ScreenWidth == 1024 ? "1024" : "") + ".uis"); } m_ExitButton = (UIButton)ui["ExitButton"]; m_ExitButton.OnButtonClick += new ButtonClickDelegate(m_ExitButton_OnButtonClick); CancelButton = (UIButton)ui["CancelButton"]; CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick); CancelButton.Disabled = true; DescriptionTextEdit.CurrentText = ui.GetString("DefaultAvatarDescription"); DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1); DescriptionTextEdit.AttachSlider(DescriptionSlider); NameTextEdit.OnChange += new ChangeDelegate(NameTextEdit_OnChange); NameTextEdit.CurrentText = GlobalSettings.Default.LastUser; AcceptButton.Disabled = NameTextEdit.CurrentText.Length == 0; AcceptButton.OnButtonClick += new ButtonClickDelegate(AcceptButton_OnButtonClick); /** Appearance **/ SkinLightButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick); SkinMediumButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick); SkinDarkButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick); SelectedAppearanceButton = SkinLightButton; m_HeadSkinBrowser = ui.Create<UICollectionViewer>("HeadSkinBrowser"); m_HeadSkinBrowser.OnChange += new ChangeDelegate(HeadSkinBrowser_OnChange); m_HeadSkinBrowser.Init(); this.Add(m_HeadSkinBrowser); m_BodySkinBrowser = ui.Create<UICollectionViewer>("BodySkinBrowser"); m_BodySkinBrowser.OnChange += new ChangeDelegate(BodySkinBrowser_OnChange); m_BodySkinBrowser.Init(); this.Add(m_BodySkinBrowser); FemaleButton.OnButtonClick += new ButtonClickDelegate(GenderButton_OnButtonClick); MaleButton.OnButtonClick += new ButtonClickDelegate(GenderButton_OnButtonClick); /** Backgrounds **/ var bg = new UIImage(BackgroundImage); this.AddAt(0, bg); var offset = new Vector2(0, 0); if (BackgroundImageDialog != null) { offset = new Vector2(112, 84); this.AddAt(1, new UIImage(BackgroundImageDialog) { X = 112, Y = 84 }); } /** * Music */ PlayBackgroundMusic( new string[] { GlobalSettings.Default.StartupPath + "\\music\\modes\\create\\tsocas1_v2.mp3" } ); SimBox = new UISim(Guid.NewGuid().ToString()); if (GlobalSettings.Default.ScaleUI) { SimBox.SimScale = 0.8f; SimBox.Position = new Microsoft.Xna.Framework.Vector2(offset.X + 140, offset.Y + 130); } else { SimBox.SimScale = 0.5f; SimBox.Position = new Microsoft.Xna.Framework.Vector2(offset.X + 140, offset.Y + 260); } SimBox.AutoRotate = true; this.Add(SimBox); /** * Init state */ if (GlobalSettings.Default.DebugGender) { Gender = Gender.Male; MaleButton.Selected = true; FemaleButton.Selected = false; } else { Gender = Gender.Female; MaleButton.Selected = false; FemaleButton.Selected = true; } AppearanceType = (AppearanceType)GlobalSettings.Default.DebugSkin; SkinLightButton.Selected = false; SkinMediumButton.Selected = false; SkinDarkButton.Selected = false; switch (AppearanceType) { case AppearanceType.Light: SkinLightButton.Selected = true; break; case AppearanceType.Medium: SkinMediumButton.Selected = true; break; case AppearanceType.Dark: SkinDarkButton.Selected = true; break; } RefreshCollections(); SearchCollectionForInitID(GlobalSettings.Default.DebugHead, GlobalSettings.Default.DebugBody); NetworkFacade.Controller.OnCharacterCreationProgress += new OnCharacterCreationProgressDelegate(Controller_OnCharacterCreationStatus); }
public void SetAvatarBodyStrings(STR data, VMContext context) { if (data == null) return; try { var body = data.GetString(1); var randBody = data.GetString(9); if (randBody != "") { var bodySpl = randBody.Split(';'); BodyOutfit = Convert.ToUInt64(bodySpl[context.NextRandom((ulong)bodySpl.Length)], 16); } else if (body != "") { BodyOutfit = Convert.ToUInt64(body, 16); } var head = data.GetString(2); var randHead = data.GetString(10); if (randHead != "") { var headSpl = randHead.Split(';'); HeadOutfit = Convert.ToUInt64(headSpl[context.NextRandom((ulong)headSpl.Length)], 16); } else if (head != "") { HeadOutfit = Convert.ToUInt64(head, 16); } } catch { //head or body invalid, resort to default. } var gender = data.GetString(12); var genVar = (int)VMPersonDataVariable.Gender; if (gender.Equals("male", StringComparison.InvariantCultureIgnoreCase)) PersonData[genVar] = 0; else if (gender.Equals("female", StringComparison.InvariantCultureIgnoreCase)) PersonData[genVar] = 1; else if (gender.Equals("dogmale", StringComparison.InvariantCultureIgnoreCase)) PersonData[genVar] = 8; else if (gender.Equals("dogfemale", StringComparison.InvariantCultureIgnoreCase)) PersonData[genVar] = 9; else if (gender.Equals("catmale", StringComparison.InvariantCultureIgnoreCase)) PersonData[genVar] = 16; else if (gender.Equals("catfemale", StringComparison.InvariantCultureIgnoreCase)) PersonData[genVar] = 17; var names = data.GetString(11); if (names != "") { var nameSpl = names.Split(';'); Name = nameSpl[context.NextRandom((ulong)nameSpl.Length)]; } PersonData[(int)VMPersonDataVariable.PersonsAge] = Convert.ToInt16(data.GetString(13)); var skinTone = data.GetString(14); if (skinTone.Equals("lgt", StringComparison.InvariantCultureIgnoreCase)) SkinTone = AppearanceType.Light; else if (skinTone.Equals("med", StringComparison.InvariantCultureIgnoreCase)) SkinTone = AppearanceType.Medium; else if (skinTone.Equals("drk", StringComparison.InvariantCultureIgnoreCase)) SkinTone = AppearanceType.Dark; }
public EffectInstance(uint id, AppearanceType type) : base(id, type) { Phase = AppearanceAnimator.PhaseAsynchronous; }
public static void LoadSim3D(Sim sim, Outfit OutfHead, AppearanceType skin) { var Apr = new Appearance(ContentManager.GetResourceFromLongID(OutfHead.GetAppearance(skin))); var Bnd = new Binding(ContentManager.GetResourceFromLongID(Apr.BindingIDs[0])); sim.HeadTexture = GetOutfitTexture(Bnd.TextureAssetID); sim.HeadMesh = GetOutfitMesh(sim.SimSkeleton, Bnd.MeshAssetID); }
public override void Deserialize(BinaryReader reader) { base.Deserialize(reader); var anims = reader.ReadInt32(); Animations = new VMAnimationStateMarshal[anims]; for (int i = 0; i < anims; i++) { Animations[i] = new VMAnimationStateMarshal(reader); } var carry = reader.ReadBoolean(); if (carry) { CarryAnimationState = new VMAnimationStateMarshal(reader); } Message = reader.ReadString(); MessageTimeout = reader.ReadInt32(); var motCs = reader.ReadInt32(); MotiveChanges = new VMMotiveChange[motCs]; for (int i = 0; i < motCs; i++) { MotiveChanges[i] = new VMMotiveChange(); MotiveChanges[i].Deserialize(reader); } MotiveDecay = new VMAvatarMotiveDecay(); MotiveDecay.Deserialize(reader); var pdats = reader.ReadInt32(); PersonData = new short[Math.Max(101, pdats)]; for (int i = 0; i < pdats; i++) { PersonData[i] = reader.ReadInt16(); } var mdats = reader.ReadInt32(); MotiveData = new short[mdats]; for (int i = 0; i < mdats; i++) { MotiveData[i] = reader.ReadInt16(); } HandObject = reader.ReadInt16(); RadianDirection = reader.ReadSingle(); if (Version > 1) { KillTimeout = reader.ReadInt32(); } DefaultSuits = new VMAvatarDefaultSuits(reader); if (Version >= 15) { DynamicSuits = new VMAvatarDynamicSuits(reader); Decoration = new VMAvatarDecoration(reader); } else { DynamicSuits = new VMAvatarDynamicSuits(false); Decoration = new VMAvatarDecoration(); } var aprs = reader.ReadInt32(); BoundAppearances = new string[aprs]; for (int i = 0; i < aprs; i++) { BoundAppearances[i] = reader.ReadString(); } BodyOutfit = new VMOutfitReference(reader); HeadOutfit = new VMOutfitReference(reader); SkinTone = (AppearanceType)reader.ReadByte(); }
void SkinButton_OnButtonClick(UIElement button) { SelectedAppearanceButton.Selected = false; SelectedAppearanceButton = (UIButton)button; SelectedAppearanceButton.Selected = true; var type = AppearanceType.Light; if (button == SkinMediumButton) { type = AppearanceType.Medium; } else if (button == SkinDarkButton) { type = AppearanceType.Dark; } this.AppearanceType = type; RefreshCollections(); }
public Appearance(AppearanceType tree = null, MCGameObject obj = null) { type = tree; }
internal static UseActionImpl CreateUseAction(Vector3Int absolutePosition, AppearanceType appearanceType, int stackPosOrData, Vector3Int targetAbsolute, ObjectInstance targetObject, int targetStackPosOrData, UseActionTarget useTarget) { return(new UseActionImpl(absolutePosition, appearanceType, stackPosOrData, targetAbsolute, targetObject, targetStackPosOrData, useTarget)); }
public override void Deserialize(BinaryReader reader) { base.Deserialize(reader); var anims = reader.ReadInt32(); Animations = new VMAnimationStateMarshal[anims]; for (int i = 0; i < anims; i++) { Animations[i] = new VMAnimationStateMarshal(reader); } var carry = reader.ReadBoolean(); if (carry) { CarryAnimationState = new VMAnimationStateMarshal(reader); } Name = reader.ReadString(); Message = reader.ReadString(); MessageTimeout = reader.ReadInt32(); var motCs = reader.ReadInt32(); MotiveChanges = new VMMotiveChange[motCs]; for (int i = 0; i < motCs; i++) { MotiveChanges[i] = new VMMotiveChange(); MotiveChanges[i].Deserialize(reader); } var pdats = reader.ReadInt32(); PersonData = new short[pdats]; for (int i = 0; i < pdats; i++) { PersonData[i] = reader.ReadInt16(); } var mdats = reader.ReadInt32(); MotiveData = new short[mdats]; for (int i = 0; i < mdats; i++) { MotiveData[i] = reader.ReadInt16(); } HandObject = reader.ReadInt16(); RadianDirection = reader.ReadSingle(); DefaultSuits = new VMAvatarDefaultSuits(reader); var aprs = reader.ReadInt32(); BoundAppearances = new string[aprs]; for (int i = 0; i < aprs; i++) { BoundAppearances[i] = reader.ReadString(); } BodyOutfit = reader.ReadUInt64(); HeadOutfit = reader.ReadUInt64(); SkinTone = (AppearanceType)reader.ReadByte(); }
public void SetAvatarBodyStrings(STR data, VMContext context) { if (data == null) { return; } try { var body = data.GetString(1); var randBody = data.GetString(9); if (randBody != "") { var bodySpl = randBody.Split(';'); BodyOutfit = Convert.ToUInt64(bodySpl[context.NextRandom((ulong)bodySpl.Length)], 16); } else if (body != "") { BodyOutfit = Convert.ToUInt64(body, 16); } var head = data.GetString(2); var randHead = data.GetString(10); if (randHead != "") { var headSpl = randHead.Split(';'); HeadOutfit = Convert.ToUInt64(headSpl[context.NextRandom((ulong)headSpl.Length)], 16); } else if (head != "") { HeadOutfit = Convert.ToUInt64(head, 16); } } catch { //head or body invalid, resort to default. } var gender = data.GetString(12); var genVar = (int)VMPersonDataVariable.Gender; if (gender == "male") { PersonData[genVar] = 0; } else if (gender == "female") { PersonData[genVar] = 1; } else if (gender == "dogmale") { PersonData[genVar] = 8; } else if (gender == "dogfemale") { PersonData[genVar] = 9; } else if (gender == "catmale") { PersonData[genVar] = 16; } else if (gender == "catfemale") { PersonData[genVar] = 17; } var names = data.GetString(11); if (names != "") { var nameSpl = names.Split(';'); Name = nameSpl[context.NextRandom((ulong)nameSpl.Length)]; } PersonData[(int)VMPersonDataVariable.PersonsAge] = Convert.ToInt16(data.GetString(13)); var skinTone = data.GetString(14); if (skinTone == "lgt") { SkinTone = AppearanceType.Light; } else if (skinTone == "med") { SkinTone = AppearanceType.Medium; } else if (skinTone == "drk") { SkinTone = AppearanceType.Dark; } }
public static Appearance GetAppearanceObject(this Outfit outfit, AppearanceType type) { return SimCatalog.GetAppearance(outfit.GetAppearance(type)); }
public PersonSelectionEdit() : base() { /** * Data */ var content = Content.Content.Get(); MaleHeads = content.AvatarCollections.Get("ea_male_heads.col"); MaleOutfits = content.AvatarCollections.Get("ea_male.col"); FemaleHeads = content.AvatarCollections.Get("ea_female_heads.col"); FemaleOutfits = content.AvatarCollections.Get("ea_female.col"); /** * UI */ UIScript ui = this.RenderScript("personselectionedit1024.uis"); Position = new Vector2((GlobalSettings.Default.GraphicsWidth - 1024) / 2, (GlobalSettings.Default.GraphicsHeight - 768) / 2) * FSOEnvironment.DPIScaleFactor; Console.WriteLine(Position.ToString()); m_ExitButton = (UIButton)ui["ExitButton"]; m_ExitButton.OnButtonClick += new ButtonClickDelegate(m_ExitButton_OnButtonClick); CancelButton = (UIButton)ui["CancelButton"]; CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick); CancelButton.Disabled = true; DescriptionTextEdit.CurrentText = ui.GetString("DefaultAvatarDescription"); DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1); DescriptionTextEdit.AttachSlider(DescriptionSlider); NameTextEdit.OnChange += new ChangeDelegate(NameTextEdit_OnChange); NameTextEdit.CurrentText = GlobalSettings.Default.LastUser; AcceptButton.Disabled = NameTextEdit.CurrentText.Length == 0; AcceptButton.OnButtonClick += new ButtonClickDelegate(AcceptButton_OnButtonClick); /** Appearance **/ SkinLightButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick); SkinMediumButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick); SkinDarkButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick); SelectedAppearanceButton = SkinLightButton; m_HeadSkinBrowser = ui.Create <UICollectionViewer>("HeadSkinBrowser"); m_HeadSkinBrowser.OnChange += new ChangeDelegate(HeadSkinBrowser_OnChange); m_HeadSkinBrowser.Init(); this.Add(m_HeadSkinBrowser); m_BodySkinBrowser = ui.Create <UICollectionViewer>("BodySkinBrowser"); m_BodySkinBrowser.OnChange += new ChangeDelegate(BodySkinBrowser_OnChange); m_BodySkinBrowser.Init(); this.Add(m_BodySkinBrowser); FemaleButton.OnButtonClick += new ButtonClickDelegate(GenderButton_OnButtonClick); MaleButton.OnButtonClick += new ButtonClickDelegate(GenderButton_OnButtonClick); /** Backgrounds **/ var bg = new UIImage(BackgroundImage).With9Slice(128, 128, 84, 84); this.AddAt(0, bg); bg.SetSize(GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight); bg.Position = new Vector2((GlobalSettings.Default.GraphicsWidth - 1024) / -2, (GlobalSettings.Default.GraphicsHeight - 768) / -2); var offset = new Vector2(0, 0); if (BackgroundImageDialog != null) { offset = new Vector2(112, 84); this.AddAt(1, new UIImage(BackgroundImageDialog) { X = 112, Y = 84 }); } /** * Music */ HIT.HITVM.Get().PlaySoundEvent(UIMusic.CAS); /* * PlayBackgroundMusic( * new string[] { GlobalSettings.Default.StartupPath + "\\music\\modes\\create\\tsocas1_v2.mp3" } * );*/ SimBox = new UISim(Guid.NewGuid().ToString()); SimBox.SimScale = 0.5f; SimBox.Position = new Microsoft.Xna.Framework.Vector2(offset.X + 70, offset.Y + 88); SimBox.AutoRotate = true; this.Add(SimBox); /** * Init state */ if (GlobalSettings.Default.DebugGender) { Gender = Gender.Male; MaleButton.Selected = true; FemaleButton.Selected = false; } else { Gender = Gender.Female; MaleButton.Selected = false; FemaleButton.Selected = true; } AppearanceType = (AppearanceType)GlobalSettings.Default.DebugSkin; SkinLightButton.Selected = false; SkinMediumButton.Selected = false; SkinDarkButton.Selected = false; switch (AppearanceType) { case AppearanceType.Light: SkinLightButton.Selected = true; break; case AppearanceType.Medium: SkinMediumButton.Selected = true; break; case AppearanceType.Dark: SkinDarkButton.Selected = true; break; } RefreshCollections(); SearchCollectionForInitID(GlobalSettings.Default.DebugHead, GlobalSettings.Default.DebugBody); NetworkFacade.Controller.OnCharacterCreationProgress += new OnCharacterCreationProgressDelegate(Controller_OnCharacterCreationStatus); }
public PersonSelectionEdit() : base() { /** * Data */ var content = Content.Content.Get(); MaleHeads = content.AvatarCollections.Get("ea_male_heads.col"); MaleOutfits = content.AvatarCollections.Get("ea_male.col"); FemaleHeads = content.AvatarCollections.Get("ea_female_heads.col"); FemaleOutfits = content.AvatarCollections.Get("ea_female.col"); /** * UI */ UIScript ui = this.RenderScript("personselectionedit1024.uis"); Position = new Vector2((GlobalSettings.Default.GraphicsWidth-1024)/2, (GlobalSettings.Default.GraphicsHeight-768)/2) * FSOEnvironment.DPIScaleFactor; Console.WriteLine(Position.ToString()); m_ExitButton = (UIButton)ui["ExitButton"]; m_ExitButton.OnButtonClick += new ButtonClickDelegate(m_ExitButton_OnButtonClick); CancelButton = (UIButton)ui["CancelButton"]; CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick); CancelButton.Disabled = true; DescriptionTextEdit.CurrentText = ui.GetString("DefaultAvatarDescription"); DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1); DescriptionTextEdit.AttachSlider(DescriptionSlider); NameTextEdit.OnChange += new ChangeDelegate(NameTextEdit_OnChange); NameTextEdit.CurrentText = GlobalSettings.Default.LastUser; AcceptButton.Disabled = NameTextEdit.CurrentText.Length == 0; AcceptButton.OnButtonClick += new ButtonClickDelegate(AcceptButton_OnButtonClick); /** Appearance **/ SkinLightButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick); SkinMediumButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick); SkinDarkButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick); SelectedAppearanceButton = SkinLightButton; m_HeadSkinBrowser = ui.Create<UICollectionViewer>("HeadSkinBrowser"); m_HeadSkinBrowser.OnChange += new ChangeDelegate(HeadSkinBrowser_OnChange); m_HeadSkinBrowser.Init(); this.Add(m_HeadSkinBrowser); m_BodySkinBrowser = ui.Create<UICollectionViewer>("BodySkinBrowser"); m_BodySkinBrowser.OnChange += new ChangeDelegate(BodySkinBrowser_OnChange); m_BodySkinBrowser.Init(); this.Add(m_BodySkinBrowser); FemaleButton.OnButtonClick += new ButtonClickDelegate(GenderButton_OnButtonClick); MaleButton.OnButtonClick += new ButtonClickDelegate(GenderButton_OnButtonClick); /** Backgrounds **/ var bg = new UIImage(BackgroundImage).With9Slice(128,128, 84, 84); this.AddAt(0, bg); bg.SetSize(GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight); bg.Position = new Vector2((GlobalSettings.Default.GraphicsWidth - 1024) / -2, (GlobalSettings.Default.GraphicsHeight - 768) / -2); var offset = new Vector2(0, 0); if (BackgroundImageDialog != null) { offset = new Vector2(112, 84); this.AddAt(1, new UIImage(BackgroundImageDialog) { X = 112, Y = 84 }); } /** * Music */ HIT.HITVM.Get().PlaySoundEvent(UIMusic.CAS); /* PlayBackgroundMusic( new string[] { GlobalSettings.Default.StartupPath + "\\music\\modes\\create\\tsocas1_v2.mp3" } );*/ SimBox = new UISim(Guid.NewGuid().ToString()); SimBox.SimScale = 0.5f; SimBox.Position = new Microsoft.Xna.Framework.Vector2(offset.X + 70, offset.Y + 88); SimBox.AutoRotate = true; this.Add(SimBox); /** * Init state */ if (GlobalSettings.Default.DebugGender) { Gender = Gender.Male; MaleButton.Selected = true; FemaleButton.Selected = false; } else { Gender = Gender.Female; MaleButton.Selected = false; FemaleButton.Selected = true; } AppearanceType = (AppearanceType)GlobalSettings.Default.DebugSkin; SkinLightButton.Selected = false; SkinMediumButton.Selected = false; SkinDarkButton.Selected = false; switch (AppearanceType) { case AppearanceType.Light: SkinLightButton.Selected = true; break; case AppearanceType.Medium: SkinMediumButton.Selected = true; break; case AppearanceType.Dark: SkinDarkButton.Selected = true; break; } RefreshCollections(); SearchCollectionForInitID(GlobalSettings.Default.DebugHead, GlobalSettings.Default.DebugBody); NetworkFacade.Controller.OnCharacterCreationProgress += new OnCharacterCreationProgressDelegate(Controller_OnCharacterCreationStatus); }