mirror of
				https://gitgud.io/AbstractConcept/rimworld-animations-patch.git
				synced 2024-08-15 00:43:27 +00:00 
			
		
		
		
	v2.0.7
- Fixed issue where apparel settings were not being saved between sessions - Using the 'set all true / false' buttons in the apparel settings now only applies to the apparel that are currently displayed in the configuration table - Added default apparel settings for Biotech apparel - Set up the strings used in the apparel configuration table menu to be translatable
This commit is contained in:
		
							parent
							
								
									e139ff14fb
								
							
						
					
					
						commit
						91b3a80400
					
				
					 13 changed files with 193 additions and 199 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -192,7 +192,7 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
 | 
			
		||||
            if (comp?.rimNudeDataStatus == RimNudeDataStatus.NotLoaded)
 | 
			
		||||
            {
 | 
			
		||||
                RimNudeData rimNudeData = ApparelSettings.GetRimNudeData(comp?.apparel);
 | 
			
		||||
                RimNudeData rimNudeData = ApparelSettingsUtility.GetRimNudeData(comp?.apparel);
 | 
			
		||||
 | 
			
		||||
                if (rimNudeData == null)
 | 
			
		||||
                {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -86,7 +86,7 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
		public static bool Prefix_DrawAddons(PawnRenderFlags renderFlags, Vector3 vector, Vector3 headOffset, Pawn pawn, Quaternion quat, Rot4 rotation)
 | 
			
		||||
		{
 | 
			
		||||
			if (!(pawn.def is ThingDef_AlienRace alienProps) || renderFlags.FlagSet(PawnRenderFlags.Invisible)) return true;
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
			// Get actor components and body addons
 | 
			
		||||
			List<AlienPartGenerator.BodyAddon> bodyAddons = alienProps.alienRace.generalSettings.alienPartGenerator.bodyAddons;
 | 
			
		||||
			AlienPartGenerator.AlienComp alienComp = pawn.GetComp<AlienPartGenerator.AlienComp>();
 | 
			
		||||
| 
						 | 
				
			
			@ -116,9 +116,9 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
				Graphic addonGraphic = alienComp.addonGraphics[i];
 | 
			
		||||
				BodyAddonData bodyAddonDatum = sexDataComp.GetBodyAddonData(bodyAddon, renderFlags.FlagSet(PawnRenderFlags.Portrait));
 | 
			
		||||
				if (bodyAddonDatum == null) continue;
 | 
			
		||||
 | 
			
		||||
				
 | 
			
		||||
				// Can draw?
 | 
			
		||||
				bool canDraw = addonGraphic.path.Contains("featureless", StringComparison.OrdinalIgnoreCase) == false && bodyAddonDatum.CanDraw();
 | 
			
		||||
				bool canDraw = bodyAddonDatum.CanDraw();
 | 
			
		||||
				bool drawHand = BasicSettings.showHands && handsAvailableCount > 0 && renderFlags.FlagSet(PawnRenderFlags.Portrait) == false;
 | 
			
		||||
 | 
			
		||||
				if (canDraw == false && drawHand == false)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,20 +23,7 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			Scribe_Values.Look(ref cropApparel, "cropApparel", false);
 | 
			
		||||
			Scribe_Values.Look(ref clothesThrownOnGround, "clothesThrownOnGround", true);
 | 
			
		||||
			Scribe_Values.Look(ref apparelWornForQuickies, "apparelWornForQuickies", RJWPreferenceSettings.Clothing.Clothed);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static RimNudeData GetRimNudeData(Apparel apparel)
 | 
			
		||||
		{
 | 
			
		||||
			if (rimNudeData.NullOrEmpty())
 | 
			
		||||
			{ ApparelSettingsUtility.ResetRimNudeData(rimNudeData); }
 | 
			
		||||
 | 
			
		||||
			foreach (RimNudeData apparelData in rimNudeData)
 | 
			
		||||
			{
 | 
			
		||||
				if (apparelData.EquivalentTo(new RimNudeData(apparel.def)))
 | 
			
		||||
				{ return apparelData; }
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			return null;
 | 
			
		||||
			Scribe_Collections.Look(ref rimNudeData, "rimNudeData", LookMode.Deep);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -70,6 +57,7 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
		
 | 
			
		||||
		public ApparelSettingsDisplay(ModContentPack content) : base(content)
 | 
			
		||||
		{
 | 
			
		||||
			ApparelSettings.rimNudeData = new List<RimNudeData>();
 | 
			
		||||
			GetSettings<ApparelSettings>();
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -183,8 +171,7 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			}
 | 
			
		||||
 | 
			
		||||
			// Ensure that all apparel has associated RimNudeData
 | 
			
		||||
			if (ApparelSettings.rimNudeData.NullOrEmpty())
 | 
			
		||||
			{ ApparelSettingsUtility.ResetRimNudeData(ApparelSettings.rimNudeData); }
 | 
			
		||||
			if (ApparelSettings.rimNudeData.NullOrEmpty()) ApparelSettingsUtility.ResetRimNudeData();
 | 
			
		||||
 | 
			
		||||
			// Add buttons to the top of the main window
 | 
			
		||||
			innerX = halfColumnWidth;
 | 
			
		||||
| 
						 | 
				
			
			@ -194,9 +181,9 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			// Apparel
 | 
			
		||||
			tempRect = new Rect(innerX + SettingsUtility.Align(labelWidth, doubleColumnWidth), windowY - headerHeight - 5, labelWidth, headerHeight);
 | 
			
		||||
			Widgets.DrawHighlightIfMouseover(tempRect);
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "List of apparel that covers the legs and/or torso. Use the provided drop down menu to load apparel settings for different mods.");
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "apparel_button_desc".Translate());
 | 
			
		||||
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "Apparel - " + currentModContentPack.ModMetaData.Name)) {
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, currentModContentPack.ModMetaData.Name)) {
 | 
			
		||||
				List<FloatMenuOption> options = new List<FloatMenuOption> { };
 | 
			
		||||
 | 
			
		||||
				foreach (ModContentPack modContentPack in relevantModContentPacks)
 | 
			
		||||
| 
						 | 
				
			
			@ -217,17 +204,17 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			// Covers groin
 | 
			
		||||
			tempRect = new Rect(innerX + SettingsUtility.Align(buttonWidth, singleColumnWidth), windowY - headerHeight - 5, buttonWidth, headerHeight);
 | 
			
		||||
			Widgets.DrawHighlightIfMouseover(tempRect);
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "Toggles whether genitials should be hidden when wearing this apparel.");
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "covers_groin_desc".Translate());
 | 
			
		||||
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "Covers\ngroin"))
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "covers_groin".Translate()))
 | 
			
		||||
			{
 | 
			
		||||
				List<FloatMenuOption> options = new List<FloatMenuOption>
 | 
			
		||||
			{
 | 
			
		||||
				new FloatMenuOption("Set all 'true'", delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversGroin(ApparelSettings.rimNudeData, true);
 | 
			
		||||
				new FloatMenuOption("set_all_true".Translate(), delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversGroin(shortListedApparelDefs, true);
 | 
			
		||||
				}, MenuOptionPriority.Default, null, null, 0f, null, null, true, 0),
 | 
			
		||||
				new FloatMenuOption("Set all 'false'", delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversGroin(ApparelSettings.rimNudeData, false);
 | 
			
		||||
				new FloatMenuOption("set_all_false".Translate(), delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversGroin(shortListedApparelDefs, false);
 | 
			
		||||
				}, MenuOptionPriority.Default, null, null, 0f, null, null, true, 0),
 | 
			
		||||
			}; Find.WindowStack.Add(new FloatMenu(options));
 | 
			
		||||
			}; innerX += singleColumnWidth;
 | 
			
		||||
| 
						 | 
				
			
			@ -235,17 +222,17 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			// Covers belly
 | 
			
		||||
			tempRect = new Rect(innerX + SettingsUtility.Align(buttonWidth, singleColumnWidth), windowY - headerHeight - 5, buttonWidth, headerHeight);
 | 
			
		||||
			Widgets.DrawHighlightIfMouseover(tempRect);
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "Toggles whether an enlarged belly should be hidden when wearing this apparel.");
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "covers_belly_desc".Translate());
 | 
			
		||||
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "Covers\nbelly"))
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "covers_belly".Translate()))
 | 
			
		||||
			{
 | 
			
		||||
				List<FloatMenuOption> options = new List<FloatMenuOption>
 | 
			
		||||
			{
 | 
			
		||||
				new FloatMenuOption("Set all 'true'", delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversBelly(ApparelSettings.rimNudeData, true);
 | 
			
		||||
				new FloatMenuOption("set_all_true".Translate(), delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversBelly(shortListedApparelDefs, true);
 | 
			
		||||
				}, MenuOptionPriority.Default, null, null, 0f, null, null, true, 0),
 | 
			
		||||
				new FloatMenuOption("Set all 'false'", delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversBelly(ApparelSettings.rimNudeData, false);
 | 
			
		||||
				new FloatMenuOption("set_all_false".Translate(), delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversBelly(shortListedApparelDefs, false);
 | 
			
		||||
				}, MenuOptionPriority.Default, null, null, 0f, null, null, true, 0),
 | 
			
		||||
			}; Find.WindowStack.Add(new FloatMenu(options));
 | 
			
		||||
			}; innerX += singleColumnWidth;
 | 
			
		||||
| 
						 | 
				
			
			@ -253,17 +240,17 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			// Covers belly
 | 
			
		||||
			tempRect = new Rect(innerX + SettingsUtility.Align(buttonWidth, singleColumnWidth), windowY - headerHeight - 5, buttonWidth, headerHeight);
 | 
			
		||||
			Widgets.DrawHighlightIfMouseover(tempRect);
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "Toggles whether this apparel conceals breasts.");
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "covers_chest_desc".Translate());
 | 
			
		||||
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "Covers\nbreasts"))
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "covers_chest".Translate()))
 | 
			
		||||
			{
 | 
			
		||||
				List<FloatMenuOption> options = new List<FloatMenuOption>
 | 
			
		||||
			{
 | 
			
		||||
				new FloatMenuOption("Set all 'true'", delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversChest(ApparelSettings.rimNudeData, true);
 | 
			
		||||
				new FloatMenuOption("set_all_true".Translate(), delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversChest(shortListedApparelDefs, true);
 | 
			
		||||
				}, MenuOptionPriority.Default, null, null, 0f, null, null, true, 0),
 | 
			
		||||
				new FloatMenuOption("Set all 'false'", delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversChest(ApparelSettings.rimNudeData, false);
 | 
			
		||||
				new FloatMenuOption("set_all_false".Translate(), delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllCoversChest(shortListedApparelDefs, false);
 | 
			
		||||
				}, MenuOptionPriority.Default, null, null, 0f, null, null, true, 0),
 | 
			
		||||
			}; Find.WindowStack.Add(new FloatMenu(options));
 | 
			
		||||
			}; innerX += singleColumnWidth;
 | 
			
		||||
| 
						 | 
				
			
			@ -271,17 +258,17 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			// Sex wear
 | 
			
		||||
			tempRect = new Rect(innerX + SettingsUtility.Align(buttonWidth, singleColumnWidth), windowY - headerHeight - 5, buttonWidth, headerHeight);
 | 
			
		||||
			Widgets.DrawHighlightIfMouseover(tempRect);
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "Toggles whether this piece of apparel should always be kept on during lovin'");
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "sex_wear_desc".Translate());
 | 
			
		||||
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "Sex-wear"))
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "sex_wear".Translate()))
 | 
			
		||||
			{
 | 
			
		||||
				List<FloatMenuOption> options = new List<FloatMenuOption>
 | 
			
		||||
			{
 | 
			
		||||
				new FloatMenuOption("Set all 'true'", delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllSexWear(ApparelSettings.rimNudeData, true);
 | 
			
		||||
				new FloatMenuOption("set_all_true".Translate(), delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllSexWear(shortListedApparelDefs, true);
 | 
			
		||||
				}, MenuOptionPriority.Default, null, null, 0f, null, null, true, 0),
 | 
			
		||||
				new FloatMenuOption("Set all 'false'", delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllSexWear(ApparelSettings.rimNudeData, false);
 | 
			
		||||
				new FloatMenuOption("set_all_false".Translate(), delegate()
 | 
			
		||||
				{ ApparelSettingsUtility.SetAllSexWear(shortListedApparelDefs, false);
 | 
			
		||||
				}, MenuOptionPriority.Default, null, null, 0f, null, null, true, 0),
 | 
			
		||||
			}; Find.WindowStack.Add(new FloatMenu(options));
 | 
			
		||||
			}; innerX += singleColumnWidth;
 | 
			
		||||
| 
						 | 
				
			
			@ -289,10 +276,10 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			// Reset button
 | 
			
		||||
			tempRect = new Rect(innerX + SettingsUtility.Align(buttonWidth, singleColumnWidth), windowY - headerHeight - 5, buttonWidth, headerHeight);
 | 
			
		||||
			Widgets.DrawHighlightIfMouseover(tempRect);
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "Returns all values in this table to their default state.");
 | 
			
		||||
			TooltipHandler.TipRegion(tempRect, "reset_to_defaults_desc".Translate());
 | 
			
		||||
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "Reset to\ndefaults"))
 | 
			
		||||
			{ ApparelSettingsUtility.ResetRimNudeData(ApparelSettings.rimNudeData); }; innerX += singleColumnWidth + scrollBarWidthMargin;
 | 
			
		||||
			if (Widgets.ButtonText(tempRect, "reset_to_defaults".Translate()))
 | 
			
		||||
			{ ApparelSettingsUtility.ResetRimNudeData(shortListedApparelDefs); }; innerX += singleColumnWidth + scrollBarWidthMargin;
 | 
			
		||||
 | 
			
		||||
			// Determine the height of the scrollable area
 | 
			
		||||
			int apparelCount = shortListedApparelDefs.Count();
 | 
			
		||||
| 
						 | 
				
			
			@ -319,7 +306,7 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
				innerY = (float)num * (rowHeight);
 | 
			
		||||
				num++;
 | 
			
		||||
 | 
			
		||||
				RimNudeData rimNudeApparel = ApparelSettings.rimNudeData.First(x => x.EquivalentTo(new RimNudeData(thingDef)));
 | 
			
		||||
				RimNudeData rimNudeApparel = ApparelSettingsUtility.GetRimNudeData(thingDef);
 | 
			
		||||
 | 
			
		||||
				// Apparel symbol
 | 
			
		||||
				Widgets.ThingIcon(new Rect(innerX + SettingsUtility.Align(widgetWidth, halfColumnWidth), innerY + SettingsUtility.Align(widgetHeight, rowHeight), widgetWidth, widgetHeight), thingDef, null, null, 1f, null);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -104,7 +104,7 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
                
 | 
			
		||||
                if (comp == null) continue;
 | 
			
		||||
                if (apparel.def is bondage_gear_def) continue; 
 | 
			
		||||
                if (ApparelSettings.GetRimNudeData(apparel) != null && ApparelSettings.GetRimNudeData(apparel).sexWear) continue;
 | 
			
		||||
                if (ApparelSettingsUtility.GetRimNudeData(apparel)?.sexWear == true) continue;
 | 
			
		||||
 | 
			
		||||
                if (clothingPreference == RJWPreferenceSettings.Clothing.Nude || undressForRitual || undressForParty)
 | 
			
		||||
                { 
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,189 +32,175 @@ namespace Rimworld_Animations_Patch
 | 
			
		|||
			cachedApparelTextures.Clear();
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static bool IsApparelOfInterest(ThingDef thingDef)
 | 
			
		||||
		{
 | 
			
		||||
			if (thingDef.IsApparel == false) return false;
 | 
			
		||||
 | 
			
		||||
			return thingDef.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Torso) ||
 | 
			
		||||
				thingDef.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Legs) ||
 | 
			
		||||
				thingDef.apparel.bodyPartGroups.Contains(PatchBodyPartGroupDefOf.GenitalsBPG) ||
 | 
			
		||||
				thingDef.apparel.bodyPartGroups.Contains(PatchBodyPartGroupDefOf.ChestBPG);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static List<ThingDef> GetApparelOfInterest()
 | 
			
		||||
		{
 | 
			
		||||
			List<ThingDef> thingDefs = new List<ThingDef>();
 | 
			
		||||
 | 
			
		||||
			foreach (ThingDef thingDef in DefDatabase<ThingDef>.AllDefs)
 | 
			
		||||
			{
 | 
			
		||||
				if (thingDef.IsApparel &&
 | 
			
		||||
					(thingDef.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Torso) ||
 | 
			
		||||
					thingDef.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Legs) ||
 | 
			
		||||
					thingDef.apparel.bodyPartGroups.Contains(PatchBodyPartGroupDefOf.GenitalsBPG) ||
 | 
			
		||||
					thingDef.apparel.bodyPartGroups.Contains(PatchBodyPartGroupDefOf.ChestBPG)))
 | 
			
		||||
				if (IsApparelOfInterest(thingDef))
 | 
			
		||||
				{ thingDefs.Add(thingDef); }
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			return thingDefs;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// Resets all data
 | 
			
		||||
		public static void ResetRimNudeData(List<RimNudeData> rimNudeData)
 | 
			
		||||
		// Get data
 | 
			
		||||
		public static RimNudeData GetRimNudeData(ThingDef thingDef)
 | 
			
		||||
		{
 | 
			
		||||
			rimNudeData.Clear();
 | 
			
		||||
			List<ThingDef> thingDefs = GetApparelOfInterest();
 | 
			
		||||
			if (ApparelSettings.rimNudeData.NullOrEmpty()) ResetRimNudeData();
 | 
			
		||||
			if (IsApparelOfInterest(thingDef) == false) return null;
 | 
			
		||||
 | 
			
		||||
			foreach (RimNudeData rimNudeData in ApparelSettings.rimNudeData)
 | 
			
		||||
			{
 | 
			
		||||
				if (rimNudeData.EquivalentTo(new RimNudeData(thingDef)))
 | 
			
		||||
				{ return rimNudeData; }
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			var newRimNudeData = GetApparelDefault(thingDef);
 | 
			
		||||
			if (newRimNudeData == null) newRimNudeData = new RimNudeData(thingDef);
 | 
			
		||||
 | 
			
		||||
			ApparelSettings.rimNudeData.Add(newRimNudeData);
 | 
			
		||||
 | 
			
		||||
			return newRimNudeData;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static RimNudeData GetRimNudeData(Apparel apparel)
 | 
			
		||||
		{	
 | 
			
		||||
			return GetRimNudeData(apparel.def);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// Reset all data
 | 
			
		||||
		public static void ResetRimNudeData()
 | 
			
		||||
		{
 | 
			
		||||
			ApparelSettings.rimNudeData = new List<RimNudeData>();
 | 
			
		||||
 | 
			
		||||
			foreach (ThingDef thingDef in GetApparelOfInterest())
 | 
			
		||||
			{
 | 
			
		||||
				var newRimNudeData = GetApparelDefault(thingDef);
 | 
			
		||||
				if (newRimNudeData == null) newRimNudeData = new RimNudeData(thingDef);
 | 
			
		||||
 | 
			
		||||
				ApparelSettings.rimNudeData.Add(newRimNudeData);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// Reset some data
 | 
			
		||||
		public static void ResetRimNudeData(List<ThingDef> thingDefs)
 | 
			
		||||
		{
 | 
			
		||||
			if (ApparelSettings.rimNudeData.NullOrEmpty()) ResetRimNudeData();
 | 
			
		||||
 | 
			
		||||
			foreach (ThingDef thingDef in thingDefs)
 | 
			
		||||
			{
 | 
			
		||||
				for (int i = 0; i < 5; i++)
 | 
			
		||||
				{ rimNudeData.Add(new RimNudeData(thingDef)); }
 | 
			
		||||
			}
 | 
			
		||||
				var newRimNudeData = GetApparelDefault(thingDef);
 | 
			
		||||
				if (newRimNudeData == null) newRimNudeData = new RimNudeData(thingDef);
 | 
			
		||||
 | 
			
		||||
			GetApparelDefaults(rimNudeData);
 | 
			
		||||
				RimNudeData rimNudeData = ApparelSettings.rimNudeData.FirstOrDefault(x => x.EquivalentTo(new RimNudeData(thingDef)));
 | 
			
		||||
				rimNudeData.coversGroin = newRimNudeData.coversGroin;
 | 
			
		||||
				rimNudeData.coversBelly = newRimNudeData.coversBelly;
 | 
			
		||||
				rimNudeData.coversChest = newRimNudeData.coversChest;
 | 
			
		||||
				rimNudeData.sexWear = newRimNudeData.sexWear;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// Update apparel data
 | 
			
		||||
		public static void UpdateRimNudeData(List<RimNudeData> rimNudeData, string thingDef, bool coversGroin, bool coversBelly, bool coversChest, bool sexWear)
 | 
			
		||||
		public static void SetAllCoversGroin(List<ThingDef> thingDefs, bool value)
 | 
			
		||||
		{
 | 
			
		||||
			for (int i = 0; i < rimNudeData.Count; i++)
 | 
			
		||||
			foreach (ThingDef thingDef in thingDefs)
 | 
			
		||||
			{
 | 
			
		||||
				RimNudeData apparelData = rimNudeData[i];
 | 
			
		||||
 | 
			
		||||
				if (apparelData.thingDef == thingDef)
 | 
			
		||||
				{
 | 
			
		||||
					rimNudeData[i] = new RimNudeData(thingDef, coversGroin, coversBelly, coversChest, sexWear);
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				RimNudeData rimNudeApparel = ApparelSettings.rimNudeData.First(x => x.EquivalentTo(new RimNudeData(thingDef)));
 | 
			
		||||
				rimNudeApparel.coversGroin = value; 
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static void SetAllCoversGroin(List<RimNudeData> rimNudeData, bool value)
 | 
			
		||||
		public static void SetAllCoversBelly(List<ThingDef> thingDefs, bool value)
 | 
			
		||||
		{
 | 
			
		||||
			foreach (RimNudeData rimNudeApparel in rimNudeData)
 | 
			
		||||
			{ rimNudeApparel.coversGroin = value; }
 | 
			
		||||
			foreach (ThingDef thingDef in thingDefs)
 | 
			
		||||
			{
 | 
			
		||||
				RimNudeData rimNudeApparel = ApparelSettings.rimNudeData.First(x => x.EquivalentTo(new RimNudeData(thingDef)));
 | 
			
		||||
				rimNudeApparel.coversBelly = value; 
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static void SetAllCoversBelly(List<RimNudeData> rimNudeData, bool value)
 | 
			
		||||
		public static void SetAllCoversChest(List<ThingDef> thingDefs, bool value)
 | 
			
		||||
		{
 | 
			
		||||
			foreach (RimNudeData rimNudeApparel in rimNudeData)
 | 
			
		||||
			{ rimNudeApparel.coversBelly = value; }
 | 
			
		||||
			foreach (ThingDef thingDef in thingDefs)
 | 
			
		||||
			{
 | 
			
		||||
				RimNudeData rimNudeApparel = ApparelSettings.rimNudeData.First(x => x.EquivalentTo(new RimNudeData(thingDef)));
 | 
			
		||||
				rimNudeApparel.coversChest = value; 
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static void SetAllCoversChest(List<RimNudeData> rimNudeData, bool value)
 | 
			
		||||
		public static void SetAllSexWear(List<ThingDef> thingDefs, bool value)
 | 
			
		||||
		{
 | 
			
		||||
			foreach (RimNudeData rimNudeApparel in rimNudeData)
 | 
			
		||||
			{ rimNudeApparel.coversChest = value; }
 | 
			
		||||
			foreach (ThingDef thingDef in thingDefs)
 | 
			
		||||
			{
 | 
			
		||||
				RimNudeData rimNudeApparel = ApparelSettings.rimNudeData.First(x => x.EquivalentTo(new RimNudeData(thingDef)));
 | 
			
		||||
				rimNudeApparel.sexWear = value;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static void SetAllSexWear(List<RimNudeData> rimNudeData, bool value)
 | 
			
		||||
		public static RimNudeData GetApparelDefault(ThingDef thingDef)
 | 
			
		||||
		{
 | 
			
		||||
			foreach (RimNudeData rimNudeApparel in rimNudeData)
 | 
			
		||||
			{ rimNudeApparel.sexWear = value; }
 | 
			
		||||
			foreach(RimNudeData rimNudeData in apparelDefaults)
 | 
			
		||||
			{
 | 
			
		||||
				if (rimNudeData.thingDef == thingDef.defName)
 | 
			
		||||
				{ return rimNudeData; }
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			return null; 
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static void GetApparelDefaults(List<RimNudeData> rimNudeData)
 | 
			
		||||
		public static List<RimNudeData> apparelDefaults = new List<RimNudeData>()
 | 
			
		||||
		{
 | 
			
		||||
			//Apparel_BasicShirt
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_BasicShirt", coversGroin: false, coversBelly: true, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//Apparel_CollarShirt
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_CollarShirt", coversGroin: false, coversBelly: true, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//Apparel_FlakVest
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_FlakVest", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//Apparel_Duster
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_Duster", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//Apparel_Jacket
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_Jacket", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//Apparel_TribalA
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_TribalA", coversGroin: true, coversBelly: true, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//Apparel_BodyStrap
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_BodyStrap", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//Apparel_PsyfocusRobe
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_PsyfocusRobe", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//Apparel_Cape
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_Cape", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//Apparel_RobeRoyal
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_RobeRoyal",  coversGroin: false, coversBelly: false, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//Apparel_Corset
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "Apparel_Corset", coversGroin: false, coversBelly: true, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VAE_Apparel_Overalls
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VAE_Apparel_Overalls", coversGroin: true, coversBelly: true, coversChest: false, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VAE_Apparel_LabCoat
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VAE_Apparel_LabCoat",  coversGroin: false, coversBelly: false, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VAE_Apparel_BuildersJacket
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VAE_Apparel_BuildersJacket",  coversGroin: false, coversBelly: false, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VAE_Apparel_Apron
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VAE_Apparel_Apron", coversGroin: true, coversBelly: true, coversChest: false, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VAE_Apparel_Tunic
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VAE_Apparel_Tunic", coversGroin: false, coversBelly: true, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VAE_Apparel_PeltCoat
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VAE_Apparel_PeltCoat", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VAE_Apparel_WoodenArmor
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VAE_Apparel_WoodenArmor", coversGroin: false, coversBelly: true, coversChest: false, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VAE_Apparel_AdvancedVest
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VAE_Apparel_AdvancedVest", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VAE_Apparel_BulletproofVest
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VAE_Apparel_BulletproofVest", coversGroin: false, coversBelly: true, coversChest: false, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VWE_Apparel_Exoframe
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VWE_Apparel_Exoframe", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VFEM_Apparel_Tabard
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VFEM_Apparel_Tabard", coversGroin: true, coversBelly: true, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VFEV_Apparel_JarlCape
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VFEV_Apparel_JarlCape", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//VFEV_Apparel_RoyalFurCoat
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "VFEV_Apparel_RoyalFurCoat",  coversGroin: false, coversBelly: false, coversChest: true, sexWear: false);
 | 
			
		||||
 | 
			
		||||
			//PrisonerChains
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "PrisonerChains", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_ChainHarnessA
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_ChainHarnessA", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_NippleWristCuffs
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_NippleWristCuffs", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_ServantGirlDress
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_ServantGirlDress", coversGroin: true, coversBelly: true, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_ZDress
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_ZDress", coversGroin: false, coversBelly: true, coversChest: true, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_MaidA
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_MaidA", coversGroin: false, coversBelly: true, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_DiscoTop
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_DiscoTop", coversGroin: false, coversBelly: false, coversChest: true, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_TransparentSkirt
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_TransparentSkirt", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_Vibrator
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_Vibrator", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_VibratorDouble
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_VibratorDouble", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_WiredVibrator
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_WiredVibrator", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_DoubleWiredVibrator
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_DoubleWiredVibrator", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true);
 | 
			
		||||
 | 
			
		||||
			//S16_WiredAnalVibrator
 | 
			
		||||
			UpdateRimNudeData(rimNudeData, "S16_WiredAnalVibrator", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true);
 | 
			
		||||
		}
 | 
			
		||||
			new RimNudeData("Apparel_BasicShirt", coversGroin: false, coversBelly: true, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_CollarShirt", coversGroin: false, coversBelly: true, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_FlakVest", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_Duster", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_Jacket", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_TribalA", coversGroin: true, coversBelly: true, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_BodyStrap", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("Apparel_PsyfocusRobe", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_Cape", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_RobeRoyal", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_Corset", coversGroin: false, coversBelly: true, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_Bandolier", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_Sash", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("Apparel_HeavyShield", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("VAE_Apparel_Overalls", coversGroin: true, coversBelly: true, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("VAE_Apparel_LabCoat", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("VAE_Apparel_BuildersJacket", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("VAE_Apparel_Apron", coversGroin: true, coversBelly: true, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("VAE_Apparel_Tunic", coversGroin: false, coversBelly: true, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("VAE_Apparel_PeltCoat", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("VAE_Apparel_WoodenArmor", coversGroin: false, coversBelly: true, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("VAE_Apparel_AdvancedVest", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("VAE_Apparel_BulletproofVest", coversGroin: false, coversBelly: true, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("VWE_Apparel_Exoframe", coversGroin: false, coversBelly: false, coversChest: false, sexWear: false),
 | 
			
		||||
			new RimNudeData("VFEM_Apparel_Tabard", coversGroin: true, coversBelly: true, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("VFEV_Apparel_JarlCape", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("VFEV_Apparel_RoyalFurCoat", coversGroin: false, coversBelly: false, coversChest: true, sexWear: false),
 | 
			
		||||
			new RimNudeData("PrisonerChains", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_ChainHarnessA", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_NippleWristCuffs", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_ServantGirlDress", coversGroin: true, coversBelly: true, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_ZDress", coversGroin: false, coversBelly: true, coversChest: true, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_MaidA", coversGroin: false, coversBelly: true, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_DiscoTop", coversGroin: false, coversBelly: false, coversChest: true, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_TransparentSkirt", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_Vibrator", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_VibratorDouble", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_WiredVibrator", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_DoubleWiredVibrator", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true),
 | 
			
		||||
			new RimNudeData("S16_WiredAnalVibrator", coversGroin: false, coversBelly: false, coversChest: false, sexWear: true),
 | 
			
		||||
		};
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue