Beispiel #1
0
        public static void InjectCustomUI()
        {
            Rect editButtonRect = new Rect(620f, 0.0f, 50f, 30f);

            if (ModsConfig.IsActive("hahkethomemah.simplepersonalities"))
            {
                editButtonRect.x -= 130;
            }

            if (Widgets.ButtonText(editButtonRect, "RandomPlus.FilterButton".Translate(), true, false, true))
            {
                var page = new Page_RandomEditor();
                Find.WindowStack.Add(page);
            }

            Rect rerollLabelRect = new Rect(620f, 40f, 200f, 30f);

            if (ModsConfig.IdeologyActive)
            {
                rerollLabelRect.y += 40;
            }

            string labelText = "RandomPlus.RerollLabel".Translate() + RandomSettings.RandomRerollCounter() + "/" + RandomSettings.PawnFilter.RerollLimit;

            var tmpSave = GUI.color;

            if (RandomSettings.RandomRerollCounter() >= RandomSettings.PawnFilter.RerollLimit)
            {
                GUI.color = Color.red;
            }
            Widgets.Label(rerollLabelRect, labelText);
            GUI.color = tmpSave;
        }
        public static void DrawEditButton()
        {
            Rect editButtonRect = new Rect(620f, 0.0f, 50f, 30f);

            if (Widgets.ButtonText(editButtonRect, "Edit", true, false, true))
            {
                var page = new Page_RandomEditor();
                Find.WindowStack.Add(page);
            }

            Rect   rerollLabelRect = new Rect(620f, 40f, 200f, 30f);
            string labelText       = "Rerolls: " + RandomSettings.RandomRerollCounter() + "/" + RandomSettings.RandomRerollLimit();

            var tmpSave = GUI.color;

            if (RandomSettings.RandomRerollCounter() >= RandomSettings.RandomRerollLimit())
            {
                GUI.color = Color.red;
            }
            Widgets.Label(rerollLabelRect, labelText);
            GUI.color = tmpSave;
        }