public override void Notify_QuestSignalReceived(Signal signal)
        {
            base.Notify_QuestSignalReceived(signal);
            if (!(signal.tag == inSignal))
            {
                return;
            }
            LookTargets lookTargets = this.lookTargets;

            if (getLookTargetsFromSignal && !lookTargets.IsValid())
            {
                SignalArgsUtility.TryGetLookTargets(signal.args, "SUBJECT", out lookTargets);
            }
            if (lookTargets.IsValid())
            {
                if (select)
                {
                    CameraJumper.TryJumpAndSelect(lookTargets.TryGetPrimaryTarget());
                }
                else
                {
                    CameraJumper.TryJump(lookTargets.TryGetPrimaryTarget());
                }
            }
        }
        public override void Notify_QuestSignalReceived(Signal signal)
        {
            base.Notify_QuestSignalReceived(signal);
            if (!(signal.tag == inSignal))
            {
                return;
            }
            DiaNode     diaNode             = new DiaNode(signal.args.GetFormattedText(text));
            LookTargets resolvedLookTargets = lookTargets;

            if (getLookTargetsFromSignal && !resolvedLookTargets.IsValid())
            {
                SignalArgsUtility.TryGetLookTargets(signal.args, "SUBJECT", out resolvedLookTargets);
            }
            if (resolvedLookTargets.IsValid())
            {
                DiaOption diaOption = new DiaOption("JumpToLocation".Translate());
                diaOption.action = delegate
                {
                    CameraJumper.TryJumpAndSelect(resolvedLookTargets.TryGetPrimaryTarget());
                };
                diaOption.resolveTree = true;
                diaNode.options.Add(diaOption);
            }
            if (options.Any())
            {
                for (int i = 0; i < options.Count; i++)
                {
                    int       localIndex = i;
                    DiaOption diaOption2 = new DiaOption(signal.args.GetFormattedText(options[i].text));
                    diaOption2.action = delegate
                    {
                        Find.SignalManager.SendSignal(new Signal(options[localIndex].outSignal));
                    };
                    diaOption2.resolveTree = true;
                    diaNode.options.Add(diaOption2);
                }
            }
            else
            {
                DiaOption diaOption3 = new DiaOption("OK".Translate());
                diaOption3.resolveTree = true;
                diaNode.options.Add(diaOption3);
            }
            TaggedString formattedText = signal.args.GetFormattedText(title);

            Find.WindowStack.Add(new Dialog_NodeTreeWithFactionInfo(diaNode, relatedFaction, delayInteractivity: true, radioMode, formattedText));
            if (addToArchive)
            {
                Find.Archive.Add(new ArchivedDialog(diaNode.text, formattedText, relatedFaction));
            }
        }
Beispiel #3
0
 protected override void Enable(SignalArgs receivedArgs)
 {
     base.Enable(receivedArgs);
     resolvedLabel       = receivedArgs.GetFormattedText(label);
     resolvedExplanation = receivedArgs.GetFormattedText(explanation);
     resolvedLookTargets = lookTargets;
     if (getLookTargetsFromSignal && !resolvedLookTargets.IsValid())
     {
         SignalArgsUtility.TryGetLookTargets(receivedArgs, "SUBJECT", out resolvedLookTargets);
     }
 }
Beispiel #4
0
 public override void Notify_QuestSignalReceived(Signal signal)
 {
     base.Notify_QuestSignalReceived(signal);
     if (signal.tag == inSignal)
     {
         LookTargets lookTargets = this.lookTargets;
         if (getLookTargetsFromSignal && !lookTargets.IsValid())
         {
             SignalArgsUtility.TryGetLookTargets(signal.args, "SUBJECT", out lookTargets);
         }
         TaggedString formattedText = signal.args.GetFormattedText(message);
         if (!formattedText.NullOrEmpty())
         {
             Messages.Message(formattedText, lookTargets, messageType ?? MessageTypeDefOf.NeutralEvent, quest, historical);
         }
     }
 }