Esempio n. 1
0
        public async Task <IActionResult> PutBodyTypes([FromRoute] int id, [FromBody] BodyTypes bodyTypes)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != bodyTypes.Id)
            {
                return(BadRequest());
            }

            _context.Entry(bodyTypes).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BodyTypesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 2
0
        protected static List <CASParts.Wrapper> GetVisibleCASParts(CASLogic ths, BodyTypes bodyType, uint categories)
        {
            uint alteredCategories = categories;

            ths.AdjustAvailableCategoriesForCASMode(ref alteredCategories);

            SimBuilder builder = ths.mBuilder;

            CASAgeGenderFlags age     = builder.Age;
            CASAgeGenderFlags gender  = builder.Gender;
            CASAgeGenderFlags species = builder.Species;

            List <CASParts.Wrapper> list = new List <CASParts.Wrapper>();

            foreach (CASParts.Wrapper part in CASBase.HairParts)
            {
                InvalidPartBase.Reason reason = InvalidPartBooter.Allow(part, age, gender, species, false, (OutfitCategories)categories);
                if (reason != InvalidPartBase.Reason.None)
                {
                    continue;
                }

                if ((part.mPart.BodyType == bodyType) && OutfitUtils.PartMatchesSim(builder, alteredCategories, part.mPart))
                {
                    list.Add(part);
                }
            }
            return(list);
        }
Esempio n. 3
0
            public static bool GetItemEnum(AvatarCustomizationCategory type, BodyTypes currentBodyType, ref IEnumerable<CustomizationItemDefinition> __result)
            {
                List<CharacterBodyDefinition> bodiesList = Traverse.CreateWithType("CharacterManager").Field("bodiesList").GetValue<List<CharacterBodyDefinition>>();
                foreach (CharacterBodyDefinition item in bodiesList)
                {
                    item.BodyType = currentBodyType;
                }

                List<CharacterHeadDefinition> headsList = Traverse.CreateWithType("CharacterManager").Field("headsList").GetValue<List<CharacterHeadDefinition>>();
                foreach (CharacterHeadDefinition item in headsList)
                {
                    item.BodyType = currentBodyType;
                }

                List<CharacterHairDefinition> hairList = Traverse.CreateWithType("CharacterManager").Field("hairList").GetValue<List<CharacterHairDefinition>>();
                foreach (CharacterHairDefinition item in hairList)
                {
                    item.BodyType = currentBodyType;
                }

                List<CharacterHeadDecoDefinition> glassesList = Traverse.CreateWithType("CharacterManager").Field("glassesList").GetValue<List<CharacterHeadDecoDefinition>>();
                foreach (CharacterHeadDecoDefinition item in glassesList)
                {
                    item.BodyType = currentBodyType;
                }

                return true;
            }
Esempio n. 4
0
 private static async Task InsertTestData(IServiceProvider serviceProvider)
 {
     await AddOrUpdateAsync(serviceProvider, g => g.MakeId, Makes.Select(m => m.Value));
     await AddOrUpdateAsync(serviceProvider, g => g.ModelId, Models.Select(m => m.Value));
     await AddOrUpdateAsync(serviceProvider, g => g.BodyTypeId, BodyTypes.Select(m => m.Value));
     await AddOrUpdateAsync(serviceProvider, g => g.CarId, Cars.Select(m => m.Value));
     await AddOrUpdateAsync(serviceProvider, g => g.OrderId, Orders);
 }
Esempio n. 5
0
 public BodyBasic(double weight, double width, double height, double depth, string color, BodyTypes type)
 {
     Weight   = weight;
     Width    = width;
     Height   = height;
     Depth    = depth;
     Color    = color;
     BodyType = type;
 }
Esempio n. 6
0
 public Person()
 {
     Name        = "Name";
     Surname     = "Surname";
     DateOfBirth = DateTime.Today;
     Height      = 1;
     Weight      = 1;
     BodyType    = BodyTypes.ECTOMORPH;
 }
Esempio n. 7
0
 public Person(string name, string surname, DateTime dateOfBirth, ushort height, double weight, BodyTypes bodyType)
 {
     this.Name        = name;
     this.Surname     = surname;
     this.DateOfBirth = dateOfBirth;
     this.Height      = height;
     this.Weight      = weight;
     this.BodyType    = bodyType;
 }
 public void SetBodyTypes(List <KVPBase> data)
 {
     data = data.OrderBy(p => p.Name).ToList();
     BodyTypes.Clear();
     foreach (var item in data)
     {
         BodyTypes.Add(item);
     }
 }
