Jump to content
Alloder.pro  about Allods with love 😱
Search In
  • More options...
Find results that contain...
Find results in...

Servers monitoring and the Addons Editor

We present you two legends. All dreams come true.

Servers monitoring The Addons Editor

Digest April

We talk about what was done and updated in the past month. We help keep abreast of events.

Read more

Game tooltips

Tooltips provide a way for 3rd party fansites and extensions to display detailed information on mouseover.

Read more

передача данных между аддонами


icreator
 Share

Recommended Posts

наткнулась на такую штуку - если в разных аддонах сделать инициализацию драг+дроп:

Code:
wtShowHideBtn =  getNamedChild(mainForm, "Show" , false )

DnD:Init( 555, wtShowHideBtn, wtShowHideBtn, true )

то будут одновременно оба виджета двигаться! - хотя они принадлежат разным аддонам!

но ведь LibDnD.lua у каждого свой?? ил нет? получается что создавая любую переменную Global мы можем через нее передавать данные между разными аддонами... так?

походу предложение для LibDnD.lua - сделать там локальный массив данных

Code:
local _DnD = {}

...

_DnD.Widgets = {}

_DnD.Widgets.wtReacting = wtReacting

_DnD.Widgets.wtMovable = wtMovable or wtReacting

...

Link to comment
Share on other sites

Quote:
создавая любую переменную Global мы можем через нее передавать данные между разными аддонами... так?

Нет. Для каждого аддона создается своя "песочница". Обмен осуществляется с помощью событий.
LibDnD давно пора перевести в аддон. Это уже предлагалась, как минимум, тут.
Link to comment
Share on other sites

хорошо - вот можем же мы в один и тот же виджет закатать данные - в EditLine например! и что самое интересное потом можно оттуда их взять! любой другой программе-аддону. а так же есть подстановки в мета таблицах. например я заменила стандартные методы в системном чате-окне для того чтобы считать сколько строк положили в контейнер:

Code:
wtChat:CountItemsInit()

if not mt.CountItems then

mt.CountItems = function ( self, count )

if count then countItems = countItems + count end

return countItems

end

end

if not mt.CountSetItems then

mt.CountSetItems = function ( self, count )

countItems = count

end

end

if not mt._RemoveItems then

mt._RemoveItems = mt.RemoveItems

mt.RemoveItems = function ( self )

self:_RemoveItems()

self:CountSetItems(0)

end

end

if not mt._PushFrontValuedText then

mt._PushFrontValuedText = mt.PushFrontValuedText

mt.PushFrontValuedText = function ( self, VOText )

self:_PushFrontValuedText( VOText )

self:CountItems(1)

end

end

if not mt._PushFrontRawText then

mt._PushFrontRawText = mt.PushFrontRawText

mt.PushFrontRawText = function ( self, VOText )

self:_PushFrontRawText( VOText )

self:CountItems(1)

end

end

if not mt._PushBackValuedText then

mt._PushBackValuedText = mt.PushBackValuedText

mt.PushBackValuedText = function ( self, VOText )

self:_PushBackValuedText( VOText )

self:CountItems(1)

end

end

if not mt._PushBackRawValuedText then

mt._PushBackRawValuedText = mt.PushBackRawValuedText

mt.PushBackRawValuedText = function ( self, VOText )

self:_PushBackRawValuedText( VOText )

self:CountItems(1)

end

end

if not mt._PopFront then

mt._PopFront = mt.PopFront

mt.PopFront = function ( self )

self:_PopFront( )

self:CountItems(-1)

end

end

if not mt._PopBack then

mt._PopBack = mt.PopBack

mt.PopBack = function ( self )

self:_PopBack( )

self:CountItems(-1)

end

end

но как оказалось - там будет все равно храниться значение только для моего аддона ((( использование методов виджета в других аддонах не изменилось - подсчет положенных строк в окно контейнер - не происходит ((

Link to comment
Share on other sites

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use