Tayedaen
unread,Dec 3, 2007, 7:29:52 AM12/3/07Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to develop_xub
Hi !
I decided to highlight the important parts of the Multibutton code, so
that we can discuss them (slightly modified for better understanding).
Here comes the multiranking part:
--------------------------------------------------------------------------------------------------
if ( aRank ) and ( string.find( string.upper(aRank), "RANKED" ) ) then
if string.upper(aRank) == "MB-RANKED" then --different
mouseclicks cast different ranks
myButton:SetAttribute("*spell2", aSpellName .. "(" .. RANK ..
" 1)" ) -- right click
myButton:SetAttribute("*spell3", aSpellName .. "(" .. RANK ..
" " .. math.ceil((l_MaxSpellRank+1) / 2) .. ")" ) --middle click
myButton.Multirank = "MB-RANKED"
elseif string.upper(aRank) == "KB-RANKED" then --different
keyboard modifier cast different ranks
myButton:SetAttribute("shift-spell*", aSpellName .. "(" ..
RANK .. " 1)" )
myButton:SetAttribute("alt-spell*", aSpellName .. "(" ..
RANK .. " " .. math.ceil((l_MaxSpellRank+1) / 2) .. ")" )
myButton.Multirank = "KB-RANKED"
end
myButton.FullSpellName = aSpellName .. "()";
end
myButton:SetAttribute("*spell*", myButton.FullSpellName ) --all
clicks (minus the ones defined above)
----------------------------------------------------------------------------------------
And YES, that's the only IF her - so no big performance impact is to
be expected here.
Additional code, needed for every kind of multibuttons:
myButton:RegisterForClicks("AnyUp");