Skip to content

Commit

Permalink
CASP new version, tags update, body types update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarNYC committed Jan 14, 2017
1 parent 79868c3 commit 25d0d5f
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 52 deletions.
22 changes: 21 additions & 1 deletion s4pi Wrappers/CASPartResource/CASPFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,20 @@ public enum BodyType : uint
MoleLeftCheek = 0x37,
MoleRightCheek = 0x38,
MouthCrease = 0x39,
SkinOverlay = 0x3A
SkinOverlay = 0x3A,
OccultBrow = 0x40,
OccultEyeSocket = 0x41,
OccultEyeLid = 0x42,
OccultMouth = 0x43,
OccultLeftCheek = 0x44,
OccultRightCheek = 0x45,
OccultNeckScar = 0x46
}

[Flags]
public enum OccultTypesDisabled : uint
{
Vampire = 1 << 2,
Alien = 1 << 1,
Human = 1
}
Expand Down Expand Up @@ -196,6 +204,18 @@ public enum ExcludePartFlag : ulong
BODYTYPE_SKINOVERLAY = 1ul << 58
}

[Flags]
public enum ExcludePartFlag2 : ulong
{
BODYTYPE_OCCULT_BROW = 1,
BODYTYPE_OCCULT_EYE_SOCKET = 1ul << 1,
BODYTYPE_OCCULT_EYE_LID = 1ul << 2,
BODYTYPE_OCCULT_MOUTH = 1ul << 3,
BODYTYPE_OCCULT_LEFT_CHEEK = 1ul << 4,
BODYTYPE_OCCULT_RIGHT_CHEEK = 1ul << 5,
BODYTYPE_OCCULT_NECK_SCAR = 1ul << 6
}

[Flags]
public enum CASPanelGroupType : uint
{
Expand Down
54 changes: 40 additions & 14 deletions s4pi Wrappers/CASPartResource/CASPartResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public override int RecommendedApiVersion
private ParmFlag parmFlags;
private ParmFlag2 parmFlags2;
private ExcludePartFlag excludePartFlags;
private ExcludePartFlag2 excludePartFlags2; // cmar - added v 0x29
private ulong excludeModifierRegionFlags; // cmar - changed from uint to ulong with V 0x25
private ulong unknown1; // cmar - added v 0x29
private FlagList flagList; // property 16-bit tag / 32-bit value pairs
private uint deprecatedPrice; // deprecated
private uint partTitleKey;
Expand Down Expand Up @@ -98,6 +98,7 @@ public override int RecommendedApiVersion
private byte specularMapKey;
private uint sharedUVMapSpace;
private byte emissionMapKey; // cmar - added V 0x1E
private byte reservedByte; // added V 0x3333333333322A
private CountedTGIBlockList tgiList;

#endregion
Expand Down Expand Up @@ -136,9 +137,9 @@ private void Parse(Stream s)
this.parmFlags = (ParmFlag)r.ReadByte();
if (this.version >= 39) parmFlags2 = (ParmFlag2)r.ReadByte();
this.excludePartFlags = (ExcludePartFlag)r.ReadUInt64();
if (this.version >= 41) this.excludePartFlags2 = (ExcludePartFlag2)r.ReadUInt64();
if (this.version >= 36) this.excludeModifierRegionFlags = r.ReadUInt64();
else this.excludeModifierRegionFlags = r.ReadUInt32();
if (this.version >= 41) this.unknown1 = r.ReadUInt64();

if (this.version >= 37)
this.flagList = new FlagList(this.OnResourceChanged, s);
Expand Down Expand Up @@ -237,6 +238,10 @@ private void Parse(Stream s)
{
this.emissionMapKey = r.ReadByte();
}
if (this.version >= 42)
{
this.reservedByte = r.ReadByte();
}
}

protected override Stream UnParse()
Expand All @@ -255,6 +260,7 @@ protected override Stream UnParse()
w.Write((byte)this.parmFlags);
if (this.version >= 39) w.Write((byte)this.parmFlags2);
w.Write((ulong)this.excludePartFlags);
if (this.version >= 41) w.Write((ulong)this.excludePartFlags2);
if (this.version >= 36)
{
w.Write(this.excludeModifierRegionFlags);
Expand All @@ -263,8 +269,6 @@ protected override Stream UnParse()
{
w.Write((uint)this.excludeModifierRegionFlags);
}
if (this.version >= 41) w.Write(this.unknown1);

this.flagList = this.flagList ?? new FlagList(this.OnResourceChanged);
if (this.version >= 37)
{
Expand Down Expand Up @@ -366,6 +370,11 @@ protected override Stream UnParse()
{
w.Write(this.emissionMapKey);
}
if (this.version >= 42)
{
w.Write(this.reservedByte);
}

var tgiPosition = w.BaseStream.Position;
w.BaseStream.Position = 4;
w.Write(tgiPosition - 8);
Expand Down Expand Up @@ -531,28 +540,28 @@ public ExcludePartFlag ExcludePartFlags
}

[ElementPriority(11)]
public ulong ExcludeModifierRegionFlags
public ExcludePartFlag2 ExcludePartFlags2
{
get { return this.excludeModifierRegionFlags; }
get { return this.excludePartFlags2; }
set
{
if (!value.Equals(this.excludeModifierRegionFlags))
if (!value.Equals(this.excludePartFlags2))
{
this.excludeModifierRegionFlags = value;
this.excludePartFlags2 = value;
}
this.OnResourceChanged(this, EventArgs.Empty);
}
}

[ElementPriority(12)]
public ulong Unknown1
public ulong ExcludeModifierRegionFlags
{
get { return this.unknown1; }
get { return this.excludeModifierRegionFlags; }
set
{
if (!value.Equals(this.unknown1))
if (!value.Equals(this.excludeModifierRegionFlags))
{
this.unknown1 = value;
this.excludeModifierRegionFlags = value;
}
this.OnResourceChanged(this, EventArgs.Empty);
}
Expand Down Expand Up @@ -1093,8 +1102,21 @@ public byte EmissionMapKey
this.OnResourceChanged(this, EventArgs.Empty);
}
}

[ElementPriority(51)]
public byte ReservedByte
{
get { return this.reservedByte; }
set
{
if (!value.Equals(this.reservedByte))
{
this.reservedByte = value;
}
this.OnResourceChanged(this, EventArgs.Empty);
}
}

[ElementPriority(52)]
public CountedTGIBlockList TGIList
{
get { return this.tgiList; }
Expand Down Expand Up @@ -1160,7 +1182,11 @@ public override List<string> ContentFields
}
if (this.version < 0x29)
{
res.Remove("Unknown1");
res.Remove("ExcludePartFlags2");
}
if (this.version < 0x2A)
{
res.Remove("ReservedByte");
}
return res;
}
Expand Down
112 changes: 75 additions & 37 deletions s4pi.Resource.Commons/S4_03B33DDF_00000000_D89CB9186B79ACB7.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<T ev="111">GenderAppropriate</T>
<T ev="112">NudePart</T>
<T ev="113">FaceDetail</T>
<T ev="114">Cat_TEMP</T>
<T ev="114">VampireArchetype</T>
</L>
</C>
<C n="Tag">
Expand Down Expand Up @@ -146,6 +146,7 @@
<T ev="168">BuyCatEE_KidToy</T>
<T ev="169">BuyCatEE_Alarm</T>
<T ev="171">BuyCatEE_Clock</T>
<T ev="172">BuyCatEE_Toddlers</T>
<T ev="173">BuyCatEE_IndoorActivity</T>
<T ev="174">BuyCatEE_KidActivity</T>
<T ev="175">BuyCatEE_OutdoorActivity</T>
Expand Down Expand Up @@ -1612,14 +1613,51 @@
<T ev="1651">FaceDetail_FrecklesNose</T>
<T ev="1652">FaceDetail_TeethStraight</T>
<T ev="1653">Skill_SchoolTask</T>
<T ev="1654">Occult_RESERVED_00</T>
<T ev="1655">Buff_RESERVED_27</T>
<T ev="1656">Situation_RESERVED_28</T>
<T ev="1657">Style_RESERVED_19</T>
<T ev="1658">Style_RESERVED_17</T>
<T ev="1659">Style_RESERVED_18</T>
<T ev="1660">Style_RESERVED_21</T>
<T ev="1661">Style_RESERVED_20</T>
<T ev="1654">Func_HighChair</T>
<T ev="1655">Skill_Toddler</T>
<T ev="1656">Genre_Book_Toddler_PictureBook</T>
<T ev="1657">AgeAppropriate_Toddler</T>
<T ev="1658">Func_Toddler_Bed</T>
<T ev="1659">Food_ToddlerDislike</T>
<T ev="1660">Food_ToddlerLike</T>
<T ev="1661">Drink_Toddler</T>
<T ev="1662">Func_NestingBlocks</T>
<T ev="1663">Func_ShowerTub</T>
<T ev="1664">Func_Potty</T>
<T ev="1665">Func_ToddlerToybox</T>
<T ev="1666">Func_ToddlerBookcase</T>
<T ev="1667">Tooltip_MiscToddlerOnly</T>
<T ev="1668">Tooltip_SkillMovement</T>
<T ev="1669">Tooltip_SkillImagination</T>
<T ev="1670">Tooltip_SkillCommunication</T>
<T ev="1671">Tooltip_SkillThinking</T>
<T ev="1672">Tooltip_SkillPotty</T>
<T ev="1673">Uniform_Toddler_DiaperOnly</T>
<T ev="1674">Food_EatWithUtensil</T>
<T ev="1675">Food_EatWithToddlerSized</T>
<T ev="1676">Func_ToddlerSeating</T>
<T ev="1677">Occult_Vampire</T>
<T ev="1678">Buff_DayNightTracking</T>
<T ev="1679">Situation_NightTimeVisit</T>
<T ev="1680">Style_VampireArchetype_Nosferatu</T>
<T ev="1681">Style_VampireArchetype_Dracula</T>
<T ev="1682">Style_VampireArchetype_Modern</T>
<T ev="1683">Style_VampireArchetype_Victorian</T>
<T ev="1684">Style_VampireArchetype_Punk</T>
<T ev="1685">Func_Toddler</T>
<T ev="1686">Food_Single</T>
<T ev="1687">Food_FoodBlob_Applesauce_LightBrown</T>
<T ev="1688">Food_FoodBlob_FruitSalad_RedYellowBlue</T>
<T ev="1689">Food_FoodBlob_MacCheese_YellowSpotty</T>
<T ev="1690">Food_FoodBlob_Minestrone_ReddishBrown</T>
<T ev="1691">Food_FoodBlob_Oatmeal_LightBrownSpotty</T>
<T ev="1692">Food_FoodBlob_Yogurt_PinkWhitish</T>
<T ev="1693">Food_FoodBlob_Peas_Green</T>
<T ev="1694">Func_HighChairFood</T>
<T ev="1695">Func_HighChairDrink</T>
<T ev="1696">DuplicateAffordance_ToysPlayWith</T>
<T ev="1697">DuplicateAffordance_ToysPickUp</T>
<T ev="1698">Interaction_NestingBlocks</T>
<T ev="8194">Skill_Psychic</T>
<T ev="8195">Style_Witch</T>
<T ev="8196">Style_Pirate</T>
Expand Down Expand Up @@ -2140,34 +2178,34 @@
<T ev="55436">Situation_LivesOnStreet_B</T>
<T ev="55437">Situation_LivesOnStreet_C</T>
<T ev="55438">Situation_LivesOnStreet_D</T>
<T ev="40961">Func_RESERVED_16</T>
<T ev="40962">Func_RESERVED_29</T>
<T ev="40963">Func_RESERVED_36</T>
<T ev="40964">Style_RESERVED_23</T>
<T ev="40966">Style_RESERVED_22</T>
<T ev="40967">Style_RESERVED_25</T>
<T ev="40968">Style_RESERVED_24</T>
<T ev="40969">Skill_RESERVED_30</T>
<T ev="40970">Func_RESERVED_31</T>
<T ev="40971">Func_RESERVED_32</T>
<T ev="40972">Func_RESERVED_33</T>
<T ev="40973">Func_RESERVED_34</T>
<T ev="40974">Func_RESERVED_12</T>
<T ev="40975">Func_RESERVED_13</T>
<T ev="40976">Func_RESERVED_14</T>
<T ev="40977">Func_RESERVED_15</T>
<T ev="40978">Tooltip_RESERVED_35</T>
<T ev="40979">Func_RESERVED_11</T>
<T ev="40980">EyeColor_RESERVED_02</T>
<T ev="40981">EyeColor_RESERVED_04</T>
<T ev="40982">EyeColor_RESERVED_05</T>
<T ev="40983">EyeColor_RESERVED_06</T>
<T ev="40984">EyeColor_RESERVED_08</T>
<T ev="40985">EyeColor_RESERVED_07</T>
<T ev="40986">EyeColor_RESERVED_09</T>
<T ev="40987">EyeColor_RESERVED_10</T>
<T ev="40988">EyeColor_RESERVED_03</T>
<T ev="40989">Buff_RESERVED_01</T>
<T ev="40961">Func_VampireTome</T>
<T ev="40962">Func_Garlic</T>
<T ev="40963">Func_PipeOrgan</T>
<T ev="40964">Style_VampireWalkby_Nosferatu</T>
<T ev="40966">Style_VampireWalkby_Modern</T>
<T ev="40967">Style_VampireWalkby_Victorian</T>
<T ev="40968">Style_VampireWalkby_Punk</T>
<T ev="40969">Skill_PipeOrgan</T>
<T ev="40970">Func_Coffin</T>
<T ev="40971">Func_Garden_Garlic</T>
<T ev="40972">Func_Bait_PlasmaFruit</T>
<T ev="40973">Func_Garden_PlasmaTree</T>
<T ev="40974">Func_VampireTome_Set1</T>
<T ev="40975">Func_VampireTome_Set2</T>
<T ev="40976">Func_VampireTome_Set3</T>
<T ev="40977">Func_VampireTome_Ultimate</T>
<T ev="40978">Tooltip_SkillPipeOrgan</T>
<T ev="40979">Func_RegisteredVampireLair</T>
<T ev="40980">EyeColor_VampireBlueBlack</T>
<T ev="40981">EyeColor_VampireGreen</T>
<T ev="40982">EyeColor_VampireIceBlue</T>
<T ev="40983">EyeColor_VampirePurple</T>
<T ev="40984">EyeColor_VampireRed</T>
<T ev="40985">EyeColor_VampireRedBlack</T>
<T ev="40986">EyeColor_VampireWhite</T>
<T ev="40987">EyeColor_VampireYellow</T>
<T ev="40988">EyeColor_VampireBlack</T>
<T ev="40989">Buff_VampireSunlight</T>
<T ev="36865">Func_BarGlobe</T>
<T ev="36866">Func_VanityTable</T>
<T ev="36867">Situation_Butler</T>
Expand Down

0 comments on commit 25d0d5f

Please sign in to comment.