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

Как отследить виджет другого аддона?


GRuSHa
 Share

Recommended Posts

Доброго времени суток.

Помогите решить проблему.

Как аддоном отследить виджет другого аддона?

Допустим у меня есть аддон, mainform называется Form1 и мне нужно из другого аддона отследить Form1:IsVisible() как это сделать?

 

Link to comment
Share on other sites

Чтобы понять структуру виджетов, используй https://alloder.pro/files/file/101-inspect-widgets/

 

Виджеты располагаются в виде дерева, начинаясь от stateMainForm, детьми которого являются mainForm'ы аддонов.

 

Если mainForm'ы двух аддонов называются одинаково, то их не отличить друг от друга если не знать наверняка что у одного из них есть ребенок с определенным названием.

 

Хотя могу в чем-то и ошибаться. Например если вызов идет из аддона, который является хозяином одного из двух Form1, то можно использовать выражение :IsEqual(mainForm) чтобы выяснить является ли данная форма (ребенок стейт мейн формы) мейн формой данного аддона.

 

А вообще я бы советовал называть их по-своему, т.е. каждому аддону свое уникальное название.

  • Upvote 1
Link to comment
Share on other sites

Если известно имя виджета, то можно подписаться на изменение состояния его видимости.

    wtContextShipPlate = (common.GetAddonMainForm( "ContextShipPlate" )):GetChildChecked( "Plate", false )
    wtContextShipPlate:SetOnShowNotification(true)
    common.RegisterEventHandler(VisibleContextShipPlate, "EVENT_WIDGET_SHOW_CHANGED")

 

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