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

Помогите с Action


HugoOlivera
 Share

Recommended Posts

Доброго времени суток Вам. Собственно вопрос вот в чем состоит. Имеется шаблон кнопки созданный следующим образом.

local AOContextActionbar = stateMainForm:GetChildChecked( "ContextActionbar", false )
local AOActionBar = AOContextActionbar:GetChildChecked( "ActionBar", false )
local AOAction = AOActionBar:GetChildChecked( "Action01", false ):GetWidgetDesc()

Сам  виджет строится примерно так:

function CreateTest()
        local w = mainForm:CreateWidgetByDesc( AOAction )
        w:SetName("Test")
        local i = w:GetPlacementPlain()
        i.alignX = WIDGET_ALIGN_LOW
        i.alignY = WIDGET_ALIGN_LOW
        i.posX = 15
        i.posY = 15
        i.sizeX = 50
        i.sizeY = 50
        w:SetPlacementPlain(i)
        TestPanel:AddChild(w)
        w:GetChildChecked('Button',true):Show(true)
        w:GetChildChecked('Autocast',true):Show(false)
        w:GetChildChecked('Blink',true):Show(false)
        w:GetChildChecked('Frame',true):Show(false)
        w:GetChildChecked('Cooldown',true):Show(false)
        w:GetChildChecked('Cooldown',true):Show(true)
        w:GetChildChecked('Gauge',true):Show(false)
        w:GetChildChecked('Gauge',true):Show(true)
        w:GetChildChecked('Icon',true):Show(true)
        w:GetChildChecked('Locked',true):Show(false)
        w:GetChildChecked('Prepared',true):Show(false)
        w:GetChildChecked('Effect',true):Show(false)
        w:GetChildChecked('Count',true):Show(true)
        w:GetChildChecked('Countdown',true):Show(false)
        w:GetChildChecked('Link',true):Show(false)
        w:GetChildChecked('Pressed',true):Show(false)
        w:GetChildChecked('TopLeftIcon',true):Show(false)
        w:GetChildChecked('Shortcut',true):Show(false)
        w:Show(true)
end

т.е. создан виджет похожий на "Action01" вопрос в том как заставить его реагировать на нажатие по нему мышкой, чтобы он скажем использовал итем или скилл. Если можно буквально пару строк напишите каким образом заставить сие чудо работать.

Lua API уже и так все вычитал не пойму. От части догадки есть, что необходимо через 2ую ссылку но как не пойму. Буду очень благодарен за помощь.

LuaApi/FunctionCommonRegisterReactionHandler.html
LuaApi/FunctionCommonOnReaction.html

P.S. версия клиента 4.0.02.42

Link to comment
Share on other sites

Создай кнопку в аддоне
возьми к примеру data\Mods\SampleAddons\SampleReactionHandler
в Execute.(WidgetButton).xdb пропиши имя типа
<Name>Button</Name>
 
Запиши виджет кнопки с этим именем
wtButton = wtMainPanel:GetChildChecked( "Button", false )
 
И добавь к ней скопированную кнопку wtButton:AddChild(w)
 
я бы так начал лепить...

Link to comment
Share on other sites

Все проще. В этом экшн-слоте есть виджет. Зовется Button. На клики посылает реакции slot_pressed и slot_pressed_rmb. Создать виджет слота из шаблона, подписаться на реакции его кнопки.

  • Upvote 1
Link to comment
Share on other sites

Все проще. В этом экшн-слоте есть виджет. Зовется Button. На клики посылает реакции slot_pressed и slot_pressed_rmb. Создать виджет слота из шаблона, подписаться на реакции его кнопки.

Спасибо от души как говорится, о том что есть такое догадывался, но вот без точного имени можно гадать как на кофейной гуще. Кстати не подскажешь от куда такая информация?

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