コード例 #1
0
ファイル: OccultUnicornEx.cs プロジェクト: yakoder/NRaas
        protected static bool PartMatches(CASParts.Wrapper part)
        {
            if (part.mPart.Key.GroupId != 0x48000000)
            {
                return(false);
            }

            return(sUnicornParts.ContainsKey(part.mPart.Key.InstanceId));
        }
コード例 #2
0
ファイル: CASParts.cs プロジェクト: yakoder/NRaas
        public static List <CASParts.Wrapper> GetParts(TestPart onTest)
        {
            List <CASParts.Wrapper> results = new List <CASParts.Wrapper>();

            PartSearch search = new PartSearch();

            foreach (CASPart part in search)
            {
                CASParts.Wrapper newPart = new CASParts.Wrapper(part);

                if ((onTest != null) && (!onTest(newPart)))
                {
                    continue;
                }

                results.Add(newPart);
            }

            search.Reset();

            return(results);
        }
コード例 #3
0
ファイル: CASParts.cs プロジェクト: Robobeurre/NRaas
        public static List<CASParts.Wrapper> GetParts(TestPart onTest)
        {
            List<CASParts.Wrapper> results = new List<CASParts.Wrapper>();            

            PartSearch search = new PartSearch();
            foreach (CASPart part in search)
            {
                CASParts.Wrapper newPart = new CASParts.Wrapper(part);               

                if ((onTest != null) && (!onTest(newPart))) continue;                

                results.Add(newPart);
            }          

            search.Reset();

            return results;
        }
コード例 #4
0
ファイル: CASClothingRowEx.cs プロジェクト: Robobeurre/NRaas
        public void OnClothingSelect(WindowBase sender, UIMouseEventArgs args)
        {
            try
            {
                CASParts.Wrapper part = null;

                CASClothingRow.ClothingThumbnail tag = sender.Tag as CASClothingRow.ClothingThumbnail;
                if (!mRow.mTempWindowValid || (tag.mIndex != (mRow.mItems.Count - 0x1)))
                {
                    if (tag.mData is CASPart)
                    {
                        part = new CASParts.Wrapper((CASPart)tag.mData);

                        if (args.MouseKey != MouseKeys.kMouseRight)
                        {
                            SelectItem(mRow.RowController, part.mPart, null);
                            mRow.mSelectedItem = (part.mPart.Key.InstanceId != 0x0L) ? tag.mIndex : -1;
                        }
                    }
                    else if (tag.mData is CASPartPreset)
                    {
                        CASPartPreset preset = (CASPartPreset)tag.mData;

                        part = new CASParts.Wrapper(preset.mPart);

                        if ((mRow.mRowController.IsAccessoryType(part.mPart.BodyType)) && ((tag.mState & CASClothingRow.WindowState.Active) != CASClothingRow.WindowState.Normal))
                        {
                            if (args.MouseKey != MouseKeys.kMouseRight)
                            {
                                if (!mAllowMultiple)
                                {
                                    mRow.RowController.RemoveItem(part.mPart.BodyType);
                                }
                                else
                                {
                                    RemoveItem(mRow.RowController, part.mPart);
                                }

                                mRow.mSelectedItem = -1;
                            }
                            else
                            {
                                if (mRow.mRowController is CASClothingCategory)
                                {
                                    (mRow.mRowController as CASClothingCategory).mCurrentPreset = preset;
                                }
                                else if (mRow.mRowController is CASMakeup)
                                {
                                    (mRow.mRowController as CASMakeup).mCurrentPreset = preset;
                                }
                            }
                        }
                        else if (args.MouseKey != MouseKeys.kMouseRight)
                        {
                            SelectItem(mRow.RowController, preset.mPart, preset);
                            mRow.mSelectedItem = tag.mIndex;
                        }
                    }
                    else if ((args.MouseKey != MouseKeys.kMouseRight) && (!(tag.mData is IFeaturedStoreItem)))
                    {
                        mRow.RowController.RemoveItem(mRow.CASPart.BodyType);
                        mRow.mSelectedItem = -1;
                    }

                    if (args.MouseKey != MouseKeys.kMouseRight)
                    {
                        mRow.ClearTempItem();
                        if (mRow.mObjectOfInterest is CASPart)
                        {
                            if (!mAllowMultiple)
                            {
                                mRow.mRowController.OnRowInItemSelected(mRow, mRow.CASPart.BodyType);
                            }
                            UpdateSelectedStates(tag.mIndex);
                        }
                    }
                }
                else if ((mRow.mRowController.IsAccessoryType(mRow.CASPart.BodyType)) && (IsWorn(mRow.CASPart)))
                {
                    if (args.MouseKey != MouseKeys.kMouseRight)
                    {
                        if (!mAllowMultiple)
                        {
                            mRow.RowController.RemoveItem(mRow.CASPart.BodyType);
                        }
                        else
                        {
                            RemoveItem(mRow.RowController, mRow.CASPart);
                        }

                        mRow.mSelectedItem = -1;

                        mRow.ClearTempItem();

                        if (!mAllowMultiple)
                        {
                            mRow.mRowController.OnRowInItemSelected(mRow, mRow.CASPart.BodyType);
                        }
                        UpdateSelectedStates(tag.mIndex);
                    }
                }

                if (args.MouseKey == MouseKeys.kMouseRight)
                {
                    bool remove = ((args.Modifiers & Modifiers.kModifierMaskControl) == Modifiers.kModifierMaskControl);

                    CASBase.Blacklist(part, remove, null);

                    if (remove)
                    {
                        bool compactCAS = false;
                        if (mRow.mRowController.IsAccessoryType(mRow.CASPart.BodyType))
                        {
                            compactCAS = MasterController.Settings.mCompactAccessoryCAS;
                        }
                        else
                        {
                            compactCAS = MasterController.Settings.mCompactClothingCAS;
                        }

                        if (!compactCAS)
                        {
                            for (int i = 0; i < mRow.mItems.Count; i++)
                            {
                                CASClothingRow.ClothingThumbnail thumbnail = mRow.mItems[i] as CASClothingRow.ClothingThumbnail;
                                if (thumbnail != null)
                                {
                                    if ((i + 1) < mRow.mGridWindows.Length)
                                    {
                                        mRow.mGridWindows[i + 1].Visible = false;
                                    }
                                }
                            }
                        }
                        else
                        {
                            CASClothingRow.ClothingThumbnail thumbnail = mRow.mItems[tag.mIndex] as CASClothingRow.ClothingThumbnail;
                            if (thumbnail != null)
                            {
                                if ((tag.mIndex + 1) < mRow.mGridWindows.Length)
                                {
                                    mRow.mGridWindows[tag.mIndex + 1].Visible = false;
                                }
                            }
                        }
                    }

                    args.Handled = true;
                }
            }
            catch (Exception e)
            {
                Common.Exception("OnClothingSelect", e);
            }
        }