Esempio n. 1
0
        public override void DoWindowContents(Rect rect)
        {
            base.DoWindowContents(rect);
            if (RimStoryMod.settings.enableLogging)
            {
                bigRect = rect;


                bigRect = new Rect(rect.position, new Vector2(rect.width, defaultLogSize + (35f * Resources.eventsLog.Count)));
                logSize = new Vector2(rect.x, defaultLogSize + (35f * Resources.eventsLog.Count));
                inner   = new Rect(rect.position, logSize);
                outter  = new Rect(rect.position, new Vector2(rect.width - 200, rect.height));

                listing_Standard.Begin(bigRect);
                Widgets.BeginScrollView(outter, ref vect, inner, true);

                if (Resources.eventsLog != null)
                {
                    foreach (IEvent e in Resources.eventsLog)
                    {
                        if (e != null)
                        {
                            if (e.ShowInLog() != null)
                            {
                                if (!Resources.showRaidsInLog && e is ABigThreat)
                                {
                                }
                                else if (!Resources.showDeadColonistsInLog && e is AMemorialDay)
                                {
                                }
                                else if (!Resources.showIncidentsInLog && e is IncidentShort)
                                {
                                }
                                else
                                {
                                    listing_Standard.AddLabelLine(e.ShowInLog());
                                    listing_Standard.AddHorizontalLine(3f);
                                }
                            }
                        }
                    }
                    if (Resources.eventsLog.Count == 0)
                    {
                        listing_Standard.AddLabelLine("Nothing here yet.");
                    }
                }

                Widgets.EndScrollView();



                listing_Standard.End();


                filterRect = new Rect(new Vector2(outter.width, rect.position.y), new Vector2(200, 200));
                listing_Standard.Begin(filterRect);
                listing_Standard.AddLabeledCheckbox("ShowRaidsInLog".Translate(), ref Resources.showRaidsInLog);
                listing_Standard.AddLabeledCheckbox("ShowDeadColonistsInLog".Translate(), ref Resources.showDeadColonistsInLog);
                listing_Standard.AddLabeledCheckbox("ShowIncidentsInLog".Translate(), ref Resources.showIncidentsInLog);

                listing_Standard.End();
            }
        }