Exemple #1
0
        public void CreateColorSelector(ref Color c, float left, float top)
        {
            GenFont.SetFontTiny();
            Rect position = new Rect(left + 10f, top, 100f, 20f);

            GUI.Label(position, Language.FindText(LoadLanguage.language, "Choose Color"));
            position  = new Rect(left, top + 20f, 100f, 20f);
            GUI.color = c;
            GUI.Box(position, ctex);
            GUI.color = Color.white;
            position  = new Rect(left + 15f, top + 42f, 20f, 20f);
            GUI.color = Color.red;
            GUI.Label(position, "R");
            position  = new Rect(left + 45f, top + 42f, 20f, 20f);
            GUI.color = Color.green;
            GUI.Label(position, "G");
            position  = new Rect(left + 75f, top + 42f, 20f, 20f);
            GUI.color = Color.blue;
            GUI.Label(position, "B");
            GUI.color = Color.white;
            position  = new Rect(left + 10f, top + 65f, 20f, 70f);
            float num = GUI.VerticalSlider(position, c.r, 1f, 0f);

            if (c.r != num)
            {
                c.r = num;
            }
            position = new Rect(left + 40f, top + 65f, 20f, 70f);
            float num2 = GUI.VerticalSlider(position, c.g, 1f, 0f);

            if (c.g != num2)
            {
                c.g = num2;
            }
            position = new Rect(left + 70f, top + 65f, 20f, 70f);
            float num3 = GUI.VerticalSlider(position, c.b, 1f, 0f);

            if (c.b != num3)
            {
                c.b = num3;
            }
        }
Exemple #2
0
        protected override void FillWindow(Rect inRect)
        {
            GenFont.SetFontMedium();
            GUI.contentColor = Color.white;
            Rect     position = new Rect(0f, 2f, 520f, 20f);
            GUIStyle gUIStyle = new GUIStyle();

            gUIStyle.alignment          = TextAnchor.MiddleCenter;
            gUIStyle.onNormal.textColor = Color.yellow;
            gUIStyle.normal.textColor   = Color.yellow;
            GUI.Label(position, Language.FindText(LoadLanguage.language, "Change Clothing"), gUIStyle);

            //Shirt
            GenFont.SetFontTiny();
            position = new Rect(0f, 50f, 200f, 20f);
            GUI.Label(position, Language.FindText(LoadLanguage.language, "Shirt"));

            Rect position2 = new Rect(30f, 70f, 100f, 24f);

            position = new Rect(0f, 70f, 24f, 24f);
            if (Widgets.TextButton(position, "<"))
            {
                ShirtDown(position2);
            }
            GUI.Label(position2, Language.FindText(LoadLanguage.language, ShirtList[shirtindex].Label));
            position = new Rect(140f, 70f, 24f, 24f);
            if (Widgets.TextButton(position, ">"))
            {
                ShirtUp(position2);
            }

            common.CreateColorSelector(ref color1, 210f, 50f);

            //Coat
            position = new Rect(0f, 190f, 200f, 20f);
            GUI.Label(position, Language.FindText(LoadLanguage.language, "Coat"));
            position2 = new Rect(30f, 210f, 100f, 24f);

            position = new Rect(0f, 210f, 24f, 24f);
            if (Widgets.TextButton(position, "<"))
            {
                CoatDown(position2);
            }
            GUI.Label(position2, Language.FindText(LoadLanguage.language, CoatList[coatindex].Label));
            position = new Rect(140f, 210f, 24f, 24f);
            if (Widgets.TextButton(position, ">"))
            {
                CoatUp(position2);
            }

            common.CreateColorSelector(ref color2, 210f, 190f);

            //Preview
            position = new Rect(320f, 50f, 240f, 280f);
            GUI.Box(position, "");

            common.CreatePawnPreview(colonist, 380f, 140f, colonist.BodyType.ToString(), colonist.HeadGraphicPath, thisShirt, thisCoat, colonist.HairDef.GraphicPath, colonist.SkinColor, color1, color2, colonist.HairColor);

            GenFont.SetFontMedium();
            GUI.color = Color.white;
            if (Widgets.TextButton(new Rect(inRect.width / 2f + 20f, inRect.height - 35f, inRect.width / 2f - 20f, 35f), "Confirm".Translate()))
            {
                thisShirt.Color      = color1;
                thisCoat.Color       = color2;
                colonist.Clothing[0] = thisShirt;
                colonist.Clothing[1] = thisCoat;
                base.Close();
            }
            if (Widgets.TextButton(new Rect(0f, inRect.height - 35f, inRect.width / 2f - 20f, 35f), "Back".Translate()))
            {
                base.Close();
            }
        }
