Ejemplo n.º 1
0
        public override void DoWindowContents(Rect inRect)
        {
            Rect unnamedCounter = new Rect(inRect.x + 10, 0, 300, 52);

            Widgets.Label(unnamedCounter, "Unnamed Colonists: " + unnamedColonists.Count);

            Rect colonistPortrait = new Rect(inRect.x + 10, 60, 100, 140);

            DrawColonist(colonistPortrait, selectedPawn);

            Rect rightSide = new Rect(130, 60, 300, 26);

            selectedUsername = Widgets.TextEntryLabeled(rightSide, "Username:"******"Assign Viewer"))
            {
                if (selectedUsername == "")
                {
                    return;
                }

                NameColonist(selectedUsername, selectedPawn);
            }

            if (pawnComponent.HasPawnBeenNamed(selectedPawn))
            {
                rightSide.y += 32;

                if (Widgets.ButtonText(rightSide, "Rename Colonist"))
                {
                    Dialog_NamePawn dialog = new Dialog_NamePawn(selectedPawn);
                    Find.WindowStack.Add(dialog);
                }
            }

            rightSide.x    -= 70;
            rightSide.y    += 40;
            rightSide.width = 250;

            Widgets.CheckboxLabeled(rightSide, "Rename pawn on assignment", ref renamePawn);

            Rect pawnSelectors = new Rect(26, 210, 40, 26);

            if (Widgets.ButtonText(pawnSelectors, "<"))
            {
                GetPawn(PawnQueueSelector.Back);
            }

            pawnSelectors.x += 42;
            if (Widgets.ButtonText(pawnSelectors, ">"))
            {
                GetPawn(PawnQueueSelector.Next);
            }

            Rect namedStatus = new Rect(0, 236, 300, 26);
            bool viewerNamed = pawnComponent.HasPawnBeenNamed(selectedPawn);

            Widgets.Label(namedStatus, "Name: " + selectedPawn.Name);

            namedStatus.y += 26;
            Widgets.Label(
                namedStatus,
                "Colonist " + (
                    viewerNamed ?
                    "Named after <color=#4BB543>" + pawnComponent.UserAssignedToPawn(selectedPawn) + "</color>" :
                    "<color=#B2180E>Unnamed</color>"
                    )
                );

            Rect queueButtons = new Rect(0, 300, 200, 28);

            Widgets.Label(queueButtons, "Viewers in Queue: " + pawnComponent.ViewersInQueue());

            queueButtons.y += 32;
            if (Widgets.ButtonText(queueButtons, "Next Viewer"))
            {
                selectedUsername = pawnComponent.GetNextViewerFromQueue();
            }

            queueButtons.y += 32;
            if (Widgets.ButtonText(queueButtons, "Random Viewer"))
            {
                selectedUsername = pawnComponent.GetRandomViewerFromQueue();
            }

            queueButtons.y += 32;
            if (Widgets.ButtonText(queueButtons, "Ban Viewer"))
            {
                Viewer viewer = Viewers.GetViewer(selectedUsername);
                viewer.BanViewer();
            }
        }
Ejemplo n.º 2
0
        public override void DoWindowContents(Rect inRect)
        {
            Rect unnamedCounter = new Rect(inRect.x + 10, 0, 300, 52);

            Widgets.Label(unnamedCounter, "Unnamed Colonists: " + unnamedColonists.Count);

            Rect colonistPortrait = new Rect(inRect.x + 10, 60, 100, 140);

            DrawColonist(colonistPortrait, selectedPawn);

            Rect rightSide = new Rect(130, 60, 300, 26);

            selectedUsername = Widgets.TextEntryLabeled(rightSide, "Username:"******"Assign"))
            {
                NameColonist(selectedUsername, selectedPawn);
            }

            Rect pawnSelectors = new Rect(26, 210, 40, 26);

            if (Widgets.ButtonText(pawnSelectors, "<"))
            {
                GetPawn(PawnQueueSelector.Back);
            }

            pawnSelectors.x += 42;
            if (Widgets.ButtonText(pawnSelectors, ">"))
            {
                GetPawn(PawnQueueSelector.Next);
            }

            Rect namedStatus = new Rect(0, 236, 300, 26);
            bool viewerNamed = pawnComponent.HasPawnBeenNamed(selectedPawn);

            Widgets.Label(namedStatus, "Name: " + selectedPawn.Name);

            namedStatus.y += 26;
            Widgets.Label(
                namedStatus,
                "Colonist " + (
                    viewerNamed ?
                    "Named after <color=#4BB543>" + pawnComponent.UserAssignedToPawn(selectedPawn) + "</color>" :
                    "<color=#B2180E>Unnamed</color>"
                    )
                );

            Rect queueButtons = new Rect(0, 300, 200, 26);

            Widgets.Label(queueButtons, "Viewers in Queue: " + pawnComponent.ViewersInQueue());

            queueButtons.y += 26;
            if (Widgets.ButtonText(queueButtons, "Next Viewer from Queue"))
            {
                selectedUsername = pawnComponent.GetNextViewerFromQueue();
            }

            queueButtons.y += 26;
            if (Widgets.ButtonText(queueButtons, "Random Viewer from Queue"))
            {
                selectedUsername = pawnComponent.GetRandomViewerFromQueue();
            }

            queueButtons.y += 26;
            if (Widgets.ButtonText(queueButtons, "Ban Viewer from Queue"))
            {
                pawnComponent.BanUserFromQueue(selectedUsername);
            }
        }