This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| private_addon_developer_help [2017/02/22 10:03] – fxfire | private_addon_developer_help [2020/12/02 13:29] (current) – fxfire | ||
|---|---|---|---|
| Line 55: | Line 55: | ||
| Get all files inside the " | Get all files inside the " | ||
| Entries from this table can be passed to the ReadModuleFile function to load those files. The modulename is not used, you can only load files inside your own module. | Entries from this table can be passed to the ReadModuleFile function to load those files. The modulename is not used, you can only load files inside your own module. | ||
| + | | ||
| + | CheckUserAddonOwnership({UUID}): | ||
| + | Checks if the user owns the addon with that uuid. returns true or false. Your own addon uuids are displayed on the developer addon update page. | ||
| Here is an example of how to declare a local module main table and use the private module functions to load a file from inside the module: | Here is an example of how to declare a local module main table and use the private module functions to load a file from inside the module: | ||
| Line 84: | Line 87: | ||
| Get all files inside the " | Get all files inside the " | ||
| local filelist = modexample.ModuleFunctions.GetModuleFiles(" | local filelist = modexample.ModuleFunctions.GetModuleFiles(" | ||
| + | |||
| + | |||
| + | ===== Sharing Data between private Addons ===== | ||
| + | |||
| + | The addon that shares data: | ||
| + | To allow access of other addons to the shared data, add this line to the .def file of the addon which shares the data: | ||
| + | SharedAccess=2948FB2D-0228-11EB-A373-52540012300A, | ||
| + | Where ' | ||
| + | |||
| + | Lua code of the sharing addon: | ||
| + | local testtable = {} | ||
| + | testtable.Text = " | ||
| + | function testtable.Function() | ||
| + | d(" | ||
| + | end | ||
| + | local modulefunctions = GetPrivateModuleFunctions() | ||
| + | if (modulefunctions ~= nil ) then | ||
| + | if( modulefunctions.SetPrivateModuleTable ~= nil) then | ||
| + | res = modulefunctions.SetPrivateModuleTable(testtable) | ||
| + | end | ||
| + | end | ||
| + | | ||
| + | | ||
| + | To access the shared data from the allowed addons: | ||
| + | local modulefunctions = GetPrivateModuleFunctions() | ||
| + | if (modulefunctions ~= nil) then | ||
| + | if( modulefunctions.GetPrivateModuleTable ~= nil) then | ||
| + | testtable = modulefunctions.GetPrivateModuleTable(" | ||
| + | end | ||
| + | if (testtable ~= nil) then | ||
| + | d(testtable) | ||
| + | testtable.Function() | ||
| + | else | ||
| + | d(" | ||
| + | end | ||
| + | end | ||
| + | |||
| + | |||