public void Dress(Pawn pawn) { #if DRESSER_OUTFIT Log.Warning("Begin DefinedOutfit.Dress(Pawn: " + pawn.Name.ToStringShort + ")"); #endif List <Apparel> removed = ApparelUtil.RemoveApparel(pawn); ApparelUtil.StoreApparelInWorldDresser(removed, pawn); pawn.outfits.CurrentOutfit = this.Outfit; #if DRESSER_OUTFIT Log.Message(" Pawn's outfit is now: " + pawn.outfits.CurrentOutfit.label); #endif /* * bool done = false; * for(int i = 0; i < 10 && !done; ++i) * { * Apparel a; * Building_Dresser d; * if (!(done = WorldComp.TryFindBestApparel(pawn, out a, out d))) * { * if (d != null) * d.RemoveNoDrop(a); * pawn.apparel.Wear(a); * if (customApparel.Contains(a)) * pawn.outfits.forcedHandler.ForcedApparel.Add(a); * } * } */ ApparelUtil.OptimizeApparel(pawn); this.isBeingWorn = true; #if DRESSER_OUTFIT Log.Warning("End DefinedOutfit.Dress"); #endif }
public void Dress(Pawn pawn) { #if DRESSER_OUTFIT Log.Warning("Begin CustomOutfit.Dress(Pawn: " + pawn.Name.ToStringShort + ")"); #endif List <Apparel> removed = ApparelUtil.RemoveApparel(pawn); #if DRESSER_OUTFIT Log.Message(" Add Custom Apparel:"); #endif // Dress the pawn with this outfit's apparel foreach (Apparel a in this.Apparel) { #if DRESSER_OUTFIT Log.Message(" " + a.Label); #endif removed.Remove(a); pawn.apparel.Wear(a); // Force all apparel pawn.outfits.forcedHandler.ForcedApparel.Add(a); //tracker.RemoveCustomApparel(a); } if (this.Outfit != null) { pawn.outfits.CurrentOutfit = this.Outfit; ApparelUtil.OptimizeApparel(pawn); } /*/ Add any previously worn apparel that still can be worn * for (int i = 0; i < removed.Count; ++i) * { * Apparel a = wasWearing[i]; * if (pawn.apparel.CanWearWithoutDroppingAnything(a.def)) * { * pawn.apparel.Wear(a); * removed[i] = null; * } * }*/ ApparelUtil.StoreApparelInWorldDresser(removed, pawn); this.isBeingWorn = true; #if DRESSER_OUTFIT Log.Warning("End CustomOutfit.Dress"); #endif }