Nevcairiel

Untitled

Oct 15th, 2022
1,214
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1.         if IsPressHoldReleaseSpell then
  2.             local pressAndHold = false
  3.             if type == "action" then
  4.                 self:SetAttribute("typerelease", "actionrelease")
  5.                 local actionType, id = GetActionInfo(action)
  6.                 if actionType == "spell" then
  7.                     pressAndHold = IsPressHoldReleaseSpell(id)
  8.                 elseif actionType == "macro" then
  9.                     -- GetMacroSpell is not in the restricted environment
  10.                     --[=[
  11.                         local spellID = GetMacroSpell(id)
  12.                         if spellID then
  13.                             pressAndHold = IsPressHoldReleaseSpell(spellID)
  14.                         end
  15.                     ]=]
  16.                 end
  17.             elseif type == "spell" then
  18.                 self:SetAttribute("typerelease", nil)
  19.                 -- XXX: while we can query this attribute, there is no corresponding action to release a spell button, only "actionrelease" exists
  20.                 pressAndHold = IsPressHoldReleaseSpell(action)
  21.             else
  22.                 self:SetAttribute("typerelease", nil)
  23.             end
  24.  
  25.             self:SetAttribute("pressAndHoldAction", pressAndHold)
  26.         end
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment