Esempio n. 1
0
        public void AddManagementWindow(TieredFloatMenuOption option)
        {
            MarkOptionAsSelected(option);
            TieredFloatMenu floatMenu = new ManagementMenu(this, colonistGroup, windowRect, Textures.StatMenu);

            OpenNewMenu(floatMenu);
        }
Esempio n. 2
0
        public void DoCategory(TreeNode_Pawns node, int nestLevel, int openMask, bool showSlaveSuppresion = false)
        {
            OpenCloseWidget(node, nestLevel, openMask);
            Rect rect = new Rect(15f, curY, LabelWidth, lineHeight);

            Widgets.Label(rect, node.Label);
            EndLine();

            if (node.IsOpen(openMask))
            {
                rect.xMin = XAtIndentLevel(nestLevel) + 18f;
                if (node.pawns != null)
                {
                    var pawnRows = GetPawnRows(node, 4);
                    for (var i = 0; i < pawnRows.Count; i++)
                    {
                        for (var j = 0; j < pawnRows[i].Count; j++)
                        {
                            Rect pawnRect = new Rect(xPawnRectOffset + (j * (TacticalColonistBar.DefaultBaseSize.x + xPawnIconMargin)),
                                                     rect.yMax + 10 + (i * (TacticalColonistBar.DefaultBaseSize.y + yPawnIconMargin)),
                                                     TacticalColonistBar.DefaultBaseSize.x, TacticalColonistBar.DefaultBaseSize.y);
                            Widgets.DrawBox(pawnRect);
                            ManagementMenu.DrawColonist(pawnRect, pawnRows[i][j], pawnRows[i][j].Map, false, false, showSlaveSuppresion: showSlaveSuppresion);
                            if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 2 && Mouse.IsOver(pawnRect))
                            {
                                Event.current.Use();
                                CameraJumper.TryJump(pawnRows[i][j]);
                            }
                            if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1 && Mouse.IsOver(pawnRect))
                            {
                                Event.current.Use();
                                Find.Selector.ClearSelection();
                                Find.Selector.Select(pawnRows[i][j]);
                            }
                        }
                        curY += TacticalColonistBar.DefaultBaseSize.y + yPawnIconMargin;
                    }
                }
            }
        }