Getting Started with EPL

Enhanced Prefab Loader (EPL) is a mod loader for TCG Card Shop Simulator that allows mod authors to load custom assets, items, card expansions, and more into the game.

EPL is fully usable with just a JSON descriptor and asset bundle — no C# code required. The EPL API is an optional extension point for power users who want custom runtime behaviors such as custom pack generators or price generators.

Adding Content (JSON Descriptor Path)

The primary way to add content with EPL is through a JSON descriptor file paired with a Unity asset bundle. Define your items, card expansions, prefabs, and more in the descriptor and EPL will handle loading and registering them automatically.

Use the Bundle Verification Window in Unity to configure and build your bundles. It exports both the asset bundle and the JSON descriptor for you.

Installing Your Bundle

Place your built asset bundle folder (containing the bundle file and its .json descriptor) inside the BepInEx/plugins/ directory. EPL automatically discovers and loads all bundles during the game's loading screen.

Adding the API as a Dependency (Power Users)

If you need runtime control beyond what the descriptor supports, add the EPL API as a dependency:

  1. Download EnhancedPrefabLoader.API.dll from the latest EPL release
  2. Add a reference to it in your mod project
  3. Add EPL as a BepInEx soft dependency in your plugin class:
[BepInDependency("EnhancedPrefabLoader", BepInDependency.DependencyFlags.SoftDependency)]
[BepInPlugin("com.yourname.yourmod", "Your Mod", "1.0.0")]
public class YourPlugin : BaseUnityPlugin { }

Checking if EPL is Available

EPL may not always be installed. Always check before using the API:

if(Epl.IsAvailable)
{
    var api = Epl.Api;
}

Entry Point

All EPL functionality is accessed through Epl.Api:

Epl.Api.Assets          // Access loaded EPL assets
Epl.Api.Services        // Interact with EPL game state
Epl.Api.Events          // Subscribe to EPL events
Epl.Api.BundleRegistry  // Query loaded bundles

Waiting for EPL to Finish Loading

EPL loads asset bundles during the game's loading screen. Subscribe to OnBundleLoadingComplete to know when EPL assets are ready:

Epl.Api.Events.OnBundleLoadingComplete += () =>
{
    // Safe to access EPL assets here
};

Note: If you subscribe after loading is already complete, the event will fire immediately. You do not need to check IsLoadingComplete separately.

Custom Shops

If EPL bundles register custom shops and a phone app host (Phone Overhaul or QOL ShopOS) is installed, you can react when all shops are ready:

Epl.Api.Events.Shops.OnShopsReady += () =>
{
    // All custom shops have been registered and the shared shop screen is ready
};

The data behind each shop is available through Epl.Api.Assets.Shops:

var shops = Epl.Api.Assets.Shops;
foreach(var appId in shops.GetPhoneAppIds())
{
    var shop = shops.GetShopDataFor(appId)!;
    // shop.AppDisplayName
    // shop.TCG / shop.Accessories / shop.Figurines      RestockData sold in the shop
    // shop.SiteLogo / SiteHeader / SiteBackground       StreamingAsset<Sprite>, null when the bundle has none
    // shop.AppIcon / AppInnerBGImage / AppOuterBGImage  image names a bundle ships for Phone Overhaul
}
var customOnly = shops.GetCustomShopItemTypes(); // item types kept out of the base game restock lists

A mod that hosts the shops on its own phone or tablet uses Epl.Api.Services.ShopService:

var shopService = Epl.Api.Services.ShopService;
Epl.Api.Events.Shops.OnShopsReady += () =>
{
    foreach(var appId in Epl.Api.Assets.Shops.GetPhoneAppIds())
    {
        AddTile(appId, onTap: () =>
        {
            var screen = shopService.PrepareShopScreen(appId); // swaps the shared screen to this shop
            if(screen is not null)
            {
                OpenInMyUi(screen.Screen);
            }
        });
    }
};

OpenShop(appId) does the same through the game phone screen instead. SharedScreen and both methods return null/false until OnShopsReady has fired for the current game scene. IsHostLoaded reports whether EPL keeps custom shop items out of the base game shop, which it does when Phone Overhaul or QOL ShopOS is installed.