Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Content Patcher] Add content-pack-provided tokens #575

Open
Pathoschild opened this issue Oct 17, 2020 · 1 comment
Open

[Content Patcher] Add content-pack-provided tokens #575

Pathoschild opened this issue Oct 17, 2020 · 1 comment

Comments

@Pathoschild
Copy link
Owner

SMAPI mods can define mod-provided tokens for content packs to use, but there's currently no way to expose tokens between two content packs. Add some way for content packs to define their own mod-provided tokens.

@Pathoschild
Copy link
Owner Author

One possible approach would be a ModProvidedTokens field that lets you list any config or dynamic tokens:

{
   "Format": "1.18.0",
   "DynamicTokens": [
      {
         "Name": "IsTownPatched",
         "Value": "{{EnableMapChanges}}" // config token
      }
   ],
   "ModProvidedTokens": [ "IsTownPatched" ]
}

Then another content pack can access those tokens, if it has a dependency or HasMod check (just like regular mod-provided tokens). For example, if the above mod has ID Pathoschild.SampleMod:

{
    "Format": "1.18",
    "Changes": [
      {
         "Action": "EditMap",
         "Target": "Maps/Town",
         "FromFile": "assets/town.tbin",
         "When": {
            "Pathoschild.SampleMod/IsTownPatched": true
         }
      }
   ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant