コード例 #1
0
ファイル: PartyPickerDialogEx.cs プロジェクト: yakoder/NRaas
        private void RepopulateSourceTableEx()
        {
            int num    = -1;
            int column = -1;

            mSourceTable.GetFirstVisibleCell(ref column, ref num);
            mSourceTable.Clear();
            foreach (PhoneSimPicker.SimPickerInfo info in mSims)
            {
                ISimDescription simDescription = info.SimDescription as ISimDescription;

                bool enabled = true;

                if (MasterController.Settings.mPartyAgeFilter)
                {
                    switch (this.Result.mPartyType)
                    {
                    case PartyType.kChildSlumberParty:
                        enabled = simDescription.Child;
                        break;

                    case PartyType.kTeenSlumberParty:
                    case PartyType.kTeenParty:
                        enabled = simDescription.Teen;
                        break;

                    case PartyType.kJuiceKeggerParty:
                    case PartyType.kBachelorParty:
                    case PartyType.kTailgatingParty:
                    case PartyType.kMasqueradeBall:
                    case PartyType.kVictoryParty:
                        enabled = simDescription.YoungAdultOrAbove;
                        break;

                    case PartyType.kBonfire:
                    case PartyType.kVideoGameLANParty:
                        enabled = simDescription.ChildOrAbove;
                        break;
                    }
                }

                if (((mFilter != FilterType.kCoworkers) || info.CoWorker) && ((mFilter != FilterType.kFriends) || info.Friend))
                {
                    TableRow row = mSourceTable.CreateRow();
                    PartyPickerRowController controller = new PartyPickerRowController(row, mSourceTable, info);
                    row.RowController  = controller;
                    controller.Enabled = enabled;
                    mSourceTable.AddRow(row);
                }
            }
            mSourceTable.ClearSelection();
            mRightArrow.Enabled = false;
            mSourceTable.Flush();
            mSourceTable.ScrollRowToTop(num);
        }
コード例 #2
0
ファイル: CASLoadSimEx.cs プロジェクト: Robobeurre/NRaas
 public static void RequestLoadSim(ISimDescription simDesc, bool inHousehold)
 {
     SimDescription newSimDesc = simDesc as SimDescription;
     if (newSimDesc.FavoriteMusic == FavoriteMusicType.Custom)
     {
         Array installedFavoriteMusicList = CASCharacter.GetInstalledFavoriteMusicList();
         while (newSimDesc.mFavouriteMusicType == FavoriteMusicType.Custom)
         {
             newSimDesc.mFavouriteMusicType = (FavoriteMusicType)installedFavoriteMusicList.GetValue(RandomUtil.GetInt(0x1, installedFavoriteMusicList.Length - 0x1));
         }
     }
     CASLogic.CASOperationStack.Instance.Push(new SetSimDescOperationEx(newSimDesc, inHousehold));
 }
コード例 #3
0
        public static void RequestLoadSim(ISimDescription simDesc, bool inHousehold)
        {
            SimDescription newSimDesc = simDesc as SimDescription;

            if (newSimDesc.FavoriteMusic == FavoriteMusicType.Custom)
            {
                Array installedFavoriteMusicList = CASCharacter.GetInstalledFavoriteMusicList();
                while (newSimDesc.mFavouriteMusicType == FavoriteMusicType.Custom)
                {
                    newSimDesc.mFavouriteMusicType = (FavoriteMusicType)installedFavoriteMusicList.GetValue(RandomUtil.GetInt(0x1, installedFavoriteMusicList.Length - 0x1));
                }
            }
            CASLogic.CASOperationStack.Instance.Push(new SetSimDescOperationEx(newSimDesc, inHousehold));
        }
コード例 #4
0
ファイル: PartyPickerDialogEx.cs プロジェクト: yakoder/NRaas
        private void RepopulateTargetTableEx()
        {
            mInviteesTable.Clear();
            mNumChildrenInvited = 0x0;

            foreach (PhoneSimPicker.SimPickerInfo info in mInvitees)
            {
                ISimDescription          simDescription = info.SimDescription as ISimDescription;
                TableRow                 row            = mInviteesTable.CreateRow();
                PartyPickerRowController controller     = new PartyPickerRowController(row, mInviteesTable, info);
                row.RowController = controller;
                mInviteesTable.AddRow(row);
                if ((simDescription != null) && simDescription.ChildOrBelow)
                {
                    mNumChildrenInvited++;
                }
            }
            ValidateParty();
        }
