protected override void FillWindow(Rect inRect) { GenFont.SetFontMedium(); //Header Rect HeaderPos = new Rect(0f, 0f, WinSize.x, 40f); GUI.Label(HeaderPos, Language.FindText(LoadLanguage.language, "Use the Colonist Creation Menu?")); //SelectDown Rect YesPos = new Rect(0f, 55f, ButtonSize.x, ButtonSize.y); if (Widgets.TextButton(YesPos, Language.FindText(LoadLanguage.language, "Yes"))) { ColonistManager.Population.Clear(); if (Genstep_ColonistCreationMod.BaseStats[0] == false) { Find.LayerStack.Add(new ColonistDifficulty()); } else { Find.LayerStack.Add(new ColonistNum()); } } Rect NoPos = new Rect(WinSize.x - 160f, 55f, ButtonSize.x, ButtonSize.y); if (Widgets.TextButton(NoPos, Language.FindText(LoadLanguage.language, "No"))) { base.Close(); Genstep_ColonistCreationMod.SpawnStartingColonists(); } }
protected override void FillWindow(Rect inRect) { GenFont.SetFontMedium(); //Header Rect HeaderPos = new Rect(40f, 0f, WinSize.x, 40f); GUI.Label(HeaderPos, Language.FindText(LoadLanguage.language, "Choose your difficulty") + ":"); //Easy Rect EasyPos = new Rect(0f, 60f, 280f, 40f); if (Widgets.TextButton(EasyPos, Language.FindText(LoadLanguage.language, "Easy"))) { Difficulty = "Easy"; ColonistNum.Amount = 3; Find.LayerStack.Add(new ColonistNum()); } //Normal Rect NormalPos = new Rect(0f, 110f, 280f, 40f); if (Widgets.TextButton(NormalPos, Language.FindText(LoadLanguage.language, "Normal"))) { Difficulty = "Normal"; ColonistNum.Amount = 3; Find.LayerStack.Add(new ColonistNum()); } //Hard Rect HardPos = new Rect(0f, 160f, 280f, 40f); if (Widgets.TextButton(HardPos, Language.FindText(LoadLanguage.language, "Hard"))) { Difficulty = "Hard"; ColonistNum.Amount = 3; Find.LayerStack.Add(new ColonistNum()); } //Insane Rect InsanePos = new Rect(0f, 210f, 280f, 40f); if (Widgets.TextButton(InsanePos, Language.FindText(LoadLanguage.language, "Insane"))) { Difficulty = "Insane"; ColonistNum.Amount = 1; ModdedMapInitParams.GenerateColonists(); if (Genstep_ColonistCreationMod.BaseStats[0] == false) { ColonistManager.RandomColonists(); } else { ColonistManager.PawnsToColonists(); } Find.LayerStack.Add(new ColonistCreationMenu(ColonistManager.Population[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(); } }
protected override void FillWindow(Rect inRect) { GenFont.SetFontMedium(); //Header Rect HeaderPos = new Rect(0f, 0f, WinSize.x, 40f); GUI.Label(HeaderPos, Language.FindText(LoadLanguage.language, "Start with how many colonists?")); //SelectDown Rect DownPos = new Rect(80f, 55f, 40f, 40f); if (Widgets.TextButton(DownPos, "<".Translate())) { if (ColonistDifficulty.Difficulty == "Easy") { if (Amount > 3) { //Lower amount and re-display Amount--; ShowAmount(new Rect(135f, 60f, 40f, 40f)); } } else if (ColonistDifficulty.Difficulty == "Normal") { if (Amount > 2) { //Lower amount and re-display Amount--; ShowAmount(new Rect(135f, 60f, 40f, 40f)); } } else { if (Amount > 1) { //Lower amount and re-display Amount--; ShowAmount(new Rect(135f, 60f, 40f, 40f)); } } } //ShowAmount ShowAmount(new Rect(135f, 60f, 40f, 40f)); //SelectUp Rect UpPos = new Rect(160f, 55f, 40f, 40f); if (Widgets.TextButton(UpPos, ">".Translate())) { if (ColonistDifficulty.Difficulty == "Easy") { if (Amount < 5) { //Raise amount and re-display Amount++; ShowAmount(new Rect(135f, 60f, 40f, 40f)); } } else if (ColonistDifficulty.Difficulty == "Normal") { if (Amount < 4) { //Raise amount and re-display Amount++; ShowAmount(new Rect(135f, 60f, 40f, 40f)); } } else { if (Amount < 3) { //Raise amount and re-display Amount++; ShowAmount(new Rect(135f, 60f, 40f, 40f)); } } } GenFont.SetFontSmall(); //Return to Menu Rect ReturnPos = new Rect(0, WinSize.y - 75, ButtonSize.x, ButtonSize.y); if (Widgets.TextButton(ReturnPos, Language.FindText(LoadLanguage.language, "Back"))) { Application.LoadLevel("Entry"); } //Accept Rect AcceptPos = new Rect((WinSize.x - ButtonSize.x) - 40f, WinSize.y - 75, ButtonSize.x, ButtonSize.y); if (Widgets.TextButton(AcceptPos, Language.FindText(LoadLanguage.language, "Accept"))) { ModdedMapInitParams.GenerateColonists(); if (Genstep_ColonistCreationMod.BaseStats[0] == false) { ColonistManager.RandomColonists(); } else { ColonistManager.PawnsToColonists(); } Find.LayerStack.Add(new ColonistCreationMenu(ColonistManager.Population[0])); } }
private void ShowAmount(Rect AmountPos) { GenFont.SetFontMedium(); GUI.Label(AmountPos, Amount.ToString().Translate()); }
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(); } }
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(); } }