public static void GroupExclusionButton(Listing_Standard listing, Bill bill)
 {
     if (BillUtility.IsFor(bill) == GroupMode.ColonistsOnly)
     {
         if (listing.ButtonText("PrisonLabor_ColonistsOnly".Translate()))
         {
             BillUtility.SetFor(bill, GroupMode.PrisonersOnly);
             SoundDefOf.Click.PlayOneShotOnCamera();
         }
     }
     else if (BillUtility.IsFor(bill) == GroupMode.PrisonersOnly)
     {
         if (listing.ButtonText("PrisonLabor_PrisonersOnly".Translate()))
         {
             BillUtility.SetFor(bill, GroupMode.ColonyOnly);
             SoundDefOf.Click.PlayOneShotOnCamera();
         }
     }
     else
     {
         if (listing.ButtonText("PrisonLabor_ColonyOnly".Translate()))
         {
             BillUtility.SetFor(bill, GroupMode.ColonistsOnly);
             SoundDefOf.Click.PlayOneShotOnCamera();
         }
     }
     listing.Gap(12f);
 }
示例#2
0
        public static bool IsForCertainGroup(Pawn pawn, Bill bill)
        {
            var group = BillUtility.IsFor(bill);

            if (group == GroupMode.ColonyOnly)
            {
                return(true);
            }
            if (group == GroupMode.ColonistsOnly && !pawn.IsPrisoner)
            {
                return(true);
            }
            if (group == GroupMode.PrisonersOnly && pawn.IsPrisoner)
            {
                return(true);
            }
            return(false);
        }