コード例 #5
0
ファイル: CASGeneticsEx.cs プロジェクト: yakoder/NRaas
            protected override bool OnPerform()
            {
                CASGenetics genetics = CASGenetics.gSingleton;

                if (genetics != null)
                {
                    Button childByID = genetics.GetChildByID(0x5da4901, true) as Button;
                    childByID.Click -= genetics.OnCancelButtonClick;
                    childByID.Click -= CASGeneticsEx.OnCancelButtonClick;
                    childByID.Click += CASGeneticsEx.OnCancelButtonClick;

                    childByID        = genetics.GetChildByID(0x5da97ff, true) as Button;
                    childByID.Click -= genetics.OnCancelButtonClick;
                    childByID.Click -= CASGeneticsEx.OnCancelButtonClick;
                    childByID.Click += CASGeneticsEx.OnCancelButtonClick;

                    if (genetics.mAcceptButton != null)
                    {
                        genetics.mAcceptButton.Click -= genetics.OnAcceptButtonClick;
                        genetics.mAcceptButton.Click -= CASGeneticsEx.OnAcceptButtonClick;
                        genetics.mAcceptButton.Click += CASGeneticsEx.OnAcceptButtonClick;
                    }

                    if ((genetics.mHourglassVisible) && (genetics.mSelectedOffspring == null) && (genetics.mSelectedParents.Length == 2))
                    {
                        if ((genetics.mSelectedParents[0] == null) && (genetics.mSelectedParents[1] == null))
                        {
                            if (genetics.mFathersButtons != null)
                            {
                                foreach (Button father in genetics.mFathersButtons)
                                {
                                    if (father == null)
                                    {
                                        continue;
                                    }

                                    ISimDescription fatherSim = father.Tag as ISimDescription;
                                    if (fatherSim == null)
                                    {
                                        continue;
                                    }

                                    genetics.mSelectedParents[0] = fatherSim;
                                    genetics.UpdateFatherPreviewTask();
                                    break;
                                }
                            }

                            if ((genetics.mSelectedParents[0] == null) && (genetics.mMothersButtons != null))
                            {
                                foreach (Button mother in genetics.mMothersButtons)
                                {
                                    if (mother == null)
                                    {
                                        continue;
                                    }

                                    ISimDescription motherSim = mother.Tag as ISimDescription;
                                    if (motherSim == null)
                                    {
                                        continue;
                                    }

                                    genetics.mSelectedParents[1] = motherSim;
                                    genetics.UpdateMotherPreviewTask();
                                    break;
                                }
                            }
                        }
                        else if ((genetics.mSelectedParents[0] == null) && (genetics.mSelectedParents[1] != null))
                        {
                            genetics.mSelectedParents[0] = genetics.mSelectedParents[1];
                            genetics.UpdateFatherPreviewTask();
                        }
                        else if ((genetics.mSelectedParents[1] == null) && (genetics.mSelectedParents[0] != null))
                        {
                            genetics.mSelectedParents[1] = genetics.mSelectedParents[0];
                            genetics.UpdateMotherPreviewTask();
                        }
                    }

                    bool enableButtons = (CASPuck.Instance == null);

                    if (genetics.mFathersButtons != null)
                    {
                        foreach (Button button in genetics.mFathersButtons)
                        {
                            if (button == null)
                            {
                                continue;
                            }

                            button.Click -= genetics.OnFatherThumbnailClick;

                            button.MouseUp -= CASGeneticsEx.OnFatherThumbnailMouseUp;
                            button.MouseUp += CASGeneticsEx.OnFatherThumbnailMouseUp;
                        }
                    }

                    if (genetics.mMothersButtons != null)
                    {
                        foreach (Button button in genetics.mMothersButtons)
                        {
                            if (button == null)
                            {
                                continue;
                            }

                            button.Click -= genetics.OnMotherThumbnailClick;

                            button.MouseUp -= CASGeneticsEx.OnMotherThumbnailMouseUp;
                            button.MouseUp += CASGeneticsEx.OnMotherThumbnailMouseUp;
                        }
                    }
                }

                return(true);
            }
