Ejemplo n.º 1
0
            public override void DoWindowContents(Rect inRect)
            {
                int size = defSize * 25;

                Text.Font = GameFont.Small;

                int  y = 0;
                Rect scrollRectFact     = new Rect(0, 0, 190, 390);
                Rect scrollVertRectFact = new Rect(0, 0, scrollRectFact.x, size);

                Widgets.BeginScrollView(scrollRectFact, ref scrollPosition, scrollVertRectFact);

                foreach (var def in DefDatabase <BaseBlueprintDef> .AllDefs)
                {
                    if (Widgets.ButtonText(new Rect(0, y, 170, 20), def.defName))
                    {
                        Thing t = Find.Selector.SingleSelectedThing;
                        if (t != null)
                        {
                            BlueprintHandler.CreateBlueprintAt(t.Position, Find.CurrentMap, def, Find.FactionManager.RandomEnemyFaction(), null, out Dictionary <Pawn, LordType> pawns, out float totalThreat, true);
                        }
                        else
                        {
                            Log.Message($"THING NULL");
                        }
                    }
                    y += 22;
                }

                Widgets.EndScrollView();
            }
Ejemplo n.º 2
0
        public override void PostMapGenerate()
        {
            base.PostMapGenerate();

            BaseBlueprintDef basePrint = GetBaseBlueprint();

            BlueprintHandler.CreateBlueprintAt(settlement.Map.Center, settlement.Map, basePrint, settlement.Faction, null, out Dictionary <Pawn, LordType> pawns, out float totalThreat, true);
            foreach (var p in pawns.Keys)
            {
                friendlyPawns.Add(p);
                if (p != null)
                {
                    p.SetFaction(Faction.OfPlayer);
                }
            }

            friendlyPawnsBeforeAttack = friendlyPawns.Count;

            if (HelpShowed == false)
            {
                ShowHelp();
            }
        }
Ejemplo n.º 3
0
        public override void PostMapGenerate()
        {
            base.PostMapGenerate();

            BlueprintHandler.CreateBlueprintAt(camp.Map.Center, camp.Map, baseBlueprint, camp.Faction, null, out Dictionary <Pawn, LordType> pawnsList, out totalThreat, true);
        }