Example #1
0
            internal void Iterate()
            {
                ConceptDatabase.KnowledgeDemonstrated(ConceptDefOf.InspectRoomStats, KnowledgeAmount.GuiFrame);
                Text.Font = GameFont.Small;
                float num  = 19f;
                Rect  rect = new Rect(19f, num, this.windowRect.width - 38f, 100f);

                GUI.color = Color.white;
                Widgets.Label(rect, RoomStatsDrawer.GetRoomRoleLabel(this.room));
                num += 25f;
                for (int i = 0; i < DefDatabase <RoomStatDef> .AllDefsListForReading.Count; i++)
                {
                    RoomStatDef roomStatDef = DefDatabase <RoomStatDef> .AllDefsListForReading[i];
                    if (!roomStatDef.isHidden)
                    {
                        float stat = this.room.GetStat(roomStatDef);
                        RoomStatScoreStage scoreStage = roomStatDef.GetScoreStage(stat);
                        if (this.room.Role.IsStatRelated(roomStatDef))
                        {
                            GUI.color = RoomStatsDrawer.RelatedStatColor;
                        }
                        else
                        {
                            GUI.color = Color.gray;
                        }
                        Rect rect2 = new Rect(rect.x, num, RoomStatsDrawer.statLabelColumnWidth, 23f);
                        Widgets.Label(rect2, roomStatDef.LabelCap);
                        Rect   rect3 = new Rect(rect2.xMax + 35f, num, RoomStatsDrawer.scoreColumnWidth, 23f);
                        string label;
                        if (roomStatDef.displayRounded)
                        {
                            label = Mathf.RoundToInt(stat).ToString();
                        }
                        else
                        {
                            label = stat.ToString("0.##");
                        }
                        Widgets.Label(rect3, label);
                        Rect rect4 = new Rect(rect3.xMax + 35f, num, RoomStatsDrawer.scoreStageLabelColumnWidth, 23f);
                        Widgets.Label(rect4, scoreStage.label);
                        num += 25f;
                    }
                }
                GUI.color = Color.white;
            }
Example #2
0
        public override void UIRootOnGUI()
        {
            this.CallAncestorUIRootOnGUI();
            this.screenSizeMonitor.Update();
            this.thingOverlays.ThingOverlaysOnGUI();
            for (int i = 0; i < Find.Map.components.Count; i++)
            {
                Find.Map.components[i].MapComponentOnGUI();
            }
            bool filtersCurrentEvent = this.screenshotMode.FiltersCurrentEvent;

            foreach (IRenderedComponent current in this.renderedComponents)
            {
                if (!filtersCurrentEvent || current.RenderWithScreenshots)
                {
                    current.OnGUI();
                }
            }
            BeautyDrawer.BeautyOnGUI();
            this.selector.dragBox.DragBoxOnGUI();
            DesignatorManager.DesignationManagerOnGUI();
            this.targeter.TargeterOnGUI();
            Find.TooltipGiverList.DispenseAllThingTooltips();
            Find.ColonyInfo.ColonyInfoOnGUI();
            DebugTools.DebugToolsOnGUI();
            if (!this.screenshotMode.FiltersCurrentEvent)
            {
                this.globalControls.GlobalControlsOnGUI();
                this.resourceReadout.ResourceReadoutOnGUI();
                this.mainTabsRoot.MainTabsOnGUI();
                this.mouseoverReadout.MouseoverReadoutOnGUI();
                this.alerts.AlertsReadoutOnGUI();
                ActiveTutorNoteManager.ActiveLessonManagerOnGUI();
            }
            RoomStatsDrawer.RoomStatsOnGUI();
            Find.DebugDrawer.DebugDrawerOnGUI();
            this.windows.WindowStackOnGUI();
            DesignatorManager.ProcessInputEvents();
            this.targeter.ProcessInputEvents();
            this.mainTabsRoot.HandleLowPriorityShortcuts();
            this.selector.SelectorOnGUI();
            this.OpenMainMenuShortcut();
        }