コード例 #6
0
ファイル: CASGeneticsEx.cs プロジェクト: yakoder/NRaas
        private static void OnThumbnailMouseUp(WindowBase sender, UIMouseEventArgs args, CASAgeGenderFlags gender)
        {
            try
            {
                CASGenetics ths = CASGenetics.gSingleton;
                if (ths == null)
                {
                    return;
                }

                if (!ths.mHourglassVisible)
                {
                    CASAgeGenderFlags otherGender = CASAgeGenderFlags.Female;

                    Sims3.Gameplay.Function func    = ths.UpdateFatherPreviewTask;
                    Sims3.Gameplay.Function altFunc = ths.UpdateMotherPreviewTask;

                    int index = 0, altIndex = 1;
                    if (gender == CASAgeGenderFlags.Female)
                    {
                        index       = 1;
                        altIndex    = 0;
                        otherGender = CASAgeGenderFlags.Male;

                        func    = ths.UpdateMotherPreviewTask;
                        altFunc = ths.UpdateFatherPreviewTask;
                    }

                    ISimDescription tag = sender.Tag as ISimDescription;

                    if (args.MouseKey == MouseKeys.kMouseLeft)
                    {
                        sAlternate = !sAlternate;
                        if ((!HasGender(otherGender)) && (sAlternate))
                        {
                            ths.mSelectedParents[altIndex] = tag;
                            if (tag != null)
                            {
                                ths.CheckSpecies();

                                Common.FunctionTask.Perform(altFunc);
                            }
                        }
                        else
                        {
                            // Elements are intentionally reversed
                            ths.mSelectedParents[index] = tag;
                            if (tag != null)
                            {
                                ths.CheckSpecies();

                                Common.FunctionTask.Perform(func);
                            }
                        }
                    }
                    else if (args.MouseKey == MouseKeys.kMouseRight)
                    {
                        // Elements are intentionally reversed
                        ths.mSelectedParents[altIndex] = tag;
                        if (tag != null)
                        {
                            ths.CheckSpecies();

                            Common.FunctionTask.Perform(altFunc);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception("OnThumbnailMouseUp", e);
            }
        }
コード例 #7
0
ファイル: CASModelProxy.cs プロジェクト: Robobeurre/NRaas
 public ObjectGuid CreateGeneticsPreviewSim(ISimDescription simDesc)
 {
     return mCASModel.CreateGeneticsPreviewSim(simDesc);
 }
コード例 #8
0
ファイル: CASModelProxy.cs プロジェクト: Robobeurre/NRaas
 public void RequestLoadSim(ISimDescription simDesc, bool inHousehold, bool isRobotRestore)
 {
     mCASModel.RequestLoadSim(simDesc, inHousehold, isRobotRestore);
 }
コード例 #9
0
ファイル: CASModelProxy.cs プロジェクト: Robobeurre/NRaas
 public void RequestLoadSim(ISimDescription simDesc, bool inHousehold)
 {
     mCASModel.RequestLoadSim(simDesc, inHousehold);
 }
コード例 #10
0
ファイル: CASModelProxy.cs プロジェクト: Robobeurre/NRaas
 public ISimDescription MakeDescendant(ISimDescription dad, ISimDescription mom, CASAgeGenderFlags age, CASAgeGenderFlags gender, float averageMood, Random pregoRandom, bool interactive, bool updateGenealogy, bool setName)
 {
     return mCASModel.MakeDescendant(dad, mom, age, gender, averageMood, pregoRandom, interactive, updateGenealogy, setName);
 }
コード例 #11
0
ファイル: CASModelProxy.cs プロジェクト: Robobeurre/NRaas
 public void LTRSetDefaultLiking(ISimDescription simDesc1, ISimDescription simDesc2)
 {
     mCASModel.LTRSetDefaultLiking(simDesc1, simDesc2);
 }
コード例 #12
0
ファイル: CASModelProxy.cs プロジェクト: Robobeurre/NRaas
 public void LTRForceChangeState(ISimDescription simDesc1, ISimDescription simDesc2, Sims3.UI.Controller.LongTermRelationshipTypes relation)
 {
     mCASModel.LTRForceChangeState(simDesc1, simDesc2, relation);
 }
コード例 #13
0
ファイル: CASModelProxy.cs プロジェクト: Robobeurre/NRaas
 public bool HasValidName(ISimDescription desc)
 {
     return mCASModel.HasValidName(desc);
 }
コード例 #14
0
ファイル: HudModelProxy.cs プロジェクト: Robobeurre/NRaas
 public IRelationship GetRelationshipWith(ISimDescription simDesc)
 {
     return mHudModel.GetRelationshipWith(simDesc);
 }
コード例 #15
0
ファイル: HudModelProxy.cs プロジェクト: Robobeurre/NRaas
 public void ChangeRelationship(ISimDescription simDesc, float value)
 {
     mHudModel.ChangeRelationship(simDesc, value);
 }