Skip to content
Snippets Groups Projects
Commit 2e388f46 authored by DarkGod's avatar DarkGod
Browse files

Added two new hooks "UseTalents:generate" and "UseTalents:use" to mimic the UseItemMenu ones

parent 8f4cac5d
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -174,6 +174,7 @@ function _M:use(item, button)
table.insert(list, 2, {name=autoMark:getDisplayString()..(automode==2 and ds or "").."Auto-use when no enemies are visible", what=(automode==2 and "auto-dis" or "auto-en-2")})
table.insert(list, 2, {name=autoMark:getDisplayString()..(automode==3 and ds or "").."Auto-use when enemies are visible", what=(automode==3 and "auto-dis" or "auto-en-3")})
table.insert(list, 2, {name=autoMark:getDisplayString()..(automode==4 and ds or "").."Auto-use when enemies are visible and adjacent", what=(automode==4 and "auto-dis" or "auto-en-4")})
self:triggerHook{"UseTalents:generate", actor=self.actor, talent=t, menu=list}
for i = 1, 12 * self.actor.nb_hotkey_pages do list[#list+1] = {name="Hotkey "..i, what=i} end
Dialog:listPopup("Bind talent: "..item.name:toString(), "How do you want to bind this talent?", list, 400, 500, function(b)
......@@ -210,6 +211,8 @@ function _M:use(item, button)
self.actor:checkSetTalentAuto(item.talent, true, 4)
elseif b.what == "auto-dis" then
self.actor:checkSetTalentAuto(item.talent, false)
else
self:triggerHook{"UseTalents:use", actor=self.actor, talent=t, item=item}
end
self.c_list:drawTree()
self.actor.changed = true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment