This commit is contained in:
AbstractConcept 2022-09-11 01:05:16 -05:00
parent 8e6918ae70
commit 0fcdce6dc1
24 changed files with 122 additions and 226 deletions

View file

@ -82,8 +82,9 @@ namespace Rimworld_Animations_Patch
{
foreach (Pawn pawn in Current.Game.CurrentMap.mapPawns.AllPawns)
{
if (pawn.RaceProps.Humanlike && pawn.apparel.WornApparel.NullOrEmpty() == false)
{ pawn.Drawer.renderer.graphics.ResolveAllGraphics(); }
pawn.Drawer.renderer.graphics.ResolveAllGraphics();
PortraitsCache.SetDirty(pawn);
GlobalTextureAtlasManager.TryMarkPawnFrameSetDirty(pawn);
}
}
}
@ -150,7 +151,6 @@ namespace Rimworld_Animations_Patch
int num = 0;
bool isEnabled = false;
bool linkChangesChanged = false;
// Get a list of apparel of interest
if (thingDefs.NullOrEmpty())
@ -281,7 +281,6 @@ namespace Rimworld_Animations_Patch
foreach (ThingDef thingDef in thingDefs)
{
isEnabled = false;
bool changeHappened = false;
innerX = 0;
innerY = (float)num * (rowHeight);
@ -303,7 +302,6 @@ namespace Rimworld_Animations_Patch
{
isEnabled = rimNudeApparel.coversGroin;
Widgets.Checkbox(innerX + SettingsUtility.Align(checkboxSize, singleColumnWidth), innerY + SettingsUtility.Align(checkboxSize, rowHeight), ref isEnabled, checkboxSize, false, true, null, null);
if (isEnabled != rimNudeApparel.coversGroin) { changeHappened = true; }
rimNudeApparel.coversGroin = isEnabled;
}; innerX += singleColumnWidth;
@ -312,7 +310,6 @@ namespace Rimworld_Animations_Patch
{
isEnabled = rimNudeApparel.coversBelly;
Widgets.Checkbox(innerX + SettingsUtility.Align(checkboxSize, singleColumnWidth), innerY + SettingsUtility.Align(checkboxSize, rowHeight), ref isEnabled, checkboxSize, false, true, null, null);
if (isEnabled != rimNudeApparel.coversBelly) { changeHappened = true; }
rimNudeApparel.coversBelly = isEnabled;
}; innerX += singleColumnWidth;
@ -321,29 +318,14 @@ namespace Rimworld_Animations_Patch
{
isEnabled = rimNudeApparel.coversChest;
Widgets.Checkbox(innerX + SettingsUtility.Align(checkboxSize, singleColumnWidth), innerY + SettingsUtility.Align(checkboxSize, rowHeight), ref isEnabled, checkboxSize, false, true, null, null);
if (isEnabled != rimNudeApparel.coversChest) { changeHappened = true; }
rimNudeApparel.coversChest = isEnabled;
}; innerX += singleColumnWidth;
// Is sex-wear checkbox
isEnabled = rimNudeApparel.sexWear;
Widgets.Checkbox(innerX + SettingsUtility.Align(checkboxSize, singleColumnWidth), innerY + SettingsUtility.Align(checkboxSize, rowHeight), ref isEnabled, checkboxSize, false, true, null, null);
if (isEnabled != rimNudeApparel.sexWear) { changeHappened = true; }
rimNudeApparel.sexWear = isEnabled;
innerX += singleColumnWidth;
// Update other body types if linked changed are enabled
if (BasicSettings.linkChanges && (changeHappened || linkChangesChanged))
{
for (int i = 0; i < 5; i++)
{
RimNudeData _rimNudeApparel = ApparelSettings.rimNudeData.First(x => x.EquivalentTo(new RimNudeData(thingDef)));
_rimNudeApparel.coversGroin = rimNudeApparel.coversGroin;
_rimNudeApparel.coversBelly = rimNudeApparel.coversBelly;
_rimNudeApparel.coversChest = rimNudeApparel.coversChest;
_rimNudeApparel.sexWear = rimNudeApparel.sexWear;
}
}
}
Widgets.EndScrollView();

View file

@ -3,6 +3,7 @@ using System.Linq;
using System.Collections.Generic;
using UnityEngine;
using Verse;
using RimWorld;
namespace Rimworld_Animations_Patch
{
@ -16,6 +17,7 @@ namespace Rimworld_Animations_Patch
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;
@ -42,6 +44,7 @@ namespace Rimworld_Animations_Patch
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);
@ -73,8 +76,9 @@ namespace Rimworld_Animations_Patch
{
foreach (Pawn pawn in Current.Game.CurrentMap.mapPawns.AllPawns)
{
if (pawn.RaceProps.Humanlike && pawn.apparel.WornApparel.NullOrEmpty() == false)
{ pawn.Drawer.renderer.graphics.ResolveAllGraphics(); }
pawn.Drawer.renderer.graphics.ResolveAllGraphics();
PortraitsCache.SetDirty(pawn);
GlobalTextureAtlasManager.TryMarkPawnFrameSetDirty(pawn);
}
}
}
@ -105,6 +109,7 @@ namespace Rimworld_Animations_Patch
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.CheckboxLabeled("hide_names_for_sex".Translate(), ref BasicSettings.hideNamesForSex, "hide_names_for_sex_desc".Translate());
listingStandard.CheckboxLabeled("debug_mode".Translate(), ref BasicSettings.debugMode, "debug_mode_desc".Translate());
@ -114,6 +119,7 @@ namespace Rimworld_Animations_Patch
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("redraw_hair".Translate(), ref BasicSettings.redrawHair, "redraw_hair_desc".Translate());
listingStandard.End();
base.DoSettingsWindowContents(inRect);