Removed HAR as dependency, only call namespace when it's mod is detected

This commit is contained in:
Platinum 2020-04-24 08:15:58 -07:00
parent 83b4cd689f
commit 31dd3719a1
3 changed files with 9 additions and 6 deletions

View File

@ -22,6 +22,10 @@ namespace Rimworld_Animations {
//fucked first, fucking second
participants = participants.OrderBy(p => rjw.xxx.can_fuck(p)).ToList();
if(rjw.RJWPreferenceSettings.Malesex == rjw.RJWPreferenceSettings.AllowedSex.Nohomo) {
participants = participants.OrderBy(x => rjw.xxx.is_male(x)).ToList();
}
List<Pawn> localParticipants = new List<Pawn>(participants);
IEnumerable<AnimationDef> options = DefDatabase<AnimationDef>.AllDefs.Where((AnimationDef x) => {

View File

@ -8,7 +8,6 @@ using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
using AlienRace;
namespace Rimworld_Animations {
[StaticConstructorOnStartup]
@ -42,17 +41,17 @@ namespace Rimworld_Animations {
public static bool Prefix_AnimateHeadAddons(bool portrait, Vector3 vector, Pawn pawn, Quaternion quat, Rot4 rotation, bool invisible) {
if (portrait || pawn.TryGetComp<CompBodyAnimator>() == null || !pawn.TryGetComp<CompBodyAnimator>().isAnimating) return true;
if (!(pawn.def is ThingDef_AlienRace alienProps) || invisible) return false;
if (!(pawn.def is AlienRace.ThingDef_AlienRace alienProps) || invisible) return false;
List<AlienPartGenerator.BodyAddon> addons = alienProps.alienRace.generalSettings.alienPartGenerator.bodyAddons;
AlienPartGenerator.AlienComp alienComp = pawn.GetComp<AlienPartGenerator.AlienComp>();
List<AlienRace.AlienPartGenerator.BodyAddon> addons = alienProps.alienRace.generalSettings.alienPartGenerator.bodyAddons;
AlienRace.AlienPartGenerator.AlienComp alienComp = pawn.GetComp<AlienRace.AlienPartGenerator.AlienComp>();
CompBodyAnimator pawnAnimator = pawn.TryGetComp<CompBodyAnimator>();
for (int i = 0; i < addons.Count; i++) {
AlienPartGenerator.BodyAddon ba = addons[index: i];
AlienRace.AlienPartGenerator.BodyAddon ba = addons[index: i];
if (!ba.CanDrawAddon(pawn: pawn)) continue;
AlienPartGenerator.RotationOffset offset;
AlienRace.AlienPartGenerator.RotationOffset offset;
if (ba.drawnInBed) {
offset = pawnAnimator.headFacing == Rot4.South ?