TestRunnerSRL / bizhawk-co-op

Syncs inventory, ammo, and more of multiple players for a coop experience
GNU Lesser General Public License v3.0
56 stars 41 forks source link

Default to the ramcontroller that matches the current ROM #47

Open bmclarnon opened 4 years ago

bmclarnon commented 4 years ago

Each ramcontroller may provide a Lua pattern to match against the ROMs name (as provided by gameinfo.getromname()); the ramcontroller with the first matching pattern is used as the default.

The pattern is specified by a comment rather than a function or global variable since (a) it's slow to run all of the ramcontrollers on startup, and (b) the ramcontrollers may modify global state. A comment is also trivially backwards-compatible with any existing third-party ramcontrollers.

bmclarnon commented 4 years ago

I opted not to hide non-matching ramcontrollers in case the matching fails for some reason (e.g., the 'OoTR' game name changes) or a different ROM is loaded after the lua script has been started.