@@ DAZCharacterSelector.cs - ResetClothing() @@
@@ DAZCharacterSelector.cs - ResetHair() @@
@@ DAZCharacterSelector.cs - SetActiveClothingItem() / SetActiveHairItem() @@
--- a/DAZCharacterSelector.cs
+++ b/DAZCharacterSelector.cs
@@ -3150,11 +3150,11 @@ public class DAZCharacterSelector : JSONStorable
{
if (clearAll)
{
- SetActiveClothingItem(dAZClothingItem, active: false, fromRestore: false, skipSyncAnatomy: true);
+ SetActiveClothingItemNoSync(dAZClothingItem, active: false, fromRestore: false);
}
else
{
- SetActiveClothingItem(dAZClothingItem, dAZClothingItem.startActive, fromRestore: false, skipSyncAnatomy: true);
+ SetActiveClothingItemNoSync(dAZClothingItem, dAZClothingItem.startActive, fromRestore: false);
}
}
array = _maleClothingItems;
@@ -3162,11 +3162,11 @@ public class DAZCharacterSelector : JSONStorable
{
if (clearAll)
{
- SetActiveClothingItem(dAZClothingItem2, active: false, fromRestore: false, skipSyncAnatomy: true);
+ SetActiveClothingItemNoSync(dAZClothingItem2, active: false, fromRestore: false);
}
else
{
- SetActiveClothingItem(dAZClothingItem2, dAZClothingItem2.startActive, fromRestore: false, skipSyncAnatomy: true);
+ SetActiveClothingItemNoSync(dAZClothingItem2, dAZClothingItem2.startActive, fromRestore: false);
}
}
SyncAnatomy();
@@ -3754,11 +3754,11 @@ public class DAZCharacterSelector : JSONStorable
{
if (clearAll)
{
- SetActiveHairItem(dAZHairGroup, active: false, fromRestore: false, skipSyncAnatomy: true);
+ SetActiveHairItemNoSync(dAZHairGroup, active: false, fromRestore: false);
}
else
{
- SetActiveHairItem(dAZHairGroup, dAZHairGroup.startActive, fromRestore: false, skipSyncAnatomy: true);
+ SetActiveHairItemNoSync(dAZHairGroup, dAZHairGroup.startActive, fromRestore: false);
}
}
array = _maleHairItems;
@@ -3766,11 +3766,11 @@ public class DAZCharacterSelector : JSONStorable
{
if (clearAll)
{
- SetActiveHairItem(dAZHairGroup2, active: false, fromRestore: false, skipSyncAnatomy: true);
+ SetActiveHairItemNoSync(dAZHairGroup2, active: false, fromRestore: false);
}
else
{
- SetActiveHairItem(dAZHairGroup2, dAZHairGroup2.startActive, fromRestore: false, skipSyncAnatomy: true);
+ SetActiveHairItemNoSync(dAZHairGroup2, dAZHairGroup2.startActive, fromRestore: false);
}
}
SyncAnatomy();
@@ -4874,7 +4874,15 @@ public class DAZCharacterSelector : JSONStorable
}
}
- public void SetActiveClothingItem(DAZClothingItem item, bool active, bool fromRestore = false, bool skipSyncAnatomy = false)
+ public void SetActiveClothingItem(DAZClothingItem item, bool active, bool fromRestore = false)
+ {
+ SetActiveClothingItemNoSync(item, active, fromRestore);
+ SyncAnatomy();
+ }
+
+ // SetActiveClothingItem without the trailing SyncAnatomy, so ResetClothing can
+ // batch every item and sync once at the end.
+ public void SetActiveClothingItemNoSync(DAZClothingItem item, bool active, bool fromRestore = false)
{
if (!(item != null))
{
@@ -4907,7 +4915,7 @@ public class DAZCharacterSelector : JSONStorable
{
if (clothingItems[i] != item && item.gender == clothingItems[i].gender && clothingItems[i].exclusiveRegion == exclusiveRegion && clothingItems[i].active)
{
- SetActiveClothingItem(clothingItems[i], active: false);
+ SetActiveClothingItemNoSync(clothingItems[i], active: false);
}
}
}
@@ -4920,13 +4928,16 @@ public class DAZCharacterSelector : JSONStorable
{
value.val = active;
}
- if (!skipSyncAnatomy)
- {
- SyncAnatomy();
- }
}
- public void SetActiveHairItem(DAZHairGroup item, bool active, bool fromRestore = false, bool skipSyncAnatomy = false)
+ public void SetActiveHairItem(DAZHairGroup item, bool active, bool fromRestore = false)
+ {
+ SetActiveHairItemNoSync(item, active, fromRestore);
+ SyncAnatomy();
+ }
+
+ // SetActiveHairItem without the trailing SyncAnatomy - see ResetHair.
+ public void SetActiveHairItemNoSync(DAZHairGroup item, bool active, bool fromRestore = false)
{
if (!(item != null))
{
@@ -4961,9 +4972,5 @@ public class DAZCharacterSelector : JSONStorable
{
value.val = active;
}
- if (!skipSyncAnatomy)
- {
- SyncAnatomy();
- }
}
}