public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview) { AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal); switch (rbview.name) { case "Hair": this.bodyType = BodyTypeEnum.Hair; listSelectData = CharacterBodyHandler.Instance.manager.GetAllHair(); break; case "Eye": this.bodyType = BodyTypeEnum.Eye; listSelectData = CharacterBodyHandler.Instance.manager.GetAllEye(); break; case "Mouth": this.bodyType = BodyTypeEnum.Mouth; listSelectData = CharacterBodyHandler.Instance.manager.GetAllMouth(); break; case "Skin": this.bodyType = BodyTypeEnum.Skin; listSelectData.Clear(); listSelectData.Add("Def"); listSelectData.AddRange(CharacterBodyHandler.Instance.manager.GetAllTrunk()); break; } gridVertical.SetCellCount(listSelectData.Count); gridVertical.RefreshAllCells(); }
/** * <summary> * Package protected member to read the mesage from a DataOutput stream. * </summary> * * <param name="input"> The stream from which the data is to be read</param> * <param name="retrievebody"> A flag indicating the body of the message should * be retrieved.</param> * * * <exception cref="Exception"> In the case that the stream experiences an error * while reading data.</exception> */ internal void Read(BinaryReader input, bool retrievebody) { // Make sure that if this object is being reused we don't over write the UUID (messageID = new UUID()).Read(input); messageClass = (MessageClassEnum)input.ReadByte(); messagePriority = (MessagePriorityEnum)input.ReadByte(); byte[] tmp = input.ReadBytes(Safmq.MSGLBL_LENGTH); label = new string(Encoding.UTF8.GetChars(tmp, 0, ioutil.length(tmp))); timeStamp = input.ReadInt32(); timeToLiveSeconds = input.ReadInt32(); ttlErrorWanted = input.ReadByte(); tmp = input.ReadBytes(Safmq.QNAME_LENGTH); this.responseQueueName = new string(Encoding.UTF8.GetChars(tmp, 0, ioutil.length(tmp))); // Make sure that if this object is being reused we don't over write the UUID (reciptID = new UUID()).Read(input); bodyType = (BodyTypeEnum)input.ReadByte(); bodySize = input.ReadInt32(); if (bodySize > 0) { body = new MemoryStream(input.ReadBytes(bodySize)); } }
public void SetCharacterData(BodyTypeEnum bodyType, string bodyData, Color color) { switch (bodyType) { case BodyTypeEnum.Hair: SetHair(bodyData, color); break; case BodyTypeEnum.Eye: SetEye(bodyData, color); break; case BodyTypeEnum.Mouth: SetMouth(bodyData, color); break; case BodyTypeEnum.Skin: SetSkin(color); int sex = 1; if (characterBodyData != null) { sex = characterBodyData.sex; } SetSex(sex, bodyData); break; } }
// -------------------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------------------- /// <summary> /// Change the body type to the given value /// </summary> /// <param name="newBodyType">all BodyTypeEnum values are valid</param> /// <returns>true if successful, false otherwise</returns> public bool ChangeBodyType(BodyTypeEnum newBodyType) { if (newBodyType == _bodyType) { WfLogger.Log(this, LogLevel.INFO, "Didn't change body type, because it already was " + this._bodyType); return(false); } _bodyType = newBodyType; WfLogger.Log(this, LogLevel.DEBUG, "Changed body type to " + this._bodyType); return(true); }
public void SetData(BodyTypeEnum type, string data, bool isLock) { this.type = type; this.data = data; if (isLock) { objLock.SetActive(true); objUnlock.SetActive(false); } else { objLock.SetActive(false); objUnlock.SetActive(true); } Sprite spIcon = null; priceL = 0; priceM = 0; priceS = 0; switch (type) { case BodyTypeEnum.Hair: priceM = 1; spIcon = CharacterBodyHandler.Instance.manager.GetHairSpriteByName(data); break; case BodyTypeEnum.Eye: priceL = 10; spIcon = CharacterBodyHandler.Instance.manager.GetEyeSpriteByName(data); break; case BodyTypeEnum.Mouth: priceM = 10; spIcon = CharacterBodyHandler.Instance.manager.GetMouthSpriteByName(data); break; case BodyTypeEnum.Skin: priceL = 100; if (data.Equals("Def")) { spIcon = CharacterBodyHandler.Instance.manager.GetTrunkSpriteByName("character_body_man"); } else { spIcon = CharacterBodyHandler.Instance.manager.GetTrunkSpriteByName(data + "_1"); } break; } SetIcon(spIcon); SetPrice(priceL, priceM, priceS); }
public CharacterAppearance(BodyHeightEnum _bodyHeight, BodyTypeEnum _bodyType, string _bodyTypeDescription, Skin _skin, Hair _hair, ColorEnum _eyeColor, string _eyeDescription, uint _ageInYears, Dictionary <BodyPartEnum, AppearanceFeatureEnum> _bodyPartFeatures, string _appearanceDescription) { this._bodyHeight = _bodyHeight; this._bodyType = _bodyType; this._skin = (_skin == null) ? new Skin(SkinColorTypeEnum.SINGLE_COLOR, SkinTypeEnum.SKIN, ColorEnum.MEDIUM_FLESH, ColorEnum.MEDIUM_FLESH, "") : _skin; this._hair = (_hair == null) ? new Hair(HairStyleEnum.BALD, HairLengthEnum.NONE, ColorEnum.BROWN, null) : _hair; this._eyeColor = _eyeColor; this._ageInYears = _ageInYears; this._bodyTypeDescription = (_bodyTypeDescription == null) ? "" : _bodyTypeDescription; this._eyeDescription = (_eyeDescription == null) ? "" : _eyeDescription; this._appearanceDescription = (_appearanceDescription == null) ? "" : _appearanceDescription; this._bodyPartFeatures = (_bodyPartFeatures == null) ? new Dictionary <BodyPartEnum, AppearanceFeatureEnum>() : _bodyPartFeatures; WfLogger.Log(this, LogLevel.DETAILED, "Created new Character Appearance with all members"); }
public void SelectItem(BodyTypeEnum type, string data, long priceL, long priceM, long priceS) { switch (type) { case BodyTypeEnum.Hair: selectHair = data; break; case BodyTypeEnum.Eye: selectEye = data; break; case BodyTypeEnum.Mouth: selectMouth = data; break; case BodyTypeEnum.Skin: selectSkin = data; break; } RefreshUI(); }
/** * <summary> * Package protected member to read the mesage from a DataOutput stream. * </summary> * * <param name="input"> The stream from which the data is to be read</param> * <param name="retrievebody"> A flag indicating the body of the message should * be retrieved.</param> * * * <exception cref="Exception"> In the case that the stream experiences an error * while reading data.</exception> */ internal void Read(BinaryReader input, bool retrievebody) { // Make sure that if this object is being reused we don't over write the UUID (messageID = new UUID()).Read(input); messageClass = (MessageClassEnum)input.ReadByte(); messagePriority = (MessagePriorityEnum)input.ReadByte(); byte[] tmp = input.ReadBytes(Safmq.MSGLBL_LENGTH); label = new string(Encoding.UTF8.GetChars(tmp, 0, ioutil.length(tmp))); timeStamp = input.ReadInt32(); timeToLiveSeconds = input.ReadInt32(); ttlErrorWanted = input.ReadByte(); tmp = input.ReadBytes(Safmq.QNAME_LENGTH); this.responseQueueName = new string(Encoding.UTF8.GetChars(tmp, 0, ioutil.length(tmp))); // Make sure that if this object is being reused we don't over write the UUID (reciptID = new UUID()).Read(input); bodyType = (BodyTypeEnum)input.ReadByte(); bodySize = input.ReadInt32(); if (bodySize > 0) body = new MemoryStream(input.ReadBytes(bodySize)); }