Create and Fuck your AI Cum Slut –70% OFF
x

Mod Unity [Secret Flasher Manaka] Cosplay Loader Mod 2.2.1

AACID

New Member
Nov 22, 2025
2
0
1
Hello,I meet a question when I try to import my own clothes. I want to import a skirt into the game, but I found that only the buttons on the skirt were displayed, and the materials were all displayed on the buttons. up to now I can't figure out what's wrong with this.
1764175195772.png 1764175464378.png
1764175506173.png
 

biwajimadono

Member
Jul 27, 2021
124
143
53
Maybe the reason the costume wasn't added to the slot was because I didn't buy it from the shop...
If that's the only reason, I was careless.

Also, when you change an arranged costume to a different category (e.g., Glossy → SuitLuxe), the existing costume is pushed aside.
Alphabetical order takes priority.
I made the mistake of even changing the costumes I had already purchased into a different category.
I ended up confusing the mod system.
 
Last edited:

biwajimadono

Member
Jul 27, 2021
124
143
53
I want as many people as possible to experience the author's great efforts and great kindness.
All I can do is introduce.
I would like to express my heartfelt respect to everyone who is working to evolve MANAKA.
251126.jpg
 
  • Like
Reactions: Grymbels II

ExoFifth

New Member
Nov 26, 2023
6
10
87
hiddenPartsType (string or int, default 0)
I believe setting this prevents NPCs from seeing the part - TBD.
Enum: HiddenBodyPartsByCostumeType
Example to hide boobs?: "effectType": "Boobs"
public enum HiddenBodyPartsByCostumeType
{
Boobs = 1,
Hip = 2,
Genitals = 4,
SideOrBackUpperBody = 8,
HipCrouch = 0x10
}
You're correct, but it needs to be set up so that multiple parts can be hidden (assuming I didn't just miss something in my fiddling around). Under the hood, it's a series of binary flags, each corresponding to a body part, and each can be toggled independently:

StringDecimalBinary
Boobs100001
Genitals400100
SideOrBackUpperBody801000
Boobs + Genitals500101
Boobs + Genitals + SideOrBackUpperBody1301101

The public release of my old Cosplay Patcher mod still works on cosplays imported with your mod. If my cludgy code is useful to you, feel free to use it.

Code:
using System.Text.Json;
using System.Collections.Generic;

using UnityEngine;
using BepInEx.Logging;
using HarmonyLib;

using ExposureUnnoticed2.Master.Cosplay;
using ExposureUnnoticed2.Object3D.Player.Scripts;


namespace SFM_CosplayPatch;

public class CosplayPatcher : MonoBehaviour
{
    internal static ManualLogSource Log;

    private enum binaryMode
    {
        Subtract = 0,
        Add = 1
    }
    private Dictionary<string, Dictionary<string, dynamic>> PatchDict;
    private List<int> PatchedParts = new();


    public CosplayPatcher(Dictionary<string, Dictionary<string, dynamic>> inputPatchDict, ManualLogSource logger)
    {
        PatchDict = inputPatchDict;
        Log = logger;
    }


    public void ReRunPatch()
    {
        int[] tempPartArray = PatchedParts.ToArray();
        PatchedParts.Clear();

        foreach (int part in tempPartArray)
        {
            PatchCosplayPartById(part);
        }
    }


    public void PatchCosplayPartById(int uniqueId)
    {
        var cosplayPart = ExposureUnnoticed2.Master.Cosplay.MCosplay.GetParts(uniqueId);
        if (!PatchedParts.Contains(uniqueId))
        {
            PatchCosplayPart(cosplayPart);
            PatchedParts.Add(uniqueId);
        }
    }


    public void PatchCosplayPart(RCosplayParts cosplayPart)
    {
        Traverse trav = Traverse.Create(cosplayPart);
        PlayerStateModel.HiddenBodyPartsByCostumeType hiddenParts = trav.Property("HiddenPartsType").GetValue<PlayerStateModel.HiddenBodyPartsByCostumeType>();

        if (PatchDict.ContainsKey(cosplayPart.NameKey))
        {
            Dictionary<string, dynamic> patch = PatchDict[cosplayPart.NameKey];

            if (patch != null)
            {
                foreach (KeyValuePair<string, dynamic> prop in patch)
                {
                    if (prop.Key == "HiddenPartsType") SetPropertyHiddenPartsType(trav, prop);
                    else SetPropertyOther(trav, prop);
                }
            }
        }
    }


    private PlayerStateModel.HiddenBodyPartsByCostumeType HiddenPartsBinaryOp(
        PlayerStateModel.HiddenBodyPartsByCostumeType oldFlags, PlayerStateModel.HiddenBodyPartsByCostumeType newFlag, binaryMode mode)
    {
        if (mode == binaryMode.Add) return (oldFlags | newFlag);
        else return (oldFlags ^ newFlag);
    }


    private void SetPropertyOther(Traverse trav, KeyValuePair<string, dynamic> prop)
    {
        var target = trav.Property(prop.Key);
        if (target == null)
        var targetVal = target.GetValue();

        if (targetVal is int)
        {
            int value = JsonSerializer.Deserialize<int>(prop.Value);
            trav.Property(prop.Key).SetValue(value);
        }
        else if (targetVal is float)
        {
            float value = JsonSerializer.Deserialize<float>(prop.Value);
            trav.Property(prop.Key).SetValue(value);
        }
        else if (targetVal is double)
        {
            double value = JsonSerializer.Deserialize<double>(prop.Value);
            trav.Property(prop.Key).SetValue(value);
        }
        else if (targetVal is bool)
        {
            bool value = JsonSerializer.Deserialize<bool>(prop.Value);
            trav.Property(prop.Key).SetValue(value);
        }
    }


    private void SetPropertyHiddenPartsType(Traverse trav, KeyValuePair<string, dynamic> prop)
    {
        PlayerStateModel.HiddenBodyPartsByCostumeType newFlags = trav.Property(prop.Key).GetValue<PlayerStateModel.HiddenBodyPartsByCostumeType>();
        string[] flags = JsonSerializer.Deserialize<string[]>(prop.Value);

        foreach (string f in flags)
        {
            string flag;
            binaryMode mode = binaryMode.Add;

            if (f.StartsWith('-'))
            {
                mode = binaryMode.Subtract;
                flag = f.Trim('-');
            }
            else flag = f;

            switch (flag)
            {
                case "Boobs":
                    newFlags = HiddenPartsBinaryOp(newFlags, PlayerStateModel.HiddenBodyPartsByCostumeType.Boobs, mode);
                    break;
                case "Hip":
                    newFlags = HiddenPartsBinaryOp(newFlags, PlayerStateModel.HiddenBodyPartsByCostumeType.Hip, mode);
                    break;
                case "Genitals":
                    newFlags = HiddenPartsBinaryOp(newFlags, PlayerStateModel.HiddenBodyPartsByCostumeType.Genitals, mode);
                    break;
                case "SideOrBackUpper":
                    newFlags = HiddenPartsBinaryOp(newFlags, PlayerStateModel.HiddenBodyPartsByCostumeType.SideOrBackUpperBody, mode);
                    break;
                case "HipCrouch":
                    newFlags = HiddenPartsBinaryOp(newFlags, PlayerStateModel.HiddenBodyPartsByCostumeType.HipCrouch, mode);
                    break;
                default:
                    Log.LogWarning($"JSON error in patching {trav.Property("NameKey").GetValue<string>()}: {flag} is not a valid HiddenPartsType");
                    break;
            }
        }

        trav.Property(prop.Key).SetValue(newFlags);
    }
}