Exemple #3
0
        protected override void FillWindow(Rect inRect)
        {
            Vector2 vector  = new Vector2(inRect.width - 16f, 48f);
            Vector2 vector2 = new Vector2(100f, vector.y - 12f);

            inRect.height -= 45f;
            List <FileInfo> list     = SaveFiles.AllSaveFiles.ToList <FileInfo>();
            float           num      = vector.y + 8f;
            float           height   = (float)list.Count * num;
            Rect            viewRect = new Rect(0f, 0f, inRect.width - 16f, height);
            Rect            position = new Rect(inRect.AtZero());

            position.height    -= this.bottomAreaHeight;
            this.scrollPosition = GUI.BeginScrollView(position, this.scrollPosition, viewRect);
            float num2 = 0f;

            foreach (FileInfo current in list)
            {
                Rect rect = new Rect(0f, num2, vector.x, vector.y);
                Widgets.DrawMenuSection(rect);
                Rect innerRect = rect.GetInnerRect(6f);
                GUI.BeginGroup(innerRect);
                string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(current.Name);
                if (MapFiles.IsAutoSave(fileNameWithoutExtension))
                {
                    GUI.color = DialogList.AutosaveTextColor;
                }
                else
                {
                    GUI.color = DialogList.ManualSaveTextColor;
                }
                Rect position2 = new Rect(15f, 0f, innerRect.width, innerRect.height);
                GUI.skin.label.alignment = TextAnchor.MiddleLeft;
                GenFont.SetFontSmall();
                GUI.Label(position2, fileNameWithoutExtension);
                GUI.color = Color.white;
                Rect position3 = new Rect(220f, 0f, innerRect.width, innerRect.height);
                GenFont.SetFontTiny();
                GUI.color = new Color(1f, 1f, 1f, 0.5f);
                GUI.Label(position3, current.LastWriteTime.ToString());
                GUI.color = Color.white;
                GUI.skin.label.alignment = TextAnchor.UpperLeft;
                GenFont.SetFontSmall();
                float num3    = vector.x - 12f - vector2.x - vector2.y;
                Rect  butRect = new Rect(num3, 0f, vector2.x, vector2.y);
                if (Widgets.TextButton(butRect, this.interactButLabel))
                {
                    this.DoMapEntryInteraction(Path.GetFileNameWithoutExtension(current.Name));
                }
                Rect rect2 = new Rect(num3 + vector2.x + 5f, 0f, vector2.y, vector2.y);
                if (Widgets.ImageButton(rect2, ButtonText.DeleteX))
                {
                    FileInfo localFile = current;
                    Find.UIRoot.layers.Add(new Dialog_Confirm("ConfirmDelete".Translate(new object[]
                    {
                        localFile.Name
                    }), delegate
                    {
                        localFile.Delete();
                    }, true));
                }
                TooltipHandler.TipRegion(rect2, "DeleteThisSavegame".Translate());
                GUI.EndGroup();
                num2 += vector.y + 8f;
            }
            GUI.EndScrollView();
            this.DoSpecialSaveLoadGUI(inRect.AtZero());
        }
Exemple #4
0
        protected override void FillWindow(Rect inRect)
        {
            GenFont.SetFontMedium();
            GUI.contentColor = Color.white;
            Rect     position = new Rect(0f, 2f, 520f, 20f);
            GUIStyle gUIStyle = new GUIStyle();

            gUIStyle.alignment          = TextAnchor.MiddleCenter;
            gUIStyle.onNormal.textColor = Color.yellow;
            gUIStyle.normal.textColor   = Color.yellow;
            GUI.Label(position, Language.FindText(LoadLanguage.language, "Change Head"), gUIStyle);

            //Face
            GenFont.SetFontTiny();
            position = new Rect(0f, 50f, 200f, 20f);
            GUI.Label(position, Language.FindText(LoadLanguage.language, "Face"));

            //Face1
            Rect position2 = new Rect(30f, 70f, 100f, 24f);

            position = new Rect(0f, 70f, 24f, 24f);
            if (Widgets.TextButton(position, "<"))
            {
                Face1Down(position2);
            }
            GUI.Label(position2, Language.FindText(LoadLanguage.language, Face1List[face1index]));
            position = new Rect(140f, 70f, 24f, 24f);
            if (Widgets.TextButton(position, ">"))
            {
                Face1Up(position2);
            }

            //Face2
            position2 = new Rect(30f, 100f, 100f, 24f);
            position  = new Rect(0f, 100f, 24f, 24f);
            if (Widgets.TextButton(position, "<"))
            {
                Face2Down(position2);
            }
            GUI.Label(position2, Language.FindText(LoadLanguage.language, Face2List[face2index]));
            position = new Rect(140f, 100f, 24f, 24f);
            if (Widgets.TextButton(position, ">"))
            {
                Face2Up(position2);
            }

            //Hair
            position = new Rect(0f, 190f, 200f, 20f);
            GUI.Label(position, Language.FindText(LoadLanguage.language, "Hair"));
            position2 = new Rect(30f, 210f, 100f, 24f);

            position = new Rect(0f, 210f, 24f, 24f);
            if (Widgets.TextButton(position, "<"))
            {
                HairDown(position2);
            }

            if (colonist.Gender == 1)
            {
                GUI.Label(position2, Language.FindText(LoadLanguage.language, MaleHairList[hairindex].Label));
            }
            else if (colonist.Gender == 2)
            {
                GUI.Label(position2, Language.FindText(LoadLanguage.language, FemaleHairList[hairindex].Label));
            }

            position = new Rect(140f, 210f, 24f, 24f);
            if (Widgets.TextButton(position, ">"))
            {
                HairUp(position2);
            }

            common.CreateColorSelector(ref hairColor, 210f, 190f);

            Clothing l      = null;
            Clothing l2     = null;
            Color    color  = Color.gray;
            Color    color2 = Color.gray;

            foreach (Clothing clothing in colonist.Clothing)
            {
                if (clothing.Layer.ToString() == "OnSkin")
                {
                    l     = clothing;
                    color = clothing.Color;
                }
                else
                {
                    if (clothing.Layer.ToString() == "Shell")
                    {
                        l2     = clothing;
                        color2 = clothing.Color;
                    }
                }
            }

            position = new Rect(320f, 50f, 240f, 280f);
            GUI.Box(position, "");
            common.CreatePawnPreview(colonist, 390f, 120f, colonist.BodyType.ToString(), thisFace, l, l2, thisHair.GraphicPath, colonist.SkinColor, color, color2, hairColor);

            GenFont.SetFontMedium();
            GUI.color = Color.white;
            if (Widgets.TextButton(new Rect(inRect.width / 2f + 20f, inRect.height - 35f, inRect.width / 2f - 20f, 35f), "Confirm".Translate()))
            {
                colonist.HairColor       = hairColor;
                colonist.HairDef         = thisHair;
                colonist.HeadGraphicPath = thisFace;
                base.Close();
            }
            if (Widgets.TextButton(new Rect(0f, inRect.height - 35f, inRect.width / 2f - 20f, 35f), "Back".Translate()))
            {
                base.Close();
            }
        }
