Пример #1
0
        public override bool Run()
        {
            try
            {
                Sim sim = Target as Sim;
                if (sim != null)
                {
                    string msg = null;
                    foreach (InteractionInstance instance in sim.InteractionQueue.InteractionList)
                    {
                        msg += Common.NewLine + Common.NewLine + instance.InteractionDefinition.GetType().AssemblyQualifiedName;

                        if (instance.InteractionDefinition is SocialInteractionA)
                        {
                            msg += Common.NewLine + "(" + instance.InteractionDefinition.ToString() + ")";
                        }
                    }

                    DebugEnabler.WriteLog(msg);

                    SimpleMessageDialog.Show(Common.Localize("CurrentInteraction:MenuName"), msg);
                }
                else
                {
                    string msg = null;

                    Sims3.Gameplay.Objects.RabbitHoles.CityHall cityHall = Target as Sims3.Gameplay.Objects.RabbitHoles.CityHall;
                    if (cityHall != null)
                    {
                        foreach (Sim member in LotManager.Actors)
                        {
                            if ((member.InteractionQueue != null) && (member.InteractionQueue.GetHeadInteraction() != null))
                            {
                                msg += Common.NewLine + member.SimDescription.FullName;
                                foreach (InteractionInstance instance in member.InteractionQueue.InteractionList)
                                {
                                    msg += Common.NewLine + Common.NewLine + instance.InteractionDefinition.GetType().AssemblyQualifiedName;

                                    if (instance.InteractionDefinition is SocialInteractionA.Definition)
                                    {
                                        msg += Common.NewLine + "(" + instance.InteractionDefinition.ToString() + ")";
                                    }
                                }
                            }
                        }
                    }

                    DebugEnabler.WriteLog(msg);
                }
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
            }
            return(true);
        }
Пример #2
0
        public override bool Run()
        {
            try
            {
                DebugEnabler.WriteLog(Target.GetResourceKey().ToString());

                SimpleMessageDialog.Show(Common.Localize("ResourceKey:MenuName"), Target.GetResourceKey().ToString());
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
            }
            return(true);
        }
Пример #3
0
        public override bool Run()
        {
            try
            {
                string msg = Target.GetType().AssemblyQualifiedName;

                DebugEnabler.WriteLog(msg);

                SimpleMessageDialog.Show(Common.Localize("TypeName:MenuName"), msg);
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
            }
            return(true);
        }
Пример #4
0
 private static bool Perform(SimDescription sim, bool force)
 {
     try
     {
         FixInvisibleTask.Approach approach = FixInvisibleTask.Perform(sim, force);
         if (approach != FixInvisibleTask.Approach.None)
         {
             DebugEnabler.Notify(sim.CreatedSim, Common.Localize("FixInvisibleSims:Success", sim.IsFemale, new object[] { Common.Localize("FixInvisibleSims:" + approach), sim }));
         }
         return(true);
     }
     catch (Exception e)
     {
         Common.Exception(sim, e);
         return(false);
     }
 }
Пример #5
0
        public override bool Run()
        {
            try
            {
                Sim target = Target as Sim;

                SimOutfit outfit = target.SimDescription.GetOutfit(target.CurrentOutfitCategory, target.CurrentOutfitIndex);

                DebugEnabler.WriteLog(outfit.Key.ToString());

                SimpleMessageDialog.Show(Common.Localize("ShowOutfitKey:MenuName"), outfit.Key.ToString());
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
            }
            return(true);
        }
Пример #6
0
        public override bool Run()
        {
            try
            {
                Sim sim = Target as Sim;
                if (sim != null)
                {
                    string msg = null;
                    foreach (Situation situation in sim.Autonomy.SituationComponent.Situations)
                    {
                        msg += Common.NewLine + ToString(situation);
                    }

                    DebugEnabler.WriteLog(msg);

                    SimpleMessageDialog.Show(Common.Localize("CurrentSituation:MenuName"), msg);
                }
                else
                {
                    Lot lot = Target as Lot;
                    if (lot != null)
                    {
                        string msg = null;
                        foreach (Situation situation in Situation.sAllSituations)
                        {
                            if (situation.Lot != lot)
                            {
                                continue;
                            }

                            msg += Common.NewLine + ToString(situation);
                        }

                        DebugEnabler.WriteLog(msg);

                        SimpleMessageDialog.Show(Common.Localize("CurrentSituation:MenuName"), msg);
                    }
                    else
                    {
                        string msg = null;

                        Sims3.Gameplay.Objects.RabbitHoles.CityHall cityHall = Target as Sims3.Gameplay.Objects.RabbitHoles.CityHall;
                        if (cityHall != null)
                        {
                            foreach (Sim member in LotManager.Actors)
                            {
                                if (member.Autonomy == null)
                                {
                                    continue;
                                }

                                if (member.Autonomy.SituationComponent == null)
                                {
                                    continue;
                                }

                                if (member.Autonomy.SituationComponent.Situations.Count > 0)
                                {
                                    msg += Common.NewLine + member.SimDescription.FullName;

                                    foreach (Situation situation in member.Autonomy.SituationComponent.Situations)
                                    {
                                        msg += Common.NewLine + " " + ToString(situation);
                                    }
                                }
                            }
                        }

                        DebugEnabler.WriteLog(msg);
                    }
                }
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
            }
            return(true);
        }
Пример #7
0
        public static int OnRestartMotives(object[] parameters)
        {
            try
            {
                foreach (SimDescription sim in Household.EverySimDescription())
                {
                    Sim createdSim = sim.CreatedSim;
                    if (createdSim == null)
                    {
                        continue;
                    }

                    if (sim.Household == null)
                    {
                        continue;
                    }

                    if (sim.Household.IsSpecialHousehold)
                    {
                        continue;
                    }

                    if (createdSim.Autonomy == null)
                    {
                        DebugEnabler.Notify("No Autonomy", sim.CreatedSim.ObjectId);
                        continue;
                    }

                    bool success = false;

                    if (createdSim.Autonomy.mLastTime > SimClock.ElapsedTime(TimeUnit.Minutes))
                    {
                        createdSim.Autonomy.mLastTime = 0;
                        success = true;
                    }

                    if (createdSim.Autonomy.Motives == null)
                    {
                        createdSim.Autonomy.mMotives = new Motives(createdSim, createdSim.Autonomy.mInteractionScorer);
                        success = true;
                    }

                    if (createdSim.Autonomy.Motives.GetMotive(CommodityKind.Hunger) == null)
                    {
                        createdSim.Autonomy.RecreateAllMotives();
                        success = true;
                    }

                    if (success)
                    {
                        DebugEnabler.Notify("Restarted Motive", sim.CreatedSim.ObjectId);
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception("OnRestartMotives", e);
            }

            return(0);
        }