Exemplo n.º 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));
        }
Exemplo n.º 2
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));
        }
 public static void DelayedErrorWindowRequestOnGUI()
 {
     try
     {
         for (int i = 0; i < DelayedErrorWindowRequest.requests.Count; i++)
         {
             WindowStack windowStack = Find.WindowStack;
             string      text        = DelayedErrorWindowRequest.requests[i].text;
             string      buttonAText = "OK".Translate();
             string      title       = DelayedErrorWindowRequest.requests[i].title;
             windowStack.Add(new Dialog_MessageBox(text, buttonAText, null, null, null, title, false, null, null));
         }
     }
     finally
     {
         DelayedErrorWindowRequest.requests.Clear();
     }
 }