Example #1
0
        /*
         * Work on  Site
         */
        public static Command WorkOnSite(Caravan caravan)
        {
            var command_Action = new Command_Action
            {
                defaultLabel = "RoadsOfTheRimWorkOnSite".Translate(),
                defaultDesc  = "RoadsOfTheRimWorkOnSiteDescription".Translate(),
                icon         = ContentFinder <Texture2D> .Get("UI/Commands/AddConstructionSite"),
                action       = delegate
                {
                    SoundDefOf.Click.PlayOneShotOnCamera();
                    caravan.GetComponent <WorldObjectComp_Caravan>().StartWorking();
                }
            };

            // disable if the caravan can't work OR if the site is not ready
            if (caravan.GetComponent <WorldObjectComp_Caravan>().CaravanCurrentState() != CaravanState.ReadyToWork)
            {
                command_Action.Disable("RoadsOfTheRimBuildWorkOnSiteCantWork".Translate(caravan.GetDescription()));
            }

            return(command_Action);
        }