diff --git a/1.3/Assemblies/SizedApparelforRJW.dll b/1.3/Assemblies/SizedApparelforRJW.dll
index eb895d7..45fd0ce 100644
Binary files a/1.3/Assemblies/SizedApparelforRJW.dll and b/1.3/Assemblies/SizedApparelforRJW.dll differ
diff --git a/1.3/AssembliesNotion.txt b/1.3/AssembliesNotion.txt
new file mode 100644
index 0000000..a3e6977
--- /dev/null
+++ b/1.3/AssembliesNotion.txt
@@ -0,0 +1 @@
+latest source build: SizedApparel1.4WIP22
\ No newline at end of file
diff --git a/1.3/Defs/BodyAddonDefs/AOCBody.xml b/1.3/Defs/BodyAddonDefs/AOCBody.xml
new file mode 100644
index 0000000..e46e302
--- /dev/null
+++ b/1.3/Defs/BodyAddonDefs/AOCBody.xml
@@ -0,0 +1,131 @@
+
+
+
+
+ AOC
+
+
+ Female
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+
+
+ false
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/BodyAddonDefs/BoriBody.xml b/1.3/Defs/BodyAddonDefs/BoriBody.xml
new file mode 100644
index 0000000..e219291
--- /dev/null
+++ b/1.3/Defs/BodyAddonDefs/BoriBody.xml
@@ -0,0 +1,127 @@
+
+
+
+
+ Alien_Bori
+
+
+ Thin
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/BodyAddonDefs/MihoBody.xml b/1.3/Defs/BodyAddonDefs/MihoBody.xml
new file mode 100644
index 0000000..f059a1f
--- /dev/null
+++ b/1.3/Defs/BodyAddonDefs/MihoBody.xml
@@ -0,0 +1,249 @@
+
+
+
+
+ Alien_Miho
+
+
+ Female
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+
+
+ false
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+ Thin
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/BodyAddonDefs/RabbieBody.xml b/1.3/Defs/BodyAddonDefs/RabbieBody.xml
new file mode 100644
index 0000000..58682b0
--- /dev/null
+++ b/1.3/Defs/BodyAddonDefs/RabbieBody.xml
@@ -0,0 +1,249 @@
+
+
+
+
+ Rabbie
+
+
+ Thin
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+
+
+ false
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+ Male
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/BodyAddonDefs/RatkinBody.xml b/1.3/Defs/BodyAddonDefs/RatkinBody.xml
new file mode 100644
index 0000000..67ec55d
--- /dev/null
+++ b/1.3/Defs/BodyAddonDefs/RatkinBody.xml
@@ -0,0 +1,249 @@
+
+
+
+
+ Ratkin
+
+
+ Thin
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+
+
+ false
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+ Male
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/BodyAddonDefs/Ratkin_SuBody.xml b/1.3/Defs/BodyAddonDefs/Ratkin_SuBody.xml
new file mode 100644
index 0000000..be80c0c
--- /dev/null
+++ b/1.3/Defs/BodyAddonDefs/Ratkin_SuBody.xml
@@ -0,0 +1,249 @@
+
+
+
+
+ Ratkin_Su
+
+
+ Thin
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+
+
+ false
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+ Male
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/BodyAddonDefs/SPBody.xml b/1.3/Defs/BodyAddonDefs/SPBody.xml
new file mode 100644
index 0000000..89abc6b
--- /dev/null
+++ b/1.3/Defs/BodyAddonDefs/SPBody.xml
@@ -0,0 +1,131 @@
+
+
+
+
+ Alien_SP
+
+
+ Female
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+
+
+ false
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+ false
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ false
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ false
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ false
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ false
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/BodyAddonDefs/_HumanBody.xml b/1.3/Defs/BodyAddonDefs/_HumanBody.xml
new file mode 100644
index 0000000..7e7a0a1
--- /dev/null
+++ b/1.3/Defs/BodyAddonDefs/_HumanBody.xml
@@ -0,0 +1,717 @@
+
+
+
+ Human
+
+
+ Female
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+
+
+ false
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+ true
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ true
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ true
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ true
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ true
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+ Thin
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ true
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ true
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ true
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ true
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+ Male
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ true
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ true
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ true
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ true
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+ Hulk
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ true
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ true
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ true
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ true
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+ Fat
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+ false
+
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ true
+
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ true
+
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ true
+
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
+
+
+
+ PubicHair
+ PubicHair
+ Default
+ PubicHair
+ Hair
+ false
+ true
+
+
+ 0.0099
+ 0.0099
+ 0.0099
+ 0.0099
+
+
+
+
+
+ Child
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.4/Defs/BodyAddonDefs/HumanBody.xml b/1.3/Defs/BodyAddonDefs/_HumanBody.xml.bak
similarity index 79%
rename from 1.4/Defs/BodyAddonDefs/HumanBody.xml
rename to 1.3/Defs/BodyAddonDefs/_HumanBody.xml.bak
index 229c6f6..3a6a487 100644
--- a/1.4/Defs/BodyAddonDefs/HumanBody.xml
+++ b/1.3/Defs/BodyAddonDefs/_HumanBody.xml.bak
@@ -1,5 +1,4 @@
-
Human
@@ -26,6 +25,23 @@
0.0113
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Vagina
Vagina
@@ -120,8 +136,8 @@
0.0099
0.0099
- 0.0089
- 0.0089
+ 0.0099
+ 0.0099
@@ -238,8 +254,8 @@
0.0099
0.0099
- 0.0089
- 0.0089
+ 0.0099
+ 0.0099
@@ -356,8 +372,8 @@
0.0099
0.0099
- 0.0089
- 0.0089
+ 0.0099
+ 0.0099
@@ -474,8 +490,8 @@
0.0099
0.0099
- 0.0089
- 0.0089
+ 0.0099
+ 0.0099
@@ -592,8 +608,106 @@
0.0099
0.0099
- 0.0089
- 0.0089
+ 0.0099
+ 0.0099
+
+
+
+
+
+ Child
+
+
+ Breasts
+ Breasts
+ Breasts
+ Breasts
+ Skin
+ true
+ false
+ false
+
+ 0.0113
+ 0.001
+ 0.0113
+ 0.0113
+
+
+
+ Vagina
+ Vagina
+ Vagina
+ Vagina
+ Skin
+ false
+ true
+ true
+
+ 0.0088
+ 0.0100
+ 0.0088
+ 0.0088
+
+
+
+ Anus
+ Anus
+ Anus
+ Anus
+ Skin
+ false
+ true
+
+ 0.0093
+ 0.0105
+ 0.0093
+ 0.0093
+
+
+
+ Belly
+ Belly
+ BellyBulge
+ Belly
+ Skin
+ false
+ false
+
+ 0.0098
+ 0.0002
+ 0.0098
+ 0.0098
+
+
+
+ Penis
+ Penis
+ Penis
+ Penis
+ Skin
+ false
+ true
+
+ 0.0108
+ 0.0025
+ 0.0108
+ 0.0108
+
+
+
+ Balls
+ Balls
+ Penis
+ Balls
+ Penis/Balls
+ Skin
+ false
+ true
+
+ 0.0096
+ 0.0085
+ 0.0096
+ 0.0096
diff --git a/1.3/Defs/Defs(BodyDefsWip).zip b/1.3/Defs/Defs(BodyDefsWip).zip
new file mode 100644
index 0000000..979768c
Binary files /dev/null and b/1.3/Defs/Defs(BodyDefsWip).zip differ
diff --git a/1.3/Defs/Defs(wip).zip b/1.3/Defs/Defs(wip).zip
new file mode 100644
index 0000000..0dde8d5
Binary files /dev/null and b/1.3/Defs/Defs(wip).zip differ
diff --git a/1.3/Defs/PubicHairDefs/PubicHairDefault.xml b/1.3/Defs/PubicHairDefs/PubicHairDefault.xml
new file mode 100644
index 0000000..e0e0b0c
--- /dev/null
+++ b/1.3/Defs/PubicHairDefs/PubicHairDefault.xml
@@ -0,0 +1,11 @@
+
+
+
+
+ Default
+
+ SizedApparel/BodyParts/Human/PubicHair/Default
+
+
+
+
diff --git a/1.3/Defs/PubicHairDefs/PubicHairLine.xml b/1.3/Defs/PubicHairDefs/PubicHairLine.xml
new file mode 100644
index 0000000..f2b027e
--- /dev/null
+++ b/1.3/Defs/PubicHairDefs/PubicHairLine.xml
@@ -0,0 +1,11 @@
+
+
+
+
+ Line
+
+ SizedApparel/BodyParts/Human/PubicHair/Line
+
+
+
+
diff --git a/1.3/Defs/PubicHairDefs/PubicHairLine.xml.bak b/1.3/Defs/PubicHairDefs/PubicHairLine.xml.bak
new file mode 100644
index 0000000..4bf42a4
--- /dev/null
+++ b/1.3/Defs/PubicHairDefs/PubicHairLine.xml.bak
@@ -0,0 +1,11 @@
+
+
+
+
+ Wild
+
+ SizedApparel/BodyParts/Human/PubicHair/Wild
+
+
+
+
diff --git a/1.3/Defs/PubicHairDefs/PubicHairNone.xml b/1.3/Defs/PubicHairDefs/PubicHairNone.xml
new file mode 100644
index 0000000..a49bf4e
--- /dev/null
+++ b/1.3/Defs/PubicHairDefs/PubicHairNone.xml
@@ -0,0 +1,7 @@
+
+
+
+ None
+ true
+
+
diff --git a/1.3/Defs/PubicHairDefs/PubicHairWild.xml b/1.3/Defs/PubicHairDefs/PubicHairWild.xml
new file mode 100644
index 0000000..4bf42a4
--- /dev/null
+++ b/1.3/Defs/PubicHairDefs/PubicHairWild.xml
@@ -0,0 +1,11 @@
+
+
+
+
+ Wild
+
+ SizedApparel/BodyParts/Human/PubicHair/Wild
+
+
+
+
diff --git a/1.3/Defs/SkeletonDef/AOCSkeletonDef.xml b/1.3/Defs/SkeletonDef/AOCSkeletonDef.xml
new file mode 100644
index 0000000..d927691
--- /dev/null
+++ b/1.3/Defs/SkeletonDef/AOCSkeletonDef.xml
@@ -0,0 +1,123 @@
+
+
+
+ AOC
+
+
+ Female
+
+
+ Vagina
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Penis
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Balls
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+
+
+ Child
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/SkeletonDef/BoriSkeletonDef.xml b/1.3/Defs/SkeletonDef/BoriSkeletonDef.xml
new file mode 100644
index 0000000..11e2645
--- /dev/null
+++ b/1.3/Defs/SkeletonDef/BoriSkeletonDef.xml
@@ -0,0 +1,123 @@
+
+
+
+ Alien_Bori
+
+
+ Thin
+
+
+ Vagina
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Penis
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Balls
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+
+
+ Child
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/SkeletonDef/MihoSkeletonDef.xml b/1.3/Defs/SkeletonDef/MihoSkeletonDef.xml
new file mode 100644
index 0000000..d13758e
--- /dev/null
+++ b/1.3/Defs/SkeletonDef/MihoSkeletonDef.xml
@@ -0,0 +1,233 @@
+
+
+
+ Alien_Miho
+
+
+ Thin
+
+
+ Vagina
+
+ (0, 0, -0.148)
+ 0
+
+
+ (-0.006, 0, -0.150)
+ 0
+
+
+ (-0.006, 0, -0.143)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, -0.129)
+ 0
+
+
+ (-0.006, 0, -0.139
+ 0
+
+
+ (-0.061, 0, -0.155)
+ 0
+
+
+
+ Penis
+
+ (0, 0, -0.141)
+ 0
+
+
+ (-0.006, 0, -0.141)
+ 0
+
+
+ (-0.004, 0, -0.139)
+ 0
+
+
+
+ Balls
+
+ (0, 0, -0.141)
+ 0
+
+
+ (-0.006, 0, -0.141))
+ 0
+
+
+ (-0.004, 0, -0.139)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, -0.121)
+ 0
+
+
+ (-0.006, 0, -0.109)
+ 0
+
+
+ (0.004, 0, -0.123)
+ 0
+
+
+
+
+
+ Female
+
+
+ Vagina
+
+ (0, 0, -0.148)
+ 0
+
+
+ (-0.006, 0, -0.150)
+ 0
+
+
+ (-0.006, 0, -0.143)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, -0.129)
+ 0
+
+
+ (-0.006, 0, -0.139)
+ 0
+
+
+ (-0.061, 0, -0.155)
+ 0
+
+
+
+ Penis
+
+ (0, 0, -0.141)
+ 0
+
+
+ (-0.006, 0, -0.141)
+ 0
+
+
+ (-0.004, 0, -0.139)
+ 0
+
+
+
+ Balls
+
+ (0, 0, -0.141)
+ 0
+
+
+ (-0.006, 0, -0.141)
+ 0
+
+
+ (-0.004, 0, -0.139)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0.004, 0, -0.123))
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, -0.121)
+ 0
+
+
+ (-0.006, 0, -0.109)
+ 0
+
+
+ (0.004, 0, -0.123)
+ 0
+
+
+
+
+
+ Child
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/SkeletonDef/RabbieSkeletonDef.xml b/1.3/Defs/SkeletonDef/RabbieSkeletonDef.xml
new file mode 100644
index 0000000..ebb6a16
--- /dev/null
+++ b/1.3/Defs/SkeletonDef/RabbieSkeletonDef.xml
@@ -0,0 +1,233 @@
+
+
+
+ Rabbie
+
+
+ Thin
+
+
+ Vagina
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Penis
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Balls
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+
+
+ Male
+
+
+ Vagina
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Penis
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Balls
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+
+
+ Child
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/SkeletonDef/RatkinSkeletonDef.xml b/1.3/Defs/SkeletonDef/RatkinSkeletonDef.xml
new file mode 100644
index 0000000..850f0dd
--- /dev/null
+++ b/1.3/Defs/SkeletonDef/RatkinSkeletonDef.xml
@@ -0,0 +1,233 @@
+
+
+
+ Ratkin
+
+
+ Thin
+
+
+ Vagina
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Penis
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Balls
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+
+
+ Male
+
+
+ Vagina
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Penis
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Balls
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+
+
+ Child
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/SkeletonDef/RatkinSuSkeletonDef.xml b/1.3/Defs/SkeletonDef/RatkinSuSkeletonDef.xml
new file mode 100644
index 0000000..73bf8f7
--- /dev/null
+++ b/1.3/Defs/SkeletonDef/RatkinSuSkeletonDef.xml
@@ -0,0 +1,233 @@
+
+
+
+ Ratkin_Su
+
+
+ Thin
+
+
+ Vagina
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Penis
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Balls
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+
+
+ Male
+
+
+ Vagina
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Penis
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Balls
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+
+
+ Child
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/SkeletonDef/SPSkeletonDef.xml b/1.3/Defs/SkeletonDef/SPSkeletonDef.xml
new file mode 100644
index 0000000..5dec2cf
--- /dev/null
+++ b/1.3/Defs/SkeletonDef/SPSkeletonDef.xml
@@ -0,0 +1,123 @@
+
+
+
+ Alien_SP
+
+
+ Female
+
+
+ Vagina
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Penis
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Balls
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+
+
+ Child
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.4/Defs/SkeletonDef/HumanSkeletonDef.xml b/1.3/Defs/SkeletonDef/_HumanSkeletonDef.xml
similarity index 80%
rename from 1.4/Defs/SkeletonDef/HumanSkeletonDef.xml
rename to 1.3/Defs/SkeletonDef/_HumanSkeletonDef.xml
index 65815f2..cc1a6c7 100644
--- a/1.4/Defs/SkeletonDef/HumanSkeletonDef.xml
+++ b/1.3/Defs/SkeletonDef/_HumanSkeletonDef.xml
@@ -556,7 +556,112 @@
Child
-
+
+ Vagina
+
+ (0.002, 0, -0.209)
+ 0
+
+
+ (0, 0, -0.205)
+ 0
+
+
+ (0.043, 0, -0.174)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, -0.289)
+ 0
+
+
+ (0.002, 0, -0.164)
+ 0
+
+
+ (-0.084, 0, -0.127)
+ 0
+
+
+
+ Penis
+
+ (-0.002, 0, -0.195)
+ 0
+
+
+ (-0.002, 0, -0.195)
+ 0
+
+
+ (0.047, 0, -0.170)
+ 0
+
+
+
+ Balls
+
+ (-0.002, 0, -0.195)
+ 0
+
+
+ (-0.002, 0, -0.195)
+ 0
+
+
+ (0.047, 0, -0.170)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, -0.166)
+ 0
+
+
+ (-0.002, 0, -0.164)
+ 0
+
+
+ (0.057, 0, -0.145)
+ 0
+
+
+
diff --git a/1.3/Defs/SkeletonDef/_HumanSkeletonDef.xml.bak b/1.3/Defs/SkeletonDef/_HumanSkeletonDef.xml.bak
new file mode 100644
index 0000000..47e66f0
--- /dev/null
+++ b/1.3/Defs/SkeletonDef/_HumanSkeletonDef.xml.bak
@@ -0,0 +1,668 @@
+
+
+
+ Human
+
+
+ Female
+
+
+ Vagina
+
+ (-0.002, 0, -0.340)
+ 0
+
+
+ (-0.006, 0, -0.346)
+ 0
+
+
+ (0.047, 0, -0.238)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, -0.289)
+ 0
+
+
+ (-0.006, 0, -0.289)
+ 0
+
+
+ (-0.174, 0, 0.254)
+ 0
+
+
+
+ Penis
+
+ (0, 0, -0.320)
+ 0
+
+
+ (-0.01, 0, -0.338)
+ 0
+
+
+ (0.062, 0, -0.221)
+ 0
+
+
+
+ Balls
+
+ (0, 0, -0.320)
+ 0
+
+
+ (-0.01, 0, -0.338)
+ 0
+
+
+ (0.062, 0, -0.221)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, -0.301)
+ 0
+
+
+ (0, 0, -0.318)
+ 0
+
+
+ (0.059, 0, -0.186)
+ 0
+
+
+
+
+
+ Thin
+
+
+ Vagina
+
+ (0, 0, -0.312)
+ 0
+
+
+ (-0.006, 0, -0.318)
+ 0
+
+
+ (0.006, 0, -0.256)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, -0.260)
+ 0
+
+
+ (-0.002, 0, -0.266)
+ 0
+
+
+ (-0.137, 0, -0.211)
+ 0
+
+
+
+ Penis
+
+ (0, 0, -0.307)
+ 0
+
+
+ (0, 0, -0.305)
+ 0
+
+
+ (0.008, 0, -0.248)
+ 0
+
+
+
+ Balls
+
+ (0, 0, -0.307)
+ 0
+
+
+ (0, 0, -0.305)
+ 0
+
+
+ (0.007, 0, -0.248)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, -0.281)
+ 0
+
+
+ (0, 0, -0.291)
+ 0
+
+
+ (0.021, 0, -0.219)
+ 0
+
+
+
+
+
+ Male
+
+
+ Vagina
+
+ (0, 0, -0.320)
+ 0
+
+
+ (0.002, 0, -0.311)
+ 0
+
+
+ (0.057, 0, -0.258)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, -0.268)
+ 0
+
+
+ (0, 0, -0.252)
+ 0
+
+
+ (-0.113, 0, -0.234)
+ 0
+
+
+
+ Penis
+
+ (0, 0, -0.301)
+ 0
+
+
+ (0, 0, -0.311)
+ 0
+
+
+ (0.068, 0, -0.250)
+ 0
+
+
+
+ Balls
+
+ (0.0, 0, -0.301)
+ 0
+
+
+ (0.0, 0, -0.311)
+ 0
+
+
+ (0.066, 0, -0.250)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, -0.275)
+ 0
+
+
+ (0, 0, -0.277)
+ 0
+
+
+ (0.066, 0, -0.219)
+ 0
+
+
+
+
+
+ Hulk
+
+
+ Vagina
+
+ (0.004, 0, -0.434)
+ 0
+
+
+ (0, 0, -0.453)
+ 0
+
+
+ (0.020, 0, -0.395)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0.006, 0, -0.383)
+ 0
+
+
+ (0, 0, -0.406)
+ 0
+
+
+ (-0.238, 0, -0.328)
+ 0
+
+
+
+ Penis
+
+ (0, 0, -0.436)
+ 0
+
+
+ (0.0, 0, -0.445)
+ 0
+
+
+ (0.029, 0, -0.387)
+ 0
+
+
+
+ Balls
+
+ (0, 0, -0.436)
+ 0
+
+
+ (0, 0, -0.445)
+ 0
+
+
+ (0.028, 0, -0.387)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, -0.395)
+ 0
+
+
+ (0.027, 0, -0.375)
+ 0
+
+
+ (0, 0, -0.424)
+ 0
+
+
+
+
+
+ Fat
+
+
+ Vagina
+
+ (0.002, 0, -0.352)
+ 0
+
+
+ (0.002, 0, -0.359)
+ 0
+
+
+ (0.148, 0, -0.352)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, -0.297)
+ 0
+
+
+ (0, 0, -0.297)
+ 0
+
+
+ (-0.238, 0, -0.271)
+ 0
+
+
+
+ Penis
+
+ (0, 0, -0.357)
+ 0
+
+
+ (0, 0, -0.363)
+ 0
+
+
+ (0.168, 0, -0.348)
+ 0
+
+
+
+ Balls
+
+ (0, 0, -0.357)
+ 0
+
+
+ (0, 0, -0.363)
+ 0
+
+
+ (0.168, 0, -0.348)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ PubicHair
+
+ (0, 0, -0.307)
+ 0
+
+
+ (0, 0, -0.320)
+ 0
+
+
+ (0.158, 0, -0.338)
+ 0
+
+
+
+
+
+ Child
+
+
+ Vagina
+
+ (0.002, 0, -0.209)
+ 0
+
+
+ (0, 0, -0.205)
+ 0
+
+
+ (0.043, 0, -0.174)
+ 0
+
+
+
+ Breasts
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+ Anus
+
+ (0, 0, -0.289)
+ 0
+
+
+ (0.002, 0, -0.164)
+ 0
+
+
+ (-0.084, 0, -0.127)
+ 0
+
+
+
+ Penis
+
+ (-0.002, 0, -0.195)
+ 0
+
+
+ (-0.002, 0, -0.195)
+ 0
+
+
+ (0.047, 0, -0.170)
+ 0
+
+
+
+ Balls
+
+ (-0.002, 0, -0.195)
+ 0
+
+
+ (-0.002, 0, -0.195)
+ 0
+
+
+ (0.047, 0, -0.170)
+ 0
+
+
+
+ Belly
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+ (0, 0, 0)
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Defs/TexturePointsDefs/Test.zip b/1.3/Defs/TexturePointsDefs/Test.zip
new file mode 100644
index 0000000..d6a1cce
Binary files /dev/null and b/1.3/Defs/TexturePointsDefs/Test.zip differ
diff --git a/1.3/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml b/1.3/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml
new file mode 100644
index 0000000..f8e424c
--- /dev/null
+++ b/1.3/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+ Biotech
+
+
+ Normal
+
+
+ Defs/ThingDef[defName = "Apparel_Sash"]/apparel/tags
+
+ Defs/ThingDef[defName = "Apparel_Sash"]/apparel
+
+
+ SizedApparel_IgnorBreastSize
+ SizedApparel_ShowPrivateCrotch
+
+
+
+
+ Defs/ThingDef[defName = "Apparel_Sash"]/apparel/tags
+
+ SizedApparel_IgnorBreastSize
+ SizedApparel_ShowPrivateCrotch
+
+
+
+
+ Defs/ThingDef[defName = "Apparel_Bandolier"]/apparel/tags
+
+ Defs/ThingDef[defName = "Apparel_Bandolier"]/apparel
+
+
+ SizedApparel_IgnorBreastSize
+ SizedApparel_ShowPrivateCrotch
+
+
+
+
+ Defs/ThingDef[defName = "Apparel_Bandolier"]/apparel/tags
+
+ SizedApparel_IgnorBreastSize
+ SizedApparel_ShowPrivateCrotch
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml.bak b/1.3/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml.bak
new file mode 100644
index 0000000..08e7f34
--- /dev/null
+++ b/1.3/Patches/ApparelPatches/VanillaBiotechPatch/BiotechApparelPatch.xml.bak
@@ -0,0 +1,52 @@
+
+
+
+
+
+ Biotech
+
+
+ Normal
+
+
+ Defs/ThingDef[defName = "Apparel_Sash"]/apparel/tags
+
+ Defs/ThingDef[defName = "Apparel_Sash"]/apparel
+
+
+ SizedApparel_IgnorBreastSize
+ SizedApparel_ShowPrivateCrotch
+
+
+
+
+ Defs/ThingDef[defName = "Apparel_Sash"]/apparel/tags
+
+ SizedApparel_IgnorBreastSize
+ SizedApparel_ShowPrivateCrotch
+
+
+
+
+ Defs/ThingDef[defName = "Apparel_Bandolier"]/apparel/tags
+
+ Defs/ThingDef[defName = "Apparel_Bandolier"]/apparel
+
+
+ SizedApparel_IgnorBreastSize
+ SizedApparel_ShowPrivateCrotch
+
+
+
+
+ Defs/ThingDef[defName = "Apparel_HeavyBandolier"]/apparel/tags
+
+ SizedApparel_IgnorBreastSize
+ SizedApparel_ShowPrivateCrotch
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/1.3/source/SizedApparel/AlienRaceSupport.cs b/1.3/source/SizedApparel/AlienRaceSupport.cs
index ebfcdd3..a8f1dba 100644
--- a/1.3/source/SizedApparel/AlienRaceSupport.cs
+++ b/1.3/source/SizedApparel/AlienRaceSupport.cs
@@ -11,10 +11,4 @@ namespace SizedApparel
class AlienRaceSupport
{
}
-
- public class SizedApparelPawnDef : Def
- {
- public bool allowForceHumanlike = false;
-
- }
}
diff --git a/1.3/source/SizedApparel/Graphic_BodyParts.cs b/1.3/source/SizedApparel/Graphic_BodyParts.cs
index 50be733..f221eda 100644
--- a/1.3/source/SizedApparel/Graphic_BodyParts.cs
+++ b/1.3/source/SizedApparel/Graphic_BodyParts.cs
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
namespace SizedApparel
{
+ //Does it better to optimize?
public class Graphic_BodyParts : Verse.Graphic_Multi
{
public float serverity;
diff --git a/1.3/source/SizedApparel/Graphic_SizedApparel.cs b/1.3/source/SizedApparel/Graphic_SizedApparel.cs
index a0a879c..f84fa77 100644
--- a/1.3/source/SizedApparel/Graphic_SizedApparel.cs
+++ b/1.3/source/SizedApparel/Graphic_SizedApparel.cs
@@ -3,11 +3,17 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using UnityEngine;
+using RimWorld;
+using Verse;
namespace SizedApparel
{
- public class Graphic_SizedApparel : Verse.Graphic_Multi
+ //Does it better to optimize?
+ public class Graphic_SizedApparel : Graphic_Multi
{
-
+ public string TargetBodyParts = "Breats";
+ //Sized Graphics.
+ public List graphics;
}
}
diff --git a/1.3/source/SizedApparel/HarmonyPatches.cs b/1.3/source/SizedApparel/HarmonyPatches.cs
index b723dd3..9b8d881 100644
--- a/1.3/source/SizedApparel/HarmonyPatches.cs
+++ b/1.3/source/SizedApparel/HarmonyPatches.cs
@@ -1,15 +1,11 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using HarmonyLib;
using RimWorld;
-using Verse;
-using HarmonyLib;
+//using Rimworld_Animations;
//using AlienRace;
-using UnityEngine;
using rjw;
-using RevealingApparel;
-using System.Reflection;
+using System;
+using System.Linq;
+using Verse;
namespace SizedApparel
{
@@ -24,6 +20,9 @@ namespace SizedApparel
public static bool rimNudeWorldActive = false;
public static bool OTYNudeActive = false;
public static bool LicentiaActive = false;
+ public static bool RimworldAnimationActive = false; //rjw animation
+ public static bool MenstruationActive = false; //rjw_menstruation
+ public static bool StatueOfColonistActive = false;
static SizedApparelPatch()
{
@@ -85,6 +84,40 @@ namespace SizedApparel
{
LicentiaActive = true;
}
+ if (!LicentiaActive)
+ {
+ if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId.ToLower() == "Euclidean.LustLicentia.RJWLabs".ToLower()))
+ {
+ LicentiaActive = true;
+ }
+ }
+ if (!LicentiaActive)
+ {
+ if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId.ToLower().Contains("LustLicentia.RJWLabs".ToLower())))
+ {
+ LicentiaActive = true;
+ }
+ }
+
+
+
+ //check rjw animation
+ if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId.ToLower() == "c0ffee.rimworld.animations".ToLower()))
+ {
+ RimworldAnimationActive = true;
+ }
+
+ //check rjw_menstruation
+ if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId.ToLower() == "rjw.menstruation".ToLower()))
+ {
+ MenstruationActive = true;
+ }
+
+ //check statue of Colonist
+ if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageId.ToLower() == "tammybee.statueofcolonist".ToLower()))
+ {
+ StatueOfColonistActive = true;
+ }
Log.Message("[SizedApparel] start");
@@ -137,7 +170,7 @@ namespace SizedApparel
}
else
{
- Log.Message("[SizedApparel] RimJobWorld Paatch canceled");
+ Log.Message("[SizedApparel] RimJobWorld Patch canceled");
}
}))();
}
@@ -170,6 +203,31 @@ namespace SizedApparel
catch (TypeLoadException ex) { }
*/
+ try
+ {
+ ((Action)(() =>
+ {
+ if (RimworldAnimationActive)
+ {
+ Log.Message("[SizedApparel] RimworldAnimaion(rjw animation) Found");
+
+ harmony.Patch(AccessTools.Method(typeof(Rimworld_Animations.CompBodyAnimator), "tickClip"),
+ postfix: new HarmonyMethod(typeof(RimworldAnimationPatch), "TickClipPostfix"));
+
+ harmony.Patch(AccessTools.Method(typeof(JobDriver_SexBaseInitiator), "End"),
+ postfix: new HarmonyMethod(typeof(RimworldAnimationPatch), "EndClipPostfix"));
+
+
+ Log.Message("[SizedApparel] RimworldAnimaion(rjw animation) Patched");
+ }
+ else
+ {
+ Log.Message("[SizedApparel] RimworldAnimaion(rjw animation) Patch canceled");
+ }
+ }))();
+ }
+ catch (TypeLoadException ex) { }
+
//Rim Nude World Patch
try
{
diff --git a/1.3/source/SizedApparel/Patch-Animation.cs b/1.3/source/SizedApparel/Patch-Animation.cs
new file mode 100644
index 0000000..bd92a0d
--- /dev/null
+++ b/1.3/source/SizedApparel/Patch-Animation.cs
@@ -0,0 +1,107 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using RimWorld;
+using Verse;
+using HarmonyLib;
+using UnityEngine;
+//using Rimworld_Animations;
+
+namespace SizedApparel
+{
+
+ public class RimworldAnimationPatch
+ {
+ //since instance (CompBodyAnimator class) must be soft dependency, Get as System.Object.
+ public static void TickClipPostfix(System.Object __instance) //CompBodyAnimator __instance, AnimationDef ___anim, int ___curStage, int ___actor, int ___clipTicks, float ___clipPercent
+ {
+ Rimworld_Animations.CompBodyAnimator instance = __instance as Rimworld_Animations.CompBodyAnimator;
+
+ if (instance == null)
+ return;
+
+ if (!instance.controlGenitalAngle)
+ return;
+
+ var comp = instance.parent.GetComp();
+ if (comp == null)
+ return;
+
+
+ comp.SetPenisAngle(instance.genitalAngle - instance.bodyAngle); //genitalAngle is global Angle value in rjwanimation... fix with body Angle;
+
+
+ if (!SizedApparelSettings.AnimationPatch)//Rotating Penis Setting(avobe) is set from RimworldAnimation Setting, not in SizedApparel.
+ return;
+
+ foreach (var actor in instance.actorsInCurrentAnimation)
+ {
+ //comp.ForceUpdateTickAnimation = true;
+ var actorcomp = actor.GetComp();
+ if (actorcomp == null)
+ continue;
+ //actorcomp.SetBreastJiggle(true);
+ actorcomp.ForceUpdateTickAnimation = true;
+
+ }
+ return;
+ bool isFuckTick = false;
+ /*
+ var soundEffects = ((PawnAnimationClip)___anim.animationStages[___curStage].animationClips[___actor]).SoundEffects;
+ if (soundEffects.ContainsKey(___clipTicks) && (soundEffects[___clipTicks].Contains("Fuck") || soundEffects[___clipTicks].Contains("Suck")))
+ {
+ isFuckTick = true;
+ }
+ else
+ {
+ const int jiggleTime = 3;
+ for(int i = 0; i < jiggleTime; i++)
+ {
+ if (soundEffects.ContainsKey(___clipTicks - i) && soundEffects[___clipTicks - i].Contains("Fuck"))
+ {
+ isFuckTick = true;
+ break;
+ }
+ }
+ }*/
+ //need to find partner's breasts.
+ /*
+ if (isFuckTick)
+ {
+ foreach (var actor in __instance.actorsInCurrentAnimation)
+ {
+ actor.GetComp().SetBreastJiggle(true);
+ }
+ }
+ else
+ {
+ foreach (var actor in __instance.actorsInCurrentAnimation)
+ {
+ actor.GetComp().SetBreastJiggle(false);
+ }
+ }*/
+ //may have some tick issue? too fast jiggle?
+ }
+
+ //rjw's JobDriver_SexBaseInitiator end patch
+ public static void EndClipPostfix(System.Object __instance)//CompBodyAnimator __instance
+ {
+ Rimworld_Animations.CompBodyAnimator instance = __instance as Rimworld_Animations.CompBodyAnimator;
+ if (instance == null)
+ return;
+
+ if (!instance.controlGenitalAngle)
+ return;
+ var comp = instance.parent.GetComp();
+ if (comp == null)
+ return;
+ comp.SetBreastJiggle(false, -1);
+ comp.ForceUpdateTickAnimation = false;
+ comp.SetPenisAngle(0);
+
+ }
+ }
+
+}
diff --git a/1.3/source/SizedApparel/SizedApparelDubsApparelPatch.cs b/1.3/source/SizedApparel/Patch-DubsApparelPatch.cs
similarity index 86%
rename from 1.3/source/SizedApparel/SizedApparelDubsApparelPatch.cs
rename to 1.3/source/SizedApparel/Patch-DubsApparelPatch.cs
index 8cc6e14..5addbe4 100644
--- a/1.3/source/SizedApparel/SizedApparelDubsApparelPatch.cs
+++ b/1.3/source/SizedApparel/Patch-DubsApparelPatch.cs
@@ -17,7 +17,7 @@ namespace SizedApparel
if (graphicSet == null)
return;
- var comp = pawn.TryGetComp();
+ var comp = pawn.GetComp();
if (comp == null)
return;
comp.needToCheckApparelGraphicRecords = true;
diff --git a/1.3/source/SizedApparel/Patch-Menstruation.cs b/1.3/source/SizedApparel/Patch-Menstruation.cs
new file mode 100644
index 0000000..21c4a84
--- /dev/null
+++ b/1.3/source/SizedApparel/Patch-Menstruation.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using UnityEngine;
+using Verse;
+using RJW_Menstruation;
+
+namespace SizedApparel
+{
+ public class Patch_Menstruation
+ {
+
+ public static Color? GetNippleColor(Hediff breastHediff)
+ {
+ var breastcomp = breastHediff.TryGetComp();
+ if (breastcomp == null)
+ return null;
+ return breastcomp.NippleColor;
+ }
+
+ public static float? GetNippleSize(Hediff breastHediff)
+ {
+ var breastcomp = breastHediff.TryGetComp();
+ if (breastcomp == null)
+ return null;
+ return breastcomp.NippleSize;
+ }
+
+ public static float? GetAreolaSize(Hediff breastHediff)
+ {
+ var breastcomp = breastHediff.TryGetComp();
+ if (breastcomp == null)
+ return null;
+ return breastcomp.AreolaSize;
+ }
+ }
+}
diff --git a/1.3/source/SizedApparel/SizedApparelRJWPatch.cs b/1.3/source/SizedApparel/Patch-RimJobWorld.cs
similarity index 90%
rename from 1.3/source/SizedApparel/SizedApparelRJWPatch.cs
rename to 1.3/source/SizedApparel/Patch-RimJobWorld.cs
index bc1aecf..06f8ac6 100644
--- a/1.3/source/SizedApparel/SizedApparelRJWPatch.cs
+++ b/1.3/source/SizedApparel/Patch-RimJobWorld.cs
@@ -18,10 +18,10 @@ namespace SizedApparel
{
if (!UnityData.IsInMainThread)
return;
- ApparelRecorderComp comp = pawn?.TryGetComp();
+ ApparelRecorderComp comp = pawn?.GetComp();
if (comp == null)
return;
- comp.SetDirty();
+ comp.SetDirty(true,true,true);
/*
comp.ClearAll();
var graphicSet = pawn.Drawer?.renderer?.graphics;
@@ -69,7 +69,7 @@ namespace SizedApparel
return;
//GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff);
//bool flag = hasUnSupportedApparel(__instance.pawn, breastSeverity, breastHediff);
- ApparelRecorderComp comp = pawn.TryGetComp();
+ ApparelRecorderComp comp = pawn.GetComp();
if (comp != null)
{
/*
@@ -128,7 +128,7 @@ namespace SizedApparel
{
if (pawn == null)
return;
- ApparelRecorderComp comp = pawn.TryGetComp();
+ ApparelRecorderComp comp = pawn.GetComp();
if (comp == null)
return;
comp.SetDirty();
@@ -146,7 +146,7 @@ namespace SizedApparel
- ApparelRecorderComp pawnARC = __instance.pawn.TryGetComp();
+ ApparelRecorderComp pawnARC = __instance.pawn.GetComp();
if (pawnARC != null)
{
if (__instance.pawn.RaceProps.Humanlike)
@@ -161,7 +161,7 @@ namespace SizedApparel
var partner = __instance.Partner as Pawn;
if (partner == null)
return;
- ApparelRecorderComp partnerARC = partner.TryGetComp();
+ ApparelRecorderComp partnerARC = partner.GetComp();
if (partnerARC != null)
{
if (partner.RaceProps.Humanlike)
@@ -182,7 +182,7 @@ namespace SizedApparel
{
- ApparelRecorderComp pawnARC = __instance.pawn.TryGetComp();
+ ApparelRecorderComp pawnARC = __instance.pawn.GetComp();
if (pawnARC != null)
{
@@ -209,7 +209,7 @@ namespace SizedApparel
var partner = __instance.Partner as Pawn;
if (partner == null)
return;
- ApparelRecorderComp partnerARC = partner.TryGetComp();
+ ApparelRecorderComp partnerARC = partner.GetComp();
if (partnerARC != null)
{
partnerARC.havingSex = false;
diff --git a/1.3/source/SizedApparel/SizedApparelRNWPatch.cs b/1.3/source/SizedApparel/Patch-RimNudeWorld.cs
similarity index 90%
rename from 1.3/source/SizedApparel/SizedApparelRNWPatch.cs
rename to 1.3/source/SizedApparel/Patch-RimNudeWorld.cs
index 3971a36..cdc4e93 100644
--- a/1.3/source/SizedApparel/SizedApparelRNWPatch.cs
+++ b/1.3/source/SizedApparel/Patch-RimNudeWorld.cs
@@ -36,7 +36,7 @@ namespace SizedApparel
{
if (__result == false)
return;
- var comp = pawn.TryGetComp();
+ var comp = pawn.GetComp();
if (comp == null)
return;
if (comp.hasUnsupportedApparel)
diff --git a/1.3/source/SizedApparel/Patch-StatueOfColonist.cs b/1.3/source/SizedApparel/Patch-StatueOfColonist.cs
new file mode 100644
index 0000000..2aa8860
--- /dev/null
+++ b/1.3/source/SizedApparel/Patch-StatueOfColonist.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SizedApparel
+{
+ public class Patch_StatueOfColonist
+ {
+
+ }
+}
diff --git a/1.3/source/SizedApparel/SizedApparelBodyPart.cs b/1.3/source/SizedApparel/SizedApparelBodyPart.cs
index 8ee5cc7..a8ca96e 100644
--- a/1.3/source/SizedApparel/SizedApparelBodyPart.cs
+++ b/1.3/source/SizedApparel/SizedApparelBodyPart.cs
@@ -1,33 +1,51 @@
-using System;
+using HarmonyLib;
+using RimWorld;
+using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using RimWorld;
-using Verse;
-using HarmonyLib;
+using System.Reflection;
//using AlienRace;
using UnityEngine;
-using rjw;
-using System.Reflection;
+using Verse;
namespace SizedApparel
{
- public struct Depth4Offsets
+ public class Depth4Offsets
{
- float South;
- float North;
- float East;
- float West;
+ public float south=0;
+ public float north=0;
+ public float east=0;
+ public float west=0;
+
+ public Depth4Offsets() { }
+
+ public Depth4Offsets(Vector4 arg)
+ {
+ south = arg.x;
+ north = arg.y;
+ east = arg.z;
+ west = arg.w;
+ }
+ public Depth4Offsets(float s, float n, float e, float w)
+ {
+ south = s;
+ north = n;
+ east = e;
+ west = w;
+ }
}
- public struct Rot4Offsets
+ public class Rot4Offsets
{
//X: right and left
//Y: Frong or Back
//Z: Up and Down
Vector3 South;
+
Vector3 North;
+
Vector3 East;
+
Vector3 West;
public Rot4Offsets(Vector3 vector)
@@ -68,11 +86,29 @@ namespace SizedApparel
public string bodyType;
}
+ public class BodyWithBodyType
+ {
+ public string bodyType;
+ public List Addons = new List();
+ }
+
public class BodyPart
{
- public string partName;
- public Depth4Offsets depthOffset;
- public List offsets;
+ public string partName = null;
+ public string customPath = null;
+ public string defaultHediffName = null; // for missing Hediff
+ public bool isBreasts = false;
+ public bool centeredTexture = true;
+ public bool mustMatchBodyType = false; // TODO
+
+ public string boneName = null;
+ public Bone bone = null; // For Graphic Positioning System
+ public bool mustHaveBone = true; // when bone is missing, don't draw
+
+ public SizedApparelBodyPartOf bodyPartOf = SizedApparelBodyPartOf.None;
+ public ColorType colorType = ColorType.Skin;
+ public Depth4Offsets depthOffset = new Depth4Offsets();
+ public BodyTypeAndOffset offsets = new BodyTypeAndOffset();
}
public class BodyTypeAndOffset
@@ -81,11 +117,16 @@ namespace SizedApparel
public string bodyType;
public Rot4Offsets offsets = new Rot4Offsets(Vector3.zero);
+ public BodyTypeAndOffset()
+ {
+
+ }
+
public BodyTypeAndOffset(bool useCenter)
{
if (useCenter)
{
- offsets = new Rot4Offsets(new Vector3(0.5f, 0, 0.5f));
+ offsets = new Rot4Offsets(Vector3.zero);
}
}
public BodyTypeAndOffset(Vector3 defaultOffset)
@@ -94,15 +135,15 @@ namespace SizedApparel
}
}
- public enum SizedApparelBodyPartColorOf
+ public enum ColorType
{
- Skin, Hair, Custom, None
+ Skin, Hair, Nipple, Custom, None
}
public enum SizedApparelBodyPartOf
{
- All, Torso, Breasts, Crotch, Penis, Vagina, Anus, Belly, Udder, Hips, Thighs, hands, feet, None
+ All, Torso, Breasts, Crotch, Penis, Balls, Vagina, Anus, Belly, PubicHair, Udder, Hips, Thighs, hands, feet, None
}
public static class SizedApparelBodyPartOfExtension
{
@@ -124,13 +165,17 @@ namespace SizedApparel
return true;
return false;
case SizedApparelBodyPartOf.Crotch:
- if (source == SizedApparelBodyPartOf.Penis || source == SizedApparelBodyPartOf.Vagina || source == SizedApparelBodyPartOf.Anus)
+ if (source == SizedApparelBodyPartOf.Crotch || source == SizedApparelBodyPartOf.Penis || source == SizedApparelBodyPartOf.Vagina || source == SizedApparelBodyPartOf.Anus || source == SizedApparelBodyPartOf.PubicHair || source == SizedApparelBodyPartOf.Balls)
return true;
return false;
case SizedApparelBodyPartOf.Penis:
if (source == SizedApparelBodyPartOf.Penis)
return true;
return false;
+ case SizedApparelBodyPartOf.Balls:
+ if (source == SizedApparelBodyPartOf.Balls)
+ return true;
+ return false;
case SizedApparelBodyPartOf.Vagina:
if (source == SizedApparelBodyPartOf.Vagina)
return true;
@@ -163,10 +208,13 @@ namespace SizedApparel
if (source == SizedApparelBodyPartOf.feet)
return true;
return false;
+ case SizedApparelBodyPartOf.PubicHair:
+ if (source == SizedApparelBodyPartOf.PubicHair)
+ return true;
+ return false;
case SizedApparelBodyPartOf.None:
return false;
- return false;
}
Log.Error("[SizedApparel] missing SizedApparelBodyPartOf!");
return false;
@@ -188,7 +236,7 @@ namespace SizedApparel
public class GraphicPoint
{
public string pointName;
- public Vector2 point = new Vector2(0.5f, 0.5f);
+ public Vector2 point = Vector2.zero;
}
public class GraphicPointsWithBodyType
{
@@ -199,13 +247,13 @@ namespace SizedApparel
public class PointWithBodyType
{
public string bodyTypeName; //null can be used too
- public Vector2 point = new Vector2(0.5f,0.5f);
+ public Vector2 point = Vector2.zero;
}
- public struct BodyPartPoint
+ public class BodyPartPoint
{
string name;
- Vector2 position;//Uv position. not pixel
+ Vector2 position = Vector2.zero;//Uv position. not pixel
}
[Obsolete]//todo
@@ -213,11 +261,7 @@ namespace SizedApparel
{
}
-
- public enum ColorMode
- {
- Skin, Hair
- }
+
//Def for Hediff Graphic color options or else.
public class SizedApparelHeddifDef : Def
@@ -228,6 +272,7 @@ namespace SizedApparel
}
//Def per graphic(texture)
+ [Obsolete]
public class SizedApparelBodyPartGraphicDef : Def
{
public string graphicPath;
@@ -241,17 +286,32 @@ namespace SizedApparel
public class SizedApparelBodyPartDef : Def
{
SizedApparelBodyPartOf bodyPartOf = SizedApparelBodyPartOf.None;
- public bool canPose = false;
- public bool canAnimate = false;
+ public bool canPose = true;
+ public List TexturePaths;
+
}
public class SizedApparelBodyPart
{
static MethodInfo overrideMatMethod = AccessTools.Method(typeof(PawnRenderer), "OverrideMaterialIfNeeded");
+ static Color defaultNippleColor = Color.white;//nipple texture is already colored with pink. so make it white as default to avoid double coloring pink //Strong Pink Color = new ColorInt(255, 121, 121).ToColor
- public SizedApparelBodyPart(Pawn pawn, string bodyPartName, SizedApparelBodyPartOf bodyPartOf, string defaultHediffName, bool isBreast, bool isOverlay , string customPathName = null, SizedApparelBodyPartColorOf colorOf = SizedApparelBodyPartColorOf.Skin)
+ //this is for RGB Channel Edit
+ static string texturePath_White = "SizedApparel/Masks/White";
+ static string texturePath_Black = "SizedApparel/Masks/Black";
+ static string texturePath_Red = "SizedApparel/Masks/Red";
+ static string texturePath_Green = "SizedApparel/Masks/Green";
+ static string texturePath_Blue = "SizedApparel/Masks/Blue";
+
+
+ public bool AutoOffsetForFurCoveredBody = true;
+
+ public SizedApparelBodyPart(Pawn pawn, ApparelRecorderComp apparelRecorderComp, string bodyPartName, SizedApparelBodyPartOf bodyPartOf, string defaultHediffName, bool isBreast, bool isOverlay, string customPathName = null, ColorType colorOf = ColorType.Skin, bool needBoneToRender = true, Bone parentBone = null, bool isCenteredTexture = false )
{
this.pawn = pawn; //owner
+
+ this.apparelRecorderCompCache = apparelRecorderComp; //for reduce GetComp Call; if it is null, it will try to get pawn's comp.
+
this.bodyPartName = bodyPartName;
this.def = DefDatabase.AllDefs.FirstOrDefault(b => b.defName == bodyPartName);
@@ -262,6 +322,15 @@ namespace SizedApparel
this.isOverlay = isOverlay;
this.customPath = customPathName;
this.colorType = colorOf;
+
+ this.bone = parentBone;
+ this.mustHaveBone = needBoneToRender;
+ this.centeredTexture = isCenteredTexture;
+ }
+
+ public void SetCenteredTexture(bool isCentered)
+ {
+ this.centeredTexture = isCentered;
}
public Vector2 OffsetFromUVOffset(Vector2 vector, Mesh mesh , bool isFliped = false)
@@ -269,10 +338,21 @@ namespace SizedApparel
//treat mesh as plane
//Vector3 width = mesh.vertices[2] - mesh.vertices[1];
//Vector3 height = mesh.vertices[1] - mesh.vertices[2];
- Vector2 loc = new Vector2(0.5f, 0.5f) - vector;
+
+
if(!isFliped)
+ return new Vector2((mesh.vertices[2].x - mesh.vertices[0].x)*vector.x,(mesh.vertices[0].z - mesh.vertices[2].z)*vector.y);
+ return new Vector2((mesh.vertices[2].x - mesh.vertices[0].x)*vector.x, (mesh.vertices[2].z - mesh.vertices[0].z)*vector.y);
+ /*
+ * Vector2 loc = new Vector2(0.5f, 0.5f) - vector;
+ if(!isFliped)
return new Vector2(Mathf.Lerp(mesh.vertices[0].x, mesh.vertices[2].x, loc.x), Mathf.Lerp(mesh.vertices[0].z, mesh.vertices[2].z, loc.y));
return new Vector2(Mathf.Lerp(mesh.vertices[3].x, mesh.vertices[1].x, loc.x), Mathf.Lerp(mesh.vertices[3].z, mesh.vertices[1].z, loc.y));
+
+
+
+ */
+
}
//public Vector2 OffestFromUVOffset(Vector2 vector, Vector2 drawSize, bool isFliped = false)
@@ -280,19 +360,28 @@ namespace SizedApparel
public SizedApparelBodyPartDef def;
public Pawn pawn;
+ public ApparelRecorderComp apparelRecorderCompCache; // for reduce getComp call;
+ public Bone bone;
+ private bool mustHaveBone;
+
+ public bool centeredTexture = false; // false to keep original position from mesh. and consider this graphics pivot as bone position
+
public string bodyPartName; //breast, penis, belly, pubichair... etc. just name. not like architech something
public string customPath = null;
public SizedApparelBodyPartOf bodyPartOf = SizedApparelBodyPartOf.None;
public string defaultHediffName;
public bool isBreast = false;
+
public bool isOverlay = false; //write z cache?
public string currentHediffName;
public bool isVisible = true;
- public SizedApparelBodyPartColorOf colorType = SizedApparelBodyPartColorOf.Skin;
+ public int lastPoseTick = -1;
+
+ public ColorType colorType = ColorType.Skin;
public Color? customColorOne;
public Color? customColorTwo;
@@ -313,14 +402,24 @@ namespace SizedApparel
public int maxDrawAge = -1;
+ public void SetBone(Bone bone)
+ {
+ this.bone = bone;
+ }
public void SetCustomPose(string newPose, bool autoUpdate = true, bool autoSetPawnGraphicDirty = false)
{
if (customPose == newPose)
return;
+ if(SizedApparelSettings.Debug)
+ Log.Message("[SizedApparel] Setting Custom Pose : " + newPose);
customPose = newPose;
if (autoUpdate)
+ {
this.UpdateGraphic();
+ this.lastPoseTick = Find.TickManager.TicksGame;
+ }
+
if(autoSetPawnGraphicDirty)
{
if (pawn == null)
@@ -330,39 +429,22 @@ namespace SizedApparel
}
}
- public bool CheckCanPose(string targetPose, bool checkApparels, bool mustMatchSize)
+ public bool CheckCanPose(string targetPose, bool checkApparels, bool checkBodyParts, bool mustMatchSize, bool mustMatchBodytype, bool mustMatchRace)
{
if (checkApparels)
{
- foreach(ApparelGraphicRecord agr in pawn.Drawer.renderer.graphics.apparelGraphics)
- {
- /*
- if (!agr.sourceApparel.def.apparel.bodyPartGroups.Any(bpgd => bpgd.defName == "Torso" || bpgd.defName == "Chest"))
- continue;
-
- if (agr.sourceApparel.def.apparel.tags.Any(s => s.ToLower() == "SizedApparel_IgnorePose".ToLower()))
- continue;
- */
-
- string originalPath = SizedApparelsDatabase.GetSupportedApparelOriginalPath(agr.graphic.path);
- if (originalPath == null)
- return false;
-
- int outInt = -1;
- float outFloat = -1;
- SizedApparelsDatabase.SizedApparelDatabaseKey key = new SizedApparelsDatabase.SizedApparelDatabaseKey(originalPath,pawn.def.defName,pawn.story?.bodyType?.defName, pawn.gender, currentHediffName, Math.Min(currentSeverityInt, cappedSeverityInt), false, targetPose);
- if (SizedApparelSettings.useGenderSpecificTexture)
- key.gender = Gender.None;
- var result = SizedApparelsDatabase.GetSupportedApparelSizedPath(key, out outInt, out outFloat);
- if (!result.isCustomPose)
- return false;
- }
+ if (!SizedApparelUtility.CanPoseApparels(pawn, targetPose, currentHediffName, currentSeverityInt, cappedSeverityInt))
+ return false;
}
- Graphic graphic = GetBodyPartGraphics(false, mustMatchSize, targetPose);
- Graphic graphicH = GetBodyPartGraphics(true, mustMatchSize, targetPose);
- if (graphic != null || graphicH != null)
- return true;
- return false;
+ if (checkBodyParts)
+ {
+ Graphic graphic = GetBodyPartGraphics(false, mustMatchSize, mustMatchBodytype, mustMatchRace);
+ Graphic graphicH = GetBodyPartGraphics(true, mustMatchSize, mustMatchBodytype, mustMatchRace);
+ if (graphic != null || graphicH != null)
+ return true;
+ return false;
+ }
+ return true;
}
@@ -370,20 +452,22 @@ namespace SizedApparel
public int currentSeverityInt = -1;
public int cappedSeverityInt = 1000; // supported severity from worn apparel graphics
- public Vector2 pivot = new Vector2(0.5f, 0.5f);
+ public Vector2 pivot = Vector2.zero;
public Vector2 position = Vector2.zero;//offset from pivot //UV. not pixel
- public Dictionary points;
- public Dictionary pointsHorny;
+ public SizedApparelTexturePointDef points;
+ public SizedApparelTexturePointDef pointsHorny;
public float rotation = 0; // +: rotate right, -: rotate left
- public Vector2 scale = Vector2.one;
+ public float scale = 1f;
public Graphic bodyPartGraphic;
public Graphic bodyPartGraphicHorny;
+
+
public Vector2 positionOffset = Vector2.zero; //offset from position //UV. not pixel
public Vector2 positionOffsetSouth = Vector2.zero;
public Vector2 positionOffsetNorth = Vector2.zero;
@@ -392,11 +476,13 @@ namespace SizedApparel
public float depthOffset = 0f;
+ //0.008f
public float depthOffsetEast = 0.008f;
public float depthOffsetWest = 0.008f;
public float depthOffsetSouth = 0.008f;
public float depthOffsetNorth = 0.008f;
+
//bigger = in front
public void SetDepthOffsets(float south, float north, float east, float west)
{
@@ -405,6 +491,13 @@ namespace SizedApparel
depthOffsetEast = east;
depthOffsetWest = west;
}
+ public void SetDepthOffsets(Depth4Offsets oppsets)
+ {
+ depthOffsetSouth = oppsets.south;
+ depthOffsetNorth = oppsets.north;
+ depthOffsetEast = oppsets.east;
+ depthOffsetWest = oppsets.west;
+ }
public void SetPositionOffsets(Vector2 south, Vector2 north, Vector2 east, Vector2 west)
{
positionOffsetSouth = south;
@@ -412,38 +505,58 @@ namespace SizedApparel
positionOffsetEast = east;
positionOffsetWest = west;
}
- public Graphic GetBodyPartGraphics(bool isHorny, bool mustMatchSize = false, string poseOverride = null)
+ public Graphic GetBodyPartGraphics(bool isHorny, bool mustMatchSize = false, bool mustMatchBodytype = false, bool mustMatchRace = false, string poseOverride = null)
{
- Dictionary var;
- return GetBodyPartGraphics(isHorny, out var, mustMatchSize, poseOverride);
+ SizedApparelTexturePointDef var;
+ return GetBodyPartGraphics(isHorny, out var, mustMatchBodytype, mustMatchSize, mustMatchRace, poseOverride);
}
- public Graphic GetBodyPartGraphics(bool isHorny, out Dictionary outPoints, bool mustMatchSize = false ,string poseOverride = null, string variationOverride = null)
+ public Graphic GetBodyPartGraphics(bool isHorny, out SizedApparelTexturePointDef outPoints, bool mustMatchSize = false, bool mustMatchBodyType = false , bool mustMatchRace = false ,string poseOverride = null, string variationOverride = null)
{
if (pawn == null)
{
outPoints = null;
return null;
}
-
- var comp = pawn.TryGetComp();
-
+ var comp = apparelRecorderCompCache;
+ if (comp == null)
+ comp = pawn.GetComp();
if (comp == null)
{
outPoints = null;
return null;
}
-
- var key = new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType?.defName, currentHediffName, customPath==null?bodyPartName: customPath, pawn.gender, Math.Min(currentSeverityInt, cappedSeverityInt), isHorny, poseOverride==null?customPose:poseOverride, variationOverride==null?variation: variationOverride);
+ string bodyTypeString = pawn.story?.bodyType?.defName;
+
+ var key = new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeString, currentHediffName, customPath==null?bodyPartName: customPath, pawn.gender, Math.Min(currentSeverityInt, cappedSeverityInt), isHorny, poseOverride==null?customPose:poseOverride, variationOverride==null?variation: variationOverride);
var result = SizedApparelsDatabase.GetSupportedBodyPartPath(key, isBreast, customPath == null ? bodyPartName : customPath, defaultHediffName);
+
+
+
if (mustMatchSize)
if (Math.Min(currentSeverityInt, cappedSeverityInt) != result.size)
{
outPoints = null;
return null;
}
+ if (mustMatchBodyType)
+ {
+ if(result.bodyType != pawn.story?.bodyType?.defName)
+ {
+ outPoints = null;
+ return null;
+ }
+ }
+ if (mustMatchRace)
+ {
+ if (result.raceName != pawn.def.defName)
+ {
+ outPoints = null;
+ return null;
+ }
+ }
if (result.pathWithSizeIndex == null)
{
@@ -471,7 +584,7 @@ namespace SizedApparel
public void ResetTransform()
{
this.position = Vector2.zero;
- this.scale = Vector2.one;
+ this.scale = 1f;
this.rotation = 0;
}
@@ -512,48 +625,125 @@ namespace SizedApparel
{
if (!isVisible)
return;
- if (scale == Vector2.zero)
+ if (scale == 0f)
return; //Don't draw if scale is zero
if (pawn == null)
return;
+ if (mustHaveBone && bone == null)
+ return;
+
+ if (bodyMesh == null)
+ {
+ if (SizedApparelSettings.Debug)
+ Log.Warning("[SizedApparel] DrawBodyParts But Null Body Mesh! : " + pawn.Name);
+ return;
+ }
+
+
PawnRenderer pawnRenderer = pawn.Drawer.renderer;
- Shader shader = ShaderDatabase.CutoutComplex;
+ Shader shader = shader = ShaderDatabase.CutoutSkinOverlay;
Color drawColor1 = Color.white;
Color drawColor2 = Color.white;
+
bool forceWriteZ = true;
- if(colorType == SizedApparelBodyPartColorOf.Skin)
+ bool HasFurSkin = false;
+ //Furskin Check
+ /*
+ if (pawn.Drawer.renderer.graphics.furCoveredGraphic != null)
+ {
+ HasFurSkin = true;
+ }*/
+
+ if (colorType == ColorType.Skin)
{
forceWriteZ = true;
if (bodyDrawType == RotDrawMode.Fresh)
{
+ if (HasFurSkin)
+ {
+
+ }
+ else
+ {
+ shader = pawn.Drawer.renderer.graphics.nakedGraphic.Shader;
+ if (!ShaderUtility.SupportsMaskTex(shader))
+ shader = shader = ShaderDatabase.CutoutSkinOverlay;
+ drawColor1 = pawnRenderer.graphics.nakedGraphic.Color;
+ drawColor2 = pawnRenderer.graphics.nakedGraphic.ColorTwo;
+ }
- shader = pawn.Drawer.renderer.graphics.nakedGraphic.Shader;
- if (!ShaderUtility.SupportsMaskTex(shader))
- shader = ShaderDatabase.CutoutSkinOverlay;
- drawColor1 = pawn.Drawer.renderer.graphics.nakedGraphic.Color;
- drawColor2 = pawn.Drawer.renderer.graphics.nakedGraphic.ColorTwo;
}
else if (bodyDrawType == RotDrawMode.Rotting)
{
shader = pawn.Drawer.renderer.graphics.rottingGraphic.Shader;
if (!ShaderUtility.SupportsMaskTex(shader))
- shader = ShaderDatabase.CutoutSkinOverlay;
- drawColor1 = pawn.Drawer.renderer.graphics.rottingGraphic.Color;
- drawColor2 = pawn.Drawer.renderer.graphics.nakedGraphic.ColorTwo;
+ shader = shader = ShaderDatabase.CutoutSkinOverlay;
+ drawColor1 = pawnRenderer.graphics.rottingGraphic.Color;
+ drawColor2 = pawnRenderer.graphics.nakedGraphic.ColorTwo;
}
}
- else if (colorType == SizedApparelBodyPartColorOf.Hair)
+ else if (colorType == ColorType.Nipple)
+ {
+ forceWriteZ = true;
+
+ //Get SkinColor first.
+ if (bodyDrawType == RotDrawMode.Fresh)
+ {
+ if (HasFurSkin)
+ {
+
+ }
+ else
+ {
+ shader = pawn.Drawer.renderer.graphics.nakedGraphic.Shader;
+ if (!ShaderUtility.SupportsMaskTex(shader))
+ shader = shader = ShaderDatabase.CutoutSkinOverlay;
+ drawColor1 = pawnRenderer.graphics.nakedGraphic.Color;
+ drawColor2 = pawnRenderer.graphics.nakedGraphic.ColorTwo;
+ }
+
+ }
+ else if (bodyDrawType == RotDrawMode.Rotting)
+ {
+
+ shader = pawn.Drawer.renderer.graphics.rottingGraphic.Shader;
+ if (!ShaderUtility.SupportsMaskTex(shader))
+ shader = shader = ShaderDatabase.CutoutSkinOverlay;
+ drawColor1 = pawnRenderer.graphics.rottingGraphic.Color;
+ drawColor2 = pawnRenderer.graphics.nakedGraphic.ColorTwo;
+ }
+
+ if(apparelRecorderCompCache != null)
+ {
+ if(apparelRecorderCompCache.nippleColor != null)
+ {
+ drawColor1 = apparelRecorderCompCache.nippleColor.Value; //* drawColor1;
+ drawColor2 = apparelRecorderCompCache.nippleColor.Value; //* drawColor2; //maybe can be issue
+ }
+ else
+ {
+ //nipple Color is null
+ //Ust Default Color for Nipple with SkinColor
+ drawColor1 = defaultNippleColor * drawColor1;
+ drawColor2 = defaultNippleColor * drawColor2;
+
+ }
+ }
+
+
+ }
+ else if (colorType == ColorType.Hair)
{
forceWriteZ = false;
shader = ShaderDatabase.Transparent;
if(pawn.story != null)
drawColor1 = pawn.story.hairColor;
}
- else if (colorType == SizedApparelBodyPartColorOf.Custom)
+ else if (colorType == ColorType.Custom)
{
forceWriteZ = true;
shader = ShaderDatabase.Transparent;
@@ -562,52 +752,183 @@ namespace SizedApparel
if (customColorTwo != null)
drawColor2 = customColorTwo.Value;
}
- else if (colorType == SizedApparelBodyPartColorOf.None)
+ else if (colorType == ColorType.None)
{
forceWriteZ = false;
shader = ShaderDatabase.Cutout;
}
+ if (isOverlay)
+ {
+ if (shader == ShaderDatabase.Cutout)
+ shader = ShaderDatabase.Transparent;
+ else if (shader == ShaderDatabase.CutoutSkin || shader == ShaderDatabase.CutoutSkinColorOverride)
+ shader = ShaderDatabase.CutoutSkinOverlay;
+ else
+ shader = ShaderDatabase.Transparent;
+ }
+
+
+ Mesh scaledBodyMesh;
+
+ BoneTransform boneTransform = null;
+ if(bone != null)
+ {
+ if (facing == Rot4.South)
+ {
+ boneTransform = bone.south;
+ }
+ else if (facing == Rot4.North)
+ {
+ boneTransform = bone.north;
+ }
+ else if (facing == Rot4.East)
+ {
+ boneTransform = bone.east;
+
+ }
+ else if (facing == Rot4.West)
+ {
+ boneTransform = bone.west;
+ if (boneTransform == null)
+ boneTransform = bone.east;
+
+ }
+ }
+
+ float drawScale = scale;
+ float drawRotation = angle;
+ Vector3 drawPosition = rootLoc;
+
+ /*
+ if (this.pawn.ageTracker.CurLifeStage.bodyDrawOffset != null)
+ {
+ drawPosition += this.pawn.ageTracker.CurLifeStage.bodyDrawOffset.Value;
+ }*/
+
+ if (boneTransform != null)
+ {
+ //TODO fixed angle for IK?
+
+ float width = (bodyMesh.vertices[2].x - bodyMesh.vertices[0].x);
+ if (centeredTexture)
+ {
+ bool westUsingEast = false;
+ if (facing == Rot4.West && bone.west == null)
+ westUsingEast = true;
+
+ drawRotation = boneTransform.InitialAngle + boneTransform.angleOffset;
+ //not sure it work correct
+ Vector3 v = (boneTransform.InitialPosition + boneTransform.positionOffset) * width;
+ var q = Quaternion.AngleAxis (westUsingEast? -angle : angle, Vector3.up);
+ v = q * v;
+ drawPosition = (v) ; // calculate rotated point
+
+ //Log.Message(boneTransform.angleOffset.ToString());
+ if (westUsingEast)
+ {
+ //already scaled with "width"?
+ //its using east as west. so flip position
+ drawPosition.Scale(new Vector3(-1f,0f,1f));
+ //drawRotation = boneTransform.InitialAngle - boneTransform.angleOffset;
+ }
+ drawPosition += rootLoc;
+ drawRotation += angle ;
+ }
+ else
+ {
+ //NotCentered Texture not yet support Rotation System.
+ //wip
+ Vector3 v = Vector3.zero;
+
+ bool westUsingEast = false;
+ if (facing == Rot4.West && bone.west == null)
+ westUsingEast = true;
+ drawRotation = boneTransform.InitialAngle; // + boneTransform.angleOffset
+ //not sure it work correct
+ //Vector3 v = (boneTransform.InitialPosition); //initialpos as custom pivot
+ //var q = Quaternion.AngleAxis(westUsingEast ? -drawRotation : drawRotation, Vector3.up);
+ //var q2 = Quaternion.AngleAxis(westUsingEast ? -angle : angle, Vector3.up);
+
+ //v = q * v; // calculate final draw position with torso angle
+ //v = v + boneTransform.InitialPosition + boneTransform.positionOffset;
+ //v = q2 * v; //NotCentered Texture not yet support Rotation System.
+
+ drawPosition = (v) * width;
+ if (westUsingEast)
+ {
+ //already scaled with "width"?
+ //its using east as west. so flip position
+ drawPosition.Scale(new Vector3(-1f, 0f, 1f));
+ //drawRotation = boneTransform.InitialAngle - boneTransform.angleOffset;
+ }
+ drawPosition += rootLoc ; // adjust with result
+ //Log.Message(boneTransform.angleOffset.ToString());
+ drawRotation += angle;
+ }
+ }
+
+ /*
+ if (drawScale != 1f)
+ {
+ // scale Only Rimworld Plane Mesh
+ if(bodyMesh.vertexCount == 4)
+ {
+ float width = (bodyMesh.vertices[2].x - bodyMesh.vertices[0].x);
+
+ //var meshSet = MeshPool.GetMeshSetForWidth(scale * width);
+ var meshSet = MeshPool.GetMeshSetForWidth(scale * width);
+ scaledBodyMesh = meshSet.MeshAt(facing);
+ }
+ else
+ scaledBodyMesh = bodyMesh;
+ }
+ else
+ {
+ scaledBodyMesh = bodyMesh;
+ }*/
+ scaledBodyMesh = bodyMesh;
+
+ Quaternion quaternion = Quaternion.AngleAxis(drawRotation, Vector3.up);
- Quaternion quaternion = Quaternion.AngleAxis(angle + rotation, Vector3.up);
- Vector3 vector = rootLoc;
-
Rot4 targetRot = facing;
if (rotOverride != null)
targetRot = rotOverride.Value;
if (targetRot == Rot4.South)
{
- var loc = OffsetFromUVOffset(positionOffsetSouth, bodyMesh);
- vector.x += loc.x;
- vector.z += loc.y;
- vector.y += depthOffsetSouth;
+ var loc = OffsetFromUVOffset(positionOffsetSouth, scaledBodyMesh);
+ drawPosition.x += loc.x;
+ drawPosition.z += loc.y;
+ drawPosition.y += depthOffsetSouth;
}
else if(targetRot == Rot4.North)
{
- var loc = OffsetFromUVOffset(positionOffsetNorth, bodyMesh);
- vector.x += loc.x;
- vector.z += loc.y;
- vector.y += depthOffsetNorth;
+ var loc = OffsetFromUVOffset(positionOffsetNorth, scaledBodyMesh);
+ drawPosition.x += loc.x;
+ drawPosition.z += loc.y;
+ drawPosition.y += depthOffsetNorth;
}
else if (targetRot == Rot4.East)
{
- var loc = OffsetFromUVOffset(positionOffsetEast, bodyMesh);
- vector.x += loc.x;
- vector.z += loc.y;
- vector.y += depthOffsetEast;
+ var loc = OffsetFromUVOffset(positionOffsetEast, scaledBodyMesh);
+ drawPosition.x += loc.x;
+ drawPosition.z += loc.y;
+ drawPosition.y += depthOffsetEast;
}
else if (targetRot == Rot4.West)
{
- var loc = OffsetFromUVOffset(positionOffsetWest, bodyMesh);
- vector.x += loc.x;
- vector.z += loc.y;
- vector.y += depthOffsetWest;
+ var loc = OffsetFromUVOffset(positionOffsetWest, scaledBodyMesh);
+ drawPosition.x += loc.x;
+ drawPosition.z += loc.y;
+ drawPosition.y += depthOffsetWest;
}
+
+
Graphic graphic = null;
if (SizedApparelUtility.IsHorny(pawn))
graphic = bodyPartGraphicHorny;
@@ -617,18 +938,44 @@ namespace SizedApparel
if (graphic == null)
return;
- Material mat;
- if (!flags.FlagSet(PawnRenderFlags.Cache)&&!isOverlay&& forceWriteZ)
+ //ForFurskinOffset
+ if(bodyDrawType == RotDrawMode.Fresh && HasFurSkin && AutoOffsetForFurCoveredBody)
{
- graphic = graphic.GetColoredVersion(ShaderDatabase.Cutout, drawColor1, drawColor2);
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(targetRot) : (Material)overrideMatMethod.Invoke(pawnRenderer, new object[] { graphic.MatAt(facing), pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
- }
- graphic = graphic.GetColoredVersion(shader, drawColor1, drawColor2);
- vector.y += 0.00001f;
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(targetRot) : (Material)overrideMatMethod.Invoke(pawnRenderer, new object[] { graphic.MatAt(facing), pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow));
+ //vector.y += 0.009187258f; //in PawnRenderer, it adds 0.009187258f.
+ //graphic.maskPath does error? need to check
+ // worn fur body and naked fur body has different offsets... wtf
+ //TODO Need to Fix
+ }
+
+
+
+
+ Material mat;
+
+ //If ForceWriteDepth, draw Cutout mesh for write depth. this is for avoid problem of body addons drawing under other meshes. such as breasts front of body but behind tail.
+ if (forceWriteZ || (!flags.FlagSet(PawnRenderFlags.Cache) && !isOverlay))// //(!flags.FlagSet(PawnRenderFlags.Cache) && !isOverlay)
+ {
+ Graphic Zgraphic = graphic.GetColoredVersion(ShaderDatabase.CutoutComplex, drawColor1, drawColor2); // ShaderDatabase.Cutout
+ Vector3 drawPositionZ = drawPosition;
+ drawPositionZ.y = drawPositionZ.y - 0.00001f; //Send Back of body, but it can still write depth. 1.4: send to 0
+
+ mat = flags.FlagSet(PawnRenderFlags.Cache) ? Zgraphic.MatAt(targetRot) : (Material)overrideMatMethod.Invoke(pawnRenderer, new object[] { Zgraphic.MatAt(facing), pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
+ GenDraw.DrawMeshNowOrLater(scaledBodyMesh, drawPositionZ, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
+ }
+
+ //shader must be mask
+ graphic = graphic.GetColoredVersion(shader, drawColor1, drawColor2);
+
+ if (graphic.maskPath == null)
+ {
+ //Test
+ //graphic.maskPath = texturePath_Red;
+ }
+
+ //drawPosition.y += 0.00001f;
+ mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(targetRot) : (Material)overrideMatMethod.Invoke(pawnRenderer, new object[] { graphic.MatAt(facing), pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
+ GenDraw.DrawMeshNowOrLater(scaledBodyMesh, drawPosition, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow));
}
}
@@ -637,23 +984,24 @@ namespace SizedApparel
//TODO: Torso Pose?
- public class SizedApparelBodyDef : Def
+ public class BodyDef : Def
{
//public List BodyParts;
//defName = raceName ?? could it work?
- public List bodyParts;
+ public List bodies = new List();
- /*
- public List penisOffset;
- public List vaginaOffset; //TODO
- public List udderOffset; //TODO
- public List bellyOffset; //TODO
- public List breastsOffset; //TODO
- public List anusOffset; //TODO
- */
+
+ //public List penisOffset;
+ //public List vaginaOffset;
+ //public List pubicHairOffset;
+ //public List udderOffset;
+ //public List bellyOffset;
+ //public List breastsOffset;
+ //public List anusOffset;
+
}
public class SizedApparelBody
@@ -667,4 +1015,10 @@ namespace SizedApparel
}
}
+ public class SizedApparelBodyPartOfssetDef : Def
+ {
+ //defName IsRaceName
+
+ }
+
}
diff --git a/1.3/source/SizedApparel/SizedApparelBodyPartDef.cs b/1.3/source/SizedApparel/SizedApparelBodyPartDef.cs
new file mode 100644
index 0000000..742f3f5
--- /dev/null
+++ b/1.3/source/SizedApparel/SizedApparelBodyPartDef.cs
@@ -0,0 +1,163 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using UnityEngine;
+using Verse;
+
+namespace SizedApparel
+{
+
+ //This Class is Use for Def BodyParts' Custom Pivot, or Some Special Common Vector Points Per Serverity.
+ //Not Consider Acture Graphic Textures.
+ public class SkeletonDef : Def
+ {
+ //defName = Pawn's race name (such as "Human")
+ //public List graphicBones = new List();
+
+ //Do Not Directly Use it
+ public List skeletons = new List();
+
+
+ public Skeleton CreateSkeleton(string bodyType)
+ {
+ for(int i = 0; i< skeletons.Count; i++)
+ {
+ if(skeletons[i].bodyType == bodyType)
+ {
+ return new Skeleton(skeletons[i]);
+ }
+ }
+ return null;
+ }
+ }
+
+ public class Skeleton
+ {
+ public string bodyType = null; // can be null for animal or etc
+ public List Bones;
+
+ //only runtime. Do not Set in Def
+ public Rot4 BodyFacing; // for flip east-west bones
+ public Rot4 HeadFacing; //TODO
+
+ public Skeleton()
+ {
+
+ }
+ public Skeleton(Skeleton skeletonToCopy)
+ {
+ this.Bones = new List();
+
+
+ foreach (var s in skeletonToCopy.Bones)
+ {
+ this.Bones.Add(new Bone(s, this));
+ }
+
+ }
+ public Bone FindBone(string boneName)
+ {
+ foreach (var b in this.Bones)
+ {
+ if (b.name == boneName)
+ return b;
+ }
+ return null;
+ }
+
+ }
+
+ //for deafault bone support?
+ public class BodyPartBoneDef : Def
+ {
+ //DefName is Bone Name To Use.
+ public Vector3 customPivot = new Vector3(0.5f, 0, 0.5f);
+ public Vector3 Position = new Vector3(0.5f, 0, 0.5f); // Local Position(UV) from Body
+ public float Length = 1;
+ public float Rotation = 0;
+ public float Scale = 1f; // Default Render Scale.
+ }
+
+ //Body Parts Graphic can be attached to bone position and rotation
+ public class Bone
+ {
+
+ public string name = null;
+ public Skeleton parentSkeleton = null;
+ //public string parentBoneName = null; // ToDo
+ public bool isHeadBone = false; // TODO
+ public BoneTransform south;
+ public BoneTransform north;
+ public BoneTransform east;
+ public BoneTransform west; // can be null. then use east
+ //hiding Graphic parameter will be in that bodygraphic class
+
+ public Bone()
+ {
+
+ }
+
+ public Bone(Bone boneToCopy, Skeleton parent)
+ {
+ this.name = boneToCopy.name;
+ this.parentSkeleton = parent;
+ this.isHeadBone = boneToCopy.isHeadBone;
+ if(boneToCopy.south != null)
+ this.south = new BoneTransform(boneToCopy.south);
+ if (boneToCopy.north != null)
+ this.north = new BoneTransform(boneToCopy.north);
+ if (boneToCopy.east != null)
+ this.east = new BoneTransform(boneToCopy.east);
+ if (boneToCopy.west != null)
+ this.west = new BoneTransform(boneToCopy.west); // null for use east
+
+ }
+
+ public void SetAngle(float angle)
+ {
+ if(south != null)
+ south.angleOffset = angle;
+ if (north != null)
+ north.angleOffset = angle;
+ if (east != null)
+ east.angleOffset = angle;
+ if (west != null)
+ west.angleOffset = angle;
+ }
+
+
+ }
+
+ public class BoneTransform
+ {
+ //public Vector3 customPivot = new Vector3(0.5f, 0, 0.5f); // used to calculation rotation. the rotating center will be customPivot.
+ //Custom Pivot Doesn't affect to Draw Position on zero Rotated.
+ public Vector3 InitialPosition = Vector3.zero; // Local Position(UV) from Body
+ public float InitialLength = 1;
+ public float InitialAngle = 0;
+ public float InitialScale = 1f;
+ public bool isHeadBone = false; // TODO
+
+ //public BodyPartGraphicBone parentBone; //TODO
+ public Vector3 positionOffset = Vector3.zero;
+ public float lengthOffset = 0;
+ public float angleOffset = 0;
+ public float scaleOffset = 0;
+
+ public BoneTransform() { }
+
+ public BoneTransform(BoneTransform boneToCopy)
+ {
+
+ //this.parentBoneName = boneToCopy.parentBoneName;
+ //this.customPivot = boneToCopy.customPivot;
+ this.InitialPosition = boneToCopy.InitialPosition;
+ this.InitialLength = boneToCopy.InitialLength;
+ this.InitialAngle = boneToCopy.InitialAngle;
+ this.InitialScale = boneToCopy.InitialScale;
+ }
+ }
+
+}
diff --git a/1.3/source/SizedApparel/SizedApparelComp.cs b/1.3/source/SizedApparel/SizedApparelComp.cs
index ee8cf16..2195d3c 100644
--- a/1.3/source/SizedApparel/SizedApparelComp.cs
+++ b/1.3/source/SizedApparel/SizedApparelComp.cs
@@ -13,6 +13,9 @@ namespace SizedApparel
[StaticConstructorOnStartup]
public class ApparelRecorderComp : ThingComp
{
+ Pawn pawn;// Parent Cache
+
+ public bool recentClothFlag = true;
public bool isDrawAge = true;
@@ -24,36 +27,63 @@ namespace SizedApparel
public bool needToCheckApparelGraphicRecords = false;
public bool isDirty = true;
-
+ public bool isHediffDirty = true;
+ public bool isApparelDirty = true;
+ public bool isSkeletonDirty = true;
+ public bool isBodyAddonDirty = true; // reset all body addon graphics.
public bool hasUnsupportedApparel = true;
public bool havingSex = false;//Obsolete
public bool hasUpdateForSex = false;//Obsolete
+ string cachedBodytype;
public List cachedApparelGraphicRecord = new List();
- public Hediff breastHediff = null; //TODO: Make this as List
+ public Hediff breastHediff = null;
public Hediff vaginaHediff = null;
public List penisHediffs = null; // RJW can attach multiple penis
public Hediff anusHediff = null;
-
public Hediff udderHediff = null;//RJW 4.6.8: Udder is not partof chest's breast. it attached to torso.
+ public Color? nippleColor; //for menstruation cycles Mod
+
+ //TODO Optimize Update Hediff Filter
+ private bool hasBreastsAddon = false;
+ private bool hasVaginaAddon = false;
+ private bool hasPenisAddon = false;
+ private bool hasAnusAddon = false;
+ private bool hasUdderAddon = false;
+ private bool hasPubicHairAddon = false;
+
public float breastSeverity = -1;
- public float breastSeverityCapToDraw = 1000;
public float BreastSeverityCache = 0;
//public float BiggestBreastSeverityInAvailableTextures = 0;
//for breasts animation or something.
+ public bool ForceUpdateTickAnimation = false;
+ public bool ForceBlockTickAnimation = false; // useful when you have make fixed pose
+ public bool PrePositionCache;
public Vector3? prePositionCache;
public float? preAngleCache;
public int? preTickCache;
+ public Vector3 preVelocity = Vector3.zero;
+ public float preRotation = 0;
+ public Dictionary tickCache = new Dictionary();
+
+ public BodyDef bodyDef = null;
+ public List bodyAddons = new List(); // BodyParts Added form Defs
+
+ public SkeletonDef skeletonDef; // for rebuild Skeleton
+ public Skeleton skeleton;
+ public bool skipSkeleton = false;
+
+ //native BodyParts
public SizedApparelBodyPart bodyPartBreasts;//TODO: Make this as List
public SizedApparelBodyPart bodyPartNipple;//TODO
public List bodyPartPenises = new List();
@@ -63,54 +93,35 @@ namespace SizedApparel
public SizedApparelBodyPart bodyPartBelly;
public SizedApparelBodyPart bodyPartMuscleOverlay;//TODO
public SizedApparelBodyPart bodyPartUdder;
- public SizedApparelBodyPart bodyPartPubicHair; //TODO
+
+
public SizedApparelBodyPart bodyPartHips;
public List bodyPartThighs = new List();
public List bodyPartHands = new List();
public List bodyPartFeet = new List();
+ public PubicHairDef pubicHairDef = null;
+ public PubicHairDef initialPubicHairDef = null; // For StyleStaitionWork
+ public PubicHairDef nextPubicHairDef = null; // For StyleStaitionWork
+ public SizedApparelBodyPart bodyPartPubicHair;
+
+
public Graphic graphicSourceNaked = null; //original Graphic
public Graphic graphicSourceRotten = null; //original Graphic
+ public Graphic graphicSourceFurCovered = null; //original Graphic
+
public Graphic graphicbaseBodyNaked = null;
+ public SizedApparelTexturePointDef baseBodyNakedPoints;
+ public Graphic graphicbaseBodyCorpse = null;
+ public SizedApparelTexturePointDef baseBodyCorpsePoints;
public Graphic graphicbaseBodyRotten = null;
+ public SizedApparelTexturePointDef baseBodyRottenPoints;
+ public Graphic graphicbaseBodyFurCovered = null;
+ public SizedApparelTexturePointDef baseBodyFurCoveredPoints;
- [Obsolete]
- public Graphic graphicBreasts = null;
- [Obsolete]
- public Graphic graphicBreasts_horny = null;
- [Obsolete]
- public Graphic graphicVagina = null;
- [Obsolete]
- public Graphic graphicVagina_horny = null;
- [Obsolete]
- public Graphic graphicAnus = null;
- [Obsolete]
- public Graphic graphicAnus_horny = null;
- [Obsolete]
- public List graphicPenises = new List();
- [Obsolete]
- public List graphicBallsOfPenises = new List();
- [Obsolete]
- public Graphic graphicBelly = null;
- [Obsolete]
- public Graphic graphicUdder = null; //RJW 4.6.8: Udder is not partof chest's breast. it attached to torso.
- [Obsolete]
- public Graphic graphicUdder_horny = null;
- [Obsolete]
- public List graphicPenises_horny = new List();
- [Obsolete]
- public List graphicBalls_horny = new List();//Does it need?
- //size uncapped breasts graphics.
- [Obsolete]
- public Graphic graphicBreastsNude = null;
- [Obsolete]
- public Graphic graphicBreastsNude_horny = null;
-
- private bool drawingBreastsAddon = false;
-
- public AlienRaceSetting raceSetting = new AlienRaceSetting();
+ public AlienRaceSetting raceSetting = null;
public string customPose = null;
public SizedApparelPose currentCustomPose = null;
@@ -124,97 +135,403 @@ namespace SizedApparel
public bool canDrawVaginaAndAnus = false;
public bool canDrawTorsoParts = false; //belly and udder
+
+ //this may reset skeleton animation. also little have process
+ public void InitSkeleton()
+ {
+ skeletonDef = DefDatabase.GetNamedSilentFail(pawn.def.defName);
+ if (skeletonDef == null)
+ {
+ if (raceSetting != null && raceSetting.asHuman == true) //old: !SizedApparelSettings.UnsupportedRaceToUseHumanlike
+ {
+ skeletonDef = DefDatabase.GetNamedSilentFail("Human");
+ }
+ }
+ if (skeletonDef != null)
+ {
+ if (this.pawn.story == null || this.pawn.story.bodyType == null)
+ {
+ foreach (Skeleton s in skeletonDef.skeletons)
+ {
+ if (s.bodyType == null)
+ {
+ this.skeleton = new Skeleton(s);
+ if (SizedApparelSettings.Debug)
+ Log.Message("[SizedApparel] Apply SkeletonDef: pawn withouth bodytype " + pawn.Name);
+ return;
+ }
+ }
+ }
+ else
+ {
+ //Setting Up Skeleton
+ foreach (Skeleton s in skeletonDef.skeletons)
+ {
+ if (s.bodyType == this.pawn.story.bodyType.defName)
+ {
+ this.skeleton = new Skeleton(s);
+ if (SizedApparelSettings.Debug)
+ Log.Message("[SizedApparel] Apply SkeletonDef: pawn with bodytype " + pawn.Name + " with SkeletonDef : " + this.pawn.story.bodyType.defName);
+ return;
+ }
+ }
+ }
+ this.skeleton = null;
+ }
+ if (SizedApparelSettings.Debug)
+ Log.Message("[SizedApparel] Apply SkeletonDef: No Skeleton Found for " + pawn.Name);
+ isSkeletonDirty = false;
+ }
+
+ public void InitBodyAddons()
+ {
+
+ bodyAddons.Clear();
+
+ //TODO
+ //bodyDef = DefDatabase.GetNamed(pawn.def.defName);
+
+ bodyDef = DefDatabase.GetNamedSilentFail(pawn.def.defName);
+
+ //bodyDef can be null
+
+ if (bodyDef == null)
+ {
+ if (raceSetting != null && raceSetting.asHuman) //old: !SizedApparelSettings.UnsupportedRaceToUseHumanlike
+ {
+ bodyDef = DefDatabase.GetNamedSilentFail("Human");
+ }
+ }
+
+
+ if (bodyDef != null && bodyDef.bodies != null)
+ {
+ if (pawn.story?.bodyType == null)
+ {
+ if(SizedApparelSettings.Debug)
+ Log.Message("[SizedApparel] Apply BodyDef: pawn has no bodytype " + pawn.Name);
+ BodyWithBodyType body = null;
+ if(!bodyDef.bodies.NullOrEmpty())
+ body = bodyDef.bodies[0];
+ if (body != null && body.Addons != null)
+ {
+ foreach (var bodyaddon in body.Addons)
+ {
+ if (bodyaddon == null)
+ continue;
+ var a = new SizedApparelBodyPart(pawn, this, bodyaddon.partName, bodyaddon.bodyPartOf, bodyaddon.defaultHediffName, bodyaddon.isBreasts, false, bodyaddon.customPath, bodyaddon.colorType, bodyaddon.mustHaveBone);
+ a.SetDepthOffsets(bodyaddon.depthOffset.south, bodyaddon.depthOffset.north, bodyaddon.depthOffset.east, bodyaddon.depthOffset.west);
+ //a.SetDepthOffsets(bodyaddon.depthOffset);
+ a.SetCenteredTexture(bodyaddon.centeredTexture);
+ bodyAddons.Add(a);
+ break;
+ }
+ }
+ }
+ else
+ {
+ foreach (BodyWithBodyType body in bodyDef.bodies)
+ {
+ if (body.bodyType != null && body.bodyType == this.pawn.story.bodyType.defName)
+ {
+ if (SizedApparelSettings.Debug)
+ Log.Message("[SizedApparel] Apply BodyDef: matched BodyTyped Body for " + pawn.Name);
+ if (body != null && body.Addons != null)
+ {
+ foreach (var bodyaddon in body.Addons)
+ {
+ if (bodyaddon == null)
+ continue;
+ var a = new SizedApparelBodyPart(pawn, this, bodyaddon.partName, bodyaddon.bodyPartOf, bodyaddon.defaultHediffName, bodyaddon.isBreasts, false, bodyaddon.customPath, bodyaddon.colorType, bodyaddon.mustHaveBone);
+ a.SetDepthOffsets(bodyaddon.depthOffset.south, bodyaddon.depthOffset.north, bodyaddon.depthOffset.east, bodyaddon.depthOffset.west);
+ //a.SetDepthOffsets(bodyaddon.depthOffset);
+ a.SetCenteredTexture(bodyaddon.centeredTexture);
+ bodyAddons.Add(a);
+ }
+ }
+ break;
+ }
+
+ }
+
+ }
+
+ }
+ else
+ {
+ if (SizedApparelSettings.Debug)
+ Log.Message("[SizedApparel] Cannot find BodyDef for " + pawn.def.defName);
+ }
+
+ //bodyPartBreasts = new SizedApparelBodyPart(pawn, this, "Breasts", SizedApparelBodyPartOf.Breasts, "Breasts", true, false, null);
+ //bodyPartBreasts.SetDepthOffsets(0.0113f, 0.001f, 0.0113f, 0.0113f);
+
+ //bodyPartBreasts.SetPositionOffsets(Vector2.one, Vector2.one, Vector2.one, Vector2.one);
+ //bodyPartBreasts.scale = 2f;
+ //Nipple. should I separate from Breats?
+ //bodyPartNipple = new SizedApparelBodyPart(pawn, this, "Nippple", SizedApparelBodyPartOf.Breasts, "Breasts", true, false);
+ //bodyPartBreasts.SetDepthOffsets(0.0114f, 0.000f, 0.0114f, 0.0114f);
+
+ //bodyPartUdder = new SizedApparelBodyPart(pawn, this, "Udder", SizedApparelBodyPartOf.Udder, "UdderBreasts", true, false);
+ //bodyPartUdder.SetDepthOffsets(0.0112f, 0.0005f, 0.0112f, 0.0112f);
+
+ //UdderNipple...?
+ //bodyPartUdder = new SizedApparelBodyPart(p, "Udder", SizedApparelBodyPartOf.Udder, "UdderBreasts", true, false);
+ //bodyPartUdder.SetDepthOffsets(0.0112f, 0.0005f, 0.0112f, 0.0112f);\
+
+ //bodyPartVagina = new SizedApparelBodyPart(pawn, this, "Vagina", SizedApparelBodyPartOf.Vagina, "Vagina", false, false);
+ //bodyPartVagina.SetDepthOffsets(0.0088f, 0.0100f, 0.0088f, 0.0088f);
+
+ //bodyPartAnus = new SizedApparelBodyPart(pawn, this, "Anus", SizedApparelBodyPartOf.Anus, "Anus", false, false);
+ //bodyPartAnus.SetDepthOffsets(0.0093f, 0.0105f, 0.0093f, 0.0093f);
+
+ //bodyPartBelly = new SizedApparelBodyPart(pawn, this, "Belly", SizedApparelBodyPartOf.Belly, "BellyBulge", false, false);
+ //bodyPartBelly.SetDepthOffsets(0.0098f, 0.0002f, 0.0098f, 0.0098f);
+
+ //bodyPartPubicHair = new SizedApparelBodyPart(pawn, this, "PubicHair", SizedApparelBodyPartOf.PubicHair, "Default", false, false, null, ColorType.Hair);
+ //bodyPartPubicHair.SetDepthOffsets(0.0099f, 0.0099f, 0.0089f, 0.0089f);
+ }
+
+ public void ResetBodyAddonBoneLink()
+ {
+ string s;
+ foreach(var a in bodyAddons)
+ {
+ s = a.bone?.name;
+ if (s == null)
+ continue;
+ a.SetBone(skeleton.FindBone(s));
+ }
+ }
+
public override void Initialize(CompProperties props)
{
base.Initialize(props);
- Pawn p = parent as Pawn;
-
- bodyPartBreasts = new SizedApparelBodyPart(p, "Breasts", SizedApparelBodyPartOf.Breasts, "Breasts", true, false);
- bodyPartBreasts.SetDepthOffsets(0.0113f, 0.001f, 0.0113f, 0.0113f);
- bodyPartNipple = new SizedApparelBodyPart(p, "Nippple", SizedApparelBodyPartOf.Breasts, "Breasts", true, false);
- bodyPartBreasts.SetDepthOffsets(0.0114f, 0.000f, 0.0114f, 0.0114f);
+ this.pawn = this.parent as Pawn;
- bodyPartUdder = new SizedApparelBodyPart(p, "Udder", SizedApparelBodyPartOf.Udder, "UdderBreasts", true, false);
- bodyPartUdder.SetDepthOffsets(0.0112f, 0.0005f, 0.0112f, 0.0112f);
- //UdderNipple...?
- //bodyPartUdder = new SizedApparelBodyPart(p, "Udder", SizedApparelBodyPartOf.Udder, "UdderBreasts", true, false);
- //bodyPartUdder.SetDepthOffsets(0.0112f, 0.0005f, 0.0112f, 0.0112f);
- bodyPartVagina = new SizedApparelBodyPart(p, "Vagina", SizedApparelBodyPartOf.Vagina, "Vagina", false, false);
- bodyPartVagina.SetDepthOffsets(0.0088f, 0.0100f, 0.0088f, 0.0088f);
-
- bodyPartAnus = new SizedApparelBodyPart(p, "Anus", SizedApparelBodyPartOf.Anus, "Anus", false, false);
- bodyPartAnus.SetDepthOffsets(0.0093f, 0.0105f, 0.0093f, 0.0093f);
-
- bodyPartBelly = new SizedApparelBodyPart(p, "Belly", SizedApparelBodyPartOf.Belly, "BellyBulge", false, false);
- bodyPartBelly.SetDepthOffsets(0.0098f, 0.0002f, 0.0098f, 0.0098f);
}
+ public override void PostDeSpawn(Map map)
+ {
+ base.PostDeSpawn(map);
+ }
+
+ public override void PostSpawnSetup(bool respawningAfterLoad)
+ {
+ base.PostSpawnSetup(respawningAfterLoad);
+
+ UpdateRaceSettingData(); // include race Setting
+ InitSkeleton();
+ InitBodyAddons();
+ }
+
+
public override void PostExposeData()
{
base.PostExposeData();
- Scribe_Values.Look(ref customPose, "customPose"); // save pawn's custom pose
+ Scribe_Values.Look(ref customPose, "customPose"); // save pawn's custom pose. Each bodyparts will not saved.
+ Scribe_Defs.Look(ref pubicHairDef, "PubicHairDef");
+ if (pubicHairDef == null)
+ {
+ pubicHairDef = SizedApparelUtility.GetRandomPubicHair();
+ }
+
//Scribe_Values.Look<>(); //TODO: save pubic hair data
}
+
/*
public override void CompTick()
{
+ if (PrePositionCache)
+ {
+
+ }
base.CompTick();
-
-
- }
-
+ }*/
+ /*
public override void CompTickRare()
{
base.CompTickRare();
}*/
+
+
+ float penisAngle = 0;
+ public void SetPenisAngle(float angle)
+ {
+ penisAngle = angle;
+
+ if(this.skeleton != null)
+ {
+ Bone penisBone = skeleton.FindBone("Penis");
+ if (penisBone != null)
+ {
+ //Log.Message("SetPenisAngle : " + angle.ToString());
+ penisBone.SetAngle(angle);
+ }
+ }
+
+
+ bool penisDown = false;
+ if (angle >= 120 && angle <= 250)
+ penisDown = true;
+ foreach (var p in bodyPartPenises)
+ {
+ if (penisDown)
+ {
+ p.SetCustomPose("PenisDown");
+ }
+ else
+ {
+ p.SetCustomPose(null);
+ }
+ }
+ }
+ //do not call this in character creation from new game.
+ public void SetBreastJiggle(bool jiggle, int cooltime = 5, bool checkApparelForCanPose = false)
+ {
+ //SetJiggle has cooltime.
+
+
+ bool flag1 = true;
+
+ //should set apparels pose?
+ //Use First BodyAddon which is partof Breasts
+ foreach(var a in GetSizedApparelBodyParts(SizedApparelBodyPartOf.Breasts))
+ {
+ if (flag1)
+ {
+ if (Find.TickManager.TicksGame < a.lastPoseTick + cooltime)
+ return;
+ flag1 = false;
+ }
+
+
+ if (jiggle)
+ {
+ bool flag2 = true;
+ if (flag2 && checkApparelForCanPose)
+ {
+ if (!a.CheckCanPose("JiggleUp", true, false, true, true, false))
+ return;
+ flag2 = false;
+ }
+
+ //may need to check apparels for aply pose
+ //bodyPartBreasts.CheckCanPose("JiggleUp",)
+ a.SetCustomPose("JiggleUp");
+ }
+ else
+ {
+ //SetPoseFromPoseSet(null);
+ a.SetCustomPose(null);
+ }
+ }
+
+
+ }
+
string[] testPose = { null, "JiggleUp", "JiggleCenter" };
string[] testPose2 = { null, "PenisDown" };
- public void DrawUpdate(Vector3 rootLoc, float angle) // call this in DrawPawnBody
+ public void UpdateTickAnim(Vector3 rootLoc, float angle) // call this in DrawPawnBody <- only called when it rendered
{
+ if (ForceBlockTickAnimation)// prevent breasts jiggle from other pose
+ return;
+
+ if (skeleton == null)
+ return;
+
+ if (Find.CameraDriver == null)
+ return;
+
+ //do not calculate physics camera is far
+ if (Find.CameraDriver.CurrentZoom >= CameraZoomRange.Furthest)
+ return;
//int IdTick = parent.thingIDNumber * 20; //hint from yayo animation mod
- if (SizedApparelSettings.autoJiggleBreasts)
+
+ if (!SizedApparelUtility.CanApplySizedApparel(pawn))
+ return;
+
+
+ if (SizedApparelSettings.breastsPhysics || ForceUpdateTickAnimation)//SizedApparelSettings.autoJiggleBreasts
{
- Vector3 velocity;
- if (this.prePositionCache != null)
- velocity = this.prePositionCache.Value - rootLoc;
- else
- velocity = Vector3.zero;
-
-
-
- float rotation;
- if (this.preAngleCache != null)
- rotation = this.preAngleCache.Value - angle;
- else
- rotation = 0;
int tick;
if (this.preTickCache != null)
tick = Find.TickManager.TicksGame - this.preTickCache.Value;
else
- tick = 1;
+ tick = Find.TickManager.TicksGame;
+
+ //if tick is not updated, don't update animation.
+ if (tick == 0)
+ return;
+
+ Vector3 velocity;
+ if (this.prePositionCache != null)
+ velocity = (rootLoc - this.prePositionCache.Value);// /tick
+ else
+ velocity = Vector3.zero;
+
+ float rotation;
+
+ if (this.preAngleCache != null)
+ rotation = angle - this.preAngleCache.Value;
+ else
+ rotation = 0;
+
+ float rotAcc = rotation - preRotation;
+
+
+ //Log.Message(velocity.ToString() + " , " + preVelocity.ToString());
+ //UnityEngine's vector.normalize is safe for zero vector
+ //(Vector3.Dot(velocity.normalized, preVelocity.normalized)) < 0.2f
+
+ float dotV = Vector3.Dot(velocity.normalized, preVelocity.normalized);
+ float velocityOffset = (velocity - preVelocity).magnitude;
+
+ //Log.Message(pawn.ToString());
+ //Log.Message("rotAcc : " + rotAcc.ToString());
+ //Log.Message("Velocity.x : " + velocity.x.ToString());
+ //Log.Message("Velocity.z : " + velocity.z.ToString());
+ //Log.Message("dotV : " + dotV.ToString());
+ //Log.Message("velocityOffset : " + velocityOffset.ToString());
+ //&& dotV > 0.4f
+ if (((preVelocity != Vector3.zero && velocityOffset >= 0.02))|| Mathf.Abs(rotAcc) > 0.5) //(dotV == 0 ? 0:1), Mathf.Abs(dotV) // || Mathf.Abs(rotation) > 20
+ {
+ //tickCache.Add("BreastsJiggleUp", Find.TickManager.TicksGame);
+ SetBreastJiggle(true,10,true);
+
+ }
+ else
+ {
+ SetBreastJiggle(false,10, false);
+ }
+ //cache pre data
this.prePositionCache = rootLoc;
this.preAngleCache = angle;
+ this.preRotation = rotation;
this.preTickCache = Find.TickManager.TicksGame;
+ this.preVelocity = velocity;
+
+
+
}
- SetPoseFromPoseSet(testPose2.RandomElement());
+ //SetPoseFromPoseSet(testPose2.RandomElement());
}
public bool isApparelGraphicRecordChanged()
{
- Pawn pawn = parent as Pawn;
if (pawn == null)
return false;
@@ -234,6 +551,111 @@ namespace SizedApparel
return false;
}
+ public void DrawAllBodyParts(Vector3 rootLoc, float angle, Rot4 facing, RotDrawMode bodyDrawType, PawnRenderFlags flags, Pawn ___pawn, Mesh bodyMesh)
+ {
+ if (this.isDrawAge && (!flags.FlagSet(PawnRenderFlags.Clothes) || !this.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(___pawn))) //TODO : Move it to CanDraw
+ {
+ if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawVagina && SizedApparelUtility.CanDrawVagina(___pawn, flags))
+ {
+ //if (this.bodyPartVagina != null)
+ // this.bodyPartVagina.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ foreach (var b in GetSizedApparelBodyParts(SizedApparelBodyPartOf.Vagina))
+ {
+ b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ }
+ }
+ if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawAnus && SizedApparelUtility.CanDrawAnus(___pawn, flags))
+ {
+ //if (this.bodyPartAnus != null)
+ // this.bodyPartAnus.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ foreach (var b in GetSizedApparelBodyParts(SizedApparelBodyPartOf.Anus))
+ {
+ b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ }
+ }
+
+ if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawBelly && SizedApparelUtility.CanDrawBelly(___pawn, flags))
+ {
+ //if (this.bodyPartBelly != null)
+ // this.bodyPartBelly.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ foreach (var b in GetSizedApparelBodyParts(SizedApparelBodyPartOf.Belly))
+ {
+ b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ }
+ }
+
+ //Draw Pubic Hair
+ if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawPubicHair && SizedApparelUtility.CanDrawPubicHair(___pawn, flags))
+ {
+ if (this.bodyPartPubicHair != null)
+ this.bodyPartPubicHair.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ foreach (var b in GetSizedApparelBodyParts(SizedApparelBodyPartOf.PubicHair))
+ {
+ b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ }
+ }
+
+
+ if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawUdder && SizedApparelUtility.CanDrawUdder(___pawn, flags))
+ {
+ //if (this.bodyPartUdder != null)
+ // this.bodyPartUdder.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ foreach (var b in GetSizedApparelBodyParts(SizedApparelBodyPartOf.Udder))
+ {
+ b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ }
+
+ }
+ if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawBreasts && SizedApparelUtility.CanDrawBreasts(___pawn, flags) && (SizedApparelSettings.drawSizedApparelBreastsOnlyWorn ? !SizedApparelUtility.isPawnNaked(___pawn, flags) : true))
+ {
+ //if (this.bodyPartBreasts != null)
+ // this.bodyPartBreasts.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ foreach (var b in GetSizedApparelBodyParts(SizedApparelBodyPartOf.Breasts))
+ {
+ b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ }
+ }
+
+ if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawPenis && SizedApparelUtility.CanDrawPenis(___pawn, flags, true))
+ {
+
+ if (SizedApparelSettings.hideBallOfFuta ? !Genital_Helper.is_futa(___pawn) : true)
+ {
+ /*
+ foreach (SizedApparelBodyPart b in this.bodyPartBalls)
+ {
+ b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ }*/
+ foreach (var b in GetSizedApparelBodyParts(SizedApparelBodyPartOf.Balls))
+ {
+ b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ }
+ }
+ /*
+ foreach (SizedApparelBodyPart p in this.bodyPartPenises)
+ {
+ p.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ }*/
+ foreach (var b in GetSizedApparelBodyParts(SizedApparelBodyPartOf.Penis))
+ {
+ b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
+ }
+
+ }//Draw BodyParts
+
+ //Draw Modular Apparel Parts... TODO...? Is it passible?
+ if (flags.FlagSet(PawnRenderFlags.Clothes))
+ {
+
+ }
+
+
+
+
+ }
+
+ }
+
//not working
public override void PostPostMake()
@@ -257,22 +679,20 @@ namespace SizedApparel
}
*/
- }
- public void ClearHediffs()
+ }
+ public void ClearHediffs()
{
breastHediff = null;
vaginaHediff = null;
if(penisHediffs != null)
penisHediffs.Clear();
anusHediff = null;
-
udderHediff = null;
}
public void ClearBreastCacheValue()
{
breastHediff = null;
breastSeverity = -1;
- breastSeverityCapToDraw = 1000;
BreastSeverityCache = 0;
}
public void ClearPenisCacheValue()
@@ -288,44 +708,34 @@ namespace SizedApparel
}
public void ClearGraphics(bool clearBreasts = true)
{
+ //Since Injection of base body is now in Matarial. no need to keep
+ graphicSourceNaked = null;
+ graphicSourceFurCovered = null;
+ graphicSourceRotten = null;
+
hasGraphicUpdatedBefore = false;
graphicbaseBodyNaked = null;
graphicbaseBodyRotten = null;
+ graphicbaseBodyFurCovered = null;
+ return;
//Clear BodyParts
- if(clearBreasts)
+ if (clearBreasts && bodyPartBreasts!= null)
bodyPartBreasts.Clear();
- bodyPartAnus.Clear();
- bodyPartBelly.Clear();
- bodyPartVagina.Clear();
+ if(bodyPartAnus != null)
+ bodyPartAnus.Clear();
+ if (bodyPartBelly != null)
+ bodyPartBelly.Clear();
+ if (bodyPartVagina != null)
+ bodyPartVagina.Clear();
+ if (bodyPartPubicHair != null)
+ bodyPartPubicHair.Clear();
+
+ foreach(var a in bodyAddons)
+ {
+ a.Clear();
+ }
- graphicBreasts = null;
- graphicVagina = null;
- graphicAnus = null;
- if (graphicPenises == null)
- graphicPenises = new List();
- else
- graphicPenises.Clear();
- if (graphicBallsOfPenises == null)
- graphicBallsOfPenises = new List();
- else
- graphicBallsOfPenises.Clear();
- graphicBelly = null;
-
- graphicUdder = null;
- graphicUdder_horny = null;
-
- graphicBreasts_horny = null;
- graphicVagina_horny = null;
- graphicAnus_horny = null;
- if (graphicPenises_horny == null)
- graphicPenises_horny = new List();
- else
- graphicPenises_horny.Clear();
- if (graphicBalls_horny == null)
- graphicBalls_horny = new List();
- else
- graphicBalls_horny.Clear();
}
public void ClearAll(bool clearGraphics = true)
{
@@ -340,12 +750,15 @@ namespace SizedApparel
needToCheckApparelGraphicRecords = false;
}
- public void SetDirty(bool clearPawnGraphicSet = false)
+ public void SetDirty(bool clearPawnGraphicSet = false, bool dirtyHediff = true, bool dirtyApparel = true, bool dirtySkeleton = false, bool dirtyBodyAddons = false)
{
this.isDirty = true;
+ this.isHediffDirty = dirtyHediff;
+ this.isApparelDirty = dirtyApparel;
+ this.isSkeletonDirty = dirtySkeleton;
+ this.isBodyAddonDirty = dirtyBodyAddons;
if (clearPawnGraphicSet)
{
- Pawn pawn = parent as Pawn;
if (pawn == null)
return;
if (pawn.Drawer == null)
@@ -353,42 +766,29 @@ namespace SizedApparel
if (pawn.Drawer.renderer == null)
return;
pawn.Drawer.renderer.graphics.ClearCache();
-
}
}
-
- public void UpdateIfDirty()
+ public void UpdateRaceSettingData()
{
-
- }
-
- public void UpdateBodyGraphics()
- {
-
- }
- public void UpdateSettingData()
- {
- Pawn pawn = parent as Pawn;
if (pawn == null)
return;
var loc_raceSetting = SizedApparelSettings.alienRaceSettings.FirstOrDefault((AlienRaceSetting s) => s.raceName == pawn.def.defName);
- if (raceSetting == null)
+ if (loc_raceSetting == null)
return;
raceSetting = loc_raceSetting;
}
public void CheckAgeChanged()
{
- Pawn pawn = parent as Pawn;
if (pawn == null)
return;
if (pawn.ageTracker == null)
return;
//TODO. Cleanup
- UpdateSettingData();
+ UpdateRaceSettingData();
if (raceSetting == null)
return;
@@ -398,44 +798,320 @@ namespace SizedApparel
isDrawAge = false;
}
+ public void FindAndApplyBodyGraphic(Pawn pawn, Graphic sourceGraphic, ref Graphic targetGraphicBaseBody, ref Graphic cachedSourceGraphic, string debugName)
+ {
+ const string baseBodyString = "_BaseBody";
+ string baseBodyStringWithSex;
+
+ if (SizedApparelSettings.useGenderSpecificTexture)
+ {
+ if (pawn.gender == Gender.Female)
+ {
+ baseBodyStringWithSex = baseBodyString + "F";
+ }
+ else if (pawn.gender == Gender.Male)
+ {
+ baseBodyStringWithSex = baseBodyString + "M";
+ }
+ else
+ {
+ baseBodyStringWithSex = baseBodyString; // + "N" //Does it need to add N?
+ }
+ }
+ else
+ baseBodyStringWithSex = baseBodyString;
+ string targetGraphicPath = null;
+ if (sourceGraphic != null)
+ {
+ //path = path.Insert(Math.Max(path.LastIndexOf('/'), 0), "/CustomPose/"+ customPose);
+ if (cachedSourceGraphic == null)
+ cachedSourceGraphic = sourceGraphic;
+ targetGraphicPath = cachedSourceGraphic.path;
+
+ if (customPose != null)
+ targetGraphicPath = targetGraphicPath.Insert(Math.Max(targetGraphicPath.LastIndexOf('/'), 0), "/CustomPose/" + customPose);
+
+ if (!targetGraphicPath.Contains(baseBodyString))
+ {
+ if (SizedApparelSettings.useGenderSpecificTexture && pawn.gender != Gender.None)
+ {
+ if (targetGraphicBaseBody == null)
+ {
+ if (ContentFinder.Get((targetGraphicPath + baseBodyStringWithSex + "_south"), false) != null)
+ {
+ //cachedSourceGraphic = sourceGraphic;
+ Shader shader = sourceGraphic.Shader;
+ //if (!ShaderUtility.SupportsMaskTex(shader))
+ // shader = ShaderDatabase.CutoutSkinOverlay;
+ targetGraphicBaseBody = GraphicDatabase.Get(targetGraphicPath + baseBodyStringWithSex, shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data);
+ //sourceGraphic = targetGraphicBaseBody;
+ }
+ else if (customPose != null)
+ {
+ targetGraphicPath = sourceGraphic.path;
+ if (ContentFinder.Get((targetGraphicPath + baseBodyStringWithSex + "_south"), false) != null)
+ {
+ //cachedSourceGraphic = sourceGraphic;
+ Shader shader = sourceGraphic.Shader;
+ //if (!ShaderUtility.SupportsMaskTex(shader))
+ // shader = ShaderDatabase.CutoutSkinOverlay;
+ targetGraphicBaseBody = GraphicDatabase.Get(targetGraphicPath + baseBodyStringWithSex, shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data);
+ //sourceGraphic = targetGraphicBaseBody;
+ }
+ else
+ {
+ if (SizedApparelSettings.Debug)
+ Log.Warning("[SizedApparel] Missing BaseBodyTexture for "+ debugName + " Graphic: " + targetGraphicPath + baseBodyStringWithSex + "_south");
+ }
+ }
+ }
+ }
+ if (targetGraphicBaseBody == null)
+ {
+ if (ContentFinder.Get((targetGraphicPath + baseBodyString + "_south"), false) != null)
+ {
+ // cachedSourceGraphic = sourceGraphic;
+ Shader shader = sourceGraphic.Shader;
+ //if (!ShaderUtility.SupportsMaskTex(shader))
+ // shader = ShaderDatabase.CutoutSkinOverlay;
+ targetGraphicBaseBody = GraphicDatabase.Get(targetGraphicPath + baseBodyString, shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data);
+ //sourceGraphic = targetGraphicBaseBody;
+ }
+ else if (customPose != null)
+ {
+ targetGraphicPath = sourceGraphic.path;
+ if (ContentFinder.Get((targetGraphicPath + baseBodyString + "_south"), false) != null)
+ {
+ //cachedSourceGraphic = sourceGraphic;
+ Shader shader = sourceGraphic.Shader;
+ //if (!ShaderUtility.SupportsMaskTex(shader))
+ // shader = ShaderDatabase.CutoutSkinOverlay;
+ targetGraphicBaseBody = GraphicDatabase.Get(targetGraphicPath + baseBodyString, shader, sourceGraphic.drawSize, sourceGraphic.color, sourceGraphic.colorTwo, sourceGraphic.data);
+ //sourceGraphic = targetGraphicBaseBody;
+ }
+ else
+ {
+ if (SizedApparelSettings.Debug)
+ Log.Warning("[SizedApparel] Missing BaseBodyTexture for " + debugName + " Graphic: " + targetGraphicPath + baseBodyString + "_south");
+ }
+
+ }
+ }
+
+ }
+ else
+ targetGraphicBaseBody = sourceGraphic;
+
+ }
+
+ }
+
public void Update(bool cache = true, bool fromGraphicRecord = true, bool updateGraphics = true, bool CheckApparel = true)
{
+ if (cache)
+ recentClothFlag = CheckApparel;
+
+
+
isDirty = false;
bool flag = fromGraphicRecord;
needToCheckApparelGraphicRecords = false;
//flag = false; //TODO:fromGraphicRecord is forced not to do for a while. it will update later
- hasUpdateBefore = true;
- Pawn pawn = parent as Pawn;
- if (pawn == null)
+
+
+
+ UpdateRaceSettingData();
+
+
+
+ if (!hasUpdateBefore)
+ {
+ InitSkeleton();
+ InitBodyAddons();
+ hasUpdateBefore = true;
+ }
+ else
+ {
+ //check is bodytype changed
+ if(cachedBodytype != pawn.story?.bodyType?.defName)
+ {
+ isSkeletonDirty = true;
+ }
+ if (isSkeletonDirty)
+ {
+ InitSkeleton();
+
+ if (isBodyAddonDirty)
+ InitBodyAddons();
+ else
+ ResetBodyAddonBoneLink();
+ }
+ else
+ {
+ if (isBodyAddonDirty)
+ InitBodyAddons();
+ }
+ }
+
+ if (skeleton == null)
+ {
+ if (Find.CurrentMap != null)
+ return;
+ }
+
+
+ if (!SizedApparelUtility.CanApplySizedApparel(pawn))
return;
+
+
+ if (pubicHairDef == null)
+ {
+ pubicHairDef = SizedApparelUtility.GetRandomPubicHair();
+ }
+
+
if (SizedApparelSettings.Debug)
Log.Message("[SizedApparel] Updating Component of " + pawn.Name);
if (updateGraphics)
{
ClearGraphics();
- ClearHediffs();
+ //ClearHediffs();
}
+
+
+
+ //float breastSeverityCapped = 1000;
+ string bodyTypeDefName = null;
+ if (pawn.story != null)
+ bodyTypeDefName = pawn.story.bodyType?.defName;
+ float bellySeverity = 0;
+
+ if (isHediffDirty) //Update Hediff Data
+ {
+ ClearHediffs();
+
+
+ if(SizedApparelSettings.drawPenis || SizedApparelSettings.drawVagina || SizedApparelSettings.drawAnus)
+ {
+ BodyPartRecord genitalPart = Genital_Helper.get_genitalsBPR(pawn);
+ if (genitalPart != null)
+ {
+ var genitalList = Genital_Helper.get_PartsHediffList(pawn, genitalPart);
+ if (!genitalList.NullOrEmpty())
+ {
+ if (SizedApparelSettings.Debug)
+ {
+ foreach (var g in genitalList)
+ {
+ Log.Message(" [SizedApparel] " + pawn.Name + "has hediff in genital (" + g.def.defName + ")");
+ }
+ }
+
+ //penisHediffs = genitalList.FindAll((Hediff h) => SizedApparelUtility.isPenis(h.def.defName));
+ penisHediffs = genitalList.FindAll((Hediff h) => Genital_Helper.is_penis(h));
+ //vaginaHediff = genitalList.FirstOrDefault((Hediff h) => SizedApparelUtility.isVagina(h.def.defName));
+ vaginaHediff = genitalList.FirstOrDefault((Hediff h) => Genital_Helper.is_vagina(h));
+
+ }
+ }
+ }
+
+ if (SizedApparelSettings.drawBelly)
+ {
+ //EggImplement as Pregnant
+ //need to Optimize... TODO...
+ List pregnancies = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => SizedApparelUtility.isPragnencyHediff(h) || SizedApparelUtility.isRJWEggHediff(h));//pregnancy and pregnant. has some issue with "pregnancy mood"
+ if (!pregnancies.NullOrEmpty())
+ {
+ foreach (Hediff h in pregnancies)
+ {
+ //Set Labor Belly as Big Belly.
+
+ //Code for 1.4
+ /*
+ if (h.def == HediffDefOf.PregnancyLabor || h.def == HediffDefOf.PregnancyLaborPushing)
+ bellySeverity = Math.Max(bellySeverity, 1f);
+ else
+ bellySeverity = Math.Max(bellySeverity, h.Severity);
+ */
+ bellySeverity = Math.Max(bellySeverity, h.Severity);
+ }
+ }
+
+ //Licentia Lab Hediff
+ if (SizedApparelPatch.LicentiaActive)
+ {
+ Hediff cumflation = pawn.health?.hediffSet?.GetFirstHediffOfDef(HediffDef.Named("Cumflation"));
+ Hediff cumstuffed = pawn.health?.hediffSet?.GetFirstHediffOfDef(HediffDef.Named("Cumstuffed"));
+ bellySeverity += cumflation != null ? cumflation.Severity : 0;
+ bellySeverity += cumstuffed != null ? cumstuffed.Severity : 0;
+ }
+
+
+ }
+
+
+
+ }
+
CheckAgeChanged();
- SizedApparelUtility.GetBreastSeverity(pawn, out breastSeverity, out breastHediff);
+ if (SizedApparelSettings.drawBreasts)
+ {
+ SizedApparelUtility.GetBreastSeverity(pawn, out breastSeverity, out breastHediff);
+
+ }
+
if (breastHediff != null)
{
- BreastSeverityCache = 1000;
- if (CheckApparel)
+
+ //get nipple color from Menstruation.
+ if (SizedApparelPatch.MenstruationActive)
+ {
+ nippleColor = Patch_Menstruation.GetNippleColor(breastHediff);
+ }
+
+
+
+ if (pawn.gender == Gender.Male && !SizedApparelSettings.ApplyApparelPatchForMale)
+ {
+ CheckApparel = false;
+ }
+
+
+ if (CheckApparel || this.isApparelDirty)
+ {
hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparelFromWornData(pawn, breastSeverity, breastHediff, true, flag);
+
+ }
else
+ {
hasUnsupportedApparel = false;
+
+ }
//float validBreastTextureSeverity = SizedApparelUtility.GetBreastSeverityValidTextures(pawn, breastHediff);
- if (hasUnsupportedApparel)
- BreastSeverityCache = breastSeverity;
+ if (SizedApparelSettings.useBreastSizeCapForApparels) // && hasUnsupportedApparel
+ {
+ BreastSeverityCache = Math.Min(BreastSeverityCache, breastSeverity);
+
+ }
+ else
+ {
+ BreastSeverityCache = 1000;
+ }
+ //if (SizedApparelSettings.useBreastSizeCapForApparels) //SizedApparelSettings.useBreastSizeCapForApparels //wip
+ // breastSeverityCapped = Math.Min(BreastSeverityCache, breastSeverityCapped);
+
+
//float validBreastTextureSeverity = SizedApparelUtility.GetBreastSeverityValidTextures(pawn, breastHediff);
//breast cache forApparel brests Check. This ignore variation!
//SizedApparelMod.CheckAndLoadAlienRaces();
-
+
var key = new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType?.defName, breastHediff.def.defName, "Breasts", pawn.gender ,SizedApparelUtility.BreastSeverityInt(breastHediff.Severity));
var raceSetting = SizedApparelSettings.alienRaceSettings.FirstOrDefault((AlienRaceSetting s) => s.raceName == key.raceName);
+ //TODO? Remove ValidBreastsTextureCheck...
float validBreastTextureSeverity = SizedApparelUtility.BreastSizeIndexToSeverity(SizedApparelsDatabase.GetSupportedBodyPartPath(key,true,"Breasts","Breasts").size);
//if (validBreastTextureSeverity < -5 && SizedApparelSettings.alienRaceSettings.settings[key.raceName].asHumanlike)//old: SizedApparelSettings.UnsupportedRaceToUseHumanlike
// validBreastTextureSeverity = SizedApparelUtility.GetBreastSeverityValidTextures(pawn, breastHediff, "Humanlike");
@@ -447,28 +1123,7 @@ namespace SizedApparel
//since rjw race support's part name are too variation, not handling it.
- BodyPartRecord genitalPart = Genital_Helper.get_genitalsBPR(pawn);
- if (genitalPart != null)
- {
- var genitalList = Genital_Helper.get_PartsHediffList(pawn, genitalPart);
- if (!genitalList.NullOrEmpty())
- {
- if (SizedApparelSettings.Debug)
- {
- foreach (var g in genitalList)
- {
- Log.Message(" [SizedApparel] "+ pawn.Name + "has hediff in genital (" + g.def.defName + ")");
- }
- }
- //penisHediffs = genitalList.FindAll((Hediff h) => SizedApparelUtility.isPenis(h.def.defName));
- penisHediffs = genitalList.FindAll((Hediff h) => Genital_Helper.is_penis(h));
- //vaginaHediff = genitalList.FirstOrDefault((Hediff h) => SizedApparelUtility.isVagina(h.def.defName));
- vaginaHediff = genitalList.FirstOrDefault((Hediff h) => Genital_Helper.is_vagina(h));
-
- }
-
- }
var anusList = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn));
if(!anusList.NullOrEmpty())
anusHediff = anusList.FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("anus"));
@@ -480,35 +1135,39 @@ namespace SizedApparel
if (updateGraphics)
{
- string baseBodyString = "_BaseBody";
- string baseBodyStringWithSex;
-
- if (SizedApparelSettings.useGenderSpecificTexture)
- {
- if (pawn.gender == Gender.Female)
- {
- baseBodyStringWithSex = baseBodyString + "F";
- }
- else if (pawn.gender == Gender.Male)
- {
- baseBodyStringWithSex = baseBodyString + "M";
- }
- else
- {
- baseBodyStringWithSex = baseBodyString; // + "N" //Does it need to add N?
- }
- }
- else
- baseBodyStringWithSex = baseBodyString;
-
if (pawnRenderer != null)
{
//pawnRenderer.ResolveAllGraphics();
+ //TODO Use Function To Make Clear Code
+ /*
+ FindAndApplyBodyGraphic(pawn, pawnRenderer.nakedGraphic, ref graphicbaseBodyNaked, ref graphicSourceNaked,"Naked");
+ FindAndApplyBodyGraphic(pawn, pawnRenderer.rottingGraphic, ref graphicbaseBodyRotten, ref graphicSourceRotten, "Rotting");
+ FindAndApplyBodyGraphic(pawn, pawnRenderer.nakedGraphic, ref graphicbaseBodyFurCovered, ref graphicSourceFurCovered, "FurCuvered");
+ */
+ const string baseBodyString = "_BaseBody";
+ string baseBodyStringWithSex;
+
+ if (SizedApparelSettings.useGenderSpecificTexture)
+ {
+ if (pawn.gender == Gender.Female)
+ {
+ baseBodyStringWithSex = baseBodyString + "F";
+ }
+ else if (pawn.gender == Gender.Male)
+ {
+ baseBodyStringWithSex = baseBodyString + "M";
+ }
+ else
+ {
+ baseBodyStringWithSex = baseBodyString; // + "N" //Does it need to add N?
+ }
+ }
+ else
+ baseBodyStringWithSex = baseBodyString;
- //TODO. Move BodyTextureSearch to utility
string nakedGraphicPath = null;
if (pawnRenderer.nakedGraphic != null)
{
@@ -522,20 +1181,10 @@ namespace SizedApparel
if (!nakedGraphicPath.Contains(baseBodyString))
{
- if (graphicbaseBodyNaked == null)
+ if (SizedApparelSettings.useGenderSpecificTexture & pawn.gender != Gender.None)
{
- if (ContentFinder.Get((nakedGraphicPath + baseBodyStringWithSex + "_south"), false) != null)
+ if (graphicbaseBodyNaked == null)
{
- //graphicSourceNaked = pawnRenderer.nakedGraphic;
- Shader shader = pawnRenderer.nakedGraphic.Shader;
- //if (!ShaderUtility.SupportsMaskTex(shader))
- // shader = ShaderDatabase.CutoutSkinOverlay;
- graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data);
- //pawnRenderer.nakedGraphic = graphicbaseBodyNaked;
- }
- else if (customPose != null)
- {
- nakedGraphicPath = pawnRenderer.nakedGraphic.path;
if (ContentFinder.Get((nakedGraphicPath + baseBodyStringWithSex + "_south"), false) != null)
{
//graphicSourceNaked = pawnRenderer.nakedGraphic;
@@ -545,10 +1194,23 @@ namespace SizedApparel
graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data);
//pawnRenderer.nakedGraphic = graphicbaseBodyNaked;
}
- else
+ else if (customPose != null)
{
- if (SizedApparelSettings.Debug)
- Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + nakedGraphicPath + baseBodyStringWithSex + "_south");
+ nakedGraphicPath = pawnRenderer.nakedGraphic.path;
+ if (ContentFinder.Get((nakedGraphicPath + baseBodyStringWithSex + "_south"), false) != null)
+ {
+ //graphicSourceNaked = pawnRenderer.nakedGraphic;
+ Shader shader = pawnRenderer.nakedGraphic.Shader;
+ //if (!ShaderUtility.SupportsMaskTex(shader))
+ // shader = ShaderDatabase.CutoutSkinOverlay;
+ graphicbaseBodyNaked = GraphicDatabase.Get(nakedGraphicPath + baseBodyStringWithSex, shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data);
+ //pawnRenderer.nakedGraphic = graphicbaseBodyNaked;
+ }
+ else
+ {
+ if (SizedApparelSettings.Debug)
+ Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + nakedGraphicPath + baseBodyStringWithSex + "_south");
+ }
}
}
}
@@ -589,6 +1251,18 @@ namespace SizedApparel
graphicbaseBodyNaked = pawnRenderer.nakedGraphic;
}
+ //Finding Texture Points
+ if (false && graphicbaseBodyNaked != null)
+ {
+ SizedApparelTexturePointDef PointsDef = DefDatabase.AllDefs.FirstOrDefault((SizedApparelTexturePointDef s) => s.Path == graphicbaseBodyNaked.path);
+ if (SizedApparelSettings.Debug && PointsDef != null)
+ {
+ Log.Message("[SizedApparel] : NakedBaseBody Texture Points Def Found : " + PointsDef.defName);
+ }
+ baseBodyNakedPoints = PointsDef;
+ }
+ else
+ baseBodyNakedPoints = null;
string rottingGraphicPath = null;
if (pawnRenderer.rottingGraphic != null)
@@ -628,7 +1302,7 @@ namespace SizedApparel
else
{
if (SizedApparelSettings.Debug)
- Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + rottingGraphicPath + baseBodyStringWithSex + "_south");
+ Log.Warning("[SizedApparel] Missing BaseBodyTexture for rotting Graphic: " + rottingGraphicPath + baseBodyStringWithSex + "_south");
}
}
if (graphicbaseBodyRotten == null)
@@ -657,7 +1331,7 @@ namespace SizedApparel
else
{
if (SizedApparelSettings.Debug)
- Log.Warning("[SizedApparel] Missing BaseBodyTexture for naked Graphic: " + rottingGraphicPath + baseBodyString + "_south");
+ Log.Warning("[SizedApparel] Missing BaseBodyTexture for rotting Graphic: " + rottingGraphicPath + baseBodyString + "_south");
}
}
}
@@ -667,6 +1341,35 @@ namespace SizedApparel
graphicbaseBodyRotten = pawnRenderer.rottingGraphic;
}
+ //Finding Texture Points
+ if (false && graphicbaseBodyRotten != null)
+ {
+ SizedApparelTexturePointDef PointsDef = DefDatabase.AllDefs.FirstOrDefault((SizedApparelTexturePointDef s) => s.Path == graphicbaseBodyRotten.path);
+ if (SizedApparelSettings.Debug && PointsDef != null)
+ {
+ Log.Message("[SizedApparel] : RottenBaseBody Texture Points Def Found : " + PointsDef.defName);
+ }
+ baseBodyRottenPoints = PointsDef;
+ }
+ else
+ baseBodyRottenPoints = null;
+
+
+ string furCoveredGraphicPath = null;
+
+ //Finding Texture Points
+ if (false && graphicbaseBodyFurCovered != null)
+ {
+ SizedApparelTexturePointDef PointsDef = DefDatabase.AllDefs.FirstOrDefault((SizedApparelTexturePointDef s) => s.Path == graphicbaseBodyFurCovered.path);
+ if (SizedApparelSettings.Debug && PointsDef != null)
+ {
+ Log.Message("[SizedApparel] : FurCoveredBaseBody Texture Points Def Found : " + PointsDef.defName);
+ }
+ baseBodyFurCoveredPoints = PointsDef;
+ }
+ else
+ baseBodyFurCoveredPoints = null;
+
/*
//Try to find sized Body if it's valid
@@ -763,361 +1466,309 @@ namespace SizedApparel
//graphicBreasts = SizedApparelUtility.GetBodyPartGraphic(pawn, breastHediff, true, "Breasts", "Breasts");
//if(graphicBreasts == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
// graphicBreasts = SizedApparelUtility.GetBodyPartGraphic(pawn, breastHediff, true, "Breasts", "Breasts", false, true, "Humanlike");
- string bodyPartPath = null;
- SizedApparelsDatabase.PathAndSize cachedPathAndSize;
- float breastSeverityCapped = breastSeverity;
- if (SizedApparelSettings.useBreastSizeCapForApparels) //SizedApparelSettings.useBreastSizeCapForApparels //wip
- breastSeverityCapped = Math.Min(BreastSeverityCache, breastSeverityCapped);
-
- string bodyTypeDefName = null;
- if (pawn.story != null)
- bodyTypeDefName = pawn.story.bodyType?.defName;
-
- if(breastHediff != null)
+ if (SizedApparelSettings.drawBodyParts)//body parts update
{
- var breastvar = breastHediff.TryGetComp();
-
- bodyPartBreasts.SetHediffData(breastHediff.def.defName, SizedApparelUtility.BreastSeverityInt(breastHediff.Severity), SizedApparelUtility.BreastSeverityInt(breastSeverityCapped), breastvar?.variation);
- bodyPartBreasts.UpdateGraphic();
-
-
- }
-
-
-
-
-
- if (udderHediff != null)
- {
- var udderVar = udderHediff.TryGetComp();
-
- bodyPartUdder.SetHediffData(udderHediff.def.defName, SizedApparelUtility.BreastSeverityInt(udderHediff.Severity), 1000, udderVar?.variation);
- bodyPartUdder.UpdateGraphic();
-
- }
- else
- bodyPartUdder.SetHediffData(null, -1);
-
-
-
- float bellySeverity = 0;
- List pregnancies = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("pregnancy"));
- if (!pregnancies.NullOrEmpty())
- {
- foreach (Hediff h in pregnancies)
+ if (SizedApparelSettings.drawBreasts)
{
- bellySeverity = Math.Max(bellySeverity, h.Severity);
- }
- }
- /*
- List eggs = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("rjw") && h.def.defName.ToLower().Contains("egg"));
- if (!eggs.NullOrEmpty())
- {
- foreach (Hediff h in eggs)
- {
- bellySeverity = Math.Max(bellySeverity, h.Severity);
- }
- }
- List mech = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("rjw") && h.def.defName.ToLower().Contains("mech"));
- if (!mech.NullOrEmpty())
- {
- foreach (Hediff h in mech)
- {
- bellySeverity = Math.Max(bellySeverity, h.Severity);
- }
- }
- List parasite = pawn.health?.hediffSet?.hediffs?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("parasite"));
- if (!parasite.NullOrEmpty())
- {
- foreach (Hediff h in parasite)
- {
- bellySeverity = Math.Max(bellySeverity, h.Severity);
- }
- }*/
- //Licentia Lab Hediff
- if (SizedApparelPatch.LicentiaActive)
- {
- Hediff cumflation = pawn.health?.hediffSet?.GetFirstHediffOfDef(HediffDef.Named("Cumflation"));
- Hediff cumstuffed = pawn.health?.hediffSet?.GetFirstHediffOfDef(HediffDef.Named("Cumstuffed"));
- bellySeverity += cumflation != null ? cumflation.Severity : 0;
- bellySeverity += cumstuffed != null ? cumstuffed.Severity : 0;
- }
-
- if (bellySeverity >= 0)
- {
- //var bellyVar = breastHediff.TryGetComp();
- string BellyVar = null;
-
- bodyPartBelly.SetHediffData("BellyBulge", SizedApparelUtility.PrivatePartSeverityInt(bellySeverity),1000, BellyVar);
- bodyPartBelly.UpdateGraphic();
- /*
- bodyPartPath = null;
- cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, "BellyBulge", "Belly", SizedApparelUtility.PrivatePartSeverityInt(bellySeverity), false), false, "Belly", "BellyBulge");
- bodyPartPath = cachedPathAndSize.pathWithSizeIndex;
- if (bodyPartPath != null)
- {
- if (cachedPathAndSize.isUnsupportedHumanlikePath)
+ if (breastHediff != null)
{
- if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike)
- graphicBelly = GraphicDatabase.Get(bodyPartPath);
+ var breastvar = breastHediff.TryGetComp();
+
+ foreach(var addon in bodyAddons)
+ {
+ if(addon.bodyPartOf == SizedApparelBodyPartOf.Breasts)
+ {
+ addon.SetHediffData(breastHediff.def.defName, SizedApparelUtility.BreastSeverityInt(breastHediff.Severity), SizedApparelUtility.BreastSeverityInt(BreastSeverityCache), breastvar?.variation);
+ addon.SetBone(skeleton?.FindBone("Breasts"));
+ addon.UpdateGraphic();
+ }
+ }
+ //bodyPartBreasts.SetHediffData(breastHediff.def.defName, SizedApparelUtility.BreastSeverityInt(breastHediff.Severity), SizedApparelUtility.BreastSeverityInt(breastSeverityCapped), breastvar?.variation);
+ //bodyPartBreasts.UpdateGraphic();
}
else
- graphicBelly = GraphicDatabase.Get(bodyPartPath);
- }*/
- //if (graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- //{
- // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina", "Humanlike").pathWithSizeIndex;
- // if (bodyPartPath != null)
- // graphicVagina_horny = GraphicDatabase.Get(bodyPartPath);
- //}
- }
-
-
-
- //graphicVagina = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina");
- //if(graphicVagina == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- // graphicVagina = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", false, true,"Humanlike");
- if (vaginaHediff != null)
- {
- var vaginaVar = vaginaHediff.TryGetComp();
- bodyPartVagina.SetHediffData(vaginaHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity),1000, vaginaVar?.variation);
- bodyPartVagina.UpdateGraphic();
- /*
- bodyPartPath = null;
- cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), false), false, "Vagina", "Vagina");
- bodyPartPath = cachedPathAndSize.pathWithSizeIndex;
- if (bodyPartPath != null)
- {
- if (cachedPathAndSize.isUnsupportedHumanlikePath)
{
- if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike)
- graphicVagina = GraphicDatabase.Get(bodyPartPath);
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Breasts)
+ {
+ addon.SetHediffData(null, -1);
+ }
+ }
}
- else
- graphicVagina = GraphicDatabase.Get(bodyPartPath);
+
}
- bodyPartPath = null;
- cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina");
- bodyPartPath = cachedPathAndSize.pathWithSizeIndex;
- if (bodyPartPath != null)
+
+
+
+
+ if (SizedApparelSettings.drawUdder)
{
- if (cachedPathAndSize.isUnsupportedHumanlikePath)
+ if (udderHediff != null)
{
- if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike)
- graphicVagina_horny = GraphicDatabase.Get(bodyPartPath);
+ var udderVar = udderHediff.TryGetComp();
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Udder)
+ {
+ addon.SetHediffData(udderHediff.def.defName, SizedApparelUtility.BreastSeverityInt(udderHediff.Severity), 1000, udderVar?.variation);
+ addon.SetBone(skeleton?.FindBone("Udder"));
+ addon.UpdateGraphic();
+ }
+ }
+ //bodyPartUdder.SetHediffData(udderHediff.def.defName, SizedApparelUtility.BreastSeverityInt(udderHediff.Severity), 1000, udderVar?.variation);
+ //bodyPartUdder.UpdateGraphic();
+
}
else
- graphicVagina_horny = GraphicDatabase.Get(bodyPartPath);
- }*/
- //if (graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- //{
- // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, vaginaHediff.def.defName, "Vagina", SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), true), false, "Vagina", "Vagina", "Humanlike").pathWithSizeIndex;
- // if (bodyPartPath != null)
- // graphicVagina_horny = GraphicDatabase.Get(bodyPartPath);
- //}
- }
- else
- bodyPartVagina.SetHediffData(null, -1);
-
- //graphicVagina_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", true);
- //if(graphicVagina_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- // graphicVagina_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, vaginaHediff, false, "Vagina", "Vagina", true, true, "Humanlike");
- /*
- graphicPenises.Clear();
- graphicPenises_horny.Clear();
- graphicBallsOfPenises.Clear();
- */
-
- //TODO: Optimize
- bodyPartPenises.Clear();
- bodyPartBalls.Clear();
- if (penisHediffs != null)
- {
+ {
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Udder)
+ {
+ addon.SetHediffData(null, -1);
+ }
+ }
+ }
- for (int i = 0; i < penisHediffs.Count; i++)
+ }
+
+
+ if (SizedApparelSettings.drawBelly)
{
- Hediff penisHediff = penisHediffs[i];
- float offsetX = 0; // right and left
- float offsetZ = 0; // up and down
- float t = (i + 1f) / (penisHediffs.Count + 1);
- offsetX = Mathf.Lerp(-0.05f, 0.05f, t);
- offsetZ = Mathf.Lerp(-0.02f, 0.02f, t);
-
- if (penisHediff == null)
- continue;
-
- var penisVar = penisHediff.TryGetComp();
-
- SizedApparelBodyPart penis = new SizedApparelBodyPart(pawn, "Penis", SizedApparelBodyPartOf.Penis, "Penis", false, false);
- penis.SetDepthOffsets(0.0108f, 0.0025f, 0.0108f, 0.0108f);
- penis.SetPositionOffsets(new Vector2(offsetX, 0), new Vector2(-offsetX, 0), new Vector2(offsetX, offsetZ), new Vector2(offsetX, -offsetZ));
- penis.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity),1000,penisVar?.variation);
- penis.UpdateGraphic();
- bodyPartPenises.Add(penis);
- SizedApparelBodyPart balls = new SizedApparelBodyPart(pawn, "Balls", SizedApparelBodyPartOf.Penis, "Penis", false, false, "Penis/Balls");
- balls.SetDepthOffsets(0.0096f, 0.0085f, 0.0096f, 0.0096f);
- balls.SetPositionOffsets(new Vector2(offsetX, 0), new Vector2(-offsetX, 0), new Vector2(offsetX, offsetZ), new Vector2(offsetX, -offsetZ));
- balls.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), 1000, penisVar?.variation);
- balls.UpdateGraphic();
- bodyPartBalls.Add(balls);
+ if (bellySeverity >= 0)
+ {
+ //var bellyVar = breastHediff.GetComp();
+ string BellyVar = null;
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Belly)
+ {
+ addon.SetHediffData("BellyBulge", SizedApparelUtility.PrivatePartSeverityInt(bellySeverity), 1000, BellyVar);
+ addon.SetBone(skeleton?.FindBone("Belly"));
+ addon.UpdateGraphic();
+ }
+ }
+ //bodyPartBelly.SetHediffData("BellyBulge", SizedApparelUtility.PrivatePartSeverityInt(bellySeverity), 1000, BellyVar);
+ //bodyPartBelly.UpdateGraphic();
+ }
+ else
+ {
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Belly)
+ {
+ addon.SetHediffData(null, -1);
+ }
+ }
+ }
+
+ }
+
+
+ if (SizedApparelSettings.drawVagina)
+ {
+ if (vaginaHediff != null)
+ {
+ var vaginaVar = vaginaHediff.TryGetComp();
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Vagina)
+ {
+ addon.SetHediffData(vaginaHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), 1000, vaginaVar?.variation);
+ addon.SetBone(skeleton?.FindBone("Vagina"));
+ addon.UpdateGraphic();
+
+ }
+ }
+ //bodyPartVagina.SetHediffData(vaginaHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(vaginaHediff.Severity), 1000, vaginaVar?.variation);
+ //bodyPartVagina.UpdateGraphic();
+
+ }
+ else
+ {
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Vagina)
+ {
+ addon.SetHediffData(null, -1);
+ }
+ }
+ }
+ }
+
+ if (SizedApparelSettings.drawPubicHair)
+ {
+ if (pubicHairDef != null && pubicHairDef.defName != "None") // pubicHairDef != null // for testing
+ {
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.PubicHair)
+ {
+ addon.SetHediffData(pubicHairDef.defName, 0, 1000, null);
+ addon.SetBone(skeleton?.FindBone("PubicHair"));
+ addon.UpdateGraphic();
+ }
+ }
+
+ //bodyPartPubicHair.SetHediffData(pubicHairDef.defName, 0, 1000, null);
+ //bodyPartPubicHair.UpdateGraphic();
+ }
+ else
+ {
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.PubicHair)
+ {
+ addon.SetHediffData(null, -1);
+ }
+ }
+ }
+ }
+
+ if (SizedApparelSettings.drawPenis)
+ {
+ //TODO: Optimize.... memory leak issue?
+ //bodyPartPenises.Clear();
+ //bodyPartBalls.Clear();
+ if (!penisHediffs.NullOrEmpty())
+ {
+ var penisHediff = penisHediffs[0];
+
+ if (penisHediff != null)
+ {
+ var penisVar = penisHediff.TryGetComp();
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Penis)
+ {
+ addon.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), 1000, penisVar?.variation);
+ addon.SetBone(skeleton?.FindBone("Penis"));
+ addon.UpdateGraphic();
+ }
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Balls)
+ {
+ addon.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), 1000, penisVar?.variation);
+ addon.SetBone(skeleton?.FindBone("Balls"));
+ addon.UpdateGraphic();
+ }
+ }
+ }
+ else
+ {
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Penis)
+ {
+ addon.SetHediffData(null, -1);
+ }
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Balls)
+ {
+ addon.SetHediffData(null, -1);
+ }
+ }
+ }
+
+
+ // Multiple Penis Drawing. obsolte
+ /*
+ for (int i = 0; i < penisHediffs.Count; i++)
+ {
+ penisHediff = penisHediffs[i];
+ float offsetX = 0; // right and left
+ float offsetZ = 0; // up and down
+ float t = (i + 1f) / (penisHediffs.Count + 1);
+ offsetX = Mathf.Lerp(-0.05f, 0.05f, t);
+ offsetZ = Mathf.Lerp(-0.02f, 0.02f, t);
+
+ if (penisHediff == null)
+ continue;
+
+ Bone penisBone = null;
+ Bone ballsBone = null;
+ if(skeleton != null)
+ {
+ penisBone = skeleton.FindBone("Penis");
+ ballsBone = skeleton.FindBone("Balls");
+ if (ballsBone == null)
+ ballsBone = penisBone;
+ }
+
+
+
+ var penisVar = penisHediff.TryGetComp();
+
+ SizedApparelBodyPart penis = new SizedApparelBodyPart(pawn, this, "Penis", SizedApparelBodyPartOf.Penis, "Penis", false, false, null,ColorType.Skin, penisBone);
+ penis.SetDepthOffsets(0.0108f, 0.0025f, 0.0108f, 0.0108f);
+ penis.SetPositionOffsets(new Vector2(offsetX, 0), new Vector2(-offsetX, 0), new Vector2(offsetX, offsetZ), new Vector2(offsetX, -offsetZ));
+ penis.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), 1000, penisVar?.variation);
+ penis.centeredTexture = true; // Test Bone
+ penis.UpdateGraphic();
+ bodyPartPenises.Add(penis);
+
+ SizedApparelBodyPart balls = new SizedApparelBodyPart(pawn, this, "Balls", SizedApparelBodyPartOf.Balls, "Penis", false, false, "Penis/Balls", ColorType.Skin, ballsBone);
+ balls.SetDepthOffsets(0.0096f, 0.0085f, 0.0096f, 0.0096f);
+ balls.SetPositionOffsets(new Vector2(offsetX, 0), new Vector2(-offsetX, 0), new Vector2(offsetX, offsetZ), new Vector2(offsetX, -offsetZ));
+ balls.SetHediffData(penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), 1000, penisVar?.variation);
+ balls.centeredTexture = true; // Test Bone
+ balls.UpdateGraphic();
+ bodyPartBalls.Add(balls);
+ */
+
+ }
+ }
+
+ else
+ {
+ bodyPartPenises.Clear();
+ bodyPartBalls.Clear();
+ }
+
+ if (SizedApparelSettings.drawAnus)
+ {
/*
- Graphic penisGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis");
- if (penisGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- penisGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", false, true, "Humanlike");
+ graphicAnus = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus");
+ if (graphicAnus == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
+ graphicAnus = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", false, true, "Humanlike");
- Graphic penisGraphicHorny = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", true);
- if (penisGraphicHorny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- penisGraphicHorny = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis", "Penis", true, true, "Humanlike");
+ graphicAnus_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", true);
+ if (graphicAnus_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
+ graphicAnus_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", true, true, "Humanlike");
*/
- /*
- Graphic penisGraphic = null;
- bodyPartPath = null;
- cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis", "Penis");
- bodyPartPath = cachedPathAndSize.pathWithSizeIndex;
- if (bodyPartPath != null)
+ if (anusHediff != null)
{
- if (cachedPathAndSize.isUnsupportedHumanlikePath)
+ var anusVar = anusHediff.TryGetComp();
+ foreach (var addon in bodyAddons)
{
- if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike)
- penisGraphic = GraphicDatabase.Get(bodyPartPath);
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Anus)
+ {
+ addon.SetHediffData(anusHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), 1000, anusVar?.variation);
+ addon.SetBone(skeleton?.FindBone("Anus"));
+ addon.UpdateGraphic();
+ }
}
- else
- penisGraphic = GraphicDatabase.Get(bodyPartPath);
- }
- //if (penisGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- //{
- // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis", "Penis", "Humanlike").pathWithSizeIndex;
- // if (bodyPartPath != null)
- // penisGraphic = GraphicDatabase.Get(bodyPartPath);
- //}
- Graphic penisGraphicHorny = null;
- bodyPartPath = null;
- cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), true), false, "Penis", "Penis");
- bodyPartPath = cachedPathAndSize.pathWithSizeIndex;
- if (bodyPartPath != null)
- {
- if (cachedPathAndSize.isUnsupportedHumanlikePath)
- {
- if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike)
- penisGraphicHorny = GraphicDatabase.Get(bodyPartPath);
- }
- else
- penisGraphicHorny = GraphicDatabase.Get(bodyPartPath);
- }
- //if (penisGraphicHorny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- //{
- // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, penisHediff.def.defName, "Penis", SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), true), false, "Penis", "Penis", "Humanlike").pathWithSizeIndex;
- // if (bodyPartPath != null)
- // penisGraphicHorny = GraphicDatabase.Get(bodyPartPath);
- //}
-
- //balls are no need horny graphic. it wiil share sametime
-
- //Graphic ballGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis/Balls", "Penis", false);
- //if (ballGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- // ballGraphic = SizedApparelUtility.GetBodyPartGraphic(pawn, penisHediff, false, "Penis/Balls", "Penis", false, true, "Humanlike");
-
-
- Graphic ballGraphic = null;
- bodyPartPath = null;
- cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, "Penis/Balls", penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis/Balls", "Penis");
- bodyPartPath = cachedPathAndSize.pathWithSizeIndex;
- if (bodyPartPath != null)
- {
- if (cachedPathAndSize.isUnsupportedHumanlikePath)
- {
- if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike)
- ballGraphic = GraphicDatabase.Get(bodyPartPath);
- }
- else
- ballGraphic = GraphicDatabase.Get(bodyPartPath);
- }
- //if (ballGraphic == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- //{
- // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, "Penis/Balls", penisHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(penisHediff.Severity), false), false, "Penis/Balls", "Penis", "Humanlike").pathWithSizeIndex;
- // if (bodyPartPath != null)
- // ballGraphic = GraphicDatabase.Get(bodyPartPath);
- //}
-
-
- if (true)//penisGraphic != null
- {
- graphicPenises.Add(penisGraphic);
- graphicPenises_horny.Add(penisGraphicHorny);
- graphicBallsOfPenises.Add(ballGraphic);
- }
- */
- }
- }
- /*
- graphicAnus = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus");
- if (graphicAnus == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- graphicAnus = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", false, true, "Humanlike");
-
- graphicAnus_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", true);
- if (graphicAnus_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- graphicAnus_horny = SizedApparelUtility.GetBodyPartGraphic(pawn, anusHediff, false, "Anus", "Anus", true, true, "Humanlike");
- */
- if(anusHediff != null)
- {
- var anusVar = anusHediff.TryGetComp();
-
- bodyPartAnus.SetHediffData(anusHediff.def.defName, SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity),1000, anusVar?.variation);
- bodyPartAnus.UpdateGraphic();
-
- /*
- bodyPartPath = null;
- cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), false), false, "Anus", "Anus");
- bodyPartPath = cachedPathAndSize.pathWithSizeIndex;
- if (bodyPartPath != null)
- {
- if (cachedPathAndSize.isUnsupportedHumanlikePath)
- {
- if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike)
- graphicAnus = GraphicDatabase.Get(bodyPartPath);
}
else
- graphicAnus = GraphicDatabase.Get(bodyPartPath);
- }
- //if (graphicAnus == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- //{
- // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), false), false, "Anus", "Anus", "Humanlike").pathWithSizeIndex;
- // if (bodyPartPath != null)
- // graphicAnus = GraphicDatabase.Get(bodyPartPath);
- //}
- bodyPartPath = null;
- cachedPathAndSize = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, bodyTypeDefName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), true), false, "Anus", "Anus");
- bodyPartPath = cachedPathAndSize.pathWithSizeIndex;
- if (bodyPartPath != null)
- {
- if (cachedPathAndSize.isUnsupportedHumanlikePath)
{
- if (SizedApparelSettings.UnsupportedRaceToUseHumanlike && pawn.RaceProps.Humanlike)
- graphicAnus_horny = GraphicDatabase.Get(bodyPartPath);
+ foreach (var addon in bodyAddons)
+ {
+ if (addon.bodyPartOf == SizedApparelBodyPartOf.Anus)
+ {
+ addon.SetHediffData(null, -1);
+ }
+ }
}
- else
- graphicAnus_horny = GraphicDatabase.Get(bodyPartPath);
}
- //if (graphicAnus_horny == null && pawn.RaceProps.Humanlike && SizedApparelSettings.UnsupportedRaceToUseHumanlike)
- //{
- // bodyPartPath = SizedApparelsDatabase.GetSupportedBodyPartPath(new SizedApparelsDatabase.BodyPartDatabaseKey(pawn.def.defName, pawn.story?.bodyType.defName, anusHediff.def.defName, "Anus", SizedApparelUtility.PrivatePartSeverityInt(anusHediff.Severity), true), false, "Anus", "Anus", "Humanlike").pathWithSizeIndex;
- // if (bodyPartPath != null)
- // graphicAnus_horny = GraphicDatabase.Get(bodyPartPath);
- //}*/
+
}
- else
- bodyPartAnus.SetHediffData(null, -1);
-
-
-
hasGraphicUpdatedBefore = true;
}
@@ -1127,6 +1778,9 @@ namespace SizedApparel
cachedApparelGraphicRecord = new List();
hasUpdateBeforeSuccess = true;
+ this.isHediffDirty = false;
+ this.isApparelDirty = false;
+ this.isSkeletonDirty = false;
}
@@ -1188,6 +1842,10 @@ namespace SizedApparel
{
yield return bp;
}
+ foreach (SizedApparelBodyPart bp in bodyAddons)
+ {
+ yield return bp;
+ }
}
public IEnumerable GetSizedApparelBodyParts(SizedApparelBodyPartOf targetPartOf, bool returnNullPart = false)
{
@@ -1209,7 +1867,7 @@ namespace SizedApparel
public void SetPoseFromPoseSet(string poseSetName, bool autoUpdate = true, bool autoSetPawnGraphicDirty = false)
{
- if (poseSetName == null)
+ if (poseSetName.NullOrEmpty())
{
ClearAllPose(autoUpdate, autoSetPawnGraphicDirty);
return;
diff --git a/1.3/source/SizedApparel/SizedApparelDef.cs b/1.3/source/SizedApparel/SizedApparelDef.cs
new file mode 100644
index 0000000..524457a
--- /dev/null
+++ b/1.3/source/SizedApparel/SizedApparelDef.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using RimWorld;
+using Verse;
+using HarmonyLib;
+//using AlienRace;
+using UnityEngine;
+using rjw;
+
+namespace SizedApparel
+{
+
+ //for avoid first hitch. some day it might need make pre def for fast cache...
+
+ public class ApparelTexture
+ {
+ public BodyTypeDef bodytype;
+ public List textures;
+
+ public string GetTexturePath(int level, out int result)
+ {
+ result = -1;
+ if (level < 0)
+ return null;
+ if (textures.Count > level)
+ {
+ result = level;
+ return textures[level];
+ }
+ if (!textures.NullOrEmpty())
+ {
+ result = textures.Count - 1;
+ return textures[result]; //return biggest as supported
+ }
+ return null;
+ }
+ }
+
+ public class SizedApparelDef : Def
+ {
+ //def name must be match with apparels DefName
+ public bool hidingGenitals = false; // pants must be true
+ public List SizedTextures;
+
+ public ApparelTexture GetApparelTexture(BodyTypeDef bodytype)
+ {
+ if(SizedTextures != null)
+ {
+ return SizedTextures.FirstOrDefault(a => a.bodytype == bodytype);
+ }
+ return null;
+ }
+ }
+
+}
diff --git a/1.3/source/SizedApparel/SizedApparelMain.cs b/1.3/source/SizedApparel/SizedApparelMain.cs
index 3a5c770..0f80d38 100644
--- a/1.3/source/SizedApparel/SizedApparelMain.cs
+++ b/1.3/source/SizedApparel/SizedApparelMain.cs
@@ -7,12 +7,12 @@ using Verse;
using HarmonyLib;
using UnityEngine;
using rjw;
+using Rimworld_Animations;
using System.Reflection;
-
-
//since I test system alot, source cord is very dirty and not optimized.
+
namespace SizedApparel
{
public struct supportedIndex
@@ -20,8 +20,6 @@ namespace SizedApparel
}
-
-
[StaticConstructorOnStartup]
[HarmonyPatch(typeof(Pawn_HealthTracker), "Notify_HediffChanged")]
public class PawnHealthTrackerPatch
@@ -30,7 +28,7 @@ namespace SizedApparel
{
if (___pawn == null)
return;
- var comp = ___pawn.TryGetComp();
+ var comp = ___pawn.GetComp();
if (comp == null)
return;
if (hediff == null)
@@ -40,7 +38,7 @@ namespace SizedApparel
{
//comp.ClearAll();
//comp.Update();
- comp.SetDirty();
+ comp.SetDirty(false,true,false);
//already doing set dirty in hediffchange method.
//___pawn.Drawer.renderer.graphics.SetApparelGraphicsDirty();
//PortraitsCache.SetDirty(___pawn);
@@ -49,15 +47,27 @@ namespace SizedApparel
}
if (SizedApparelUtility.isBellyBulgeHediff(hediff))
{
- comp.SetDirty();
+ comp.SetDirty(false, true, false);
return;
}
}
}
-
-
+ //for 1.4
+ /*
+ [StaticConstructorOnStartup]
+ [HarmonyPatch(typeof(Pawn_AgeTracker), "PostResolveLifeStageChange")]
+ public class PawnAgeTrackerPatch
+ {
+ public static void Postfix(Pawn ___pawn)
+ {
+ var comp = ___pawn.GetComp();
+ if (comp == null)
+ return;
+ comp.SetDirty(false,false,false,true,true);//Apparel and Hediff will be changed with other reason. just set skeleton dirty.
+ }
+ }*/
@@ -100,18 +110,18 @@ namespace SizedApparel
-
+ [Obsolete]
[StaticConstructorOnStartup]
public class BodyPatch
{
- public static void SetBodyGraphic(Pawn pawn,bool drawClothFlag = true, bool fromGraphicRecord = true, bool revert = false)
+ public static void SetBodyGraphic(Pawn pawn, bool drawClothFlag = true, bool fromGraphicRecord = true, bool revert = false)
{
//Pawn_ApparelTracker __instance;
//GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff);
//bool flag = hasUnSupportedApparel(__instance.pawn, breastSeverity, breastHediff);
- ApparelRecorderComp comp = pawn.TryGetComp();
+ ApparelRecorderComp comp = pawn.GetComp();
if (comp == null)
return;
@@ -132,6 +142,9 @@ namespace SizedApparel
pawnRenderer.nakedGraphic = comp.graphicSourceNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo);
if (comp.graphicSourceRotten != null)
pawnRenderer.rottingGraphic = comp.graphicSourceRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo);
+ //if (comp.graphicSourceFurCovered != null)
+ // pawnRenderer.furCoveredGraphic = comp.graphicSourceRotten.GetColoredVersion(pawnRenderer.furCoveredGraphic.Shader, pawnRenderer.furCoveredGraphic.color, pawnRenderer.furCoveredGraphic.colorTwo);
+
}
@@ -157,31 +170,9 @@ namespace SizedApparel
{
pawnRenderer.ResolveAllGraphics();
}*/
-
if (pawnRenderer == null)
return;
- string nakedGraphicPath = pawnRenderer.nakedGraphic?.path;
- //Log.Message("nakedGraphicPath");
- string rottingGraphicPath = pawnRenderer.rottingGraphic?.path;
- //Log.Message("rottingGraphicPath");
- int currentBreastSizeIndex = 0;
- float currentBreastSeverity = 0;
- Graphic nakedGraphic;
- Graphic rottingGraphic;
- bool validNakedTexture = false;
- bool validRottingTexture = false;
- int offset = 0;
-
-
- /*
- * Obsolete
- if (SizedApparelSettings.DontReplaceBodyTextureOnNude == true && SizedApparelUtility.isPawnNaked(pawn))
- {
- if (SizedApparelSettings.Debug)
- Log.Message("[Sized Apparel] " + pawn.Name + "is Naked. And DontReplaceBodyTextureOnNude Option is active. Changing Body Texture is cancled.");
- return;
- }*/
if (!comp.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(pawn) || !drawClothFlag)
{
@@ -194,7 +185,12 @@ namespace SizedApparel
{
pawnRenderer.rottingGraphic = comp.graphicbaseBodyRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo);
- }
+ }/*
+ if (comp.graphicbaseBodyFurCovered != null)
+ {
+ pawnRenderer.furCoveredGraphic = comp.graphicbaseBodyFurCovered.GetColoredVersion(pawnRenderer.furCoveredGraphic.Shader, pawnRenderer.furCoveredGraphic.color, pawnRenderer.furCoveredGraphic.colorTwo);
+
+ }*/
}
else
{
@@ -202,212 +198,92 @@ namespace SizedApparel
pawnRenderer.nakedGraphic = comp.graphicSourceNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo);
if (comp.graphicSourceRotten != null)
pawnRenderer.rottingGraphic = comp.graphicSourceRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo);
+ //if (comp.graphicSourceFurCovered != null)
+ // pawnRenderer.furCoveredGraphic = comp.graphicSourceFurCovered.GetColoredVersion(pawnRenderer.furCoveredGraphic.Shader, pawnRenderer.furCoveredGraphic.color, pawnRenderer.furCoveredGraphic.colorTwo);
+
}
return;//no need to replace full body texture anymore.
- if (false && comp.hasUnsupportedApparel && SizedApparelSettings.useUnsupportedBodyTexture)//old method. no need to do.
- {
- //Log.Message("hasUnsupportedApparel");
- // SetBodyGraphic(__instance, true);
- if (true)
- {
- if ((ContentFinder.Get((nakedGraphicPath + "_UnsupportedApparel" + "_south"), false) != null))
- {
- nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + "_Unsupported", pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- pawnRenderer.nakedGraphic = nakedGraphic;
- }
- if ((ContentFinder.Get((rottingGraphicPath + "_UnsupportedApparel" + "_south"), false) != null))
- {
- rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + "_UnsupportedApparel", pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- pawnRenderer.rottingGraphic = rottingGraphic;
- }
+ /*
+ if (SizedApparelSettings.useBodyTexture == false)
+ return;
- }
+ //Log.Message("Hello");
+ if (pawnGraphicSet == null)
+ return;
+
+ if (pawnGraphicSet.pawn.RaceProps.Humanlike == false)
+ return;
+
+ return;
+
+
+ //Log.Message("SetBodyGraphic");
+ //pawnGraphicSet.ClearCache();
+ string path = pawnGraphicSet.pawn.story.bodyType.bodyNakedGraphicPath;
+ string path_bodyDessicated = pawnGraphicSet.pawn.story.bodyType.bodyDessicatedGraphicPath;
+ string filename;
+ string pathname;
+ string filename_bodyDessicated;
+ string pathname_bodyDessicated;
+ pathname = System.IO.Path.GetDirectoryName(path);
+ filename = System.IO.Path.GetFileName(path);
+ filename_bodyDessicated = System.IO.Path.GetFileName(path_bodyDessicated);
+ pathname_bodyDessicated = System.IO.Path.GetDirectoryName(path_bodyDessicated);
+
+ //Log.Message("SetPath");
+ bool validBody = false;
+ bool validDessicatedBody = false;
+
+ //pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic
+ //pawnGraphicSet.pawn.Drawer.renderer.graphics.dessicatedGraphic
+
+ if (hasUnsupportApparel)
+ {
+ //Log.Message("IfhasUnsupportApparel");
+ //Graphic newBodyGraphic = null;
+ //Graphic newRottingGraphic = null;
+ //string path;
+
+ //Log.Message("tryUnsupportedApparelBodyTexture");
+ //OLD::pawnGraphicSet.pawn.Drawer.renderer.graphics
+ if (pawnGraphicSet.nakedGraphic != null)
+ if (ContentFinder.Get((pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic.path + "_UnsupportedApparel" + "_south"), false) != null)
+ {
+ pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic = GraphicDatabase.Get(pawnGraphicSet.nakedGraphic.path + "_UnsupportedApparel", pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo);
+ validBody = true;
+ }
+ if (pawnGraphicSet.dessicatedGraphic != null)
+ if (ContentFinder.Get((pawnGraphicSet.dessicatedGraphic.path + "_UnsupportedApparel" + "_south"), false) != null)
+ {
+ pawnGraphicSet.dessicatedGraphic = GraphicDatabase.Get(pawnGraphicSet.dessicatedGraphic.path + "_UnsupportedApparel", pawnGraphicSet.rottingGraphic.Shader, pawnGraphicSet.rottingGraphic.drawSize, pawnGraphicSet.rottingGraphic.color, pawnGraphicSet.rottingGraphic.colorTwo);
+ validDessicatedBody = true;
+ }
}
else
{
- if(!comp.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(pawn))
- {
-
- }
- if (comp.graphicbaseBodyNaked!=null)
- pawnRenderer.nakedGraphic = comp.graphicbaseBodyNaked.GetColoredVersion(pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo);
- if (comp.graphicbaseBodyRotten != null)
- pawnRenderer.rottingGraphic = comp.graphicbaseBodyRotten.GetColoredVersion(pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo);
-
- return;//no need to replace full body texture anymore.
- while (offset < SizedApparelUtility.size.Length)
- {
- string breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(breastSeverity, offset, true, ref currentBreastSizeIndex, ref currentBreastSeverity);
- //search bigger
- //SizedApparelSettings.matchBodyTextureToMinimumApparelSize? currentBreastSizeIndex <= minSupportedBreasSizeIndex:true
- if (validNakedTexture == false)
+ //Log.Message("undo");
+ string currentPath = pawnGraphicSet.nakedGraphic.path;
+ string currentDessicatedPath = pawnGraphicSet.dessicatedGraphic.path;
+ //Log.Message(currentPath.Substring(0,currentPath.Length - "_UnsupportedApparel".Length));
+ if (pawnGraphicSet.nakedGraphic != null)
+ if (ContentFinder.Get(currentPath.Substring(0, currentPath.Length - "_UnsupportedApparel".Length) + "_south", false) != null)
{
- if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null))
- {
- if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true)
- {
- nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- pawnRenderer.nakedGraphic = nakedGraphic;
- validNakedTexture = true;
- }
- }
+ pawnGraphicSet.nakedGraphic = GraphicDatabase.Get((currentPath.Substring(0, currentPath.Length - "_UnsupportedApparel".Length)), pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo);
+
}
- if (validRottingTexture == false)
+ if (pawnGraphicSet.dessicatedGraphic != null)
+ if (ContentFinder.Get(currentDessicatedPath.Substring(0, currentDessicatedPath.Length - "_UnsupportedApparel".Length) + "_south", false) != null)
{
- if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null))
- {
- if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true)
- {
- rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- pawnRenderer.rottingGraphic = rottingGraphic;
- validRottingTexture = true;
- }
- }
+ pawnGraphicSet.dessicatedGraphic = GraphicDatabase.Get((currentDessicatedPath.Substring(0, currentDessicatedPath.Length - "_UnsupportedApparel".Length)), pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo);
+
}
- //search smaller
-
- breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(breastSeverity, offset, false, ref currentBreastSizeIndex, ref currentBreastSeverity);
-
- if (validNakedTexture == false)
- {
- if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null))
- {
- if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true)
- {
- nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, pawnRenderer.nakedGraphic.Shader, pawnRenderer.nakedGraphic.drawSize, pawnRenderer.nakedGraphic.color, pawnRenderer.nakedGraphic.colorTwo, pawnRenderer.nakedGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- pawnRenderer.nakedGraphic = nakedGraphic;
- validNakedTexture = true;
- }
- }
- }
- if (validRottingTexture == false)
- {
- if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null))
- {
- if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? SizedApparelUtility.BreastSizeIndexToSeverity(currentBreastSizeIndex) <= comp.breastSeverityCapToDraw : true)
- {
- rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, pawnRenderer.rottingGraphic.Shader, pawnRenderer.rottingGraphic.drawSize, pawnRenderer.rottingGraphic.color, pawnRenderer.rottingGraphic.colorTwo, pawnRenderer.rottingGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- pawnRenderer.rottingGraphic = rottingGraphic;
- validRottingTexture = true;
- }
- }
- }
-
- if (validNakedTexture == true && validRottingTexture == true)
- {
- if (SizedApparelSettings.Debug)
- Log.Message("[Sized Apparel] " + pawn.Name + "'s body texture has changed.");
- break;
- }
-
- offset++;
- }
-
- }
+ }*/
+ //pawnGraphicSet.ClearCache();
}
-
-
-
- return;
- /*
- if (SizedApparelSettings.useBodyTexture == false)
- return;
-
- //Log.Message("Hello");
- if (pawnGraphicSet == null)
- return;
-
- if (pawnGraphicSet.pawn.RaceProps.Humanlike == false)
- return;
-
- return;
-
-
- //Log.Message("SetBodyGraphic");
- //pawnGraphicSet.ClearCache();
- string path = pawnGraphicSet.pawn.story.bodyType.bodyNakedGraphicPath;
- string path_bodyDessicated = pawnGraphicSet.pawn.story.bodyType.bodyDessicatedGraphicPath;
- string filename;
- string pathname;
- string filename_bodyDessicated;
- string pathname_bodyDessicated;
- pathname = System.IO.Path.GetDirectoryName(path);
- filename = System.IO.Path.GetFileName(path);
- filename_bodyDessicated = System.IO.Path.GetFileName(path_bodyDessicated);
- pathname_bodyDessicated = System.IO.Path.GetDirectoryName(path_bodyDessicated);
-
- //Log.Message("SetPath");
- bool validBody = false;
- bool validDessicatedBody = false;
-
- //pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic
- //pawnGraphicSet.pawn.Drawer.renderer.graphics.dessicatedGraphic
-
- if (hasUnsupportApparel)
- {
- //Log.Message("IfhasUnsupportApparel");
- //Graphic newBodyGraphic = null;
- //Graphic newRottingGraphic = null;
- //string path;
-
- //Log.Message("tryUnsupportedApparelBodyTexture");
- //OLD::pawnGraphicSet.pawn.Drawer.renderer.graphics
- if (pawnGraphicSet.nakedGraphic != null)
- if (ContentFinder.Get((pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic.path + "_UnsupportedApparel" + "_south"), false) != null)
- {
- pawnGraphicSet.pawn.Drawer.renderer.graphics.nakedGraphic = GraphicDatabase.Get(pawnGraphicSet.nakedGraphic.path + "_UnsupportedApparel", pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo);
- validBody = true;
- }
- if (pawnGraphicSet.dessicatedGraphic != null)
- if (ContentFinder.Get((pawnGraphicSet.dessicatedGraphic.path + "_UnsupportedApparel" + "_south"), false) != null)
- {
- pawnGraphicSet.dessicatedGraphic = GraphicDatabase.Get(pawnGraphicSet.dessicatedGraphic.path + "_UnsupportedApparel", pawnGraphicSet.rottingGraphic.Shader, pawnGraphicSet.rottingGraphic.drawSize, pawnGraphicSet.rottingGraphic.color, pawnGraphicSet.rottingGraphic.colorTwo);
- validDessicatedBody = true;
- }
- }
- else
- {
- //Log.Message("undo");
- string currentPath = pawnGraphicSet.nakedGraphic.path;
- string currentDessicatedPath = pawnGraphicSet.dessicatedGraphic.path;
- //Log.Message(currentPath.Substring(0,currentPath.Length - "_UnsupportedApparel".Length));
- if (pawnGraphicSet.nakedGraphic != null)
- if (ContentFinder.Get(currentPath.Substring(0, currentPath.Length - "_UnsupportedApparel".Length) + "_south", false) != null)
- {
- pawnGraphicSet.nakedGraphic = GraphicDatabase.Get((currentPath.Substring(0, currentPath.Length - "_UnsupportedApparel".Length)), pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo);
-
- }
- if (pawnGraphicSet.dessicatedGraphic != null)
- if (ContentFinder.Get(currentDessicatedPath.Substring(0, currentDessicatedPath.Length - "_UnsupportedApparel".Length) + "_south", false) != null)
- {
- pawnGraphicSet.dessicatedGraphic = GraphicDatabase.Get((currentDessicatedPath.Substring(0, currentDessicatedPath.Length - "_UnsupportedApparel".Length)), pawnGraphicSet.nakedGraphic.Shader, pawnGraphicSet.nakedGraphic.drawSize, pawnGraphicSet.nakedGraphic.color, pawnGraphicSet.nakedGraphic.colorTwo);
-
- }
-
- }*/
- //pawnGraphicSet.ClearCache();
}
@@ -422,62 +298,7 @@ namespace SizedApparel
}
-
-
-
-
-
-
-
- //for worn apparel
-
-
-
-
-
-
-
-
-
-
- //[HarmonyPatch(typeof(ApparelGraphicRecordGetter), "TryGetGraphicApparel")]
- /*
- [StaticConstructorOnStartup]
- [HarmonyPatch(typeof(PawnGraphicSet), "ResolveAllGraphics")]
- class BodyfixForUnsupported
- {
- static void Prefix(PawnGraphicSet __instance)
- {
- if (!UnityData.IsInMainThread)
- return;
- if (__instance.pawn == null)
- return;
- var comp = __instance.pawn.TryGetComp();
- if (comp == null)
- return;
- comp.ClearAll();
- //comp.Update();
- }
- }*/
-
-
- /*
-[StaticConstructorOnStartup]
-[HarmonyPatch(typeof(PawnGenerator), "GeneratePawn", typeof(PawnGenerationRequest) )]
-class GeneratePawnPatch
-{
- Type[] types = { typeof(PawnGenerationRequest) };
- static void Postfix(PawnGenerationRequest request, Pawn __result)
- {
- if (!UnityData.IsInMainThread)
- return;
- if (__result != null)
- {
- //__result.Drawer.renderer.graphics.ResolveAllGraphics();
- __result.Drawer.renderer.graphics.ResolveApparelGraphics();
- }
- }
-}*/
+ [Obsolete]
[StaticConstructorOnStartup]
//[HarmonyPatch(typeof(Pawn_ApparelTracker), "ExposeData")]
class ApparelTrackerExposePatch
@@ -492,7 +313,7 @@ class GeneratePawnPatch
return;
if (Scribe.mode == LoadSaveMode.PostLoadInit)
{
- ApparelRecorderComp comp = __instance.pawn.TryGetComp();
+ ApparelRecorderComp comp = __instance.pawn.GetComp();
if (comp == null)
return;
if (!comp.hasUpdateBefore)
@@ -527,7 +348,7 @@ class GeneratePawnPatch
//GetBreastSeverity(__instance.pawn, out breastSeverity, out breastHediff);
//bool flag = hasUnSupportedApparel(__instance.pawn, breastSeverity, breastHediff);
- ApparelRecorderComp comp = __instance.pawn.TryGetComp();
+ ApparelRecorderComp comp = __instance.pawn.GetComp();
if (comp != null)
{
//comp.ClearBreastCacheValue();
@@ -543,7 +364,7 @@ class GeneratePawnPatch
//comp.Update(true, false);//TODO: Coverd But No Graphic may cause Big Issue!!!
//comp.Update(true, true);
- comp.SetDirty();
+ comp.SetDirty(false,false,true);
/*
if (SizedApparelSettings.drawBodyParts)//old:SizedApparelSettings.useBodyTexture
@@ -641,6 +462,8 @@ class GeneratePawnPatch
}
+
+ //Apparel Graphic Texture injection
[StaticConstructorOnStartup]
[HarmonyPatch(typeof(ApparelGraphicRecordGetter), "TryGetGraphicApparel")]
[HarmonyBefore(new string[]{"QualityOfBuilding"})]
@@ -657,16 +480,15 @@ class GeneratePawnPatch
if (bodyType == null)
return;
-
if (apparel.Wearer != null)
{
//rec = new ApparelGraphicRecord(null, null);
- var comp = apparel.Wearer.TryGetComp();
+ var comp = apparel.Wearer.GetComp();
//if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize)
// BreastSeverity = comp.BreastSeverityCache;
- int currentBreastSizeIndex = 0;
- float currentBreastSeverity = -1;
+ //int currentBreastSizeIndex = 0;
+ //float currentBreastSeverity = -1;
//int minSupportedBreastSizeIndex = 1000;
//float minSupportedBreastSeverity = 1000;
@@ -708,18 +530,19 @@ class GeneratePawnPatch
}*/
}
+ //Log.Message("1");
var breastHediff = comp.breastHediff;
float BreastSeverity = comp.breastSeverity;
-
+ //Log.Message("2");
if (SizedApparelSettings.useBreastSizeCapForApparels) //SizedApparelSettings.useBreastSizeCapForApparels //wip
BreastSeverity = Math.Min(comp.BreastSeverityCache, BreastSeverity);
-
- if (comp.hasUnsupportedApparel == false && (comp.bodyPartBreasts.bodyPartGraphic !=null || comp.bodyPartBreasts.bodyPartGraphicHorny != null))//(comp.graphicBreasts!=null|| comp.graphicBreasts_horny != null)
+ //Log.Message("3");
+ if (comp.hasUnsupportedApparel == false)//&& (comp.bodyPartBreasts.bodyPartGraphic !=null || comp.bodyPartBreasts.bodyPartGraphicHorny != null)
{
Graphic sizedGraphic = null;
-
- string resultPath = SizedApparelsDatabase.GetSupportedApparelSizedPath(new SizedApparelsDatabase.SizedApparelDatabaseKey(rec.graphic.path, apparel?.Wearer?.def.defName, breastHediff.def.defName, apparel.Wearer.gender, apparel?.Wearer?.story?.bodyType?.defName, SizedApparelUtility.BreastSeverityInt(BreastSeverity))).pathWithSizeIndex;
+ //Log.Message("4");
+ string resultPath = SizedApparelsDatabase.GetSupportedApparelSizedPath(new SizedApparelsDatabase.SizedApparelDatabaseKey(rec.graphic.path, apparel?.Wearer?.def.defName, breastHediff?.def?.defName, apparel.Wearer.gender, apparel?.Wearer?.story?.bodyType?.defName, SizedApparelUtility.BreastSeverityInt(BreastSeverity))).pathWithSizeIndex;
if(resultPath != null)
{
//sizedGraphic = SizedApparelUtility.GetSizedApparelGraphic(rec.graphic, BreastSeverity, apparel?.Wearer?.def.defName, breastHediff.def.defName);
@@ -756,424 +579,17 @@ class GeneratePawnPatch
{
return;
}
- var comp = __instance.pawn.TryGetComp();
+ var comp = __instance.pawn.GetComp();
if (comp == null)
return;
//comp.ClearAll(false);
//comp.needToCheckApparelGraphicRecords = true;
- comp.SetDirty();
+ comp.SetDirty(false,true,false,false,false); // Check Hediff. If you don't the crotch will not have graphic on first load
}
}
-
-
-
- //[HarmonyPatch(typeof(PawnGraphicSet))]
- //[HarmonyPatch("ResolveApparelGraphics")]
- //[HarmonyBefore(new string[] { "rimworld.erdelf.alien_race.main" })]
- [StaticConstructorOnStartup]
- //[HarmonyPatch(typeof(PawnGraphicSet), "ResolveApparelGraphics")]
- class ApparelFix
- {
- [Obsolete]
- public static bool old_old_Prefix(Apparel apparel, BodyTypeDef bodyType, ApparelGraphicRecord rec, ref bool __result)
- {
-
- bool result = true;
- bool flag = apparel.def.apparel.wornGraphicPath.NullOrEmpty();
- if (flag)
- {
- string text = apparel.def.apparel.wornGraphicPath + "_" + bodyType.defName + "_3";
-
- bool flag2 = false;
-
- flag2 = ContentFinder.Get(text + "_north", true) == null || ContentFinder.Get(text + "_east", true) == null || ContentFinder.Get(text + "_south", true) == null;
- if (flag2)
- {
- bool flag3 = apparel.def.apparel.LastLayer != ApparelLayerDefOf.Overhead;
- if (flag3)
- {
- //text = apparel.def.apparel.wornGraphicPath + "_Female";
- Graphic graphic = GraphicDatabase.Get(text, ShaderDatabase.Cutout, apparel.def.graphicData.drawSize, apparel.DrawColor);
- rec = new ApparelGraphicRecord(graphic, apparel);
- result = false;
- __result = true;
- }
- }
- else
- {
- bool flag4 = apparel.def.apparel.LastLayer == ApparelLayerDefOf.Overhead;
- if (flag4)
- {
- Graphic graphic2 = GraphicDatabase.Get(text, ShaderDatabase.Cutout, apparel.def.graphicData.drawSize, apparel.DrawColor);
- rec = new ApparelGraphicRecord(graphic2, apparel);
- result = false;
- __result = true;
- }
- }
- }
- return result;
- }
-
- [Obsolete]
- static void old_Postfix(ref PawnGraphicSet __instance)
- {
- if (Current.Game.World == null)
- return;
-
- // Log.Message("ResolveGraphic");
- if (__instance.pawn.RaceProps.Humanlike)
- {
- //Log.Message("ResolveApparelGraphics");
- //__instance.pawn.health.hediffSet.HasHediff(Hediff ,BodyPartRecord ,false);
- //__instance.pawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined, null, null).Any((BodyPartRecord bpr) => bpr.untranslatedCustomLabel == label || bpr.def.defName == label);
-
- var comp = __instance.pawn.TryGetComp();
- if (comp != null)
- {
- bool flag = false;
- float BreastSeverity = -1;
- Hediff breastHediff = null;
- SizedApparelUtility.GetBreastSeverity(__instance.pawn, out BreastSeverity, out breastHediff);
- //Log.Message("hasUnsupported? : "+comp.hasUnsupportedApparel.ToString());
-
- if (true) //(!comp.hasUpdateBefore)
- {
- //Log.Message("UpdateFirst");
- /*
- if (comp.havingSex)
- comp.hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparel(__instance.pawn, BreastSeverity, breastHediff);
- else
- comp.hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparelFromWornData(__instance.pawn, BreastSeverity, breastHediff);
- */
- comp.hasUnsupportedApparel = SizedApparelUtility.hasUnSupportedApparelFromWornData(__instance.pawn, BreastSeverity, breastHediff);
- comp.hasUpdateBefore = true;
- }
- if (comp.hasUnsupportedApparel == false)
- {
- int currentBreastSizeIndex = 0;
- int minSupportedBreastSizeIndex = 1000;
- float currentBreastSeverity = 0;
- float minSupportedBreastSeverity = 1000;
- List newAgr = new List();
- foreach (ApparelGraphicRecord agr in __instance.apparelGraphics)//ApparelGraphicRecord agr in curAgr
- {
- /*
- if(apparel != null)
- {
- ApparelGraphicRecord rec;
- if (apparel.def.apparel.wornGraphicPath.NullOrEmpty())
- {
- rec = new ApparelGraphicRecord(null, null);
- newAgr.Add(rec);
- continue;
- }
- string path;
- if (apparel.def.apparel.LastLayer == ApparelLayerDefOf.Overhead || apparel.def.apparel.wornGraphicPath == BaseContent.PlaceholderImagePath)
- {
- path = apparel.def.apparel.wornGraphicPath;
- }
- else
- {
- path = apparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName;
- }
- Shader shader = ShaderDatabase.Cutout;
- if (apparel.def.apparel.useWornGraphicMask)
- {
- shader = ShaderDatabase.CutoutComplex;
- }
- Graphic graphic = GraphicDatabase.Get(path, shader, apparel.def.graphicData.drawSize, apparel.DrawColor);
- rec = new ApparelGraphicRecord(graphic, apparel);
- //string endstring = (gender == Gender.Female && (ContentFinder.Get(apparel.def.apparel.wornGraphicPath + "_" + bodyType.defName + "_fem_south", false) != null)) ? "_fem" : null;
- //string path = (apparel.def.apparel.LastLayer != ApparelLayerDefOf.Overhead) ? (apparel.def.apparel.wornGraphicPath + "_" + bodyType.defName + endstring) : apparel.def.apparel.wornGraphicPath;
- //path = agr.sourceApparel.def.graphic.path;
-
- //var path = agr.graphic.path;
- var ExtraPath = path;
- string targetPath;
- }
- */
-
-
- string path;
- string extraPath;
- //path = agr.sourceApparel.def.apparel.wornGraphicPath + "_" + __instance.pawn.story.bodyType.defName;
- path = agr.graphic.path;
- if (breastHediff != null)
- {
- extraPath = path + "_" + breastHediff.def.defName;
-
- }
- else
- extraPath = path;
-
-
- int offset = 0;
-
-
- bool validTexture = false;
- Graphic graphic = null;
- bool findBigger = true; // if false : search smaller first
- while (offset < SizedApparelUtility.size.Length)
- {
- if (breastHediff != null)
- {
- if (ContentFinder.Get((extraPath + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity) + "_south"), false) != null) // checking special texture like udder
- {
- minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex);
- minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity);
- graphic = new Graphic();
- graphic = GraphicDatabase.Get(extraPath + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity), agr.graphic.Shader, agr.graphic.drawSize, agr.graphic.color, agr.graphic.colorTwo, agr.graphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- validTexture = true;
- //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Found");
- break;
- }
- //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Extra Texture Not Found.");
- }
-
- if ((ContentFinder.Get((path + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity) + "_south"), false) != null))
- {
- minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex);
- minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity);
- graphic = GraphicDatabase.Get(path + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity), agr.graphic.Shader, agr.graphic.drawSize, agr.graphic.color, agr.graphic.colorTwo, agr.graphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Found");
- break;
- }
- //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. Try bigger Texture.");
- offset++;
-
- }
-
- if (validTexture == false)
- {
- //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. try smaller instead of bigger .");
- }
-
-
- if (validTexture == false)
- {
- offset = 0;
- while (offset < SizedApparelUtility.size.Length)
- {
- if (breastHediff != null)
- {
- if (ContentFinder.Get((extraPath + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity) + "_south"), false) != null) // checking special texture like udder
- {
- minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex);
- minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity);
- graphic = new Graphic();
- graphic = GraphicDatabase.Get(extraPath + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity), agr.graphic.Shader, agr.graphic.drawSize, agr.graphic.color, agr.graphic.colorTwo, agr.graphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- validTexture = true;
- //Log.Message(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Found");
- break;
- }
- //Log.Warning(extraPath + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Extra Texture Not Found.");
- }
-
- if ((ContentFinder.Get((path + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity) + "_south"), false) != null))
- {
- minSupportedBreastSizeIndex = Math.Min(currentBreastSizeIndex, minSupportedBreastSizeIndex);
- minSupportedBreastSeverity = Math.Min(currentBreastSeverity, minSupportedBreastSeverity);
- graphic = GraphicDatabase.Get(path + SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, !findBigger, ref currentBreastSizeIndex, ref currentBreastSeverity), agr.graphic.Shader, agr.graphic.drawSize, agr.graphic.color, agr.graphic.colorTwo, agr.graphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- break;
- }
- //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Not Found. Try smaller Texture.");
- offset++;
- }
- }
-
- if (validTexture == false)
- {
- //Log.Warning(path + BreastSeverityString(BreastSeverity, offset, findBigger) + ":Texture Not Found. try smaller instead of bigger .");
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //graphic = GraphicDatabase.Get(path, ShaderDatabase.Cutout, agr.graphic.drawSize, agr.graphic.color);
- graphic = agr.graphic;
- }
-
-
- ApparelGraphicRecord _Agr = new ApparelGraphicRecord(graphic, agr.sourceApparel);
-
- //_Agr.sourceApparel.
- newAgr.Add(_Agr);
-
-
- }
- __instance.apparelGraphics = newAgr;
- comp.breastSeverityCapToDraw = minSupportedBreastSeverity;
-
- if (SizedApparelSettings.useBodyTexture == true)
- {
- //Log.Message("useBodyTexture");
- if (__instance.nakedGraphic == null || __instance.rottingGraphic == null)
- {
- __instance.ResolveAllGraphics();
- return;
- }
- string nakedGraphicPath = __instance.nakedGraphic.path;
- //Log.Message("nakedGraphicPath");
- string rottingGraphicPath = __instance.rottingGraphic.path;
- //Log.Message("rottingGraphicPath");
-
- Graphic nakedGraphic;
- Graphic rottingGraphic;
- bool validNakedTexture = false;
- bool validRottingTexture = false;
- int offset = 0;
- if (SizedApparelSettings.DontReplaceBodyTextureOnNude == true && SizedApparelUtility.isPawnNaked(__instance.pawn))
- return;
- if (comp.hasUnsupportedApparel && SizedApparelSettings.useUnsupportedBodyTexture)
- {
- //Log.Message("hasUnsupportedApparel");
- // SetBodyGraphic(__instance, true);
- if (true)
- {
- if ((ContentFinder.Get((nakedGraphicPath + "_UnsupportedApparel" + "_south"), false) != null))
- {
- nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + "_Unsupported", __instance.nakedGraphic.Shader, __instance.nakedGraphic.drawSize, __instance.nakedGraphic.color, __instance.nakedGraphic.colorTwo, __instance.nakedGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- __instance.nakedGraphic = nakedGraphic;
- }
- if ((ContentFinder.Get((rottingGraphicPath + "_UnsupportedApparel" + "_south"), false) != null))
- {
- rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + "_UnsupportedApparel", __instance.rottingGraphic.Shader, __instance.rottingGraphic.drawSize, __instance.rottingGraphic.color, __instance.rottingGraphic.colorTwo, __instance.rottingGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- __instance.rottingGraphic = rottingGraphic;
- }
-
- }
- }
- else
- {
- while (offset < SizedApparelUtility.size.Length)
- {
- string breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, true, ref currentBreastSizeIndex, ref currentBreastSeverity);
- //search bigger
- //SizedApparelSettings.matchBodyTextureToMinimumApparelSize? currentBreastSizeIndex <= minSupportedBreasSizeIndex:true
- if (validNakedTexture == false)
- {
- if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null))
- {
- if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? currentBreastSizeIndex <= minSupportedBreastSizeIndex : true)
- {
- nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, __instance.nakedGraphic.Shader, __instance.nakedGraphic.drawSize, __instance.nakedGraphic.color, __instance.nakedGraphic.colorTwo, __instance.nakedGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- __instance.nakedGraphic = nakedGraphic;
- validNakedTexture = true;
- }
- }
- }
- if (validRottingTexture == false)
- {
- if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null))
- {
- if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? currentBreastSizeIndex <= minSupportedBreastSizeIndex : true)
- {
- rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, __instance.rottingGraphic.Shader, __instance.rottingGraphic.drawSize, __instance.rottingGraphic.color, __instance.rottingGraphic.colorTwo, __instance.rottingGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- __instance.rottingGraphic = rottingGraphic;
- validRottingTexture = true;
- }
- }
- }
-
- //search smaller
-
- breastSeverityStringCache = SizedApparelUtility.BreastSeverityString(BreastSeverity, offset, false, ref currentBreastSizeIndex, ref currentBreastSeverity);
-
- if (validNakedTexture == false)
- {
- if ((ContentFinder.Get((nakedGraphicPath + breastSeverityStringCache + "_south"), false) != null))
- {
- if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? currentBreastSizeIndex <= minSupportedBreastSizeIndex : true)
- {
- nakedGraphic = GraphicDatabase.Get(nakedGraphicPath + breastSeverityStringCache, __instance.nakedGraphic.Shader, __instance.nakedGraphic.drawSize, __instance.nakedGraphic.color, __instance.nakedGraphic.colorTwo, __instance.nakedGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- __instance.nakedGraphic = nakedGraphic;
- validNakedTexture = true;
- }
- }
- }
- if (validRottingTexture == false)
- {
- if ((ContentFinder.Get((rottingGraphicPath + breastSeverityStringCache + "_south"), false) != null))
- {
- if (SizedApparelSettings.matchBodyTextureToMinimumApparelSize ? currentBreastSizeIndex <= minSupportedBreastSizeIndex : true)
- {
- rottingGraphic = GraphicDatabase.Get(rottingGraphicPath + breastSeverityStringCache, __instance.rottingGraphic.Shader, __instance.rottingGraphic.drawSize, __instance.rottingGraphic.color, __instance.rottingGraphic.colorTwo, __instance.rottingGraphic.data);
- //newAgr.Add(new ApparelGraphicRecord(graphic, agr.sourceApparel));
- //validTexture = true;
- //Log.Message(path + BreastSeverityString(BreastSeverity, offset, !findBigger) + ":Texture Found");
- __instance.rottingGraphic = rottingGraphic;
- validRottingTexture = true;
- }
- }
- }
-
- if (validNakedTexture == true && validRottingTexture == true)
- break;
-
- offset++;
- }
- }
-
-
-
- }
- }
- //SetBodyGraphic(__instance, comp.hasUnsupportedApparel);
- }
-
-
- }
-
- return;
- }
-
- /*
- static void Prefix(ref PawnGraphicSet __instance)
- {
- if (!UnityData.IsInMainThread)
- return;
- if (__instance.pawn == null)
- return;
- var comp = __instance.pawn.TryGetComp();
- if (comp == null)
- return;
- comp.ClearAll();
- comp.Update();
- }*/
-
- static void oldPostfix(ref PawnGraphicSet __instance)
- {
- if (!UnityData.IsInMainThread)
- return;
- if (false&&SizedApparelSettings.useBodyTexture)//TODO
- {
- BodyPatch.SetBodyGraphic(__instance.pawn);
- }
- }
-
- }
-
@@ -1198,10 +614,10 @@ class GeneratePawnPatch
{
public static void Prefix(CompRottable __instance)
{
- var comp = __instance.parent.TryGetComp();
+ var comp = __instance.parent.GetComp();
if (comp == null)
return;
- comp.SetDirty();
+ comp.SetDirty(false,false,false); // should clear graphicSet....?
}
}
@@ -1211,7 +627,7 @@ class GeneratePawnPatch
{
public static void Postfix(Pawn_AgeTracker __instance, Pawn ___pawn)
{
- var comp = ___pawn.TryGetComp();
+ var comp = ___pawn.GetComp();
if (comp == null)
return;
comp.CheckAgeChanged();
@@ -1267,24 +683,27 @@ class GeneratePawnPatch
}
}
//RimWorld 1.3
+ //WIPWIPWIP TODO
[HarmonyPatch(typeof(PawnRenderer), "BaseHeadOffsetAt")]
public class BaseHeadOffsetAtPatch
{
public static void Postfix(ref PawnRenderer __instance, Pawn ___pawn, Rot4 rotation, ref Vector3 __result)
{
- ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp();
+ ApparelRecorderComp apparelRecorder = ___pawn.GetComp();
if (apparelRecorder == null)
return;
if (apparelRecorder.customPose != null)
{
- var item = apparelRecorder.currentCustomPose.headOffset.FirstOrDefault(b => b.bodyType == ___pawn.story.bodyType.label);
- __result += item.offsets.GetOffset(rotation);
+ //var item = apparelRecorder.currentCustomPose.headOffset.FirstOrDefault(b => b.bodyType == ___pawn.story.bodyType.label);
+ //__result += item.offsets.GetOffset(rotation);
}
}
}
- //RimWorld 1.3
- [HarmonyPatch(typeof(PawnRenderer), "DrawPawnBody")]
+
+
+ //RimWorld 1.3 Only. Not 1.4
+ [HarmonyPatch(typeof(PawnRenderer), "DrawPawnBody")]
public class DrawPawnBodyPatch
{
static MethodInfo overrideMatMethod = AccessTools.Method(typeof(PawnRenderer), "OverrideMaterialIfNeeded");
@@ -1296,7 +715,7 @@ class GeneratePawnPatch
return;
if (___pawn == null)
return;
- ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp();
+ ApparelRecorderComp apparelRecorder = ___pawn.GetComp();
if (apparelRecorder == null)
return;
//!flags.FlagSet(PawnRenderFlags.StylingStation)&&
@@ -1313,10 +732,10 @@ class GeneratePawnPatch
{
//apparelRecorder.isDirty is allways true
- if (false)//StylingStation Doesn't work with cache! patch in postfix
+ if (true)//StylingStation Doesn't work with cache! patch in postfix
{
- apparelRecorder.Update(true, true, true, flags.FlagSet(PawnRenderFlags.Clothes));
- //Log.Message(" [Sized Apparel]StylingStation:: isDirty? : " + apparelRecorder.isDirty);
+ if(apparelRecorder.recentClothFlag != flags.FlagSet(PawnRenderFlags.Clothes))
+ apparelRecorder.Update(true, true, true, flags.FlagSet(PawnRenderFlags.Clothes));
if(flags.FlagSet(PawnRenderFlags.Clothes))
SizedApparelUtility.UpdateAllApparel(___pawn, true);
}
@@ -1341,6 +760,8 @@ class GeneratePawnPatch
//SizedApparelUtility.UpdateAllApparel(___pawn, true);
}
}
+ return;
+ //don't change body graphic file. it will inject material in PawnGraphicSet.MatsBodyBaseAt
if (SizedApparelSettings.drawBodyParts)
BodyPatch.SetBodyGraphic(___pawn, flags.FlagSet(PawnRenderFlags.Clothes), false);
else
@@ -1351,7 +772,7 @@ class GeneratePawnPatch
{
if (___pawn == null)
return;
- ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp();
+ ApparelRecorderComp apparelRecorder = ___pawn.GetComp();
if (apparelRecorder == null)
return;
Quaternion quaternion = Quaternion.AngleAxis(angle, Vector3.up);
@@ -1364,6 +785,7 @@ class GeneratePawnPatch
string defName = __instance.graphics.pawn.def.defName;
+ /*
Shader shader = ___pawn.Drawer.renderer.graphics.nakedGraphic.Shader;
Color skinColor = Color.white;
Color skinColor2 = Color.white;
@@ -1381,8 +803,19 @@ class GeneratePawnPatch
if (!ShaderUtility.SupportsMaskTex(shader))
shader = ShaderDatabase.CutoutSkinOverlay;
skinColor = ___pawn.Drawer.renderer.graphics.rottingGraphic.Color;
- skinColor2 = ___pawn.Drawer.renderer.graphics.nakedGraphic.ColorTwo;
- }
+ skinColor2 = ___pawn.Drawer.renderer.graphics.rottingGraphic.ColorTwo;
+ }*/
+
+ /*
+ //FurCoveredColor
+ if(bodyDrawType == RotDrawMode.Fresh && __instance.graphics.furCoveredGraphic != null)
+ {
+ shader = ___pawn.Drawer.renderer.graphics.furCoveredGraphic.Shader;
+ if (!ShaderUtility.SupportsMaskTex(shader))
+ shader = ShaderDatabase.CutoutSkinOverlay;
+ skinColor = ___pawn.Drawer.renderer.graphics.furCoveredGraphic.Color;
+ skinColor2 = ___pawn.Drawer.renderer.graphics.furCoveredGraphic.ColorTwo;
+ }*/
@@ -1393,289 +826,88 @@ class GeneratePawnPatch
}
//breasts are only rendered when all of worn apparels are supported or nude.
- if (apparelRecorder.isDrawAge && (!flags.FlagSet(PawnRenderFlags.Clothes) || !apparelRecorder.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(___pawn))) //TODO : Move it to CanDraw
+
+ if (true)//__instance.graphics.furCoveredGraphic == null
{
- if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawVagina && SizedApparelUtility.CanDrawVagina(___pawn, flags))
- {
- if(apparelRecorder.bodyPartVagina != null)
- apparelRecorder.bodyPartVagina.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
- /*
- //Draw Vagina. AllwaysDraw
- Vector3 vector = rootLoc;
- if (facing == Rot4.North)
- vector.y += 0.0100f;//not sure what to do
- else
- vector.y += 0.0088f;
- Graphic graphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- graphic = apparelRecorder.graphicVagina_horny;
- if (graphic == null)
- graphic = apparelRecorder.graphicVagina;
- if (graphic != null)
- {
- Material mat;
- if (!flags.FlagSet(PawnRenderFlags.Cache))
- {
- graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2);
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
- }
- graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2);
- vector.y += 0.00001f;
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow));
- }*/
- }
- if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawAnus && SizedApparelUtility.CanDrawAnus(___pawn, flags))
- {
- if (apparelRecorder.bodyPartAnus != null)
- apparelRecorder.bodyPartAnus.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
- /*
- //Draw Anus. //Allways draw
- Vector3 vector = rootLoc;
- if (facing == Rot4.North)
- vector.y += 0.0105f;//not sure what to do
- else
- vector.y += 0.0093f;
- Graphic graphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- graphic = apparelRecorder.graphicAnus_horny;
- if (graphic == null)
- graphic = apparelRecorder.graphicAnus;
- if (graphic != null)
- {
- Material mat;
- if (!flags.FlagSet(PawnRenderFlags.Cache))
- {
- graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2);
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
- }
- graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2);
- vector.y += 0.00001f;
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow));
- }*/
- }
-
- if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawBelly && SizedApparelUtility.CanDrawBelly(___pawn, flags))
- {
- if (apparelRecorder.bodyPartBelly != null)
- apparelRecorder.bodyPartBelly.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
- /*
- //Draw Belly. Need Complex Hiding Calculation
- Vector3 vector = rootLoc;
- if (facing == Rot4.North)
- vector.y += 0.0002f;//not sure what to do
- else
- vector.y += 0.0098f;
- Graphic graphic = apparelRecorder.graphicBelly;
- if (graphic != null)
- {
- Material mat;
- if (!flags.FlagSet(PawnRenderFlags.Cache))
- {
- graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2);
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
- }
- graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2);
- vector.y += 0.00001f;
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow));
- }*/
- }
-
- if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawUdder && SizedApparelUtility.CanDrawUdder(___pawn, flags))
- {
- if (apparelRecorder.bodyPartUdder != null)
- apparelRecorder.bodyPartUdder.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
- //Draw Udder. Need Complex Hiding Calculation ->
- /*
- Vector3 vector = rootLoc;
- if (facing == Rot4.North)
- vector.y += 0.0015f;//not sure what to do
- else
- vector.y += 0.0088f;
- Graphic graphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- graphic = apparelRecorder.graphicUdder_horny;
- if (graphic == null)
- graphic = apparelRecorder.graphicUdder;
- if (graphic != null)
- {
- Material mat;
- if (!flags.FlagSet(PawnRenderFlags.Cache))
- {
- graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2);
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
- }
- graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2);
- vector.y += 0.00001f;
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow));
- }*/
- }
- if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawBreasts && SizedApparelUtility.CanDrawBreasts(___pawn, flags) && (SizedApparelSettings.drawSizedApparelBreastsOnlyWorn ? !SizedApparelUtility.isPawnNaked(___pawn, flags) : true))
- {
- if (apparelRecorder.bodyPartBreasts != null)
- apparelRecorder.bodyPartBreasts.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
-
- //Log.Message("DrawBreasts for " + ___pawn.Name);
- //if (SizedApparelSettings.Debug)
- // Log.Message("trying to draw breasts");
- //Draw Breasts. Allways draw
-
- /*
- Vector3 vector = rootLoc;
- if (facing == Rot4.North)
- vector.y += 0.001f;//not sure what to do
- else
- vector.y += 0.0113f;
- Graphic graphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- graphic = apparelRecorder.graphicBreasts_horny;
- if (graphic == null)
- graphic = apparelRecorder.graphicBreasts;
-
-
-
- if (graphic != null)
- {
- Material mat;
- if (!flags.FlagSet(PawnRenderFlags.Cache))
- {
- graphic = graphic.GetColoredVersion(graphic.Shader, skinColor, skinColor2);
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
- }
- graphic = graphic.GetColoredVersion(shader, skinColor, skinColor2);
- vector.y += 0.00001f;
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? graphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { graphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow));
- }
- else
- {
- //Log.Warning("[SizedApparel] Missing Breasts Graphic for: " + ___pawn.Name);
-
- }
- */
-
- }
-
- if (bodyDrawType != RotDrawMode.Dessicated && SizedApparelSettings.drawPenis && SizedApparelUtility.CanDrawPenis(___pawn, flags, true))
- {
- foreach(SizedApparelBodyPart b in apparelRecorder.bodyPartBalls)
- {
- b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
- }
- foreach (SizedApparelBodyPart b in apparelRecorder.bodyPartPenises)
- {
- b.DrawBodyPart(rootLoc, angle, facing, bodyDrawType, flags, bodyMesh);
- }
- /*
- //Render Penis And Balls
- Vector3 vector = rootLoc;
- if (facing == Rot4.North)
- vector.y += 0.0025f;
- else
- vector.y += 0.0108f;
-
- float offsetX = 0; // right and left
- float offsetZ = 0; // up and down
-
- if(apparelRecorder.graphicPenises != null && apparelRecorder.graphicBallsOfPenises != null)
- {
- for (int i = 0; i < apparelRecorder.graphicPenises.Count; i++)
- {
- float t = (i + 1f) / (apparelRecorder.graphicPenises.Count + 1);
- offsetX = Mathf.Lerp(-0.1f, 0.1f, t);
- offsetZ = Mathf.Lerp(-0.05f, 0.05f, t);
-
- Graphic penisGraphic = null;
- Graphic ballGraphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- {
- penisGraphic = apparelRecorder.graphicPenises_horny[i];
- }
- if (penisGraphic == null)
- penisGraphic = apparelRecorder.graphicPenises[i];
- ballGraphic = apparelRecorder.graphicBallsOfPenises[i];//Balls Doesn't support HornyVariation
- if (ballGraphic != null && (SizedApparelSettings.hideBallOfFuta ? Genital_Helper.is_futa(___pawn) : true))
- {
- Material mat;
- //TODO: vector2.y
- Vector3 vector2 = vector;
- if (facing == Rot4.North)
- vector2.y += 0.0060f;
- else
- vector2.y -= 0.0012f;
- if (facing == Rot4.North || facing == Rot4.South)
- vector2.x += offsetX;
- else
- vector2.x += offsetX * 0.5f;
-
- if (facing == Rot4.East)
- vector2.z += offsetZ;
- if (facing == Rot4.West)
- vector2.z -= offsetZ;
-
- if (!flags.FlagSet(PawnRenderFlags.Cache))
- {
- ballGraphic = ballGraphic.GetColoredVersion(ballGraphic.Shader, skinColor, skinColor2);
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? ballGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { ballGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
- }
- ballGraphic = ballGraphic.GetColoredVersion(shader, skinColor, skinColor2);
- vector2.y += 0.00001f;
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? ballGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { ballGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow));
- }
- if (penisGraphic != null)
- {
- Material mat;
- Vector3 vector2 = vector;
- if (facing == Rot4.North || facing == Rot4.South)
- vector2.x += offsetX;
- else
- vector2.x += offsetX * 0.5f;
-
- if (facing == Rot4.East)
- vector2.z += offsetZ;
- if (facing == Rot4.West)
- vector2.z -= offsetZ;
-
- if (!flags.FlagSet(PawnRenderFlags.Cache))
- {
- penisGraphic = penisGraphic.GetColoredVersion(penisGraphic.Shader, skinColor, skinColor2);
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? penisGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { penisGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow)); // draw for writeZ data to solve shadow issue
- }
- penisGraphic = penisGraphic.GetColoredVersion(shader, skinColor, skinColor2);
- //TODO: vector2.y
- vector2.y += 0.00001f;
- mat = flags.FlagSet(PawnRenderFlags.Cache) ? penisGraphic.MatAt(facing) : (Material)overrideMatMethod.Invoke(__instance, new object[] { penisGraphic.MatAt(facing), ___pawn, flags.FlagSet(PawnRenderFlags.Portrait) });
- GenDraw.DrawMeshNowOrLater(bodyMesh, vector2, quaternion, mat, flags.FlagSet(PawnRenderFlags.DrawNow));
- }
- }
- }*/
-
- }//Draw BodyParts
-
- //Draw Modular Apparel Parts
- if (flags.FlagSet(PawnRenderFlags.Clothes))
- {
-
- }
-
-
-
+ apparelRecorder.UpdateTickAnim(rootLoc, angle);
+ apparelRecorder.DrawAllBodyParts(rootLoc, angle, facing, bodyDrawType, flags, ___pawn, bodyMesh);
}
-
+ //else. the DrawPawnFur will draw bodyparts becaust it should be upper
}
}
+
+
+ //Base Body Graphic Injection
+ [HarmonyPatch(typeof(PawnGraphicSet), "MatsBodyBaseAt")]
+ public class MatsBodyBastAtPatch
+ {
+ public static void Postfix(ref List __result, PawnGraphicSet __instance, Rot4 facing, RotDrawMode bodyCondition, bool drawClothes)
+ {
+ if (!SizedApparelSettings.useBodyTexture)
+ return;
+
+ if (__result.NullOrEmpty())
+ return;
+
+ if (!SizedApparelUtility.CanApplySizedApparel(__instance.pawn))
+ return;
+
+ var comp = __instance.pawn.GetComp();
+ if (comp == null) // maybe it can be null? but why...? mechanoids?
+ return;
+
+ if (drawClothes)
+ {
+ if (comp.hasUnsupportedApparel)
+ return;
+ }
+
+ Material bodyMat = null;
+ Material sizedApparelBaseBodyMat = null;
+ switch (bodyCondition)
+ {
+ case RotDrawMode.Fresh:
+ if(__instance.nakedGraphic != null && comp.graphicbaseBodyNaked != null)
+ {
+ bodyMat = __instance.nakedGraphic.MatAt(facing, null);
+ sizedApparelBaseBodyMat = comp.graphicbaseBodyNaked.MatAt(facing, null);
+ }
+ break;
+ case RotDrawMode.Rotting:
+ if (__instance.rottingGraphic != null && comp.graphicbaseBodyRotten != null)
+ {
+ bodyMat = __instance.rottingGraphic.MatAt(facing, null);
+ sizedApparelBaseBodyMat = comp.graphicbaseBodyRotten.MatAt(facing, null);
+ }
+ break;
+ case RotDrawMode.Dessicated:
+ return;// //don't inject for Dessicated graphic. it doesn't need to patch for this
+ break;
+ default:
+ bodyMat = null;
+ sizedApparelBaseBodyMat = null;
+ break;
+ }
+
+ if (sizedApparelBaseBodyMat == null)
+ return;
+
+ //the body mat would be in first index but not sure. so search from start
+ for (int i = 0; i < __result.Count; i++)
+ {
+ if(__result[i] == bodyMat)
+ {
+ __result[i] = sizedApparelBaseBodyMat;
+ //should inject body part graphics here?
+ break;
+ }
+ }
+ //should do something more? such as add body parts or somthing?
+ }
+ }
+
+
//TODO
[HarmonyPatch(typeof(PawnRenderer), "BaseHeadOffsetAt")]
public class HeadOffsetPatch
@@ -1683,7 +915,7 @@ class GeneratePawnPatch
public static void Postfix(PawnRenderer __instance, Pawn ___pawn, Rot4 rotation, ref Vector3 __result)
{
- var comp = ___pawn.TryGetComp();
+ var comp = ___pawn.GetComp();
if (comp == null)
return;
}
@@ -1692,355 +924,6 @@ class GeneratePawnPatch
- [Obsolete]
- public class DrawPawnPatch
- {
- public static void TryDrawBodyPart(ref PawnRenderer __instance,Graphic graphic,Graphic hornyGraphic, Vector3 rootLoc, Vector3 drawOffset, float angle, bool renderBody, Rot4 bodyFacing, Rot4 headFacing, RotDrawMode bodyDrawType, bool portrait, bool headStump, bool invisible)
- {
-
- }
-
-
-
- public static void RenderPawnInternalPrefix(ref PawnRenderer __instance, Vector3 rootLoc, float angle, bool renderBody, Rot4 bodyFacing, Rot4 headFacing, RotDrawMode bodyDrawType, bool portrait, bool headStump, bool invisible, Pawn ___pawn)
- {
- if (!__instance.graphics.AllResolved)
- {
- __instance.graphics.ResolveAllGraphics();
- }
-
- if (!SizedApparelSettings.drawBodyParts)
- return;
- if (___pawn == null)
- return;
- ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp();
- if (apparelRecorder == null)
- return;
- if (!apparelRecorder.hasUpdateBefore || apparelRecorder.isDirty)
- {
- if (SizedApparelSettings.Debug)
- Log.Message("[SizedApparel] trying to draw " + ___pawn.Name + " with unupdated component! Updating it.");
- apparelRecorder.Update(true,false);
- SizedApparelUtility.UpdateAllApparel(___pawn);
- }
- if (apparelRecorder.needToCheckApparelGraphicRecords)
- {
- if(apparelRecorder.isApparelGraphicRecordChanged())
- {
- //apparelRecorder.Update(true, true); //1.3
- //SizedApparelUtility.UpdateAllApparel(___pawn, true);
- }
-
- }
- if (renderBody)
- {
- BodyPatch.SetBodyGraphic(___pawn,true, false);
- }
- }
-
- //Draw Private parts
- public static void RenderPawnInternalPostfix(ref PawnRenderer __instance, Vector3 rootLoc, float angle, bool renderBody, Rot4 bodyFacing, Rot4 headFacing, RotDrawMode bodyDrawType, bool portrait, bool headStump, bool invisible, Pawn ___pawn)
- {
-
-
- if (___pawn == null)
- return;
- ApparelRecorderComp apparelRecorder = ___pawn.TryGetComp();
- if (apparelRecorder == null)
- return;
- Quaternion quaternion = Quaternion.AngleAxis(angle, Vector3.up);
- Mesh mesh = null;
-
- if (!SizedApparelSettings.drawBodyParts)
- {
- /*
- if (SizedApparelPatch.rimNudeWorldActive && SizedApparelSettings.drawSizedApparelBreastsOnlyWorn && !SizedApparelUtility.isPawnNaked(___pawn))
- {
- //TODO
-
- if (__instance.graphics == null)
- return;
- if (bodyDrawType == RotDrawMode.Dessicated) //don't draw on skeletone
- return;
-
- if (___pawn.RaceProps.Humanlike)//this.pawn.RaceProps.Humanlike
- {
- mesh = MeshPool.humanlikeBodySet.MeshAt(bodyFacing);
- }
- else
- {
- mesh = __instance.graphics.nakedGraphic.MeshAt(bodyFacing);
- }
- string defName = __instance.graphics.pawn.def.defName;
-
-
- Vector3 loc = rootLoc;
- loc.y += 0.009183673f;
-
- Vector3 vector = rootLoc;
- if (bodyFacing == Rot4.North)
- vector.y += 0.001f;//not sure what to do
- else
- vector.y += 0.012f;
- Graphic graphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- graphic = apparelRecorder.graphicBreasts_horny;
- if (graphic == null)
- graphic = apparelRecorder.graphicBreasts;
- if (graphic != null)
- {
- Material breastMat = graphic.MatAt(bodyFacing, null);
- Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(breastMat) : breastMat;
- breastMat = __instance.graphics.flasher.GetDamagedMat(baseMat);
- GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, breastMat, portrait);
- }
- }
- */
- return;
-
- }
-
- if (renderBody)
- {
- if (__instance.graphics == null)
- return;
- if (bodyDrawType == RotDrawMode.Dessicated) //don't draw on skeletone
- return;
-
- if (___pawn.RaceProps.Humanlike)//this.pawn.RaceProps.Humanlike
- {
- mesh = MeshPool.humanlikeBodySet.MeshAt(bodyFacing);
- }
- else
- {
- mesh = __instance.graphics.nakedGraphic.MeshAt(bodyFacing);
- }
- string defName = __instance.graphics.pawn.def.defName;
-
-
- Vector3 loc = rootLoc;
- loc.y += 0.009183673f;
-
-
- //breasts are only rendered when all of worn apparels are supported or nude.
- if (!apparelRecorder.hasUnsupportedApparel || SizedApparelUtility.isPawnNaked(___pawn)) //TODO : Move it to CanDraw
- {
- //string bodyPartPath = "SizedApparel/BodyParts";
- //string breastsPath;
-
- //Hediff breastHediff = apparelRecorder.breastHediff;
-
- //float breastHediffSeverityCap = apparelRecorder.breastSeverityCapToDraw;
- //string breastName = breastHediff.def.defName;//Todo
- //breastsPath = "SizedApparel/BodyParts/Breasts/Human/testBodyPart_Female";
- /*
- if ((ContentFinder.Get((breastsPath + "_south"), false) != null))
- {
- Vector3 vector = rootLoc;
- if (bodyFacing == Rot4.North)
- vector = vector;
- else
- vector.y += 0.0092f;
- Graphic bodyPartGraphic = GraphicDatabase.Get(breastsPath, ShaderDatabase.Cutout);
- Material bodyPartMat = bodyPartGraphic.MatAt(bodyFacing, null);
- //bodyPartMat = __instance.OverrideMaterialIfNeeded_NewTemp(bodyPartMat, __instance.pawn, portrait);//private function and values //for damage mat or somthing more
- Material baseMat = (!portrait && pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(bodyPartMat) : bodyPartMat;
- bodyPartMat = __instance.graphics.flasher.GetDamagedMat(baseMat);
- GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, bodyPartMat, portrait);
- }
- else
- {
- if (SizedApparelSettings.Debug)
- Log.Warning("[Sized Apparel] Missing Breast Tesxture: " + breastsPath);
- //breastName = "Breasts";
- }
- */
- if(SizedApparelSettings.drawBreasts && (SizedApparelSettings.drawSizedApparelBreastsOnlyWorn ? !SizedApparelUtility.isPawnNaked(___pawn): true))
- {
- //Log.Message("DrawBreasts for " + ___pawn.Name);
- //if (SizedApparelSettings.Debug)
- // Log.Message("trying to draw breasts");
- //Draw Breasts. Allways draw
- Vector3 vector = rootLoc;
- if (bodyFacing == Rot4.North)
- vector.y += 0.001f;//not sure what to do
- else
- vector.y += 0.012f;
- Graphic graphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- graphic = apparelRecorder.graphicBreasts_horny;
- if(graphic == null)
- graphic = apparelRecorder.graphicBreasts;
-
- /*
- if(graphic == null)
- {
- apparelRecorder.Update();
- if (SizedApparelUtility.IsHorny(___pawn))
- graphic = apparelRecorder.graphicBreasts_horny;
- if (graphic == null)
- graphic = apparelRecorder.graphicBreasts;
- }*/
-
-
- if (graphic != null)
- {
- Material mat = graphic.MatAt(bodyFacing, null);
- Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat;
- mat = __instance.graphics.flasher.GetDamagedMat(baseMat);
- GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, mat, portrait);
- }
- else
- {
- //Log.Warning("[SizedApparel] Missing Breasts Graphic for: " + ___pawn.Name);
-
- }
-
-
- }
- if(SizedApparelSettings.drawVagina && SizedApparelUtility.CanDrawVagina(___pawn))
- {
- //Draw Vagina. AllwaysDraw
- Vector3 vector = rootLoc;
- if (bodyFacing == Rot4.North)
- vector.y += 0.0100f;//not sure what to do
- else
- vector.y += 0.0100f;
- Graphic graphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- graphic = apparelRecorder.graphicVagina_horny;
- if (graphic == null)
- graphic = apparelRecorder.graphicVagina;
- if (graphic != null)
- {
- Material mat = graphic.MatAt(bodyFacing, null);
- Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat;
- mat = __instance.graphics.flasher.GetDamagedMat(baseMat);
- GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, mat, portrait);
- }
- }
- if(SizedApparelSettings.drawAnus && SizedApparelUtility.CanDrawAnus(___pawn))
- {
- //Draw Anus. //Allways draw
- Vector3 vector = rootLoc;
- if (bodyFacing == Rot4.North)
- vector.y += 0.0105f;//not sure what to do
- else
- vector.y += 0.010f;
- Graphic graphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- graphic = apparelRecorder.graphicAnus_horny;
- if (graphic == null)
- graphic = apparelRecorder.graphicAnus;
- if (graphic != null)
- {
- Material mat = graphic.MatAt(bodyFacing, null);
- Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat;
- mat = __instance.graphics.flasher.GetDamagedMat(baseMat);
- GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, mat, portrait);
- }
- }
- if (SizedApparelSettings.drawUdder && SizedApparelUtility.CanDrawUdder(___pawn))
- {
- //Draw Udder. Need Complex Hiding Calculation ->
- Vector3 vector = rootLoc;
- if (bodyFacing == Rot4.North)
- vector.y += 0.0015f;//not sure what to do
- else
- vector.y += 0.0095f;
- Graphic graphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- graphic = apparelRecorder.graphicUdder_horny;
- if (graphic == null)
- graphic = apparelRecorder.graphicUdder;
- if (graphic != null)
- {
- Material mat = graphic.MatAt(bodyFacing, null);
- Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat;
- mat = __instance.graphics.flasher.GetDamagedMat(baseMat);
- GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, mat, portrait);
- }
- }
- if(SizedApparelSettings.drawBelly && SizedApparelUtility.CanDrawBelly(___pawn))
- {
- //Draw Belly. Need Complex Hiding Calculation
- Vector3 vector = rootLoc;
- if (bodyFacing == Rot4.North)
- vector.y += 0.0002f;//not sure what to do
- else
- vector.y += 0.0105f;
- Graphic graphic = apparelRecorder.graphicBelly;
- if (graphic != null)
- {
- Material mat = graphic.MatAt(bodyFacing, null);
- Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat;
- mat = __instance.graphics.flasher.GetDamagedMat(baseMat);
- GenDraw.DrawMeshNowOrLater(mesh, vector, quaternion, mat, portrait);
- }
- }
-
- //Rimworld 1.2 doesn't have PawnRenderFlags!
- if (SizedApparelSettings.drawPenis && SizedApparelUtility.CanDrawPenis(___pawn,PawnRenderFlags.None, false))
- {
- //Render Penis And Balls
- Vector3 vector = rootLoc;
- if (bodyFacing == Rot4.North)
- vector.y += 0.0025f;
- else
- vector.y += 0.015f;
-
- float offsetX = 0;
-
- for (int i = 0; i < apparelRecorder.graphicPenises.Count; i++)
- {
- float t = (i + 1f) / (apparelRecorder.graphicPenises.Count + 1);
- offsetX = Mathf.Lerp(-0.1f, 0.1f, t);
-
-
- Graphic penisGraphic = null;
- Graphic ballGraphic = null;
- if (SizedApparelUtility.IsHorny(___pawn))
- {
- penisGraphic = apparelRecorder.graphicPenises_horny[i];
- }
- if (penisGraphic == null)
- penisGraphic = apparelRecorder.graphicPenises[i];
- ballGraphic = apparelRecorder.graphicBallsOfPenises[i];//Balls Doesn't support HornyVariation
- if (penisGraphic != null)
- {
- //TODO: vector2.y
- Vector3 vector2 = vector;
- vector2.x += offsetX;
- Material mat = penisGraphic.MatAt(bodyFacing, null);
- Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat;
- mat = __instance.graphics.flasher.GetDamagedMat(baseMat);
- GenDraw.DrawMeshNowOrLater(mesh, vector2, quaternion, mat, portrait);
- }
- if (SizedApparelSettings.hideBallOfFuta)
- if (Genital_Helper.is_futa(___pawn))
- continue;//skip rendering ball
- if (ballGraphic != null)
- {
- //TODO: vector2.y
- Vector3 vector2 = vector;
- if (bodyFacing == Rot4.North)
- vector2.y += 0.0080f;
- else
- vector2.y -= 0.002f;
- vector2.x += offsetX;
- Material mat = ballGraphic.MatAt(bodyFacing, null);
- Material baseMat = (!portrait && ___pawn.IsInvisible()) ? InvisibilityMatPool.GetInvisibleMat(mat) : mat;
- mat = __instance.graphics.flasher.GetDamagedMat(baseMat);
- GenDraw.DrawMeshNowOrLater(mesh, vector2, quaternion, mat, portrait);
- }
- }
- }
-
- }
-
- }
- }
- }
}
diff --git a/1.3/source/SizedApparel/SizedApparelPoseSet.cs b/1.3/source/SizedApparel/SizedApparelPoseSet.cs
index ff7eb81..4356695 100644
--- a/1.3/source/SizedApparel/SizedApparelPoseSet.cs
+++ b/1.3/source/SizedApparel/SizedApparelPoseSet.cs
@@ -26,7 +26,7 @@ namespace SizedApparel
return;
/*
- var comp = ___pawn.TryGetComp();
+ var comp = ___pawn.GetComp();
if (comp == null)
return;
@@ -72,12 +72,17 @@ namespace SizedApparel
}
+ public class PoseDef : Def
+ {
+
+ }
+
public class SizedApparelPose
{
//public string poseName; use defName as PoseName
public SizedApparelBodyPartOf targetBodyPart = SizedApparelBodyPartOf.Torso;
- public List