Esempio n. 9
0
        private static void PopulatePartsGrid(CASMakeup ths, BodyTypes category)
        {
            if (category != BodyTypes.CostumeMakeup)
            {
                ItemGrid mGridMakeupParts = ths.mGridMakeupParts;
                mGridMakeupParts.Clear();
                CASPart       wornPart     = ths.GetWornPart(category);
                List <object> visibleParts = ths.GetVisibleParts(category);
                ResourceKey   layoutKey    = ResourceKey.CreateUILayoutKey("GenericCasItem", 0x0);
                foreach (object obj2 in visibleParts)
                {
                    CASPart part = (CASPart)obj2;
                    ths.AddPartsGridItem(mGridMakeupParts, layoutKey, part);
                    if (part.Key == wornPart.Key)
                    {
                        mGridMakeupParts.SelectedItem = mGridMakeupParts.Count - 0x1;
                    }
                }
                ths.mButtonColor.Enabled  = (mGridMakeupParts.SelectedItem != -1) && (mGridMakeupParts.SelectedItem != 0x0);
                ths.mButtonDelete.Enabled = ths.mButtonColor.Enabled;
            }
            else
            {
                ItemGrid mGridCostumeParts = ths.mGridCostumeParts;
                mGridCostumeParts.Clear();
                ths.mCurrentPreset     = null;
                ths.mCurrentFocusedRow = null;
                ths.mTempFocusedRow    = null;
                List <object> objectList = ths.GetVisibleParts(category);
                bool          shouldEnableCatalogProductFilter = false;
                CASPart       objectToNotRemove = ths.GetWornPart(category);
                ths.mContentTypeFilter.FilterObjects(objectList, out shouldEnableCatalogProductFilter, objectToNotRemove);
                ths.mButtonCostumeFilter.Enabled = false;
                ths.mButtonCostumeFilter.Tag     = shouldEnableCatalogProductFilter;
                foreach (CASPart part4 in objectList)
                {
                    if (!(part4.Key == ths.kInvalidCASPart.Key))
                    {
                        CASClothingRow row = UIManager.LoadLayout(ResourceKey.CreateUILayoutKey("CASClothingRow", 0x0)).GetWindowByExportID(0x1) as CASClothingRow;
                        row.CASPart       = part4;
                        row.RowController = ths;
                        if (row.CreateGridItems(true).Count > 0x0)
                        {
                            mGridCostumeParts.AddItem(new ItemGridCellItem(row, null));
                            if (row.SelectedItem != -1)
                            {
                                ths.mCurrentPreset = row.Selection as CASPartPreset;
                            }
                        }

                        CASClothingRowEx.Create(row, MasterController.Settings.mAllowMultipleMakeup);
                    }
                }
                ths.mContentTypeFilter.UpdateFilterButtonState();
            }
        }
Esempio n. 10
0
 public void SetPreset(BodyTypes type, string preset)
 {
     foreach (SavedPart part in mParts)
     {
         if (part.mPart.BodyType == type)
         {
             part.mPreset = preset;
         }
     }
 }
Esempio n. 11
0
 internal void Update(IServiseRepository storage)
 {
     ClearLists();
     Marks.AddRange(storage.Marks);
     Models.AddRange(storage.Models);
     BodyTypes.AddRange(storage.BodyTypes);
     EngineTypes.AddRange(storage.EngineTypes);
     EngineVolumes.AddRange(storage.EngineVolumes);
     TransTypes.AddRange(storage.TransTypes);
 }
Esempio n. 12
0
 public void SetBodyTypes(List <KVPBase> data)
 {
     data = data.OrderBy(p => p.Name).ToList();
     BodyTypes.Clear();
     data.ForEach(o => BodyTypes.Add(o));
     if (LoadBodiesComplete != null)
     {
         LoadBodiesComplete(this, new EventArgs());
     }
 }
Esempio n. 13
0
        //public Car(string numberPlate, string model, BodyTypes bodyType, Size size, string colour, string mileage, string accidentHistory, Transmissiontype transmissiontype, string price, string dateArrival) //дописать !!completed!!
        //{
        //    this.numberPlate = numberPlate;
        //    this.Model = model;
        //    this.bodyType = bodyType;
        //    this.size = size;
        //    this.colour = colour;
        //    this.mileage = mileage;
        //    this.accidentHistory = accidentHistory;
        //    this.transmissionType = transmissiontype;
        //    this.price = price;
        //    this.dateArrival = ToDate(dateArrival);//вызво метода преобразвоания
        //}

        // 3 v
        public Car(string numberPlate, string model, BodyTypes bodyType, string colour, string mileage, string accidentHistory, Transmissiontype transmissiontype, string price) //дописать !!completed!!
        {
            this.numberPlate      = numberPlate;
            this.Model            = model;
            this.bodyType         = bodyType;
            this.colour           = colour;
            this.mileage          = mileage;
            this.accidentHistory  = accidentHistory;
            this.transmissionType = transmissiontype;
            this.price            = price;
        }
Esempio n. 14
0
        public SmallEditor()
        {
            InitializeComponent();

            DBBodyTypes     = new BodyTypes();
            DBClasses       = new Classes();
            DBColors        = new Colors();
            DBGearTypes     = new GearTypes();
            DBLanguages     = new Languages();
            DBManafacturers = new Manafacturers();
            DBWorkplaces    = new Workplaces();
        }
Esempio n. 15
0
 public Car(string numberPlate, string model, BodyTypes bodyType, string colour, string mileage, string accidentHistory, Transmissiontype transmissiontype, string price, string dateArrival) //дописать !!completed!!
 {
     this.numberPlate      = numberPlate;
     this.Model            = model;
     this.bodyType         = bodyType;
     this.colour           = colour;
     this.mileage          = mileage;
     this.accidentHistory  = accidentHistory;
     this.transmissionType = transmissiontype;
     this.price            = price;
     this.dateArrival      = ToDate(dateArrival);//вызво метода преобразвоания
 }
