This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
private_addon_developer_help [2020/06/15 07:07] – hansw | private_addon_developer_help [2020/12/02 13:29] (current) – fxfire | ||
---|---|---|---|
Line 87: | 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 | ||
+ | |||
+ | |||