diff --git a/1.4/Assemblies/Rimworld-Animations-Patch.dll b/1.4/Assemblies/Rimworld-Animations-Patch.dll index 5640258..e659d68 100644 Binary files a/1.4/Assemblies/Rimworld-Animations-Patch.dll and b/1.4/Assemblies/Rimworld-Animations-Patch.dll differ diff --git a/About/About.xml b/About/About.xml index 69d43d2..9504725 100644 --- a/About/About.xml +++ b/About/About.xml @@ -1,7 +1,7 @@ - Rimworld-Animation Patch + Rimworld-Animations Patch AbstractConcept
  • 1.4
  • diff --git a/About/Changelog_v2.0.5.txt b/About/Changelog_v2.0.6.txt similarity index 72% rename from About/Changelog_v2.0.5.txt rename to About/Changelog_v2.0.6.txt index aec8d7c..f88d557 100644 --- a/About/Changelog_v2.0.5.txt +++ b/About/Changelog_v2.0.6.txt @@ -1,3 +1,7 @@ +Change log v 2.0.6 +- Fixed an issue where body addons with custom sizes were not scaling correctly +- Added additional debugging option which disables the patching of c0ffeeee's animation system - to be used to assist in determining if bugs or other issues are related to this patching + Change log v 2.0.5 - Fixed an issue with the orgasm not filling in some circumstances - Fixed a bug with sex overdrive not applying correctly diff --git a/About/Manifest.xml b/About/Manifest.xml index 262a37d..b9ce526 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,5 +1,5 @@ - 2.0.5 + 2.0.6 https://gitgud.io/AbstractConcept/rimworld-animations-patch \ No newline at end of file diff --git a/Defs/RulePackDefs/RulePacks_Masturbation.xml b/Defs/RulePackDefs/RulePacks_Masturbation.xml index 5d4f861..3893348 100644 --- a/Defs/RulePackDefs/RulePacks_Masturbation.xml +++ b/Defs/RulePackDefs/RulePacks_Masturbation.xml @@ -36,7 +36,7 @@
  • sent-> [INITIATOR_nameDef] played with [INITIATOR_possessive] breasts.
  • -
  • sent-> [INITIATOR_nameDef] tweaked [INITIATOR_possessive] nipples.
  • +
  • sent-> [INITIATOR_nameDef] sighed as [INITIATOR_pronoun] tweaked [INITIATOR_possessive] nipples.
  • diff --git a/Languages/English/Keyed/SettingsKeys.xml b/Languages/English/Keyed/SettingsKeys.xml index 65464a5..3a8797f 100644 --- a/Languages/English/Keyed/SettingsKeys.xml +++ b/Languages/English/Keyed/SettingsKeys.xml @@ -11,9 +11,11 @@ Note that setting this value to its maximum will not guarantee that this event will occur! It just maximises the chance of an invitation being made. All individuals involved must be attracted to / have a good opinion of each other, and the activity must not violate their traits or ideology. Set this value to zero to prevent these events from happening. Hide names when getting some lovin' May be useful if you find the names of your pawns cover up too much of the action. - Turn on debugging console messages + Turn on debugging mode with additional console messages Only required for debugging purposes. - + Use c0ffeeee's animation system + Prevents the patching of c0ffeeee's original animation system - this will cause many features of this mod to stop working. Only to be used for debugging purposes. + Animation Options Auto-scale animation offsets based on body size diff --git a/Source/.vs/Rimworld-Animations-Patch/v16/.suo b/Source/.vs/Rimworld-Animations-Patch/v16/.suo index 1458bba..212de84 100644 Binary files a/Source/.vs/Rimworld-Animations-Patch/v16/.suo and b/Source/.vs/Rimworld-Animations-Patch/v16/.suo differ diff --git a/Source/Scripts/Patches/HarmonyPatch_Rimworld_Animations.cs b/Source/Scripts/Patches/HarmonyPatch_Rimworld_Animations.cs index ec3dfb4..b27e608 100644 --- a/Source/Scripts/Patches/HarmonyPatch_Rimworld_Animations.cs +++ b/Source/Scripts/Patches/HarmonyPatch_Rimworld_Animations.cs @@ -85,7 +85,7 @@ namespace Rimworld_Animations_Patch // Replacement patch for AlienRace to draw the body addons 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 false; + if (!(pawn.def is ThingDef_AlienRace alienProps) || renderFlags.FlagSet(PawnRenderFlags.Invisible)) return true; // Get actor components and body addons List bodyAddons = alienProps.alienRace.generalSettings.alienPartGenerator.bodyAddons; @@ -99,8 +99,7 @@ namespace Rimworld_Animations_Patch { ApparelAnimationUtility.TryToDrawApparelOnFloor(pawn); } // Exit clauses - if (BasicSettings.useLegacyAnimationSystem || AnimationPatchUtility.ShouldNotAnimatePawn(pawn) || sexDataComp == null) - { return true; } + if (BasicSettings.useLegacyAnimationSystem || AnimationPatchUtility.ShouldNotAnimatePawn(pawn) || sexDataComp == null) return true; // Get available hands int handsAvailableCount = sexDataComp.GetNumberOfHands(); @@ -146,26 +145,13 @@ namespace Rimworld_Animations_Patch } float combinedAngle = MathUtility.ClampAngle(bodyAngle + bodyAddonAngle); - - Vector3 vector_ = vector; - Vector3 headOffset_ = bodyAddonDatum.alignsWithHead ? headOffset : Vector3.zero; - Vector3 bodyAddonOffset_ = bodyAddonDatum.GetOffset(apparentRotation).RotatedBy(angle: bodyAngle); - - if (pawn.ageTracker.Adult == false) - { - float bodySize = AnimationPatchUtility.GetBodySize(pawn); - addonGraphic.drawSize = new Vector2(1.5f * bodySize, 1.5f * bodySize); // Doesn't seem to be a need to scale by body part draw size (re: Orassians) - - Vector2 multi = AnimationPatchUtility.GetRaceSpecificOffsetMultipliers(pawn, bodyAddon.bodyPart); - bodyAddonOffset_.x *= bodySize * multi.x; - bodyAddonOffset_.z *= bodySize * multi.y; - } - - Vector3 bodyAddonPosition = vector_ + headOffset_ + bodyAddonOffset_; + Vector3 bodyAddonPosition = vector + (bodyAddonDatum.alignsWithHead ? headOffset : Vector3.zero) + bodyAddonDatum.GetOffset(apparentRotation).RotatedBy(angle: bodyAngle); // Draw the addon if visible if (canDraw) { + addonGraphic.drawSize = AnimationPatchUtility.DetermineDrawSize(pawn, alienComp, bodyAddon, bodyAddonDatum, renderFlags.FlagSet(PawnRenderFlags.Portrait)); + GenDraw.DrawMeshNowOrLater(mesh: addonGraphic.MeshAt(rot: apparentRotation), loc: bodyAddonPosition, quat: Quaternion.AngleAxis(angle: combinedAngle, axis: Vector3.up), diff --git a/Source/Scripts/Settings/BasicSettings.cs b/Source/Scripts/Settings/BasicSettings.cs index 8bd84b5..0730df0 100644 --- a/Source/Scripts/Settings/BasicSettings.cs +++ b/Source/Scripts/Settings/BasicSettings.cs @@ -81,7 +81,10 @@ namespace Rimworld_Animations_Patch 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()); - + + if (BasicSettings.debugMode) + { listingStandard.CheckboxLabeled("use_legacy_animation_system".Translate(), ref BasicSettings.useLegacyAnimationSystem, "use_legacy_animation_system_desc".Translate()); } + listingStandard.Gap(10f); listingStandard.Label("rimworld_animation_patch_animation".Translate()); listingStandard.Gap(5f); diff --git a/Source/Scripts/Utilities/AnimationPatchUtility.cs b/Source/Scripts/Utilities/AnimationPatchUtility.cs index 5b30654..6cec5bf 100644 --- a/Source/Scripts/Utilities/AnimationPatchUtility.cs +++ b/Source/Scripts/Utilities/AnimationPatchUtility.cs @@ -7,6 +7,7 @@ using HarmonyLib; using Verse; using Rimworld_Animations; using rjw; +using AlienRace; namespace Rimworld_Animations_Patch { @@ -184,6 +185,34 @@ namespace Rimworld_Animations_Patch return 1f; } + public static Vector2 DetermineDrawSize(Pawn pawn, AlienPartGenerator.AlienComp alienComp, AlienPartGenerator.BodyAddon bodyAddon, BodyAddonData bodyAddonData, bool isPortrait) + { + Vector2 drawSize = isPortrait && bodyAddon.drawSizePortrait != Vector2.zero ? bodyAddon.drawSizePortrait : bodyAddon.drawSize; + + if (bodyAddon.scaleWithPawnDrawsize) + { + if (isPortrait && bodyAddonData.alignsWithHead) + { drawSize *= alienComp.customPortraitHeadDrawSize; } + + else if (bodyAddonData.alignsWithHead) + { drawSize *= alienComp.customHeadDrawSize; } + + else if (isPortrait) + { drawSize *= alienComp.customPortraitDrawSize; } + + else + { drawSize *= alienComp.customDrawSize; } + } + + if (ModsConfig.BiotechActive) + { drawSize *= pawn.ageTracker.CurLifeStage.bodyWidth ?? 1.5f; } + + else + { drawSize *= 1.5f; } + + return drawSize; + } + private static Dictionary raceSpecificChildMultipliers = new Dictionary() { { "Alien_Orassan", new Vector3(1.4f, 1.4f, 1.4f) }, diff --git a/Source/Scripts/Utilities/ApparelAnimationUtility.cs b/Source/Scripts/Utilities/ApparelAnimationUtility.cs index e8fa0df..b8050da 100644 --- a/Source/Scripts/Utilities/ApparelAnimationUtility.cs +++ b/Source/Scripts/Utilities/ApparelAnimationUtility.cs @@ -70,6 +70,16 @@ namespace Rimworld_Animations_Patch return false; } + public static RJWPreferenceSettings.Clothing GetClothingPreference(Pawn pawn) + { + var clothingPreference = pawn.IsInBed(out Building bed) ? RJWPreferenceSettings.sex_wear : ApparelSettings.apparelWornForQuickies; + + if (xxx.has_quirk(pawn, "Endytophile")) + { clothingPreference = RJWPreferenceSettings.Clothing.Clothed; } + + return clothingPreference; + } + public static void DetermineApparelToKeepOn(Pawn pawn) { if (pawn?.apparel?.WornApparel == null) return; @@ -81,10 +91,7 @@ namespace Rimworld_Animations_Patch } ActorAnimationData animData = pawn.GetAnimationData(); - var clothingPreference = pawn.IsInBed(out Building bed) ? RJWPreferenceSettings.sex_wear : ApparelSettings.apparelWornForQuickies; - - if (xxx.has_quirk(pawn, "Endytophile")) - { clothingPreference = RJWPreferenceSettings.Clothing.Clothed; } + var clothingPreference = GetClothingPreference(pawn); // Get naked for rituals and parties bool undressForRitual = pawn.GetLord() != null && pawn.GetLord().LordJob is LordJob_Ritual; diff --git a/Source/obj/Debug/Rimworld-Animations-Patch.csprojAssemblyReference.cache b/Source/obj/Debug/Rimworld-Animations-Patch.csprojAssemblyReference.cache index acf9a69..df6bc57 100644 Binary files a/Source/obj/Debug/Rimworld-Animations-Patch.csprojAssemblyReference.cache and b/Source/obj/Debug/Rimworld-Animations-Patch.csprojAssemblyReference.cache differ diff --git a/Source/obj/Debug/Rimworld-Animations-Patch.dll b/Source/obj/Debug/Rimworld-Animations-Patch.dll index 5640258..e659d68 100644 Binary files a/Source/obj/Debug/Rimworld-Animations-Patch.dll and b/Source/obj/Debug/Rimworld-Animations-Patch.dll differ diff --git a/Source/obj/Debug/Rimworld-Animations-Patch.pdb b/Source/obj/Debug/Rimworld-Animations-Patch.pdb index 19e108b..957b692 100644 Binary files a/Source/obj/Debug/Rimworld-Animations-Patch.pdb and b/Source/obj/Debug/Rimworld-Animations-Patch.pdb differ