Esempio n. 1
0
        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]));
            }
        }
Esempio n. 2
0
 private static void ColonistRegen(string file)
 {
     using (XmlTextReader reader = new XmlTextReader(File.OpenRead(file)))
     {
         while (reader.Read())
         {
             switch (reader.Name)
             {
             case "ColonistAmount":
                 ColonistManager.RandomColonists();
                 ModdedMapInitParams.GenerateColonists();
                 break;
             }
         }
     }
 }
Esempio n. 3
0
        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]));
            }
        }