Ghoulboy78 / Scarpet-edit

A useful tool for developing decorative builds etc in scarpet.
Creative Commons Zero v1.0 Universal
22 stars 4 forks source link

Add an interface to allow an installer to install language files #85

Closed altrisi closed 3 years ago

altrisi commented 3 years ago

Allows an installer using the new automatic dependency downloading from app stores to provide language files to Scarpet Edit in the same tick the app was loaded.

For easy understanding this is the way the dependency installation works in Carpet:

"Library" means any app declared in the libraries section of App's config.

Since Scarpet Edit would still be here and in the app store there would only be an installer that would fetch the latest version from the releases, we can't add the language resources directly in SE, since it would have no store origin flag. Instead, this allows an installer to provide those languages as it's being downloaded. Therefore it would be the installer that would request the language files from the latest release and provide them to SE by signaling the se_install_lang event in "rest of App's static code is proccessed" step.

Installer is ready.

Testing:

Since this has to be executed in the same tick, place two command blocks: a regular one facing an "Always Active" "Chain" one. Regular one contains /script load se and chain one signals the event, with something such as /script run signal_event('se_install_lang', null, ['test', {'hi'->'b'}]). You should find a hello.json file in your langs folder that contains basically that.

altrisi commented 3 years ago

SE installer now pushed in gnembon/scarpet#232!