OnClick = function(self) local b,u = arg1, this.unit if UnitIsUnit(u, "player") then u = "player" end if not UnitExists(u) then return end if ( b == "LeftButton" ) then if ( SpellIsTargeting() ) then SpellTargetUnit(u) elseif ( CursorHasItem() ) then if UnitIsUnit(u, "player") then AutoEquipCursorItem() elseif UnitIsFriend(u, "player") and UnitIsPlayer(u) then DropItemOnUnit("target") end else TargetUnit(u) end elseif b == "RightButton" then u = oUF:strcap(u) if string.find(u,"Party") then ToggleDropDownMenu(1, nil, getglobal("PartyMemberFrame"..this:GetID().."DropDown"), "cursor", 0, 0) else ToggleDropDownMenu(1, nil, getglobal(u.."FrameDropDown"), "cursor", 0, 0) end end end, strcap = function(self, str) return strupper(strsub(str, 1, 1)) .. strlower(strsub(str, 2)) end,