daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[AftermathhUI = {}
  2. AftermathhUI.Class = select(2, UnitClass('player'))
  3. AftermathhUI.Classcolor = RAID_CLASS_COLORS[AftermathhUI.Class]
  4.  
  5. local inf = math.huge
  6. AftermathhUI.ColorGradient = function(perc, ...)
  7.     -- Translate divison by zeros into 0, so we don't blow select.
  8.     -- We check perc against itself because we rely on the fact that NaN can't equal NaN.
  9.     if(perc ~= perc or perc == inf) then perc = 0 end
  10.    
  11.     if perc >= 1 then
  12.         local r, g, b = select(select('#', ...) - 2, ...)
  13.         return r, g, b
  14.     elseif perc <= 0 then
  15.         local r, g, b = ...
  16.         return r, g, b
  17.     end
  18.    
  19.     local num = select('#', ...) / 3
  20.     local segment, relperc = math.modf(perc*(num-1))
  21.     local r1, g1, b1, r2, g2, b2 = select((segment*3)+1, ...)
  22.  
  23.     return r1 + (r2-r1)*relperc, g1 + (g2-g1)*relperc, b1 + (b2-b1)*relperc
  24. end
  25.  
  26. local function Minimap_FormatValue(i)
  27.     if (i > 1024) then
  28.         return format('%.2f MB', i/1024)
  29.     else
  30.         return format('%.2f KB', i)
  31.     end
  32. end
  33.  
  34. TimeManagerClockButton:SetScript('OnEnter', function(self)
  35.     collectgarbage()
  36.     UpdateAddOnMemoryUsage()
  37.    
  38.     local entry
  39.     local total = 0
  40.     local addons = {}
  41.     local gradient = {0, 1, 0, 1, 1, 0, 1, 0, 0}
  42.     for i = 1, GetNumAddOns() do
  43.         if (IsAddOnLoaded(i)) then
  44.             local memory = GetAddOnMemoryUsage(i)
  45.             total = total + memory
  46.            
  47.             entry = {
  48.                 name = GetAddOnInfo(i),
  49.                 memory = memory
  50.             }
  51.            
  52.             tinsert(addons, entry)
  53.        
  54.             table.sort(addons, function(a, b)
  55.                 return a.memory > b.memory
  56.             end)
  57.         end
  58.     end
  59.     GameTooltip:SetOwner(self, 'ANCHOR_BOTTOMLEFT')
  60.    
  61.     for _, content in pairs(addons) do
  62.         local r, g, b = AftermathhUI.ColorGradient((content.memory / 800), unpack(gradient))
  63.         GameTooltip:AddDoubleLine(content.name, Minimap_FormatValue(content.memory), 1, 1, 1, r, g, b)
  64.     end
  65.    
  66.     local r, g, b = AftermathhUI.ColorGradient((entry.memory / 800), unpack(gradient))
  67.     GameTooltip:AddLine(' ')
  68.     GameTooltip:AddDoubleLine('AddOns', Minimap_FormatValue(total), AftermathhUI.Classcolor.r, AftermathhUI.Classcolor.g, AftermathhUI.Classcolor.b, r, g, b)
  69.     GameTooltip:Show()
  70. end)--]]
  71.  
  72. -- Move bars
  73.  
  74. MultiBarBottomRight:ClearAllPoints()
  75. MultiBarBottomRight:SetPoint("BOTTOM",-254,100)
  76. MainMenuBar:ClearAllPoints()
  77.  MainMenuBar:SetPoint("BOTTOMRIGHT",50,0)
  78.  
  79.      -- reduce the size of some main menu bar objects
  80.  
  81. --[[for _, object in pairs({
  82.     _G['MainMenuBar'],
  83.     _G['MainMenuExpBar'],
  84.     _G['MainMenuBarMaxLevelBar'],
  85.  
  86.     _G['ReputationWatchBar'],
  87.     _G['ReputationWatchStatusBar'],
  88. }) do
  89.     object:SetWidth(512)
  90. end]]
  91.  
  92.  
  93.             -- <Config> --
  94.            
  95.         -- If you are in-game and want to change some optinos, simply change them in this .lua file and /rl (reload ui)
  96.            
  97. -- 1 = Enabled , 0 = Disabled --
  98.  
  99.     -- // Frames
  100. local ClassPortraits = 1 -- Class icons instead of portraits.
  101. local CurrentHPMPValues = 1 -- Only displays current values: eg. instead of 154.1k/154.3k it displays just 154.1k
  102. local MoveToT = 1 -- Moves the target of target, so that all buffs/debuffs are visible.
  103. local MoveFT = 1 -- Moves focus target to make all buffs/debuffs visible.
  104. local PlayerPetHitIndicatorHide = 1 -- Hides player and pet hit indicator. (the combat text on the portraits.)
  105. local PlayerNameOff = 1 -- Hides player name.
  106. local PetNameOff = 1 -- Hides pet name.
  107. local PvPIconOff = 1 -- Hides the pvp icons on player/target.
  108. local displayUA = 1 -- Always display UA on raid frames.
  109. local arenatrinkets = 1 -- Says in party when enemy trinkets are used & use /baf to show arena frames out of arena.
  110. local MoveArenaFrames = 1 -- /Movearena to move arena frames.
  111.  
  112.     -- // Bars
  113. local KeybindsHide = 0 -- Hides the keybinding text on the action bars.
  114. local MacroTextHide = 1 -- Hides the macro text on the action bars.
  115. local TexturesHide = 1 -- Hides various action bar textures.
  116. local RedOutofRange = 0 -- Makes the whole button red when out of range, instead of just the keybinding.
  117. local HideShapeShift = 1 -- Hides the various shapeshift bars.
  118. local hideBags = 1 -- Fades the bags if not mouseovered.
  119. local menuHide = 1 -- Fades the menu icons if not mouseovered.
  120. local expFade = 1 -- Fades the exp bar if not mouseovered.
  121.  
  122.     -- // Misc
  123. local HbitErrors = 1 -- Hides the error frame (unfortunately this also hides quest progress)
  124. local LanguageFilterOff = 1 -- Forces mature language filter off.
  125. local AutoQuest = 1 -- Automatically accepts/completes quests if shift is held down.
  126. local SellGrey = 1 -- Sells all greys without asking.
  127. local autoRepair = 1 -- Auto repairs.
  128. local autoGRepair = 0 -- Auto repairs with guild funds. Only one of the repair options should be enabled.
  129. local tabChangerPvP = 1 -- Changes tab to only target nearest player in PvP.
  130. local arenaMinimapHide = 0 -- Hides the minimap when in arena.
  131. local autoInvite = 1 -- Use /ainv in-game to turn this on and /ainv off to turn it off. Then it will invite anyone who whispers you "invite".
  132. local altBuy = 1 -- Automatically buys a stack of whatever by a merchant if alt is held down.
  133.  
  134.     -- // Minimap
  135. local HbitMinimap = 1 -- Hides minimap clutter, and enables minimap mousewheel zoom.
  136.  
  137.     -- // Chat
  138. local ChatMouseScroll = 1 -- Enables chat scroll with mousewheel (holding shift goes either to the top if scrolling up and down if scrolling down.)
  139. local ChatClutterHide = 1 -- Hides various clutter on the chat.
  140. local altInvite = 1 -- Hold alt and click on player name to invite in the chat.
  141. local chatShorten = 1 -- Shortens the various channel names.
  142. local tellTarget = 1 -- Use either /tt or /telltarget to whisper your current target.
  143. local NUM_LINES_TO_SCROLL = 4 -- Number of lines to scroll with mousewheel.
  144. local urlCopy = 1 -- Makes urls clickable to copy them.
  145. local chatTabs = 1 -- Makes the chattabs prettier and cleaner.
  146. local slashCommands = 1 -- /gm for opening a ticket. /rc for readycheck /rl for reload ui.
  147.  
  148.             -- </Config> --
  149.  
  150.  
  151. if (ClassPortraits == 1) then
  152. UFP="UnitFramePortrait_Update" UICC="Interface\\TargetingFrame\\UI-Classes-Circles" CIT=CLASS_ICON_TCOORDS UC=UnitClass
  153. hooksecurefunc(UFP,function(self) if self.portrait then t=CIT[select(2,UC(self.unit))] if t and UnitIsPlayer(self.unit) then self.portrait:SetTexture(UICC) self.portrait:SetTexCoord(unpack(t)) else self.portrait:SetTexCoord(0,1,0,1) end end end)
  154. end
  155.  
  156. if (KeybindsHide == 1) then
  157. for i=1,12 do _G["ActionButton"..i.."HotKey"]:SetAlpha(0)end;for i=1,12 do
  158. _G["MultiBarBottomRightButton"..i.."HotKey"]:SetAlpha(0)end;for i=1,12 do
  159. _G["MultiBarBottomLeftButton"..i.."HotKey"]:SetAlpha(0)end; for i=1,12 do
  160. _G["MultiBarRightButton"..i.."HotKey"]:SetAlpha(0)end; for i=1,12 do
  161. _G["MultiBarLeftButton"..i.."HotKey"]:SetAlpha(0)end
  162. end
  163.  
  164. if (MacroTextHide == 1) then
  165. for i=1,12 do _G["ActionButton"..i.."Name"]:SetAlpha(0)end;for i=1,12 do
  166. _G["MultiBarBottomRightButton"..i.."Name"]:SetAlpha(0)end;for i=1,12 do
  167. _G["MultiBarBottomLeftButton"..i.."Name"]:SetAlpha(0)end; for i=1,12 do
  168. _G["MultiBarRightButton"..i.."Name"]:SetAlpha(0)end; for i=1,12 do
  169. _G["MultiBarLeftButton"..i.."Name"]:SetAlpha(0)end
  170. end
  171.  
  172. if (HbitErrors == 1) then
  173. UIErrorsFrame:Hide()
  174. end
  175.  
  176. if (HbitMinimap == 1) then
  177. MinimapCluster:SetScale(0.9)
  178. MinimapCluster:SetPoint("TOPRIGHT", "UIParent", "TOPRIGHT", -5, 0)
  179. MinimapCluster:SetAlpha(0.835)
  180. MinimapBorderTop:Hide()
  181. MiniMapWorldMapButton:Hide()
  182. MinimapZoneText:SetPoint("TOPLEFT","MinimapZoneTextButton","TOPLEFT", 8, 0)
  183. MinimapZoomIn:Hide()
  184. MinimapZoomOut:Hide()
  185. Minimap:SetScript('OnMouseWheel', function(self, delta)
  186.     if delta > 0 then
  187.         Minimap_ZoomIn()
  188.     else
  189.         Minimap_ZoomOut()
  190.     end
  191. end)
  192. local EventFrame = CreateFrame("Frame")
  193. EventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
  194. EventFrame:SetScript("OnEvent", function(self,event,...)
  195.      MinimapNorthTag:Hide()
  196. end)
  197. end
  198.  
  199. if (TexturesHide == 1) then
  200. MainMenuBarTexture0:Hide()
  201. MainMenuBarTexture1:Hide()
  202. MainMenuBarTexture2:Hide()
  203. MainMenuBarTexture3:Hide()
  204. BonusActionBarFrameTexture1:SetAlpha(0)
  205. BonusActionBarFrameTexture2:SetAlpha(0)
  206. BonusActionBarFrameTexture3:SetAlpha(0)
  207. BonusActionBarFrameTexture4:SetAlpha(0)
  208. MainMenuMaxLevelBar0:Hide()
  209. MainMenuMaxLevelBar1:Hide()
  210. MainMenuMaxLevelBar2:Hide()
  211. MainMenuMaxLevelBar3:Hide()
  212. MainMenuBarLeftEndCap:Hide()
  213. MainMenuBarRightEndCap:Hide()
  214. end
  215.  
  216. if (CurrentHPMPValues == 1) then
  217. local CurrentValues = CreateFrame("Frame")
  218. CurrentValues:SetScript("OnUpdate", function(self, e)
  219.  
  220.         local PlayerHealth = UnitHealth("player")
  221.         local PlayerMana = UnitMana("player")
  222.        
  223.         local TargetHealth = UnitHealth("target")
  224.         local TargetMana = UnitMana("target")
  225.        
  226.         local FocusHealth = UnitHealth("focus")
  227.         local FocusMana = UnitMana("focus")
  228.        
  229.         local PetHealth = UnitHealth("pet")
  230.         local PetMana = UnitMana("pet")
  231.        
  232.        
  233.         PlayerFrameHealthBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(PlayerHealth))
  234.         PlayerFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(PlayerMana))
  235.        
  236.         TargetFrameHealthBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(TargetHealth))
  237.         TargetFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(TargetMana))
  238.        
  239.         FocusFrameHealthBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(FocusHealth))
  240.         FocusFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(FocusMana))
  241.        
  242.         PetFrameHealthBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(PetHealth))
  243.         PetFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(PetMana))
  244. end)
  245. end
  246.  
  247. if (MoveToT == 1) then
  248. TargetFrameToT:ClearAllPoints()
  249. TargetFrameToT:SetPoint("CENTER","TargetFrame", "CENTER", 52, -38)
  250. end
  251.  
  252. if (MoveFT == 1) then
  253. FocusFrameToT:ClearAllPoints()
  254. FocusFrameToT:SetPoint("CENTER","FocusFrame", "CENTER", 52, -38)
  255. end
  256.  
  257. if (LanguageFilterOff == 1) then
  258. BNSetMatureLanguageFilter(false)
  259. end
  260.  
  261. if (PlayerPetHitIndicatorHide == 1) then
  262. PlayerFrame:UnregisterEvent("UNIT_COMBAT")PetFrame:UnregisterEvent("UNIT_COMBAT")
  263. end
  264.  
  265. if (RedOutofRange == 1) then
  266. hooksecurefunc("ActionButton_OnEvent",function(self, event, ...)
  267.                 if ( event == "PLAYER_TARGET_CHANGED" ) then
  268.                         self.newTimer = self.rangeTimer
  269.                 end
  270.         end)
  271.  
  272.         hooksecurefunc("ActionButton_UpdateUsable",function(self)
  273.                 local icon = _G[self:GetName().."Icon"]
  274.                 local valid = IsActionInRange(self.action)
  275.  
  276.                 if ( valid == 0 ) then
  277.                         icon:SetVertexColor(1.0, 0.1, 0.1)
  278.                 end
  279.         end)
  280.  
  281.         hooksecurefunc("ActionButton_OnUpdate",function(self, elapsed)
  282.                 local rangeTimer = self.newTimer
  283.  
  284.                 if ( rangeTimer ) then
  285.                         rangeTimer = rangeTimer - elapsed
  286.  
  287.                         if ( rangeTimer <= 0 ) then
  288.                                 ActionButton_UpdateUsable(self)
  289.                                 rangeTimer = TOOLTIP_UPDATE_TIME
  290.                         end
  291.  
  292.                         self.newTimer = rangeTimer
  293.                 end
  294.         end)
  295. end    
  296.  
  297. if (PlayerNameOff == 1) then
  298. PlayerFrame.name:Hide()
  299. end
  300.  
  301. if (PetNameOff == 1) then
  302. PetFrame.name:Hide()
  303. end
  304.  
  305. if (ChatMouseScroll == 1) then
  306. function FloatingChatFrame_OnMouseScroll(self, delta)
  307.     if delta > 0 then
  308.         if IsShiftKeyDown() then
  309.             self:ScrollToTop()
  310.         elseif IsControlKeyDown() then
  311.             self:PageUp()
  312.         else
  313.             for i = 1, NUM_LINES_TO_SCROLL do
  314.                 self:ScrollUp()
  315.             end
  316.         end
  317.     elseif delta < 0 then
  318.         if IsShiftKeyDown() then
  319.             self:ScrollToBottom()
  320.         elseif IsControlKeyDown() then
  321.             self:PageDown()
  322.         else
  323.             for i = 1, NUM_LINES_TO_SCROLL do
  324.                 self:ScrollDown()
  325.             end
  326.         end
  327.     end end end
  328.  
  329. --[[FloatingChatFrame_OnMouseScroll = function(self, dir)
  330.     if(dir > 0) then
  331.         if(IsShiftKeyDown()) then
  332.             self:ScrollToTop() else self:ScrollUp() end
  333.     else if(IsShiftKeyDown()) then
  334.         self:ScrollToBottom() else self:ScrollDown() end
  335.     end
  336. end
  337. end--]]
  338.  
  339. if (ChatClutterHide == 1) then
  340. FriendsMicroButton:SetAlpha(0)
  341. FriendsMicroButton:EnableMouse(false)
  342. FriendsMicroButton:UnregisterAllEvents()
  343.  
  344. ChatFrameMenuButton:SetAlpha(0)
  345. ChatFrameMenuButton:EnableMouse(false)
  346.  
  347.  
  348. -- ChatFrame1ButtonFrame:Hide()
  349. local _G = _G
  350. local type = type
  351. local select = select
  352. local unpack = unpack
  353.  
  354. local gsub = string.gsub
  355. local format = string.format
  356.  
  357. CHAT_FRAME_TAB_SELECTED_MOUSEOVER_ALPHA = 1
  358. CHAT_FRAME_TAB_SELECTED_NOMOUSE_ALPHA = 0
  359.  
  360. CHAT_FRAME_TAB_NORMAL_MOUSEOVER_ALPHA = 0.5
  361. CHAT_FRAME_TAB_NORMAL_NOMOUSE_ALPHA = 0
  362.  
  363. CHAT_FRAME_FADE_OUT_TIME = 0
  364. CHAT_FRAME_FADE_TIME = 0
  365. CHAT_TAB_HIDE_DELAY = 0
  366.  
  367. local newAddMsg = {}
  368. for i = 1, NUM_CHAT_WINDOWS do
  369.     local cf = 'ChatFrame'..i
  370.     local tex = ({_G[cf..'EditBox']:GetRegions()})
  371.    
  372.     _G[cf..'ButtonFrame'].Show = _G[cf..'ButtonFrame'].Hide
  373.     _G[cf..'ButtonFrame']:Hide()
  374.    
  375.     _G[cf..'EditBox']:SetAltArrowKeyMode(false)
  376.     _G[cf..'EditBox']:ClearAllPoints()
  377.     _G[cf..'EditBox']:SetPoint('BOTTOMLEFT', ChatFrame1, 'TOPLEFT', -4, 6)
  378.     _G[cf..'EditBox']:SetPoint('TOPRIGHT', _G.ChatFrame1, 'TOPRIGHT', 6, 30)
  379.     _G[cf..'EditBox']:SetShadowOffset(0, 0)
  380.     _G[cf..'EditBox']:SetBackdrop({bgFile = 'Interface\\Buttons\\WHITE8x8', edgeFile = 'Interface\\Buttons\\WHITE8x8', edgeSize = 2})
  381.     _G[cf..'EditBox']:SetBackdropColor(0,0,0,.8)
  382.     _G[cf..'EditBox']:SetBackdropBorderColor(0,0,0,1)
  383.     _G[cf..'EditBox']:HookScript("OnEditFocusGained", function(self) self:Show() end)
  384.     _G[cf..'EditBox']:HookScript("OnEditFocusLost", function(self) self:Hide() end)
  385.     _G[cf..'EditBoxHeader']:SetShadowOffset(0, 0)
  386.    
  387.     _G["ChatFrame"..i.."Tab"]:HookScript("OnClick", function() _G["ChatFrame"..i.."EditBox"]:Hide() end)
  388.     tex[6]:SetAlpha(0) tex[7]:SetAlpha(0) tex[8]:SetAlpha(0) tex[9]:SetAlpha(0) tex[10]:SetAlpha(0) tex[11]:SetAlpha(0)
  389.     _G[cf]:SetMinResize(0,0)
  390.     _G[cf]:SetMaxResize(0,0)
  391.     _G[cf]:SetFading(false)
  392.     _G[cf]:SetClampRectInsets(0,0,0,0)
  393.     _G[cf..'ResizeButton']:SetPoint("BOTTOMRIGHT", cf, "BOTTOMRIGHT", 9,-5)
  394.     _G[cf..'ResizeButton']:SetScale(.4)
  395.     _G[cf..'ResizeButton']:SetAlpha(0.5)
  396.    
  397.    
  398.     if i ~= 2 then
  399.         local f = _G[format("%s%d", "ChatFrame", i)]
  400.         newAddMsg[format("%s%d", "ChatFrame", i)] = f.AddMessage
  401.         f.AddMessage = AddMessage
  402.     end
  403.    
  404. end end
  405.  
  406. if (PvPIconOff == 1) then
  407. PlayerPVPIcon:Hide();
  408. TargetFrame.pvpIcon:Hide();
  409. end
  410.  
  411. if (AutoQuest == 1) then
  412. local addon = CreateFrame('Frame')
  413. addon.completed_quests = {}
  414. addon.incomplete_quests = {}
  415.  
  416. function addon:canAutomate ()
  417.   if IsShiftKeyDown() then
  418.     return true
  419.   else
  420.     return false
  421.   end
  422. end
  423.  
  424. function addon:strip_text (text)
  425.   if not text then return end
  426.   text = text:gsub('|c%x%x%x%x%x%x%x%x(.-)|r','%1')
  427.   text = text:gsub('%[.*%]%s*','')
  428.   text = text:gsub('(.+) %(.+%)', '%1')
  429.   text = text:trim()
  430.   return text
  431. end
  432.  
  433. function addon:QUEST_PROGRESS ()
  434.   if not self:canAutomate() then return end
  435.   if IsQuestCompletable() then
  436.     CompleteQuest()
  437.   end
  438. end
  439.  
  440. function addon:QUEST_LOG_UPDATE ()
  441.   if not self:canAutomate() then return end
  442.   local start_entry = GetQuestLogSelection()
  443.   local num_entries = GetNumQuestLogEntries()
  444.   local title
  445.   local is_complete
  446.   local no_objectives
  447.  
  448.   self.completed_quests = {}
  449.   self.incomplete_quests = {}
  450.  
  451.   if num_entries > 0 then
  452.     for i = 1, num_entries do
  453.       SelectQuestLogEntry(i)
  454.       title, _, _, _, _, _, is_complete = GetQuestLogTitle(i)
  455.       no_objectives = GetNumQuestLeaderBoards(i) == 0
  456.       if title then
  457.         if is_complete or no_objectives then
  458.           self.completed_quests[title] = true
  459.         else
  460.           self.incomplete_quests[title] = true
  461.         end
  462.       end
  463.     end
  464.   end
  465.  
  466.   SelectQuestLogEntry(start_entry)
  467. end
  468.  
  469. function addon:GOSSIP_SHOW ()
  470.   if not self:canAutomate() then return end
  471.  
  472.   local button
  473.   local text
  474.  
  475.   for i = 1, 32 do
  476.     button = _G['GossipTitleButton' .. i]
  477.     if button:IsVisible() then
  478.       text = self:strip_text(button:GetText())
  479.       ABCDE={button:GetText(), text}
  480.       if button.type == 'Available' then
  481.         button:Click()
  482.       elseif button.type == 'Active' then
  483.         if self.completed_quests[text] then
  484.           button:Click()
  485.         end
  486.       end
  487.     end
  488.   end
  489. end
  490.  
  491. function addon:QUEST_GREETING (...)
  492.   if not self:canAutomate() then return end
  493.  
  494.   local button
  495.   local text
  496.  
  497.   for i = 1, 32 do
  498.     button = _G['QuestTitleButton' .. i]
  499.     if button:IsVisible() then
  500.       text = self:strip_text(button:GetText())
  501.       if self.completed_quests[text] then
  502.         button:Click()
  503.       elseif not self.incomplete_quests[text] then
  504.         button:Click()
  505.       end
  506.     end
  507.   end
  508. end
  509.  
  510. function addon:QUEST_DETAIL ()
  511.   if not self:canAutomate() then return end
  512.   AcceptQuest()
  513. end
  514. function addon:QUEST_COMPLETE (event)
  515.   if not self:canAutomate() then return end
  516.   if GetNumQuestChoices() <= 1 then
  517.     GetQuestReward(QuestFrameRewardPanel.itemChoice)
  518. end end
  519. function addon.onevent (self, event, ...)
  520.   if self[event] then
  521.     self[event](self, ...)
  522.   end
  523. end
  524. addon:SetScript('OnEvent', addon.onevent)
  525. addon:RegisterEvent('GOSSIP_SHOW')
  526. addon:RegisterEvent('QUEST_COMPLETE')
  527. addon:RegisterEvent('QUEST_DETAIL')
  528. addon:RegisterEvent('QUEST_FINISHED')
  529. addon:RegisterEvent('QUEST_GREETING')
  530. addon:RegisterEvent('QUEST_LOG_UPDATE')
  531. addon:RegisterEvent('QUEST_PROGRESS')
  532. _G.HbitAutoQuest = addon
  533. end
  534.  
  535. if (SellGrey == 1) then
  536. local function OnEvent()
  537.     for bag=0,4 do
  538.         for slot=0,GetContainerNumSlots(bag) do
  539.             local link = GetContainerItemLink(bag, slot)
  540.             if link and select(3, GetItemInfo(link)) == 0 then
  541.                 ShowMerchantSellCursor(1)
  542.                 UseContainerItem(bag, slot)
  543.             end
  544.         end
  545.     end
  546. end
  547.  
  548. local f = CreateFrame("Frame")
  549. f:RegisterEvent("MERCHANT_SHOW")
  550. f:SetScript("OnEvent", OnEvent)
  551.  
  552. if MerchantFrame:IsVisible() then OnEvent() end
  553.     end
  554.  
  555.  
  556. if (displayUA == 1) then
  557. local oldCompactUnitFrame_UtilIsPriorityDebuff = CompactUnitFrame_UtilIsPriorityDebuff
  558. CompactUnitFrame_UtilIsPriorityDebuff = function(...)
  559.         local unit, index, filter = ...
  560.         if select(11, UnitDebuff(unit, index, filter)) == 30108 then -- UA
  561.                 return true
  562.         end
  563.         return oldCompactUnitFrame_UtilIsPriorityDebuff(...)
  564. end end
  565.  
  566. if (arenatrinkets == 1) then
  567. local trinkets = {}
  568. local events = CreateFrame("Frame")
  569.  
  570. function events:ADDON_LOADED(addonName)
  571.     if addonName ~= "Blizzard_ArenaUI" then
  572.         return
  573.     end
  574.  
  575.     local arenaFrame, trinket
  576.     for i = 1, MAX_ARENA_ENEMIES do
  577.         arenaFrame = "ArenaEnemyFrame"..i
  578.         trinket = CreateFrame("Cooldown", arenaFrame.."Trinket", ArenaEnemyFrames)
  579.         trinket:SetPoint("Right", arenaFrame, 29, -5)
  580.         trinket:SetSize(30, 30)
  581.         trinket.icon = trinket:CreateTexture(nil, "BACKGROUND")
  582.         trinket.icon:SetAllPoints()
  583.         trinket.icon:SetTexture("Interface\\Icons\\inv_jewelry_trinketpvp_01")
  584.         trinket:Hide()
  585.         trinkets["arena"..i] = trinket
  586.     end
  587.     self:UnregisterEvent("ADDON_LOADED")
  588. end
  589.  
  590. function events:UNIT_SPELLCAST_SUCCEEDED(unitID, spell, rank, lineID, spellID)
  591.     if not trinkets[unitID] then
  592.         return
  593.     end
  594.     if spellID == 59752 or spellID == 42292 then
  595.         CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 120, 1)
  596.         SendChatMessage("Trinket used by: "..GetUnitName(unitID, true), "PARTY")
  597.     elseif spellID == 7744 then
  598.         CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 45, 1)
  599.         SendChatMessage("WotF used by: "..GetUnitName(unitID, true), "PARTY")
  600.     end
  601. end
  602.  
  603. function events:PLAYER_ENTERING_WORLD()
  604.     local _, instanceType = IsInInstance()
  605.     if instanceType == "arena" then
  606.         self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  607.     elseif self:IsEventRegistered("UNIT_SPELLCAST_SUCCEEDED") then
  608.         self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  609.         for _, trinket in pairs(trinkets) do
  610.             trinket:SetCooldown(0, 0)
  611.             trinket:Hide()
  612.         end
  613.     end
  614. end
  615.  
  616. SLASH_BAF1 = "/baf"
  617. SlashCmdList["BAF"] = function(msg, editBox)
  618.     if not IsAddOnLoaded("Blizzard_ArenaUI") then
  619.         LoadAddOn("Blizzard_ArenaUI")
  620.     end
  621.     ArenaEnemyFrames:Show()
  622.     local arenaFrame
  623.     for i = 1, MAX_ARENA_ENEMIES do
  624.         arenaFrame = _G["ArenaEnemyFrame"..i]
  625.         arenaFrame.classPortrait:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles")
  626.         arenaFrame.classPortrait:SetTexCoord(unpack(CLASS_ICON_TCOORDS["WARRIOR"]))
  627.         arenaFrame.name:SetText("Dispelme")
  628.         arenaFrame:Show()
  629.         CooldownFrame_SetTimer(trinkets["arena"..i], GetTime(), 120, 1)
  630.     end
  631. end
  632.  
  633. events:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end)
  634. events:RegisterEvent("ADDON_LOADED")
  635. events:RegisterEvent("PLAYER_ENTERING_WORLD")
  636. end
  637.  
  638. if (altInvite == 1) then
  639. local AltInvite = SetItemRef
  640. SetItemRef = function(link, text, button)
  641.     local linkType = string.sub(link, 1, 6)
  642.     if IsAltKeyDown() and linkType == "player" then
  643.         local name = string.match(link, "player:([^:]+)")
  644.         InviteUnit(name)
  645.         return nil
  646.     end
  647.     return AltInvite(link,text,button)
  648. end end
  649.  
  650. if (MoveArenaFrames == 1) then
  651.  
  652. SlashCmdList["MOVEARENA"] = function() f=ArenaEnemyFrame1; f:SetUserPlaced(true) f:SetMovable(true) f:EnableMouse(true) f:RegisterForDrag("LeftButton") f:SetScript("OnDragStart",f.StartMoving) f:SetScript("OnDragStop",f.StopMovingOrSizing) end
  653. SLASH_MOVEARENA1 = "/movearena"
  654. end
  655.    
  656. if (HideShapeShift == 1) then
  657. --[[local EventFrame = CreateFrame("Frame")
  658. EventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
  659. EventFrame:SetScript("OnEvent", function(self,event,...)
  660. ShapeshiftBarFrame:Hide() end) end]]
  661.  
  662.     for i = 1, NUM_SHAPESHIFT_SLOTS do
  663.         local button = _G['ShapeshiftButton'..i]
  664.         button:SetAlpha(0)
  665.         button.SetAlpha = function() end
  666.  
  667.         button:EnableMouse(false)
  668.         button.EnableMouse = function() end
  669.     end end
  670.  
  671. if (chatShorten == 1) then
  672.  --guild
  673.   CHAT_GUILD_GET = "|Hchannel:GUILD|hG|h %s "
  674.   CHAT_OFFICER_GET = "|Hchannel:OFFICER|hO|h %s "
  675.    
  676.   --raid
  677.   CHAT_RAID_GET = "|Hchannel:RAID|hR|h %s "
  678.   CHAT_RAID_WARNING_GET = "RW %s "
  679.   CHAT_RAID_LEADER_GET = "|Hchannel:RAID|hRL|h %s "
  680.  
  681.   --party
  682.   CHAT_PARTY_GET = "|Hchannel:PARTY|hP|h %s "
  683.   CHAT_PARTY_LEADER_GET =  "|Hchannel:PARTY|hPL|h %s "
  684.   CHAT_PARTY_GUIDE_GET =  "|Hchannel:PARTY|hPG|h %s "
  685.  
  686.   --bg
  687.   CHAT_BATTLEGROUND_GET = "|Hchannel:BATTLEGROUND|hB|h %s "
  688.   CHAT_BATTLEGROUND_LEADER_GET = "|Hchannel:BATTLEGROUND|hBL|h %s "
  689.  
  690.   --whisper  
  691.   CHAT_WHISPER_INFORM_GET = "to %s "
  692.   CHAT_WHISPER_GET = "%s " -- from
  693.   CHAT_BN_WHISPER_INFORM_GET = "to %s "
  694.   CHAT_BN_WHISPER_GET = "%s " -- from
  695.  
  696.   --say / yell
  697.   CHAT_SAY_GET = "%s "
  698.   CHAT_YELL_GET = "%s "
  699.  
  700.   --flags
  701.   CHAT_FLAG_AFK = "[AFK] "
  702.   CHAT_FLAG_DND = "[DND] "
  703.   CHAT_FLAG_GM = "[GM] "
  704.  
  705.   local gsub = _G.string.gsub
  706.      
  707.   for i = 1, NUM_CHAT_WINDOWS do
  708.     if ( i ~= 2 ) then
  709.       local f = _G["ChatFrame"..i]
  710.       local am = f.AddMessage
  711.       f.AddMessage = function(frame, text, ...)
  712.         return am(frame, text:gsub('|h%[(%d+)%. .-%]|h', '|h%1|h'), ...)
  713.       end
  714.     end
  715.   end
  716.  end
  717.  
  718.  
  719. if (autoRepair == 1) then
  720. local function OnEvent()
  721.     RepairAllItems()
  722.         end
  723.    
  724.  
  725. local f = CreateFrame("Frame")
  726. f:RegisterEvent("MERCHANT_SHOW")
  727. f:SetScript("OnEvent", OnEvent)
  728.  
  729. if MerchantFrame:IsVisible() then OnEvent() end
  730.     end
  731.    
  732. if (autoGRepair == 1) then
  733. local function OnEvent()
  734.     RepairAllItems(1)
  735.         end
  736.    
  737.  
  738. local f = CreateFrame("Frame")
  739. f:RegisterEvent("MERCHANT_SHOW")
  740. f:SetScript("OnEvent", OnEvent)
  741.  
  742. if MerchantFrame:IsVisible() then OnEvent() end
  743.     end
  744.    
  745.    
  746. if (tellTarget == 1) then
  747. for i=1, NUM_CHAT_WINDOWS do
  748.     local editbox = _G["ChatFrame"..i.."EditBox"]
  749.     editbox:HookScript("OnTextChanged", function(self)
  750.         local text = self:GetText()
  751.         if text:len() < 5 then
  752.             if text:sub(1, 4) == "/tt " then
  753.                 local unitname, realm
  754.                 unitname, realm = UnitName("target")
  755.                 if unitname then unitname = gsub(unitname, " ", "") end
  756.                 if unitname and not UnitIsSameServer("player", "target") then
  757.                     unitname = unitname .. "-" .. gsub(realm, " ", "")
  758.                 end
  759.                 ChatFrame_SendTell((unitname or L.chat_invalidtarget), ChatFrame1)
  760.             end
  761.         end
  762.     end)
  763. end
  764.  
  765. SLASH_TELLTARGET1 = "/tt"
  766. SLASH_TELLTARGET2 = "/telltarget"
  767. SlashCmdList.TELLTARGET = function(msg)
  768.     local unitname, realm
  769.     unitname, realm = UnitName("target")
  770.     if not unitname then return end
  771.     if unitname then unitname = gsub(unitname, " ", "") end
  772.     if unitname and not UnitIsSameServer("player", "target") then
  773.         unitname = unitname .. "-" .. gsub(realm, " ", "")
  774.     end
  775.     SendChatMessage(msg, "WHISPER", nil, unitname)
  776. end end
  777.  
  778. if (hideBags == 1) then
  779. local t = {
  780.     "MainMenuBarBackpackButton",
  781.     "CharacterBag0Slot",
  782.     "CharacterBag1Slot",
  783.     "CharacterBag2Slot",
  784.     "CharacterBag3Slot",
  785. }
  786.  
  787. local function showFoo(self)
  788.     for _, v in ipairs(t) do
  789.         _G[v]:SetAlpha(1)
  790.     end
  791. end
  792.  
  793. local function hideFoo(self)
  794.     for _, v in ipairs(t) do
  795.         _G[v]:SetAlpha(0)
  796.     end
  797. end
  798.  
  799. for _, v in ipairs(t) do
  800.     v = _G[v]
  801.     v:HookScript("OnEnter", showFoo)
  802.     v:HookScript("OnLeave", hideFoo)
  803.     v:SetAlpha(0)
  804. end end
  805.  
  806. if (tabChangerPvP == 1) then
  807. local tabChanger = CreateFrame("Frame")
  808. tabChanger:SetScript("OnEvent", function(self, event, ...)
  809.         if self[event] then
  810.                 return self[event](self, event, ...)
  811.         end
  812. end)
  813. tabChanger:RegisterEvent("PLAYER_ENTERING_WORLD")
  814. tabChanger:RegisterEvent("ZONE_CHANGED_NEW_AREA")
  815.  
  816. function tabChanger:PLAYER_ENTERTING_WORLD()
  817.         self:ZONE_CHANGED_NEW_AREA()
  818. end
  819.  
  820. function tabChanger:ZONE_CHANGED_NEW_AREA()
  821.         local type = select(2, IsInInstance())
  822.         local TabZone = {
  823.                 ["pvp"] = true,
  824.                 ["arena"] = true,
  825.         }
  826.         if TabZone[type] then
  827.                 SetBinding("TAB", "TARGETNEARESTENEMYPLAYER", 1)
  828.         else
  829.                 SetBinding("TAB", "TARGETNEARESTENEMY", 1)
  830.         end
  831. end end
  832.  
  833. if (arenaMinimapHide == 1) then
  834. local MinimapHide = CreateFrame("Frame")
  835. MinimapHide:SetScript("OnEvent", function(self, event, ...)
  836.         if self[event] then
  837.                 return self[event](self, event, ...)
  838.         end
  839. end)
  840. MinimapHide:RegisterEvent("PLAYER_ENTERING_WORLD")
  841. MinimapHide:RegisterEvent("ZONE_CHANGED_NEW_AREA")
  842.  
  843. function MinimapHide:PLAYER_ENTERTING_WORLD()
  844.         self:ZONE_CHANGED_NEW_AREA()
  845. end
  846.  
  847. function MinimapHide:ZONE_CHANGED_NEW_AREA()
  848.         local type = select(2, IsInInstance())
  849.         local TabZone = {
  850.                 ["pvp"] = true,
  851.                 ["arena"] = true,
  852.         }
  853.         if TabZone[type] then
  854.                 MinimapCluster:Hide()
  855.         else
  856.                 MinimapCluster:Show()
  857.         end
  858. end end
  859.  
  860. if (autoInvite == 1) then
  861. ------------------------------------------------------------------------
  862. -- Auto invite by whisper
  863. ------------------------------------------------------------------------
  864.  
  865. local ainvenabled = false
  866. local ainvkeyword = "invite"
  867.  
  868. local autoinvite = CreateFrame("frame")
  869. autoinvite:RegisterEvent("CHAT_MSG_WHISPER")
  870. autoinvite:SetScript("OnEvent", function(self,event,arg1,arg2)
  871.     if ((not UnitExists("party1") or IsPartyLeader("player") or IsRaidOfficer("player") or IsRaidLeader("player")) and arg1:lower():match(ainvkeyword)) and ainvenabled == true then
  872.         InviteUnit(arg2)
  873.     end
  874. end)
  875.  
  876. function SlashCmdList.AUTOINVITE(msg, editbox)
  877.     if msg == "off" then
  878.         ainvenabled = false
  879.     elseif msg == "" then
  880.         ainvenabled = true
  881.         ainvkeyword = "invite"
  882.     else
  883.         ainvenabled = true
  884.         ainvkeyword = msg
  885.     end
  886. end
  887. SLASH_AUTOINVITE1 = "/ainv" end
  888.  
  889. if (menuHide == 1) then
  890. local function showFoo(self)
  891.     for _, v in ipairs(MICRO_BUTTONS) do
  892.         _G[v]:SetAlpha(1)
  893.     end
  894. end
  895.  
  896. local function hideFoo(self)
  897.     for _, v in ipairs(MICRO_BUTTONS) do
  898.         _G[v]:SetAlpha(0)
  899.     end
  900. end
  901.  
  902. for _, v in ipairs(MICRO_BUTTONS) do
  903.     v = _G[v]
  904.     v:HookScript("OnEnter", showFoo)
  905.     v:HookScript("OnLeave", hideFoo)
  906.     v:SetAlpha(0)
  907. end end
  908.  
  909. if (urlCopy == 1) then
  910. local color = "C0C0C0"
  911. local pattern = "[wWhH][wWtT][wWtT][\46pP]%S+[^%p%s]"
  912.  
  913. function string.color(text, color)
  914.     return "|cff"..color..text.."|r"
  915. end
  916.  
  917. function string.link(text, type, value, color)
  918.     return "|H"..type..":"..tostring(value).."|h"..tostring(text):color(color or "ffffff").."|h"
  919. end
  920.  
  921. StaticPopupDialogs["LINKME"] = {
  922.     text = "URL COPY",
  923.     button2 = CANCEL,
  924.     hasEditBox = true,
  925.     editBoxWidth = 400,
  926.     timeout = 0,
  927.     exclusive = 1,
  928.     hideOnEscape = 1,
  929.     EditBoxOnEscapePressed = function(self) self:GetParent():Hide() end,
  930.     whileDead = 1,
  931.     maxLetters = 255,
  932. }
  933.  
  934. local function f(url)
  935.     return string.link("["..url.."]", "url", url, color)
  936. end
  937.  
  938. local function hook(self, text, ...)
  939.     self:f(text:gsub(pattern, f), ...)
  940. end
  941.  
  942. function LinkMeURL()
  943.     for i = 1, NUM_CHAT_WINDOWS do
  944.         if ( i ~= 2 ) then
  945.             local lframe = _G["ChatFrame"..i]
  946.             lframe.f = lframe.AddMessage
  947.             lframe.AddMessage = hook
  948.         end
  949.     end
  950. end
  951. LinkMeURL()
  952.  
  953. local ur = ChatFrame_OnHyperlinkShow
  954. function ChatFrame_OnHyperlinkShow(self, link, text, button)
  955.     local type, value = link:match("(%a+):(.+)")
  956.     if ( type == "url" ) then
  957.         local dialog = StaticPopup_Show("LINKME")
  958.         local editbox1 = _G[dialog:GetName().."EditBox"]  
  959.         editbox1:SetText(value)
  960.         editbox1:SetFocus()
  961.         editbox1:HighlightText()
  962.         local button = _G[dialog:GetName().."Button2"]
  963.            
  964.         button:ClearAllPoints()
  965.            
  966.         button:SetPoint("CENTER", editbox1, "CENTER", 0, -30)
  967.     else
  968.         ur(self, link, text, button)
  969.     end
  970. end end
  971.  
  972. if (expFade == 1) then
  973. local function show(self)
  974.     self:SetAlpha(1)
  975. end
  976. local function hide(self)
  977.     self:SetAlpha(0)
  978. end
  979. local f = MainMenuExpBar
  980. f:HookScript("OnEnter", show)
  981. f:HookScript("OnLeave", hide)
  982. f:SetAlpha(0)
  983.  
  984. end
  985.  
  986. local function updatehotkey(self, actionButtonType)
  987.     local hotkey = _G[self:GetName() .. 'HotKey']
  988.     local text = hotkey:GetText()
  989.     local replace = string.gsub
  990.    
  991.     text = replace(text, '(s%-)', 'S')
  992.     text = replace(text, '(a%-)', 'A')
  993.     text = replace(text, '(c%-)', 'C')
  994.     text = replace(text, '(Mouse Button )', 'M')
  995.     text = replace(text, '(Mouse Wheel Up)', 'MU')
  996.     text = replace(text, '(Mouse Wheel Down)', 'MD')
  997.     text = replace(text, '(Middle Mouse)', 'M3')
  998.     text = replace(text, '(Num Pad )', 'N')
  999.     text = replace(text, '(Page Up)', 'PU')
  1000.     text = replace(text, '(Page Down)', 'PD')
  1001.     text = replace(text, '(Spacebar)', 'SpB')
  1002.     text = replace(text, '(Insert)', 'Ins')
  1003.     text = replace(text, '(Home)', 'Hm')
  1004.     text = replace(text, '(Delete)', 'Del')
  1005.    
  1006.     if hotkey:GetText() == _G['RANGE_INDICATOR'] then
  1007.         hotkey:SetText('')
  1008.     else
  1009.         hotkey:SetText(text)
  1010.     end
  1011. end
  1012.  
  1013. if (chatTabs == 1) then
  1014. --[[
  1015.     Fane
  1016.    
  1017.     All credits of this chattabs script is by Fane and his author Haste.
  1018. --]]
  1019.  
  1020. local Fane = CreateFrame'Frame'
  1021. local inherit = GameFontNormalSmall
  1022.  
  1023. local updateFS = function(self, inc, flags, ...)
  1024.     local fstring = self:GetFontString()
  1025.  
  1026.     local font, fontSize = inherit:GetFont()
  1027.     if(inc) then
  1028.         fstring:SetFont(font, fontSize + 1, flags)
  1029.     else
  1030.         fstring:SetFont(font, fontSize, flags)
  1031.     end
  1032.  
  1033.     if((...)) then
  1034.         fstring:SetTextColor(...)
  1035.     end
  1036. end
  1037.  
  1038. local OnEnter = function(self)
  1039.     local emphasis = _G["ChatFrame"..self:GetID()..'TabFlash']:IsShown()
  1040.     updateFS(self, emphasis, 'OUTLINE', 1, 1, 1, 1)
  1041. end
  1042.  
  1043. local OnLeave = function(self)
  1044.     local r, g, b, al
  1045.     local id = self:GetID()
  1046.     local emphasis = _G["ChatFrame"..id..'TabFlash']:IsShown()
  1047.  
  1048.     if (_G["ChatFrame"..id] == SELECTED_CHAT_FRAME) then
  1049.         r, g, b, al = 1, 1, 1, 0
  1050.     elseif emphasis then
  1051.         r, g, b, al = 1, 0, 0, 1
  1052.     else
  1053.         r, g, b, al = 1, 1, 1, 0
  1054.     end
  1055.  
  1056.     updateFS(self, emphasis, nil, r, g, b, al)
  1057. end
  1058.  
  1059. local ChatFrame2_SetAlpha = function(self, alpha)
  1060.     if(CombatLogQuickButtonFrame_Custom) then
  1061.         CombatLogQuickButtonFrame_Custom:SetAlpha(alpha)
  1062.     end
  1063. end
  1064.  
  1065. local ChatFrame2_GetAlpha = function(self)
  1066.     if(CombatLogQuickButtonFrame_Custom) then
  1067.         return CombatLogQuickButtonFrame_Custom:GetAlpha()
  1068.     end
  1069. end
  1070.  
  1071. local faneifyTab = function(frame, sel)
  1072.     local i = frame:GetID()
  1073.  
  1074.     if(not frame.Fane) then
  1075.         frame.leftTexture:Hide()
  1076.         frame.middleTexture:Hide()
  1077.         frame.rightTexture:Hide()
  1078.  
  1079.         frame.leftSelectedTexture:Hide()
  1080.         frame.middleSelectedTexture:Hide()
  1081.         frame.rightSelectedTexture:Hide()
  1082.  
  1083.         frame.leftSelectedTexture.Show = frame.leftSelectedTexture.Hide
  1084.         frame.middleSelectedTexture.Show = frame.middleSelectedTexture.Hide
  1085.         frame.rightSelectedTexture.Show = frame.rightSelectedTexture.Hide
  1086.  
  1087.         frame.leftHighlightTexture:Hide()
  1088.         frame.middleHighlightTexture:Hide()
  1089.         frame.rightHighlightTexture:Hide()
  1090.  
  1091.         frame:HookScript('OnEnter', OnEnter)
  1092.         frame:HookScript('OnLeave', OnLeave)
  1093.  
  1094.         frame:SetAlpha(1)
  1095.  
  1096.         if(i ~= 2) then
  1097.             -- Might not be the best solution, but we avoid hooking into the UIFrameFade
  1098.             -- system this way.
  1099.             frame.SetAlpha = UIFrameFadeRemoveFrame
  1100.         else
  1101.             frame.SetAlpha = ChatFrame2_SetAlpha
  1102.             frame.GetAlpha = ChatFrame2_GetAlpha
  1103.  
  1104.             -- We do this here as people might be using AddonLoader together with Fane.
  1105.             if(CombatLogQuickButtonFrame_Custom) then
  1106.                 CombatLogQuickButtonFrame_Custom:SetAlpha(.4)
  1107.             end
  1108.         end
  1109.  
  1110.         frame.Fane = true
  1111.     end
  1112.  
  1113.     -- We can't trust sel. :(
  1114.     if(i == SELECTED_CHAT_FRAME:GetID()) then
  1115.         updateFS(frame, nil, nil, 1, 1, 1, 0)
  1116.     else
  1117.         updateFS(frame, nil, nil, 1, 1, 1, 0)
  1118.     end
  1119. end
  1120.  
  1121. hooksecurefunc('FCF_StartAlertFlash', function(frame)
  1122.     local tab = _G['ChatFrame' .. frame:GetID() .. 'Tab']
  1123.     updateFS(tab, true, nil, 1, 0, 0)
  1124. end)
  1125.  
  1126. hooksecurefunc('FCFTab_UpdateColors', faneifyTab)
  1127.  
  1128. for i=1,7 do
  1129.     faneifyTab(_G['ChatFrame' .. i .. 'Tab'])
  1130. end
  1131.  
  1132. function Fane:ADDON_LOADED(event, addon)
  1133.     if(addon == 'Blizzard_CombatLog') then
  1134.         self:UnregisterEvent(event)
  1135.         self[event] = nil
  1136.  
  1137.         return CombatLogQuickButtonFrame_Custom:SetAlpha(.4)
  1138.     end
  1139. end
  1140. Fane:RegisterEvent'ADDON_LOADED'
  1141.  
  1142. Fane:SetScript('OnEvent', function(self, event, ...)
  1143.     return self[event](self, event, ...)
  1144. end)
  1145. end
  1146.  
  1147. if (slashCommands == 1) then
  1148. -- Some Slash Commands
  1149.  
  1150. SlashCmdList["RELOADUI"] = function() ReloadUI() end
  1151. SLASH_RELOADUI1 = "/rl"
  1152.  
  1153. SlashCmdList["RCSLASH"] = function() DoReadyCheck() end
  1154. SLASH_RCSLASH1 = "/rc"
  1155.  
  1156. SlashCmdList["TICKET"] = function() ToggleHelpFrame() end
  1157. SLASH_TICKET1 = "/gm"
  1158.  
  1159. end
  1160.  
  1161. if (altBuy == 1) then
  1162. -- buy max number value with alt
  1163. local savedMerchantItemButton_OnModifiedClick = MerchantItemButton_OnModifiedClick
  1164. function MerchantItemButton_OnModifiedClick(self, ...)
  1165.     if ( IsAltKeyDown() ) then
  1166.         local maxStack = select(8, GetItemInfo(GetMerchantItemLink(self:GetID())))
  1167.         if ( maxStack and maxStack > 1 ) then
  1168.             BuyMerchantItem(self:GetID(), GetMerchantItemMaxStack(self:GetID()))
  1169.         end
  1170.     end
  1171.     savedMerchantItemButton_OnModifiedClick(self, ...)
  1172. end end
  1173.  
  1174. --[[ TEMPLATE --
  1175. local function show(self)
  1176.     self:SetAlpha(1)
  1177. end
  1178. local function hide(self)
  1179.     self:SetAlpha(0)
  1180. end
  1181. local f = PlayerFrame
  1182. f:SetScript("OnEnter", showFoo)
  1183. f:SetScript("OnLeave", hideFoo)
  1184. f:SetAlpha(0)
  1185.  
  1186. end--]]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top