예제 #1
0
        public override void OpenLetter()
        {
            Pawn   targetPawn = this.lookTargets.TryGetPrimaryTarget().Thing as Pawn;
            string text       = this.text;
            string text2      = (from entry in (from entry in (from battle in Find.BattleLog.Battles
                                                               where battle.Concerns(targetPawn)
                                                               select battle).SelectMany((Battle battle) => from entry in battle.Entries
                                                                                         where entry.Concerns(targetPawn) && entry.ShowInCompactView()
                                                                                         select entry)
                                                orderby entry.Age
                                                select entry).Take(5).Reverse <LogEntry>()
                                 select "  " + entry.ToGameStringFromPOV(null, false)).ToLineList("");

            if (text2.Length > 0)
            {
                text = string.Format("{0}\n\n{1}\n{2}", text, "LastEventsInLife".Translate(new object[]
                {
                    targetPawn.LabelDefinite()
                }) + ":", text2);
            }
            DiaNode diaNode = new DiaNode(text);

            diaNode.options.AddRange(this.Choices);
            WindowStack windowStack    = Find.WindowStack;
            DiaNode     nodeRoot       = diaNode;
            Faction     relatedFaction = this.relatedFaction;
            bool        radioMode      = this.radioMode;

            windowStack.Add(new Dialog_NodeTreeWithFactionInfo(nodeRoot, relatedFaction, false, radioMode, this.title));
        }
예제 #2
0
 public void GotoNode(DiaNode node)
 {
     foreach (DiaOption current in node.options)
     {
         current.dialog = this;
     }
     this.curNode = node;
 }
 public void GotoNode(DiaNode node)
 {
     foreach (DiaOption diaOption in node.options)
     {
         diaOption.dialog = this;
     }
     this.curNode = node;
 }
		public DiaOption(DiaOptionMold def)
		{
			this.text = def.Text;
			DiaNodeMold diaNodeMold = def.RandomLinkNode();
			if (diaNodeMold != null)
			{
				this.link = new DiaNode(diaNodeMold);
			}
		}
예제 #5
0
        public override void OpenLetter()
        {
            DiaNode diaNode = new DiaNode(text);

            diaNode.options.AddRange(Choices);
            Dialog_NodeTreeWithFactionInfo window = new Dialog_NodeTreeWithFactionInfo(diaNode, relatedFaction, delayInteractivity: false, radioMode, title);

            Find.WindowStack.Add(window);
        }
예제 #6
0
        public override void OpenLetter()
        {
            DiaNode diaNode = new DiaNode(this.text);

            diaNode.options.AddRange(this.Choices);
            WindowStack windowStack = Find.WindowStack;
            DiaNode     nodeRoot    = diaNode;
            bool        flag        = this.radioMode;

            windowStack.Add(new Dialog_NodeTree(nodeRoot, false, flag, this.title));
        }
예제 #7
0
        public override void OpenLetter()
        {
            DiaNode diaNode = new DiaNode(this.text);

            diaNode.options.AddRange(this.Choices);
            DiaNode nodeRoot       = diaNode;
            Faction relatedFaction = this.relatedFaction;
            bool    flag           = this.radioMode;
            Dialog_NodeTreeWithFactionInfo window = new Dialog_NodeTreeWithFactionInfo(nodeRoot, relatedFaction, false, flag, this.title);

            Find.WindowStack.Add(window);
        }
예제 #8
0
        public override void OpenLetter()
        {
            Pawn         targetPawn   = lookTargets.TryGetPrimaryTarget().Thing as Pawn;
            TaggedString taggedString = base.text;
            string       text         = (from entry in (from entry in Find.BattleLog.Battles.Where((Battle battle) => battle.Concerns(targetPawn)).SelectMany((Battle battle) => battle.Entries.Where((LogEntry entry) => entry.Concerns(targetPawn) && entry.ShowInCompactView()))
                                                        orderby entry.Age
                                                        select entry).Take(5).Reverse()
                                         select "  " + entry.ToGameStringFromPOV(null)).ToLineList();

            if (text.Length > 0)
            {
                taggedString = string.Format("{0}\n\n{1}\n{2}", taggedString, "LastEventsInLife".Translate(targetPawn.LabelDefinite(), targetPawn.Named("PAWN")).Resolve() + ":", text);
            }
            DiaNode diaNode = new DiaNode(taggedString);

            diaNode.options.AddRange(Choices);
            Find.WindowStack.Add(new Dialog_NodeTreeWithFactionInfo(diaNode, relatedFaction, delayInteractivity: false, radioMode, title));
        }
 public Dialog_NodeTree(DiaNode nodeRoot, bool delayInteractivity = false, bool radioMode = false, string title = null)
 {
     this.title = title;
     this.GotoNode(nodeRoot);
     base.forcePause = true;
     base.absorbInputAroundWindow = true;
     base.closeOnEscapeKey        = false;
     if (delayInteractivity)
     {
         this.makeInteractiveAtTime = (float)(Time.realtimeSinceStartup + 0.5);
     }
     base.soundAppear = SoundDefOf.CommsWindow_Open;
     base.soundClose  = SoundDefOf.CommsWindow_Close;
     if (radioMode)
     {
         base.soundAmbient = SoundDefOf.RadioComms_Ambience;
     }
 }
예제 #10
0
 public Dialog_NodeTree(DiaNode nodeRoot, bool delayInteractivity = false, bool radioMode = false, string title = null)
 {
     this.title = title;
     GotoNode(nodeRoot);
     forcePause = true;
     absorbInputAroundWindow = true;
     closeOnAccept           = false;
     closeOnCancel           = false;
     if (delayInteractivity)
     {
         makeInteractiveAtTime = RealTime.LastRealTime + 0.5f;
     }
     soundAppear = SoundDefOf.CommsWindow_Open;
     soundClose  = SoundDefOf.CommsWindow_Close;
     if (radioMode)
     {
         soundAmbient = SoundDefOf.RadioComms_Ambience;
     }
 }