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

Реакция для кнопок


Recommended Posts

Столкнулся с такой проблемой. Мне нужно создавать кнопки из готовой в коде lua. Я делаю это таким кодом:

local desc = wtButton:GetWidgetDesc()

local wtButton1 = mainForm:CreateWidgetByDesc( desc )

wtMain:AddChild( wtButton1 )

Но проблема в том что я не могу сменить реакцию на нажатие. Точнее не знаю как это сделать. В документации этого нет. Есть какие нибудь предложения?

Link to comment
Share on other sites

Нельзя ее сменить из скрипта. Бери виджет из параметров реакции и ориентируйся по нему. Ему можно имя поменять по крайней мере.

Link to comment
Share on other sites

Instead of changing the reaction, you can change the name of the button as viewed by the LUA.


Then you can ask on the reaction what the name of the button is via params.sender. If params.sender == "NewName1" then do this..

There are examples of this code at work in WhisperWindow as there are only four reaction buttons total in the add-on.

Link to comment
Share on other sites

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.


  • Create New...

Important Information

By using our site you agree to the Terms of Use