This commit is contained in:
AbstractConcept 2023-02-04 01:13:57 -06:00
parent fcf187c7dd
commit 38ec4f86c1
68 changed files with 846 additions and 1934 deletions

View file

@ -15,8 +15,6 @@ namespace Rimworld_Animations_Patch
public static bool cropApparel = false;
public static bool clothesThrownOnGround = true;
public static RJWPreferenceSettings.Clothing apparelWornForQuickies = RJWPreferenceSettings.Clothing.Clothed;
public static bool underwearSufficentForIdeos = true;
public static bool exposedUnderwearMood = true;
public override void ExposeData()
{
@ -25,8 +23,6 @@ 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);
Scribe_Values.Look(ref underwearSufficentForIdeos, "underwearSufficentForIdeos", true);
Scribe_Values.Look(ref underwearSufficentForIdeos, "exposedUnderwearMood", true);
}
public static RimNudeData GetRimNudeData(Apparel apparel)
@ -46,8 +42,8 @@ namespace Rimworld_Animations_Patch
public class ApparelSettingsDisplay : Mod
{
private const float windowY = 280f;
private const float windowHeight = 330f;
private const float windowY = 290f;
private const float windowHeight = 320f;
private Vector2 scrollPosition;
private const float scrollBarWidthMargin = 18f;
@ -66,7 +62,11 @@ namespace Rimworld_Animations_Patch
private const float singleColumnWidth = 100f;
private const float doubleColumnWidth = 180f;
private static List<ThingDef> thingDefs = new List<ThingDef>();
private IEnumerable<ThingDef> shortListedApparelDefs = new List<ThingDef>();
private IEnumerable<ThingDef> allApparelDefs = new List<ThingDef>();
private IEnumerable<ModContentPack> relevantModContentPacks = new List<ModContentPack>();
private ModContentPack currentModContentPack;
public ApparelSettingsDisplay(ModContentPack content) : base(content)
{
@ -146,8 +146,6 @@ namespace Rimworld_Animations_Patch
listingStandard.CheckboxLabeled("clothes_thrown_on_ground".Translate(), ref ApparelSettings.clothesThrownOnGround, "clothes_thrown_on_ground_desc".Translate());
listingStandard.CheckboxLabeled("crop_apparel".Translate(), ref ApparelSettings.cropApparel, "crop_apparel_desc".Translate());
listingStandard.CheckboxLabeled("underwear_sufficent_for_ideos".Translate(), ref ApparelSettings.underwearSufficentForIdeos, "underwear_sufficent_for_ideos_desc".Translate());
listingStandard.CheckboxLabeled("exposed_underwear_mood".Translate(), ref ApparelSettings.exposedUnderwearMood, "exposed_underwear_mood_desc".Translate());
listingStandard.End();
base.DoSettingsWindowContents(inRect);
@ -162,9 +160,20 @@ namespace Rimworld_Animations_Patch
bool isEnabled = false;
// Get a list of apparel of interest
if (thingDefs.NullOrEmpty())
{ thingDefs = ApparelSettingsUtility.GetApparelOfInterest(); }
// Get a list of apparel and mods of interest
if (allApparelDefs.Any() == false)
{
allApparelDefs = ApparelSettingsUtility.GetApparelOfInterest();
foreach (ThingDef thingDef in allApparelDefs)
{
if (relevantModContentPacks.Contains(thingDef.modContentPack) == false)
{ relevantModContentPacks.Append(thingDef.modContentPack); }
}
currentModContentPack = relevantModContentPacks.First();
shortListedApparelDefs = allApparelDefs.Where(x => x.modContentPack == currentModContentPack);
}
// Ensure that all apparel has associated RimNudeData
if (ApparelSettings.rimNudeData.NullOrEmpty())
@ -173,6 +182,28 @@ namespace Rimworld_Animations_Patch
// Add buttons to the top of the main window
innerX = halfColumnWidth;
// Mod selection button
if (Widgets.ButtonText(new Rect(innerX + SettingsUtility.Align(labelWidth, doubleColumnWidth), windowY - 2 * headerHeight - 5, 2 * doubleColumnWidth + 10, headerHeight), currentModContentPack.Name))
{
List<FloatMenuOption> options = new List<FloatMenuOption> { };
foreach (ModContentPack modContentPack in relevantModContentPacks)
{
FloatMenuOption option = new FloatMenuOption(modContentPack.Name, delegate ()
{
currentModContentPack = modContentPack;
shortListedApparelDefs = allApparelDefs.Where(x => x.modContentPack == currentModContentPack);
},
MenuOptionPriority.Default, null, null, 0f, null, null, true, 0);
options.Add(option);
}
Find.WindowStack.Add(new FloatMenu(options));
}
if (shortListedApparelDefs.Any() == false) return;
// Apparel
tempRect = new Rect(innerX + SettingsUtility.Align(labelWidth, doubleColumnWidth), windowY - headerHeight - 5, labelWidth, headerHeight);
Widgets.DrawHighlightIfMouseover(tempRect);
@ -183,10 +214,10 @@ namespace Rimworld_Animations_Patch
List<FloatMenuOption> options = new List<FloatMenuOption>
{
new FloatMenuOption("Sort by name", delegate()
{ thingDefs = thingDefs.OrderBy(x => x.label).ToList();
{ shortListedApparelDefs = shortListedApparelDefs.OrderBy(x => x.label);
}, MenuOptionPriority.Default, null, null, 0f, null, null, true, 0),
new FloatMenuOption("Sort by mod", delegate()
{ thingDefs = ApparelSettingsUtility.GetApparelOfInterest();
{ shortListedApparelDefs = ApparelSettingsUtility.GetApparelOfInterest();
}, MenuOptionPriority.Default, null, null, 0f, null, null, true, 0),
}; Find.WindowStack.Add(new FloatMenu(options));
}; innerX += doubleColumnWidth;
@ -272,7 +303,7 @@ namespace Rimworld_Animations_Patch
{ ApparelSettingsUtility.ResetRimNudeData(ApparelSettings.rimNudeData); }; innerX += singleColumnWidth + scrollBarWidthMargin;
// Determine the height of the scrollable area
int apparelCount = thingDefs.Count;
int apparelCount = shortListedApparelDefs.Count();
float totalContentHeight = rowHeight * (float)apparelCount;
// Create a rect for the scroll window
@ -288,7 +319,7 @@ namespace Rimworld_Animations_Patch
Widgets.DrawHighlight(contentRect);
Widgets.BeginScrollView(contentRect, ref scrollPosition, scrollViewTotal);
foreach (ThingDef thingDef in thingDefs)
foreach (ThingDef thingDef in shortListedApparelDefs)
{
isEnabled = false;

View file

@ -9,23 +9,12 @@ namespace Rimworld_Animations_Patch
{
public class BasicSettings : ModSettings
{
public static bool autoscaleDeltaPos = true;
public static bool linkChanges = false;
public static bool needPrivacy = true;
public static float chanceForOtherToJoinInSex = 0.25f;
public static bool autoscaleDeltaPos = true;
public static bool hideNamesForSex = false;
public static bool debugMode = false;
public static bool showHands = true;
public static bool redrawHair = true;
public static bool worryAboutInfidelity = true;
public static bool worryAboutBeastiality = true;
public static bool worryAboutRape = true;
public static bool worryAboutNecro = true;
public static bool worryAboutXeno = true;
public static bool ignoreSlaveRape = false;
public static bool majorTabooCanStartFights = false;
public static bool useLegacyAnimationSystem = false;
public static float genitalMasturbationChance = 1.0f;
public static float analMasturbationChance = 0.25f;
@ -40,21 +29,10 @@ namespace Rimworld_Animations_Patch
base.ExposeData();
Scribe_Values.Look(ref autoscaleDeltaPos, "autoscaleDeltaPos", true);
Scribe_Values.Look(ref linkChanges, "linkChanges", false);
Scribe_Values.Look(ref needPrivacy, "needPrivacy", true);
Scribe_Values.Look(ref chanceForOtherToJoinInSex, "chanceForSexExtra", 0.25f);
Scribe_Values.Look(ref hideNamesForSex, "hideNamesForSex", false);
Scribe_Values.Look(ref debugMode, "debugMode", false);
Scribe_Values.Look(ref showHands, "showHands", true);
Scribe_Values.Look(ref redrawHair, "redrawHair", true);
Scribe_Values.Look(ref worryAboutInfidelity, "worryAboutInfidelity", true);
Scribe_Values.Look(ref worryAboutBeastiality, "worryAboutBeastiality", true);
Scribe_Values.Look(ref worryAboutRape, "worryAboutRape", true);
Scribe_Values.Look(ref worryAboutNecro, "worryAboutNecro", true);
Scribe_Values.Look(ref worryAboutXeno, "worryAboutXeno", true);
Scribe_Values.Look(ref ignoreSlaveRape, "ignoreSlaveRape", false);
Scribe_Values.Look(ref majorTabooCanStartFights, "majorTabooCanStartFights", false);
}
}
@ -98,23 +76,6 @@ namespace Rimworld_Animations_Patch
listingStandard.Label("rimworld_animation_patch_general".Translate());
listingStandard.Gap(5f);
listingStandard.CheckboxLabeled("need_privacy".Translate(), ref BasicSettings.needPrivacy, "need_privacy_desc".Translate());
listingStandard.CheckboxLabeled("worry_about_infidelity".Translate(), ref BasicSettings.worryAboutInfidelity, "worry_about_infidelity_desc".Translate());
listingStandard.CheckboxLabeled("worry_about_beastiality".Translate(), ref BasicSettings.worryAboutBeastiality, "worry_about_beastiality_desc".Translate());
listingStandard.CheckboxLabeled("worry_about_rape".Translate(), ref BasicSettings.worryAboutRape, "worry_about_rape_desc".Translate());
if (BasicSettings.worryAboutRape)
{
listingStandard.CheckboxLabeled("ignore_slave_rape".Translate(), ref BasicSettings.ignoreSlaveRape);
}
listingStandard.CheckboxLabeled("worry_about_necro".Translate(), ref BasicSettings.worryAboutNecro, "worry_about_necro_desc".Translate());
listingStandard.CheckboxLabeled("worry_about_xeno".Translate(), ref BasicSettings.worryAboutXeno, "worry_about_xeno_desc".Translate());
listingStandard.CheckboxLabeled("major_taboo_can_start_fights".Translate(), ref BasicSettings.majorTabooCanStartFights, "major_taboo_can_start_fights_desc".Translate());
listingStandard.Label("chance_for_other_to_join_in_sex".Translate() + ": " + BasicSettings.chanceForOtherToJoinInSex.ToString("F"), -1f, "chance_for_other_to_join_in_sex_desc".Translate());
BasicSettings.chanceForOtherToJoinInSex = listingStandard.Slider(BasicSettings.chanceForOtherToJoinInSex, 0f, 1f);
//listingStandard.Label("test slide: " + BasicSettings.sliderValue.ToString("F"), -1f);
//BasicSettings.sliderValue = listingStandard.Slider(BasicSettings.sliderValue, -2f, 2f);
@ -125,10 +86,11 @@ namespace Rimworld_Animations_Patch
listingStandard.Label("rimworld_animation_patch_animation".Translate());
listingStandard.Gap(5f);
listingStandard.CheckboxLabeled("autoscale_delta_pos".Translate(), ref BasicSettings.autoscaleDeltaPos, "autoscale_delta_pos_desc".Translate());
listingStandard.CheckboxLabeled("show_hands".Translate(), ref BasicSettings.showHands, "show_hands_desc".Translate());
listingStandard.CheckboxLabeled("autoscale_delta_pos".Translate(), ref BasicSettings.autoscaleDeltaPos, "autoscale_delta_pos_desc".Translate());
listingStandard.CheckboxLabeled("redraw_hair".Translate(), ref BasicSettings.redrawHair, "redraw_hair_desc".Translate());
listingStandard.CheckboxLabeled("show_hands".Translate(), ref BasicSettings.showHands, "show_hands_desc".Translate());
listingStandard.End();
base.DoSettingsWindowContents(inRect);
}