CCDirectLink / CCLoader

Modloader for crosscode
35 stars 11 forks source link

fake fs interface for packedmods #59

Closed ac2pic closed 4 years ago

ac2pic commented 4 years ago

As we are moving towards supporting packed mods, it is important that mods have a way to ensure they do not need to handle the implementation details for interfacing with packed mods. This is the responsibility of the modloader to fulfill.

L-Sherry commented 4 years ago

You don't need to pretend to be fs.

Any mod that want to access its own files need to know where the mod is installed. And the way to do it is already a bit modloader-specific, like finding yourself in the mods array, or, like French does it, by using currentScript and xhr, both of which will probably be broken with packedmods.

Just throw a new API that works in packed and non-packed cases (And that also works to a limited extent when running ccloader in a browser, because, at least for me, it is much better than nwjs's sdk for debugging)