コード例 #1
0
        private void DrawColonySettlementCreationButton(Rect inRect)
        {
            Rect button = new Rect(InitialSize.x - 215, 40, 190, 20);

            Text.Anchor = TextAnchor.MiddleLeft;
            Text.Font   = GameFont.Small;

            Faction gfaction = FactionColonies.getPlayerColonyFaction();

            if (gfaction != null)
            {
                if (Widgets.ButtonText(button, "CreateNewColony".Translate()))
                {
                    Find.WindowStack.Add(new createColonyWindowFC());

                    //Move player to world map
                    Find.World.renderer.wantedMode = WorldRenderMode.Planet;

                    Messages.Message("SelectTile".Translate(), MessageTypeDefOf.NegativeEvent);
                }
            }
            else               //create new faction
            {
                if (Widgets.ButtonText(button, "Create New Faction"))
                {
                    FactionColonies.createPlayerColonyFaction();
                    Find.WindowStack.Add(new factionCustomizeWindowFC(faction));
                    //Initial release - Autocreate faction
                    Messages.Message(Find.WorldObjects.SettlementAt(Find.CurrentMap.Parent.Tile).Name + " " + "SetAsFactionCapital".Translate() + "!", MessageTypeDefOf.NeutralEvent);
                }
            }
        }