Esempio n. 16
0
        private void Start()
        {
            this.Body = gameObject.GetComponent <CelestialBody>();

            ScaledBody = this.Body.scaledBody;

            GameObject stb = this.ScaledTiltedBody = new GameObject(this.Body.name + " Tilted");

            stb.transform.parent = this.Body.scaledBody.transform.parent;

            if (this.Type != BodyTypes.Star)
            {
                Collider baseCollider = ScaledBody.GetComponent <Collider>();

                SunBlocker = stb.AddComponent <SphereCollider>();
                SunBlocker.sharedMaterial = baseCollider.sharedMaterial;
                SunBlocker.radius         = 1000.0F;

                Destroy(baseCollider);
            }

            stb.transform.localScale = ScaledBody.transform.localScale;
            stb.layer = GameLayers.SCALED_SPACE;

            if (this.Body.pqsController)
            {
                Type = BodyTypes.Rocky;
            }
            else
            {
                if (this.Body.scaledBody.GetComponent <StarComponent>())
                {
                    Type = BodyTypes.Star;
                }

                else
                {
                    Type = BodyTypes.Gas;
                }
            }

            // TODO: rocky bodies. haha.

            /*if(this.Type == BodyTypes.Rocky)
             * {
             *  Destroy(sb);
             *  Destroy(this);
             * }*/

            DontDestroyOnLoad(stb);

            TiltManager.Bodies.Add(this);
        }
Esempio n. 17
0
        public async Task <IActionResult> PostBodyTypes([FromBody] BodyTypes bodyTypes)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.bodyTypes.Add(bodyTypes);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetBodyTypes", new { id = bodyTypes.Id }, bodyTypes));
        }
Esempio n. 18
0
            public static bool GetPartPreset(BodyTypes type, SimOutfit sourceOutfit, ref PartPreset result)
            {
                foreach (CASPart part in sourceOutfit.Parts)
                {
                    if (part.BodyType != type)
                    {
                        continue;
                    }

                    result = new PartPreset(part, sourceOutfit.GetPartPreset(part.Key));
                    return(true);
                }

                return(false);
            }
Esempio n. 19
0
 protected Animal(
     int legs,
     DermisProtrusions dermisProtrusion,
     IncubationTypes incubationType,
     Habitats habitat,
     BodyTypes bodyType,
     params Colors[] colors
     )
 {
     Legs             = legs;
     DermisProtrusion = dermisProtrusion;
     IncubationType   = incubationType;
     Habitat          = habitat;
     Colors           = colors;
 }
Esempio n. 20
0
 public Car() //дописать, !!дописано наверно!!
 {
     this.numberPlate      = "";
     this.colour           = "";
     this.mileage          = "";
     this.accidentHistory  = "";
     this.price            = "";
     this.size             = Size.large;
     this.numDoors         = NumDoors.two;
     this.numSeats         = NumSeats.two;
     this.bodyType         = BodyTypes.Saloon;
     this.accessability    = Accessability.sold;
     this.transmissionType = Transmissiontype.manual;
     this.dateArrival      = DateTime.Today;
     this.dateSell         = new DateTime(); //вернет 01 01 01
 }
Esempio n. 21
0
        private static void SetCategory(BodyTypes category)
        {
            CASMakeup ths = CASMakeup.gSingleton;

            ths.mWindowCostume.Visible = false;
            ths.mWindowMakeup.Visible  = false;
            CASFacialDetails gSingleton = CASFacialDetails.gSingleton;

            switch (category)
            {
            case BodyTypes.FirstFace:
            case BodyTypes.EyeShadow:
            case BodyTypes.EyeLiner:
            case BodyTypes.Blush:
                ths.mWindowMakeup.Visible = true;
                gSingleton.SetLongPanel(true);
                ths.Tick -= ths.OnTick;
                ths.mButtonCostumeFilter.Selected = false;
                ths.mContentTypeFilter.Visible    = false;
                break;

            case BodyTypes.CostumeMakeup:
                ths.mWindowCostume.Visible = true;
                gSingleton.SetLongPanel(false);
                gSingleton.SetShortPanelHeight((float)570f);
                if (!(ths.GetWornPart(category).Key != ths.kInvalidCASPart.Key))
                {
                    ths.mButtonDesignCostume.Enabled = false;
                    break;
                }
                ths.mButtonDesignCostume.Enabled = true;

                ths.UpdateCostumePresetState();
                ths.Tick -= ths.OnTick;
                ths.Tick += ths.OnTick;

                break;

            default:
                break;
            }

            CASMakeup.sCategory = category;
            ths.HideUnusedIcons();
            PopulatePartsGrid(ths, CASMakeup.sCategory);
            ths.PopulatePresetsGrid(CASMakeup.sCategory, ths.GetWornPart(CASMakeup.sCategory), ths.mButtonFilter.Selected);
        }
Esempio n. 22
0
        protected List <CASParts.Wrapper> SubGetVisibleCASParts(BodyTypes bodyType, uint categories)
        {
            CASLogic logic = mCASModel as CASLogic;

            logic.AdjustAvailableCategoriesForCASMode(ref categories);

            List <CASParts.Wrapper> results = new List <CASParts.Wrapper>();

            foreach (CASParts.Wrapper part in CASBase.sUnboxedParts)
            {
                if ((part.mPart.BodyType == bodyType) && OutfitUtils.PartMatchesSim(logic.mBuilder, categories, part.mPart))
                {
                    results.Add(part);
                }
            }
            return(results);
        }
Esempio n. 23
0
        public ElementControlService()
        {
            DBAutomobilesData = new AutomobilesData();
            DBClients         = new Clients();
            DBOffices         = new Offices();
            DBSelledCars      = new SelledCars();
            DBWorkers         = new Workers();

            DBBodyTypes     = new BodyTypes();
            DBClasses       = new Classes();
            DBColors        = new Colors();
            DBCountries     = new Countries();
            DBGearTypes     = new GearTypes();
            DBLanguages     = new Languages();
            DBManafacturers = new Manafacturers();
            DBWorkplaces    = new Workplaces();
        }
