Beispiel #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]));
            }
        }
Beispiel #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;
             }
         }
     }
 }
Beispiel #3
0
        public static void GenerateColonists()
        {
            do
            {
                ModdedMapInitParams.colonists.Clear();
                for (int i = 0; i < ColonistNum.Amount; i++)
                {
                    ModdedMapInitParams.colonists.Add(PawnGenerator.GeneratePawn("Colonist", Faction.OfColony));
                }
            }while (!ModdedMapInitParams.AnyoneCanDoBasicWorks());
            ModdedMapInitParams.chosenStoryteller = DefDatabase <StorytellerDef> .GetNamed("Cassandra");

            if (ModdedMapInitParams.chosenStoryteller == null)
            {
                ModdedMapInitParams.chosenStoryteller = (
                    from d in DefDatabase <StorytellerDef> .AllDefs
                    orderby d.listOrder
                    select d).First <StorytellerDef>();
            }
        }
Beispiel #4
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]));
            }
        }
Beispiel #5
0
 static ModdedMapInitParams()
 {
     MapInitParams.mapSize         = 150;
     ModdedMapInitParams.colonists = new List <Pawn>();
     ModdedMapInitParams.Clear();
 }