Example #3
0
 public override void UIRootUpdate()
 {
     this.CallAncestorUIRootUpdate();
     try
     {
         Messages.Update();
         this.targeter.TargeterUpdate();
         SelectionDrawer.DrawSelectionOverlays();
         RoomStatsDrawer.DrawRoomOverlays();
         DesignatorManager.DesignatorManagerUpdate();
         this.alerts.AlertsReadoutUpdate();
         ConceptDecider.ConceptDeciderUpdate();
         foreach (IUpdatedComponent current in this.updatedComponents)
         {
             current.Update();
         }
     }
     catch (Exception ex)
     {
         Log.Error("Exception in UIRootUpdate: " + ex.ToString());
     }
 }
Example #4
0
 public static void RoomStatsOnGUI()
 {
     RoomStatsDrawer.Anonymous temp = new RoomStatsDrawer.Anonymous();
     if (!RoomStatsDrawer.ShouldShowRoomStats)
     {
         return;
     }
     temp.room = Gen.MouseCell().GetRoom();
     Text.Font = GameFont.Small;
     RoomStatsDrawer.CalculateColumnsSizes(temp.room);
     temp.windowRect = new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 108f + RoomStatsDrawer.statLabelColumnWidth + RoomStatsDrawer.scoreColumnWidth + RoomStatsDrawer.scoreStageLabelColumnWidth, (float)(65 + RoomStatsDrawer.DisplayedRoomStatsCount * 25));
     RoomStatsDrawer.Anonymous temp5 = temp;
     temp5.windowRect.x = temp5.windowRect.x + 5f;
     RoomStatsDrawer.Anonymous temp2 = temp;
     temp2.windowRect.y = temp2.windowRect.y + 5f;
     if (temp.windowRect.xMax > (float)Screen.width)
     {
         RoomStatsDrawer.Anonymous temp3 = temp;
         temp3.windowRect.x = temp3.windowRect.x - (temp.windowRect.width + 10f);
     }
     if (temp.windowRect.yMax > (float)Screen.height)
     {
         RoomStatsDrawer.Anonymous temp4 = temp;
         temp4.windowRect.y = temp4.windowRect.y - (temp.windowRect.height + 10f);
     }
     Find.WindowStack.ImmediateWindow(74975, temp.windowRect, WindowLayer.Super, delegate
     {
         ConceptDatabase.KnowledgeDemonstrated(ConceptDefOf.InspectRoomStats, KnowledgeAmount.GuiFrame);
         Text.Font = GameFont.Small;
         float num = 19f;
         Rect rect = new Rect(19f, num, temp.windowRect.width - 38f, 100f);
         GUI.color = Color.white;
         Widgets.Label(rect, RoomStatsDrawer.GetRoomRoleLabel(temp.room));
         num += 25f;
         for (int i = 0; i < DefDatabase <RoomStatDef> .AllDefsListForReading.Count; i++)
         {
             RoomStatDef roomStatDef = DefDatabase <RoomStatDef> .AllDefsListForReading[i];
             if (!roomStatDef.isHidden)
             {
                 float stat = temp.room.GetStat(roomStatDef);
                 RoomStatScoreStage scoreStage = roomStatDef.GetScoreStage(stat);
                 if (temp.room.Role.IsStatRelated(roomStatDef))
                 {
                     GUI.color = RoomStatsDrawer.RelatedStatColor;
                 }
                 else
                 {
                     GUI.color = Color.gray;
                 }
                 Rect rect2 = new Rect(rect.x, num, RoomStatsDrawer.statLabelColumnWidth, 23f);
                 Widgets.Label(rect2, roomStatDef.LabelCap);
                 Rect rect3 = new Rect(rect2.xMax + 35f, num, RoomStatsDrawer.scoreColumnWidth, 23f);
                 string label;
                 if (roomStatDef.displayRounded)
                 {
                     label = Mathf.RoundToInt(stat).ToString();
                 }
                 else
                 {
                     label = stat.ToString("0.##");
                 }
                 Widgets.Label(rect3, label);
                 Rect rect4 = new Rect(rect3.xMax + 35f, num, RoomStatsDrawer.scoreStageLabelColumnWidth, 23f);
                 Widgets.Label(rect4, scoreStage.label);
                 num += 25f;
             }
         }
         GUI.color = Color.white;
     }, true, false, 1f);
 }
Example #5
0
 public void Update()
 {
     RoomStatsDrawer.DrawRoomOverlays();
 }
 public void OnGUI()
 {
     RoomStatsDrawer.RoomStatsOnGUI();
 }