Esempio n. 24
0
        public MainForm()
        {
            InitializeComponent();

            // ConnectionWizard ConWiz = new ConnectionWizard();
            // ConWiz.StartPosition = FormStartPosition.CenterScreen;
            // ConWiz.ShowDialog();
            PageID = DatabaseControlService.LastPage;

            About = new AboutForm();

            //Editor Forms
            DBAutomobileEditor  = new AutomobilesEditor();
            DBClientEditor      = new ClientsEditor();
            DBOfficeEditor      = new OfficesEditor();
            DBOrderEditor       = new OrdersEditor();
            DBPresenceCarEditor = new PresenceCarsEditor();
            DBSellEditor        = new SellsEditor();
            DBWorkerEditor      = new WorkersEditor();

            //Tables
            DBAutomobilesData = new AutomobilesData();
            DBBodyTypes       = new BodyTypes();
            DBClients         = new Clients();
            DBColors          = new Colors();
            DBCountries       = new Countries();
            DBLanguages       = new Languages();
            DBManafacturers   = new Manafacturers();
            DBOffices         = new Offices();
            DBOrders          = new Orders();
            DBPresenceCars    = new PresenceCars();
            DBSelledCars      = new SelledCars();
            DBSells           = new Sells();
            DBWorkers         = new Workers();
            DBWorkplaces      = new Workplaces();

            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            dataGridView1.MultiSelect   = false;

            buttonInsert.Enabled = false;
            buttonUpdate.Enabled = false;
            buttonDelete.Enabled = false;

            ShowDialog();
        }
Esempio n. 25
0
        public SmallSelector()
        {
            InitializeComponent();

            DBBodyTypes     = new BodyTypes();
            DBClasses       = new Classes();
            DBColors        = new Colors();
            DBCountries     = new Countries();
            DBGearTypes     = new GearTypes();
            DBLanguages     = new Languages();
            DBManafacturers = new Manafacturers();
            DBWorkplaces    = new Workplaces();

            DBSmallEditor   = new SmallEditor();
            DBCountryEditor = new CountriesEditor();

            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            dataGridView1.MultiSelect   = false;
        }
Esempio n. 26
0
        /*
         * public void DebugLogColor()
         * {
         *  if (!Common.kDebugging) return;
         *
         *  Common.StringBuilder msg = new Common.StringBuilder(null;
         *
         *  msg += "Hair";
         *
         *  Color[] color = GetPresetColor(BodyTypes.Hair);
         *  if (color != null)
         *  {
         *      foreach (Color item in color)
         *      {
         *          msg += Common.NewLine + item;
         *      }
         *  }
         *
         *  try
         *  {
         *      throw new Exception();
         *  }
         *  catch (Exception e)
         *  {
         *      msg += Common.NewLine + e.StackTrace;
         *  }
         *
         *  Common.WriteLog(msg);
         * }
         */

        public string GetPreset(BodyTypes type)
        {
            foreach (SavedPart part in mParts)
            {
                if (part.mPart.BodyType == type)
                {
                    if (!string.IsNullOrEmpty(part.mPreset))
                    {
                        return(part.mPreset);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }

            return(null);
        }
Esempio n. 27
0
        public string FormatBodyTypeMessage(BodyTypes bodytype)
        {
            string message;

            switch (bodytype)
            {
            case BodyTypes.Flip:
                message = "This is a flip phone";
                break;

            case BodyTypes.Bar:
                message = "This is a flip phone";
                break;

            default:
                message = "Not supported type of phone body";
                break;
            }
            return(message);
        }
Esempio n. 28
0
        public static List <BodyTypes> GetBodyType(VehicleContext db)
        {
            List <BodyTypes> allBodyTypes = new List <BodyTypes>();
            BodyTypes        mySedan      = new BodyTypes();

            mySedan.BodyType    = new Sedan().BodyType;
            mySedan.VehicleType = new Sedan().VehicleType;

            BodyTypes myHatchBack = new BodyTypes();

            myHatchBack.BodyType    = new Hatchback().BodyType;
            myHatchBack.VehicleType = new Hatchback().VehicleType;

            allBodyTypes.Add(mySedan);
            allBodyTypes.Add(myHatchBack);



            return(allBodyTypes);
        }
Esempio n. 29
0
    /// <summary>
    /// Creates a body with no parent genes
    /// </summary>
    public void CreateBody()
    {
        BodyTypes bodyRand1 = (BodyTypes)Random.Range(0, 3);
        BodyTypes bodyRand2 = (BodyTypes)Random.Range(0, 3);

        switch (bodyRand1)
        {
        case BodyTypes.BROWN:
            _bodyAllele1 = new BodyBrown();
            break;

        case BodyTypes.BLACK:
            _bodyAllele1 = new BodyBlack();
            break;

        case BodyTypes.WHITE:
            _bodyAllele1 = new BodyWhite();
            break;
        }

        switch (bodyRand2)
        {
        case BodyTypes.BROWN:
            _bodyAllele2 = new BodyBrown();
            break;

        case BodyTypes.BLACK:
            _bodyAllele2 = new BodyBlack();
            break;

        case BodyTypes.WHITE:
            _bodyAllele2 = new BodyWhite();
            break;
        }

        SelectBody();
    }
    public void Init(SolarSystemBody body, BodyTypes bodyType)
    {
        Image = GetComponent <SpriteRenderer>();

        Body = body;

        BodyType = bodyType;

        switch (BodyType)
        {
        case BodyTypes.PLANET:
            Image.sprite = Assets.Sprites.Instance.SolarPlanet_8x8;
            break;

        case BodyTypes.STARGATE:
            //GetComponent<RectTransform>().sizeDelta = new Vector2(8, 8);

            Image.sprite = Assets.Sprites.Instance.SolarStargate_8x8;

            //GetComponent<RectTransform>().sizeDelta = new Vector2(Image.sprite.rect.width, Image.sprite.rect.height);

            Image.color = new Color(1, 1, 1, 1f);
            break;

        case BodyTypes.SUN:
            Image.sprite = Assets.Sprites.Instance.SolarPlanet_8x8;

            Image.color = Color.yellow;

            GenerateSolarTexture();

            break;
        }

        //transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = Body.Name;
    }
Esempio n. 31
0
        protected static List<CASParts.Wrapper> GetVisibleCASParts(CASLogic ths, BodyTypes bodyType, uint categories)
        {
            uint alteredCategories = categories;
            ths.AdjustAvailableCategoriesForCASMode(ref alteredCategories);

            SimBuilder builder = ths.mBuilder;

            CASAgeGenderFlags age = builder.Age;
            CASAgeGenderFlags gender = builder.Gender;
            CASAgeGenderFlags species = builder.Species;

            List<CASParts.Wrapper> list = new List<CASParts.Wrapper>();
            foreach(CASParts.Wrapper part in CASBase.HairParts)
            {
                InvalidPartBase.Reason reason = InvalidPartBooter.Allow(part, age, gender, species, false, (OutfitCategories)categories);
                if (reason != InvalidPartBase.Reason.None) continue;

                if ((part.mPart.BodyType == bodyType) && OutfitUtils.PartMatchesSim(builder, alteredCategories, part.mPart))
                {
                    list.Add(part);
                }
            }
            return list;
        }
Esempio n. 32
0
 private static Vector3[] GetMakeupVectorColors(CASMakeup ths, BodyTypes type)
 {
     return ths.GetMakeupVectorColors(ths.mCurrentPreset.mPart);
 }
Esempio n. 33
0
        private static void PopulatePartsGrid(CASMakeup ths, BodyTypes category)
        {
            if (category != BodyTypes.CostumeMakeup)
            {
                ItemGrid mGridMakeupParts = ths.mGridMakeupParts;
                mGridMakeupParts.Clear();
                CASPart wornPart = ths.GetWornPart(category);
                List<object> visibleParts = ths.GetVisibleParts(category);
                ResourceKey layoutKey = ResourceKey.CreateUILayoutKey("GenericCasItem", 0x0);
                foreach (object obj2 in visibleParts)
                {
                    CASPart part = (CASPart)obj2;
                    ths.AddPartsGridItem(mGridMakeupParts, layoutKey, part);
                    if (part.Key == wornPart.Key)
                    {
                        mGridMakeupParts.SelectedItem = mGridMakeupParts.Count - 0x1;
                    }
                }
                ths.mButtonColor.Enabled = (mGridMakeupParts.SelectedItem != -1) && (mGridMakeupParts.SelectedItem != 0x0);
                ths.mButtonDelete.Enabled = ths.mButtonColor.Enabled;
            }
            else
            {
                ItemGrid mGridCostumeParts = ths.mGridCostumeParts;
                mGridCostumeParts.Clear();
                ths.mCurrentPreset = null;
                ths.mCurrentFocusedRow = null;
                ths.mTempFocusedRow = null;
                List<object> objectList = ths.GetVisibleParts(category);
                bool shouldEnableCatalogProductFilter = false;
                CASPart objectToNotRemove = ths.GetWornPart(category);
                ths.mContentTypeFilter.FilterObjects(objectList, out shouldEnableCatalogProductFilter, objectToNotRemove);
                ths.mButtonCostumeFilter.Enabled = false;
                ths.mButtonCostumeFilter.Tag = shouldEnableCatalogProductFilter;
                foreach (CASPart part4 in objectList)
                {
                    if (!(part4.Key == ths.kInvalidCASPart.Key))
                    {
                        CASClothingRow row = UIManager.LoadLayout(ResourceKey.CreateUILayoutKey("CASClothingRow", 0x0)).GetWindowByExportID(0x1) as CASClothingRow;
                        row.CASPart = part4;
                        row.RowController = ths;
                        if (row.CreateGridItems(true).Count > 0x0)
                        {
                            mGridCostumeParts.AddItem(new ItemGridCellItem(row, null));
                            if (row.SelectedItem != -1)
                            {
                                ths.mCurrentPreset = row.Selection as CASPartPreset;
                            }
                        }

                        CASClothingRowEx.Create(row, MasterController.Settings.mAllowMultipleMakeup);
                    }
                }
                ths.mContentTypeFilter.UpdateFilterButtonState();
            }
        }
Esempio n. 34
0
        protected static CASParts.PartPreset GetRandomPreset(BodyTypes location, OutfitCategories category, CASAgeGenderFlags age, CASAgeGenderFlags gender, CASAgeGenderFlags species, bool maternity, StringBuilder log)
        {
            try
            {
                log.Append(Common.NewLine + "  Location: " + location);
                log.Append(Common.NewLine + "  Category: " + category);
                log.Append(Common.NewLine + "  Age: " + age);
                log.Append(Common.NewLine + "  Gender: " + gender);
                log.Append(Common.NewLine + "  Species: " + species);
                log.Append(Common.NewLine + "  Maternity: " + maternity);

                Dictionary<ResourceKey, CASParts.Wrapper> parts;
                if (AllParts.TryGetValue(location, out parts))
                {
                    log.Append(Common.NewLine + "  Parts Found: " + parts.Count);

                    List<CASParts.Wrapper> choices = new List<CASParts.Wrapper>();

                    Dictionary<string,int> reasons = new Dictionary<string,int>();

                    foreach (CASParts.Wrapper test in parts.Values)
                    {
                        ProcessOptions type = GetType(test.mPart.BodyType);

                        if ((type != ProcessOptions.BodyHair) || (!Dresser.Settings.mIgnoreBodyHairGender))
                        {
                            if ((test.Gender & gender) != gender)
                            {
                                Add(reasons, "Gender Fail");
                                continue;
                            }
                        }

                        if ((test.Age & age) != age)
                        {
                            Add(reasons, "Age Fail");
                            continue;
                        }

                        if (test.Species != species)
                        {
                            Add(reasons, "Species Fail");
                            continue;
                        }

                        if ((test.Category & category) != category)
                        {
                            Add(reasons, "Category Fail");
                            continue;
                        }

                        string reason = null;
                        if (!Allow(test, age, gender, species, maternity, category, out reason))
                        {
                            Add(reasons, reason);
                            continue;
                        }

                        if ((test.ExtendedCategory & OutfitCategoriesExtended.IsHiddenInCAS) != 0x0)
                        {
                            Add(reasons, "HiddenInCAS Fail");
                            continue;
                        }

                        bool testIgnore = false;
                        switch(type)
                        {
                            case ProcessOptions.Beard:
                            case ProcessOptions.BodyHair:
                                testIgnore = !Dresser.Settings.mIgnoreValidForRandomBodyHair;
                                break;
                            case ProcessOptions.Hair:
                                testIgnore = !Dresser.Settings.mIgnoreValidForRandomHair;
                                break;
                            case ProcessOptions.Accessories:
                                testIgnore = !Dresser.Settings.mIgnoreValidForRandomAccessories;
                                break;
                            case ProcessOptions.Makeup:
                                testIgnore = !Dresser.Settings.mSameMakeupForAllCategories;
                                break;
                            default:
                                testIgnore = !Dresser.Settings.mIgnoreValidForRandomClothing;
                                break;
                        }

                        if ((testIgnore) && (test.ExtendedCategory & OutfitCategoriesExtended.ValidForRandom) == 0)
                        {
                            Add(reasons, "ValidForRandom Fail");
                            continue;
                        }

                        if (maternity)
                        {
                            if ((test.ExtendedCategory & OutfitCategoriesExtended.ValidForMaternity) == 0)
                            {
                                Add(reasons, "ValidForMaternity Fail");
                                continue;
                            }
                        }

                        choices.Add(test);
                    }

                    foreach (KeyValuePair<string, int> reason in reasons)
                    {
                        log.Append(Common.NewLine + "   " + reason.Key + ": " + reason.Value);
                    }

                    log.Append(Common.NewLine + "  Final Count: " + choices.Count + Common.NewLine);

                    if (choices.Count > 0)
                    {
                        int tries = 0;
                        while (tries < 10)
                        {
                            tries++;

                            CASParts.PartPreset preset = RandomUtil.GetRandomObjectFromList(choices).GetRandomPreset();
                            if (preset != null)
                            {
                                return preset;
                            }
                        }
                    }
                }
                else
                {
                    log.Append(Common.NewLine + "  No Parts Found" + Common.NewLine);
                }
            }
            catch (Exception e)
            {
                Common.Exception(location.ToString(), e);
            }

            return null;
        }
Esempio n. 35
0
 public static bool IsMakeup(BodyTypes type)
 {
     return sMakeup.Contains(type);
 }
Esempio n. 36
0
 private CASPart[] GetVisibleParts(BodyTypes bodyType)
 {
     ArrayList visibleCASParts = Responder.Instance.CASModel.GetVisibleCASParts(bodyType);
     visibleCASParts.Insert(0x0, this.kInvalidCASPart);
     return (visibleCASParts.ToArray(typeof(CASPart)) as CASPart[]);
 }
Esempio n. 37
0
 public ArrayList GetUnicornCASParts(BodyTypes bodyType, bool isChild)
 {
     return mCASModel.GetUnicornCASParts(bodyType, isChild);
 }
Esempio n. 38
0
 public void OnHairPresetAppliedProxy(BodyTypes bodyType, ColorInfo hairColors)
 {
     try
     {
         if (OnHairPresetApplied != null)
         {
             OnHairPresetApplied(bodyType, hairColors);
         }
     }
     catch (Exception e)
     {
         Common.Exception("OnHairPresetAppliedProxy", e);
     }
 }
Esempio n. 39
0
 public void SetPreset(BodyTypes type, string preset)
 {
     foreach (SavedPart part in mParts)
     {
         if (part.mPart.BodyType == type)
         {
             part.mPreset = preset;
         }
     }
 }
Esempio n. 40
0
        public override ArrayList GetVisibleCASParts(BodyTypes bodyType, uint categories)
        {
            try
            {
                List<CASParts.Wrapper> list = SubGetVisibleCASParts(bodyType, categories);
                //ArrayList list = base.GetVisibleCASParts(bodyType, categories);

                StackTrace trace = new StackTrace(false);

                int blackListCount = 0;

                CASClothingCategory clothingCategory = CASClothingCategory.gSingleton;
                if (clothingCategory != null)
                {
                    // Fix for an issue where this listing is never cleared by the Core
                    if (clothingCategory.PartPresetsList != null)
                    {
                        clothingCategory.PartPresetsList.Clear();
                    }
                }

                bool truncate = false;

                if (list.Count > 0)
                {
                    bool found = false;

                    foreach (StackFrame frame in trace.GetFrames())
                    {
                        if (frame.GetMethod().DeclaringType == sDelayedCategoryUpdate)
                        {
                            found = true;
                            break;
                        }
                    }

                    if (!found)
                    {
                        foreach (StackFrame frame in trace.GetFrames())
                        {
                            if ((frame.GetMethod().DeclaringType == sCASClothingCategory) &&
                                (frame.GetMethod().ToString() == "Void HideUnusedIcons()"))
                            {
                                truncate = true;
                                break;
                            }
                            else if ((frame.GetMethod().DeclaringType == sCASClothingCategory) &&
                                 (frame.GetMethod().ToString() == "Void LoadParts()"))
                            {
                                truncate = true;

                                if ((clothingCategory != null) && (clothingCategory.mClothingTypesGrid != null))
                                {
                                    clothingCategory.mClothingTypesGrid.Clear();
                                }

                                CASClothingCategoryEx.DelayedCategoryUpdate.Perform();
                                break;
                            }
                        }

                        if (truncate)
                        {
                            List<CASParts.Wrapper> newList = new List<CASParts.Wrapper>();

                            newList.Add(list[0]);

                            list = newList;
                        }
                    }
                }

                if ((!truncate) && (InvalidPartBooter.HasInvalidParts))
                {
                    SimBuilder builder = CASLogic.Instance.mBuilder;

                    CASAgeGenderFlags age = builder.Age;
                    CASAgeGenderFlags gender = builder.Gender;
                    CASAgeGenderFlags species = builder.Species;

                    List<CASParts.Wrapper> newList = new List<CASParts.Wrapper>();

                    foreach(CASParts.Wrapper part in list)
                    {
                        InvalidPartBase.Reason reason = InvalidPartBooter.Allow(part, age, gender, species, false, (OutfitCategories)categories);
                        if (reason == InvalidPartBase.Reason.None)
                        {
                            newList.Add(part);
                        }
                        else
                        {
                            blackListCount++;
                        }
                    }

                    list.Clear();
                    list = newList;
                }

                ArrayList results = new ArrayList();

                foreach (CASParts.Wrapper part in list)
                {
                    results.Add(part.mPart);
                }

                return results;
            }
            catch (Exception e)
            {
                Common.Exception("GetVisibleCASParts", e);

                return new ArrayList();
            }
        }
Esempio n. 41
0
        protected List<CASParts.Wrapper> SubGetVisibleCASParts(BodyTypes bodyType, uint categories)
        {
            CASLogic logic = mCASModel as CASLogic;

            logic.AdjustAvailableCategoriesForCASMode(ref categories);

            List<CASParts.Wrapper> results = new List<CASParts.Wrapper>();
            foreach(CASParts.Wrapper part in CASBase.sUnboxedParts)
            {
                if ((part.mPart.BodyType == bodyType) && OutfitUtils.PartMatchesSim(logic.mBuilder, categories, part.mPart))
                {
                    results.Add(part);
                }
            }
            return results;
        }
Esempio n. 42
0
 protected static List<CASParts.Wrapper> GetVisibleCASParts(CASLogic ths, BodyTypes bodyType)
 {
     return GetVisibleCASParts(ths, bodyType, ths.GetForgivingCategoryMask(ths.mCurrentOutfitCategory));
 }
Esempio n. 43
0
 private static Color[] GetMakeupColors(CASMakeup ths, BodyTypes type)
 {
     Vector3[] makeupVectorColors = GetMakeupVectorColors(ths, type);
     if (makeupVectorColors == null)
     {
         return null;
     }
     int length = makeupVectorColors.Length;
     if (CASController.Singleton.ShowAllMakeupPresetsCheat)
     {
         length = 0x4;
     }
     Color[] colorArray = new Color[length];
     for (int i = 0x0; i < makeupVectorColors.Length; i++)
     {
         colorArray[i] = CompositorUtil.Vector3ToColor(makeupVectorColors[i]);
     }
     for (int j = makeupVectorColors.Length; j < length; j++)
     {
         colorArray[j] = new Color(0xffffffff);
     }
     return colorArray;
 }
Esempio n. 44
0
 public void RequestSetHairColorPreset(BodyTypes bodyType, ResourceKey hairPresetKey)
 {
     mCASModel.RequestSetHairColorPreset(bodyType, hairPresetKey);
 }
Esempio n. 45
0
        /*
        public void DebugLogColor()
        {
            if (!Common.kDebugging) return;

            Common.StringBuilder msg = new Common.StringBuilder(null;

            msg += "Hair";

            Color[] color = GetPresetColor(BodyTypes.Hair);
            if (color != null)
            {
                foreach (Color item in color)
                {
                    msg += Common.NewLine + item;
                }
            }

            try
            {
                throw new Exception();
            }
            catch (Exception e)
            {
                msg += Common.NewLine + e.StackTrace;
            }

            Common.WriteLog(msg);
        }
        */

        public string GetPreset(BodyTypes type)
        {
            foreach (SavedPart part in mParts)
            {
                if (part.mPart.BodyType == type)
                {
                    if (!string.IsNullOrEmpty(part.mPreset))
                    {
                        return part.mPreset;
                    }
                    else
                    {
                        return null;
                    }
                }
            }

            return null;
        }
Esempio n. 46
0
 public void OnSetHairColorProxy(BodyTypes bodyType)
 {
     try
     {
         if (OnSetHairColor != null)
         {
             OnSetHairColor(bodyType);
         }
     }
     catch (Exception e)
     {
         Common.Exception("OnSetHairColorProxy", e);
     }
 }
Esempio n. 47
0
 public Color GetHairColor(BodyTypes bodyType, int index)
 {
     return mCASModel.GetHairColor(bodyType, index);
 }
Esempio n. 48
0
 public int FindCurrentHairColorPresetIndex(BodyTypes bodyType, bool filterUserOnly)
 {
     return mCASModel.FindCurrentHairColorPresetIndex(bodyType, filterUserOnly);
 }
Esempio n. 49
0
 public virtual ArrayList GetVisibleCASParts(BodyTypes bodyType)
 {
     return mCASModel.GetVisibleCASParts(bodyType);
 }
Esempio n. 50
0
            public static bool GetPartPreset(BodyTypes type, SimOutfit sourceOutfit, ref PartPreset result)
            {
                foreach (CASPart part in sourceOutfit.Parts)
                {
                    if (part.BodyType != type) continue;

                    result = new PartPreset(part, sourceOutfit.GetPartPreset(part.Key));
                    return true;
                }

                return false;
            }
Esempio n. 51
0
 public virtual ArrayList GetVisibleCASParts(BodyTypes bodyType, uint categories)
 {
     return mCASModel.GetVisibleCASParts(bodyType, categories);
 }
Esempio n. 52
0
 public static ProcessOptions GetType(BodyTypes type)
 {
     ProcessOptions option;
     if (TypeLookup.TryGetValue(type, out option))
     {
         return option;
     }
     else
     {
         return ProcessOptions.None;
     }
 }
Esempio n. 53
0
 public List<CASPart> GetWornParts(BodyTypes bodyType)
 {
     return mCASModel.GetWornParts(bodyType);
 }
Esempio n. 54
0
        protected static List<CASParts.PartPreset> GetFromNakedOutfit(SimDescription sim, BodyTypes location)
        {
            SimOutfit outfit = sim.GetOutfit(OutfitCategories.Naked, 0);
            if (outfit == null) return new List<CASParts.PartPreset>();

            List<CASParts.PartPreset> results = new List<CASParts.PartPreset>();

            foreach (CASPart part in outfit.Parts)
            {
                if (location == BodyTypes.FullBody)
                {
                    if ((part.BodyType == BodyTypes.UpperBody) || (part.BodyType == BodyTypes.LowerBody))
                    {
                        results.Add(new CASParts.PartPreset(part, outfit));
                    }
                }
                else if (location == part.BodyType)
                {
                    results.Add(new CASParts.PartPreset(part, outfit));
                }
            }

            return results;
        }
Esempio n. 55
0
 public void LinkMaterials(BodyTypes bodyType, int flag)
 {
     mCASModel.LinkMaterials(bodyType, flag);
 }
Esempio n. 56
0
        private static void SetCategory(BodyTypes category)
        {
            CASMakeup ths = CASMakeup.gSingleton;

            ths.mWindowCostume.Visible = false;
            ths.mWindowMakeup.Visible = false;
            CASFacialDetails gSingleton = CASFacialDetails.gSingleton;
            switch (category)
            {
                case BodyTypes.FirstFace:
                case BodyTypes.EyeShadow:
                case BodyTypes.EyeLiner:
                case BodyTypes.Blush:
                    ths.mWindowMakeup.Visible = true;
                    gSingleton.SetLongPanel(true);
                    ths.Tick -= ths.OnTick;
                    ths.mButtonCostumeFilter.Selected = false;
                    ths.mContentTypeFilter.Visible = false;
                    break;

                case BodyTypes.CostumeMakeup:
                    ths.mWindowCostume.Visible = true;
                    gSingleton.SetLongPanel(false);
                    gSingleton.SetShortPanelHeight((float)570f);
                    if (!(ths.GetWornPart(category).Key != ths.kInvalidCASPart.Key))
                    {
                        ths.mButtonDesignCostume.Enabled = false;
                        break;
                    }
                    ths.mButtonDesignCostume.Enabled = true;

                    ths.UpdateCostumePresetState();
                    ths.Tick -= ths.OnTick;
                    ths.Tick += ths.OnTick;

                    break;

                default:
                    break;
            }

            CASMakeup.sCategory = category;
            ths.HideUnusedIcons();
            PopulatePartsGrid(ths, CASMakeup.sCategory);
            ths.PopulatePresetsGrid(CASMakeup.sCategory, ths.GetWornPart(CASMakeup.sCategory), ths.mButtonFilter.Selected);
        }
Esempio n. 57
0
 public void RequestSetAllHairColor(BodyTypes bodyType, List<Color> colors, bool includeEyeBrow, Color eyeBrowColor, bool finalize)
 {
     mCASModel.RequestSetAllHairColor(bodyType, colors, includeEyeBrow, eyeBrowColor, finalize);
 }
Esempio n. 58
0
 private static void SetMakeupColors(CASMakeup ths, BodyTypes type, Color[] colors, bool finalize)
 {
     ths.SetMakeupColors(ths.mCurrentPreset.mPart, colors, finalize, false);
 }
Esempio n. 59
0
 public void RequestSetHairColor(BodyTypes bodyType, int index, Color color, bool finalize)
 {
     mCASModel.RequestSetHairColor(bodyType, index, color, finalize);
 }