示例#1
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();
            }
        }
示例#2
0
        protected static void OnItemRowsChanged()
        {
            try
            {
                foreach (CASClothingRow row in sRows)
                {
                    if (sCompleted.ContainsKey(row))
                    {
                        continue;
                    }

                    CASClothingRowEx.Create(row, MasterController.Settings.mAllowMultipleAccessories);

                    sCompleted.Add(row, true);
                }

                sRows.Clear();
            }
            catch (Exception e)
            {
                Common.Exception("OnItemRowsChanged", e);
            }
        }