예제 #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());
        }
예제 #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);
        }
예제 #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;
            }
예제 #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);
 }
예제 #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;
 }
예제 #6
0
 public Person()
 {
     Name        = "Name";
     Surname     = "Surname";
     DateOfBirth = DateTime.Today;
     Height      = 1;
     Weight      = 1;
     BodyType    = BodyTypes.ECTOMORPH;
 }
예제 #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);
     }
 }
예제 #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();
            }
        }
예제 #10
0
 public void SetPreset(BodyTypes type, string preset)
 {
     foreach (SavedPart part in mParts)
     {
         if (part.mPart.BodyType == type)
         {
             part.mPreset = preset;
         }
     }
 }
예제 #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);
 }
예제 #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());
     }
 }
예제 #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;
        }
예제 #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();
        }
예제 #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);//вызво метода преобразвоания
 }
예제 #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);
        }
예제 #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));
        }
예제 #18
0
파일: CASParts.cs 프로젝트: yakoder/NRaas
            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);
            }
예제 #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;
 }
예제 #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
 }
예제 #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);
        }
예제 #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);
        }
예제 #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();
        }
예제 #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();
        }
예제 #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;
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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;
    }
예제 #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;
        }
예제 #32
0
 private static Vector3[] GetMakeupVectorColors(CASMakeup ths, BodyTypes type)
 {
     return ths.GetMakeupVectorColors(ths.mCurrentPreset.mPart);
 }
예제 #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();
            }
        }
예제 #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;
        }
예제 #35
0
 public static bool IsMakeup(BodyTypes type)
 {
     return sMakeup.Contains(type);
 }
예제 #36
0
파일: Old.cs 프로젝트: Robobeurre/NRaas
 private CASPart[] GetVisibleParts(BodyTypes bodyType)
 {
     ArrayList visibleCASParts = Responder.Instance.CASModel.GetVisibleCASParts(bodyType);
     visibleCASParts.Insert(0x0, this.kInvalidCASPart);
     return (visibleCASParts.ToArray(typeof(CASPart)) as CASPart[]);
 }
예제 #37
0
 public ArrayList GetUnicornCASParts(BodyTypes bodyType, bool isChild)
 {
     return mCASModel.GetUnicornCASParts(bodyType, isChild);
 }
예제 #38
0
 public void OnHairPresetAppliedProxy(BodyTypes bodyType, ColorInfo hairColors)
 {
     try
     {
         if (OnHairPresetApplied != null)
         {
             OnHairPresetApplied(bodyType, hairColors);
         }
     }
     catch (Exception e)
     {
         Common.Exception("OnHairPresetAppliedProxy", e);
     }
 }
예제 #39
0
 public void SetPreset(BodyTypes type, string preset)
 {
     foreach (SavedPart part in mParts)
     {
         if (part.mPart.BodyType == type)
         {
             part.mPreset = preset;
         }
     }
 }
예제 #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();
            }
        }
예제 #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;
        }
예제 #42
0
 protected static List<CASParts.Wrapper> GetVisibleCASParts(CASLogic ths, BodyTypes bodyType)
 {
     return GetVisibleCASParts(ths, bodyType, ths.GetForgivingCategoryMask(ths.mCurrentOutfitCategory));
 }
예제 #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;
 }
예제 #44
0
 public void RequestSetHairColorPreset(BodyTypes bodyType, ResourceKey hairPresetKey)
 {
     mCASModel.RequestSetHairColorPreset(bodyType, hairPresetKey);
 }
예제 #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;
        }
예제 #46
0
 public void OnSetHairColorProxy(BodyTypes bodyType)
 {
     try
     {
         if (OnSetHairColor != null)
         {
             OnSetHairColor(bodyType);
         }
     }
     catch (Exception e)
     {
         Common.Exception("OnSetHairColorProxy", e);
     }
 }
예제 #47
0
 public Color GetHairColor(BodyTypes bodyType, int index)
 {
     return mCASModel.GetHairColor(bodyType, index);
 }
예제 #48
0
 public int FindCurrentHairColorPresetIndex(BodyTypes bodyType, bool filterUserOnly)
 {
     return mCASModel.FindCurrentHairColorPresetIndex(bodyType, filterUserOnly);
 }
예제 #49
0
 public virtual ArrayList GetVisibleCASParts(BodyTypes bodyType)
 {
     return mCASModel.GetVisibleCASParts(bodyType);
 }
예제 #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;
            }
예제 #51
0
 public virtual ArrayList GetVisibleCASParts(BodyTypes bodyType, uint categories)
 {
     return mCASModel.GetVisibleCASParts(bodyType, categories);
 }
예제 #52
0
 public static ProcessOptions GetType(BodyTypes type)
 {
     ProcessOptions option;
     if (TypeLookup.TryGetValue(type, out option))
     {
         return option;
     }
     else
     {
         return ProcessOptions.None;
     }
 }
예제 #53
0
 public List<CASPart> GetWornParts(BodyTypes bodyType)
 {
     return mCASModel.GetWornParts(bodyType);
 }
예제 #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;
        }
예제 #55
0
 public void LinkMaterials(BodyTypes bodyType, int flag)
 {
     mCASModel.LinkMaterials(bodyType, flag);
 }
예제 #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);
        }
예제 #57
0
 public void RequestSetAllHairColor(BodyTypes bodyType, List<Color> colors, bool includeEyeBrow, Color eyeBrowColor, bool finalize)
 {
     mCASModel.RequestSetAllHairColor(bodyType, colors, includeEyeBrow, eyeBrowColor, finalize);
 }
예제 #58
0
 private static void SetMakeupColors(CASMakeup ths, BodyTypes type, Color[] colors, bool finalize)
 {
     ths.SetMakeupColors(ths.mCurrentPreset.mPart, colors, finalize, false);
 }
예제 #59
0
 public void RequestSetHairColor(BodyTypes bodyType, int index, Color color, bool finalize)
 {
     mCASModel.RequestSetHairColor(bodyType, index, color, finalize);
 }