Pathoschild / StardewMods

Mods for Stardew Valley using SMAPI.
MIT License
712 stars 380 forks source link

Feature: External (mod-provided) data layers #1020

Open focustense opened 4 months ago

focustense commented 4 months ago

Note: This is a re-send of #1010. Please see my comment there.

Adds an API for other mods to register and implement their own data layers.

The API has a single Register method which takes an IDataLayer. That, in turn, provides the legend data, colors, translations, update logic, etc.

Externally-registered layers act just like internal ones; they show up in the GMCM and the UI widget as if they were normal layers.

There might be a few caveats or rough edges here; in particular:

There's an example consumer in 078a47d94be49437710639e2d477625cd11d0a4a.