-
-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement to exports #345
Comments
Currently exports are interpreted by lua code so it can be slower than call(). |
Adding 'onVariableChanged' is near to impossible, as simple variables dont have metatables. I think the variable change side of this issue can be closed. As for the |
Is this feature still needed or can this be closed? |
to prevent meta.xml from thousands of lines just for exporting functions. |
Is your feature request related to a problem? Please describe.
I want to improve exports because are very neglected.
List of ideas i would add/change in current export system.
meta.xml contain static exports list. You can manipulate exports list via mta functions.
you can export functions in table using dot. example:
<export function="myFunctions.func1" type="shared"/>
and you can use this by
call( resource, "myFunctions.func1", arg1, arg2, ... )
you can export variables too ( in table too like above ).
<export variable="variableName" type="shared" readonly="true"/>
readonly argument means do you can overwrite this variableevent called every exported variable changed. cancelEvent makes that variable will not change
functions to manipulate exports:
addExport( function/string theFunction [, bool readOnly = true ] )
-- for adding new exports, script will detect if this is function or variable. if you provide function, script check function name, and do this function is in table. If you provide table, then all function and variables will be added.deleteExport( function/string theFunction )
-- for deleting exports.*
cause delete every exportsgetVariable( resource, variableName )
-- return value under variable in other resourcesetVariable( resource, variableName, newValue )
-- set value under variable in other resource. Return false if variable is readonly.event:
onVariableChanged
with arguments: variableName, oldValue, newValue and source = source of change.Make possible to exports memes.
if you have suggestion, please describe in comment.
The text was updated successfully, but these errors were encountered: