====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
import_a_script_directly_into_ll [2015/12/06 22:12] lm13 |
import_a_script_directly_into_ll [2016/01/23 21:46] (current) lm13 |
||
---|---|---|---|
Line 8: | Line 8: | ||
}</sxh> | }</sxh> | ||
and replace //versioncode// with the latest version available. | and replace //versioncode// with the latest version available. | ||
+ | (You can check for the latest version [[https://bintray.com/f43nd1r/maven/scriptlib/view|here]]) | ||
- | Now you can import the class ''com.app.lukas.script.ScriptManager'' in any of your modules files. | + | Now you can import the class ''com.faendir.lightning_launcher.scriptlib.ScriptManager'' in any of your modules files. |
The ''ScriptManager'' provides several static methods: | The ''ScriptManager'' provides several static methods: | ||
- | Method signatures: (v1.6 for Repository Importer 1.9, compatible with 1.8) | + | Method signatures: (v1.6.7 for Repository Importer 1.10, possibly compatible with older versions) |
<sxh java;>loadScript(Context context, String code / int codeResourceId, String name, int flags, boolean forceUpdate, final Listener listener)</sxh> | <sxh java;>loadScript(Context context, String code / int codeResourceId, String name, int flags, boolean forceUpdate, final Listener listener)</sxh> | ||
* ''context'' can be any context | * ''context'' can be any context | ||
Line 39: | Line 40: | ||
* ''context'' can be any context | * ''context'' can be any context | ||
* ''intent'' is the intent which should be sent | * ''intent'' is the intent which should be sent | ||
+ | |||
+ | <sxh java;>replaceLogger(Logger logger)</sxh> | ||
+ | * ''logger'' a logger. Use this if you want to log to an alternative place (subclass Logger) | ||
Listener methods: | Listener methods: | ||
- | <sxh java;>OnLoadFinished(int id);</sxh> | + | <sxh java;>onLoadFinished(int id);</sxh> |
* This method is called when the load succeeded with the ID of the imported script | * This method is called when the load succeeded with the ID of the imported script | ||
- | <sxh java;>OnError()</sxh> | + | <sxh java;>onError()</sxh> |
* Implement this method if you want to receive a callback when an error occurs (recommended). Do not call super.onError(). | * Implement this method if you want to receive a callback when an error occurs (recommended). Do not call super.onError(). | ||