Exemple #5
0
        protected override void FillWindow(Rect inRect)
        {
            GenFont.SetFontMedium();
            GUI.contentColor = Color.white;
            Rect     position = new Rect(0f, 2f, 520f, 20f);
            GUIStyle gUIStyle = new GUIStyle();

            gUIStyle.alignment          = TextAnchor.MiddleCenter;
            gUIStyle.onNormal.textColor = Color.yellow;
            gUIStyle.normal.textColor   = Color.yellow;
            GUI.Label(position, Language.FindText(LoadLanguage.language, "Change Skin"), gUIStyle);

            //Body
            GenFont.SetFontTiny();
            position = new Rect(0f, 50f, 200f, 20f);
            GUI.Label(position, Language.FindText(LoadLanguage.language, "Body Shape"));

            Rect position2 = new Rect(30f, 70f, 100f, 24f);

            position = new Rect(0f, 70f, 24f, 24f);
            if (Widgets.TextButton(position, "<"))
            {
                BodyDown(position2);
            }
            GUI.Label(position2, Language.FindText(LoadLanguage.language, BodyList[bodyindex].ToString()));
            position = new Rect(140f, 70f, 24f, 24f);
            if (Widgets.TextButton(position, ">"))
            {
                BodyUp(position2);
            }

            //Skin
            GenFont.SetFontTiny();
            position = new Rect(0f, 190f, 200f, 20f);
            GUI.Label(position, Language.FindText(LoadLanguage.language, "Skin Color"));

            position2 = new Rect(30f, 210f, 100f, 24f);
            position  = new Rect(0f, 210f, 24f, 24f);
            if (Widgets.TextButton(position, "<"))
            {
                SkinDown(position2);
            }
            GUI.Label(position2, Language.FindText(LoadLanguage.language, SkinList[skinindex].ToString()));
            position = new Rect(140f, 210f, 24f, 24f);
            if (Widgets.TextButton(position, ">"))
            {
                SkinUp(position2);
            }

            Clothing l      = null;
            Clothing l2     = null;
            Color    color  = Color.gray;
            Color    color2 = Color.gray;

            foreach (Clothing clothing in colonist.Clothing)
            {
                if (clothing.Layer.ToString() == "OnSkin")
                {
                    l     = clothing;
                    color = clothing.Color;
                }
                else
                {
                    if (clothing.Layer.ToString() == "Shell")
                    {
                        l2     = clothing;
                        color2 = clothing.Color;
                    }
                }
            }

            position = new Rect(320f, 50f, 240f, 280f);
            GUI.Box(position, "");
            common.CreatePawnPreview(colonist, 390f, 120f, selectedBody, colonist.HeadGraphicPath, l, l2, colonist.HairDef.GraphicPath, skinColor, color, color2, colonist.HairColor);

            GenFont.SetFontMedium();
            GUI.color = Color.white;
            if (Widgets.TextButton(new Rect(inRect.width / 2f + 20f, inRect.height - 35f, inRect.width / 2f - 20f, 35f), "Confirm".Translate()))
            {
                colonist.SkinColor = skinColor;
                base.Close();
            }
            if (Widgets.TextButton(new Rect(0f, inRect.height - 35f, inRect.width / 2f - 20f, 35f), "Back".Translate()))
            {
                base.Close();
            }
        }