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:
App is requested to be downloaded from app store
App is downloaded and loaded with extra "store origin" flag (allows for resources and libraries to be fetched)
App "static" code is processed until __config is found and analysed
Libraries are downloaded (one by one)
Library is loaded (with the flag unless from URL, like Scarpet Edit would be)
Library is processed until __config
Repeat if it had a store flag
Part after __config in Library is processed
Rest of App's "static" code is processed
[END] (tick continues to advance etc)
"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.
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:
__config
is found and analysed__config
__config
in Library is processed"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 ahello.json
file in your langs folder that contains basically that.