Skip to content

Commit

Permalink
refactor: rename to IOutfitComponent and add DisallowMultiple
Browse files Browse the repository at this point in the history
  • Loading branch information
poi-vrc committed Oct 17, 2024
1 parent bdb5d0b commit f4dbabd
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Editor/Passes/Cabinet/WardrobePass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static bool LookUpForWardrobe(Transform root, out DTWardrobe wardrobe)
return false;
}

private static bool LookUpForOutfit(Transform root, out IOutfit outfit)
private static bool LookUpForOutfit(Transform root, out IOutfitComponent outfit)
{
while (root != null)
{
Expand Down Expand Up @@ -212,7 +212,7 @@ private static void ComposeOutfitItems(Transform parent)
}
}

private static void CreateOutfitSubMenu(Context ctx, DTWardrobe wardrobeComp, Transform outfitTransform, IOutfit outfit)
private static void CreateOutfitSubMenu(Context ctx, DTWardrobe wardrobeComp, Transform outfitTransform, IOutfitComponent outfit)
{
if (wardrobeComp.UseAsMenuGroup)
{
Expand All @@ -238,7 +238,7 @@ private static void CreateOutfitSubMenu(Context ctx, DTWardrobe wardrobeComp, Tr
}
}

private static void CreateOutfitEnableItem(Context ctx, DTWardrobe wardrobeComp, DTParameterSlot slot, Transform outfitTransform, IOutfit outfit, float mappedVal)
private static void CreateOutfitEnableItem(Context ctx, DTWardrobe wardrobeComp, DTParameterSlot slot, Transform outfitTransform, IOutfitComponent outfit, float mappedVal)
{
if (wardrobeComp.UseAsMenuGroup)
{
Expand Down Expand Up @@ -456,7 +456,7 @@ private static void ComposeOutfitEnableItems(Context ctx, DTParameterSlot slot,
if (LookUpForWardrobe(outfitEnableItem.transform, out var wardrobeComp) && !wardrobeComp.UseAsMenuGroup)
{
// look up for wardrobe. if found, check if not used as menu group
IOutfit outfit;
IOutfitComponent outfit;
if (outfitEnableItem.TargetOutfit != null)
{
outfit = outfitEnableItem.TargetOutfit;
Expand Down
3 changes: 2 additions & 1 deletion Runtime/Components/Cabinet/DTAlternateOutfit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@

namespace Chocopoi.DressingTools.Components.Cabinet
{
[DisallowMultipleComponent]
[AddComponentMenu("")]
internal class DTAlternateOutfit : DTBaseComponent, IOutfit
internal class DTAlternateOutfit : DTBaseComponent, IOutfitComponent
{
public string Name { get => name; set => name = value; }
public Texture2D Icon { get => m_Icon; set => m_Icon = value; }
Expand Down
3 changes: 2 additions & 1 deletion Runtime/Components/Cabinet/DTBaseOutfit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ namespace Chocopoi.DressingTools.Components.Cabinet
/// Base outfit component. This component stores items related to the base outfit.
/// It does not contain any toggles or property groups since they are supposingly applied beforehand.
/// </summary>
[DisallowMultipleComponent]
[AddComponentMenu("")]
internal class DTBaseOutfit : DTBaseComponent, IOutfit
internal class DTBaseOutfit : DTBaseComponent, IOutfitComponent
{
public string Name => "Base";
public Texture2D Icon { get => m_Icon; set => m_Icon = value; }
Expand Down
1 change: 1 addition & 0 deletions Runtime/Components/Cabinet/DTOutfitGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace Chocopoi.DressingTools.Components.Cabinet
{
[DisallowMultipleComponent]
[AddComponentMenu("")]
internal class DTOutfitGroup : DTBaseComponent
{
Expand Down
1 change: 1 addition & 0 deletions Runtime/Components/Cabinet/DTWardrobe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

namespace Chocopoi.DressingTools.Components.Cabinet
{
[DisallowMultipleComponent]
[AddComponentMenu("")]
internal class DTWardrobe : DTBaseComponent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Chocopoi.DressingTools.Components.Cabinet
{
internal interface IOutfit
internal interface IOutfitComponent
{
Transform RootTransform { get; }
string Name { get; }
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions Runtime/Components/OneConf/DTCabinet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace Chocopoi.DressingTools.Components.OneConf
/// <summary>
/// DressingTools cabinet component. Used for storing cabinet settings and apply trigger.
/// </summary>
[DisallowMultipleComponent]
[AddComponentMenu("DressingTools/DT Cabinet")]
[DefaultExecutionOrder(-19999)]
[ExecuteInEditMode]
Expand Down
1 change: 1 addition & 0 deletions Runtime/Components/OneConf/DTWearable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace Chocopoi.DressingTools.Components.OneConf
/// <summary>
/// DressingTools wearable component. Used for storing wearable configuration.
/// </summary>
[DisallowMultipleComponent]
internal class DTWearable : DTBaseComponent
{
/// <summary>
Expand Down

0 comments on commit f4dbabd

Please sign in to comment.