コード例 #1
0
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            if (!TryFindMarriageSeeker(marriageSeeker: out this.marriageSeeker))
            {
                if (Prefs.LogVerbose)
                {
                    Log.Warning(text: "no marriageseeker");
                }
                return(false);
            }
            if (!this.TryFindBetrothed(betrothed: out this.betrothed))
            {
                if (Prefs.LogVerbose)
                {
                    Log.Warning(text: "no betrothed");
                }
                return(false);
            }

            string text = "MFI_DiplomaticMarriage".Translate(this.marriageSeeker.LabelShort, this.betrothed.LabelShort, this.marriageSeeker.Faction.Name).AdjustedFor(p: this.marriageSeeker);

            PawnRelationUtility.TryAppendRelationsWithColonistsInfo(ref text, marriageSeeker);

            ChoiceLetter_DiplomaticMarriage choiceLetterDiplomaticMarriage = (ChoiceLetter_DiplomaticMarriage)LetterMaker.MakeLetter(label: this.def.letterLabel, text: text, def: this.def.letterDef);

            choiceLetterDiplomaticMarriage.title          = "MFI_DiplomaticMarriageLabel".Translate(this.betrothed.LabelShort).CapitalizeFirst();
            choiceLetterDiplomaticMarriage.radioMode      = false;
            choiceLetterDiplomaticMarriage.marriageSeeker = this.marriageSeeker;
            choiceLetterDiplomaticMarriage.betrothed      = this.betrothed;
            choiceLetterDiplomaticMarriage.StartTimeout(duration: TimeoutTicks);
            Find.LetterStack.ReceiveLetter(@let: choiceLetterDiplomaticMarriage);
            //Find.World.GetComponent<WorldComponent_OutpostGrower>().Registerletter(choiceLetterDiplomaticMarriage);
            return(true);
        }
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            if (!TryFindMarriageSeeker(marriageSeeker: out this.marriageSeeker))
            {
                if (Prefs.LogVerbose)
                {
                    Log.Warning(text: "no marriageseeker");
                }
                return(false);
            }
            if (!this.TryFindBetrothed(betrothed: out this.betrothed))
            {
                if (Prefs.LogVerbose)
                {
                    Log.Warning(text: "no betrothed");
                }
                return(false);
            }

            ChoiceLetter_DiplomaticMarriage choiceLetterDiplomaticMarriage = (ChoiceLetter_DiplomaticMarriage)LetterMaker.MakeLetter(label: this.def.letterLabel, text: "MFI_DiplomaticMarriage".Translate(args: new object[]
            {
                this.marriageSeeker.LabelShort, this.betrothed.LabelShort, this.marriageSeeker.Faction.Name
            }).AdjustedFor(p: this.marriageSeeker), def: this.def.letterDef);

            choiceLetterDiplomaticMarriage.title = "MFI_DiplomaticMarriageLabel".Translate(args: new object[]
            {
                this.betrothed.LabelShort
            }).CapitalizeFirst();
            choiceLetterDiplomaticMarriage.radioMode      = false;
            choiceLetterDiplomaticMarriage.marriageSeeker = this.marriageSeeker;
            choiceLetterDiplomaticMarriage.betrothed      = this.betrothed;
            choiceLetterDiplomaticMarriage.StartTimeout(duration: TimeoutTicks);
            Find.LetterStack.ReceiveLetter(@let: choiceLetterDiplomaticMarriage);
            return(true);
        }