Exemplo n.º 1
0
        private static void UpdateNPCFactions(ref SpeciesControl speciesControl)
        {
            if (speciesControl.Pirate)
            {
                UpdateNPCFaction("Pirate", speciesControl.Label);
            }
            if (speciesControl.Outlander)
            {
                UpdateNPCFaction("OutlanderCivil", speciesControl.Label);
                UpdateNPCFaction("OutlanderRough", speciesControl.Label);
            }
            if (speciesControl.Tribal)
            {
                UpdateNPCFaction("TribeCivil", speciesControl.Label);
                UpdateNPCFaction("TribeRough", speciesControl.Label);
                UpdateNPCFaction("TribeSavage", speciesControl.Label);
            }

            DefDatabase <FactionDef> .AddAllInMods();

            if (Factions.IsStarWarsFactionsLoaded())
            {
                if (speciesControl.Rebels)
                {
                    UpdateNPCFaction("PJ_RebelFac", speciesControl.Label);
                }
                if (speciesControl.Scum)
                {
                    UpdateNPCFaction("PJ_Bounty", speciesControl.Label);
                }
                if (speciesControl.Empire)
                {
                    UpdateNPCFaction("PJ_GalacticEmpire", speciesControl.Label);
                }
            }
        }
Exemplo n.º 2
0
        public void DoWindowContents(Rect canvas)
        {
            SpeciesControl[] speciesList = new SpeciesControl[] {
                Twilek,
                Togruta,
                Wookiee,
                Ewok,
                Rodian,
            };
            GUI.BeginGroup(position: canvas);
            Widgets.BeginScrollView(
                outRect: canvas,
                scrollPosition: ref this.scrollPosition,
                viewRect: new Rect(x: 0f, y: 0f, width: canvas.width, height: 55 * 55f)
                );

            float num    = 6f;
            float grower = 40f;

            Text.Font = GameFont.Small;
            Rect rect;

            Widgets.DrawLineHorizontal(x: 0, y: num += grower, length: canvas.width);
            rect      = new Rect(x: 0f, y: num, width: canvas.width - 16f, height: 40f);
            Text.Font = GameFont.Medium;
            Widgets.Label(rect, "Colonist, Wanderer, Refugees, and Slaves");
            Text.Font = GameFont.Small;
            for (int x = 0; x < speciesList.Length; x++)
            {
                Widgets.DrawLineHorizontal(x: 0, y: num += grower, length: canvas.width);
                rect = new Rect(x: 0f, y: num, width: canvas.width - 16f, height: grower);
                Widgets.Label(rect, speciesList[x].Label + " settings");
                Widgets.DrawLineHorizontal(x: 0, y: num += grower, length: canvas.width);
                rect = new Rect(x: 0f, y: num, width: canvas.width - 16f, height: grower);
                Widgets.CheckboxLabeled(rect, "include " + speciesList[x].Label + " as possible colonists", ref speciesList[x].Colonist);
                rect = new Rect(x: 0f, y: num += grower, width: canvas.width - 16f, height: grower);
                Widgets.CheckboxLabeled(rect, "include " + speciesList[x].Label + " as possible wanderers", ref speciesList[x].Wanderer);
                rect = new Rect(x: 0f, y: num += grower, width: canvas.width - 16f, height: grower);
                Widgets.CheckboxLabeled(rect, "include " + speciesList[x].Label + " as possible refugees", ref speciesList[x].Refugee);
                rect = new Rect(x: 0f, y: num += grower, width: canvas.width - 16f, height: grower);
                Widgets.CheckboxLabeled(rect, "include " + speciesList[x].Label + " as potential slaves", ref speciesList[x].Slave);
            }
            Widgets.DrawLineHorizontal(x: 0, y: num += grower, length: canvas.width);
            rect      = new Rect(x: 0f, y: num, width: canvas.width - 16f, height: 40f);
            Text.Font = GameFont.Medium;
            Widgets.Label(rect, "Factions: Pirate, Outlander, and Tribals");
            Text.Font = GameFont.Small;
            for (int x = 0; x < speciesList.Length; x++)
            {
                Widgets.DrawLineHorizontal(x: 0, y: num += grower, length: canvas.width);
                rect = new Rect(x: 0f, y: num, width: canvas.width - 16f, height: grower);
                Widgets.Label(rect, speciesList[x].Label + " settings");
                Widgets.DrawLineHorizontal(x: 0, y: num += grower, length: canvas.width);
                rect = new Rect(x: 0f, y: num, width: canvas.width - 16f, height: grower);
                Widgets.CheckboxLabeled(rect, "include " + speciesList[x].Label + " in pirate faction", ref speciesList[x].Pirate);
                rect = new Rect(x: 0f, y: num += grower, width: canvas.width - 16f, height: grower);
                Widgets.CheckboxLabeled(rect, "include " + speciesList[x].Label + " in outlander factions", ref speciesList[x].Outlander);
                rect = new Rect(x: 0f, y: num += grower, width: canvas.width - 16f, height: grower);
                Widgets.CheckboxLabeled(rect, "include " + speciesList[x].Label + " in tribal factions", ref speciesList[x].Tribal);
            }
            if (Factions.IsStarWarsFactionsLoaded())
            {
                Widgets.DrawLineHorizontal(x: 0, y: num += grower, length: canvas.width);
                rect      = new Rect(x: 0f, y: num, width: canvas.width - 16f, height: 40f);
                Text.Font = GameFont.Medium;
                Widgets.Label(rect, "Star Wars Factions");
                Text.Font = GameFont.Small;
                Widgets.DrawLineHorizontal(x: 0, y: num += grower, length: canvas.width);
            }
            for (int x = 0; x < speciesList.Length; x++)
            {
                if (Factions.IsStarWarsFactionsLoaded())
                {
                    Widgets.DrawLineHorizontal(x: 0, y: num += grower, length: canvas.width);
                    rect = new Rect(x: 0f, y: num, width: canvas.width - 16f, height: grower);
                    Widgets.Label(rect, speciesList[x].Label + " settings");
                    Widgets.DrawLineHorizontal(x: 0, y: num += grower, length: canvas.width);
                    rect = new Rect(x: 0f, y: num, width: canvas.width - 16f, height: grower);
                    Widgets.CheckboxLabeled(rect, "include " + speciesList[x].Label + " in Star Wars rebel faction", ref speciesList[x].Rebels);
                    rect = new Rect(x: 0f, y: num += grower, width: canvas.width - 16f, height: grower);
                    Widgets.CheckboxLabeled(rect, "include " + speciesList[x].Label + " in Star Wars bounty hunter faction", ref speciesList[x].Scum);
                    rect = new Rect(x: 0f, y: num += grower, width: canvas.width - 16f, height: grower);
                    Widgets.CheckboxLabeled(rect, "include " + speciesList[x].Label + " in Star Wars empire faction", ref speciesList[x].Empire);
                }
            }
            Widgets.EndScrollView();
            GUI.EndGroup();
        }