Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[AftermathhUI = {}
- AftermathhUI.Class = select(2, UnitClass('player'))
- AftermathhUI.Classcolor = RAID_CLASS_COLORS[AftermathhUI.Class]
- local inf = math.huge
- AftermathhUI.ColorGradient = function(perc, ...)
- -- Translate divison by zeros into 0, so we don't blow select.
- -- We check perc against itself because we rely on the fact that NaN can't equal NaN.
- if(perc ~= perc or perc == inf) then perc = 0 end
- if perc >= 1 then
- local r, g, b = select(select('#', ...) - 2, ...)
- return r, g, b
- elseif perc <= 0 then
- local r, g, b = ...
- return r, g, b
- end
- local num = select('#', ...) / 3
- local segment, relperc = math.modf(perc*(num-1))
- local r1, g1, b1, r2, g2, b2 = select((segment*3)+1, ...)
- return r1 + (r2-r1)*relperc, g1 + (g2-g1)*relperc, b1 + (b2-b1)*relperc
- end
- local function Minimap_FormatValue(i)
- if (i > 1024) then
- return format('%.2f MB', i/1024)
- else
- return format('%.2f KB', i)
- end
- end
- TimeManagerClockButton:SetScript('OnEnter', function(self)
- collectgarbage()
- UpdateAddOnMemoryUsage()
- local entry
- local total = 0
- local addons = {}
- local gradient = {0, 1, 0, 1, 1, 0, 1, 0, 0}
- for i = 1, GetNumAddOns() do
- if (IsAddOnLoaded(i)) then
- local memory = GetAddOnMemoryUsage(i)
- total = total + memory
- entry = {
- name = GetAddOnInfo(i),
- memory = memory
- }
- tinsert(addons, entry)
- table.sort(addons, function(a, b)
- return a.memory > b.memory
- end)
- end
- end
- GameTooltip:SetOwner(self, 'ANCHOR_BOTTOMLEFT')
- for _, content in pairs(addons) do
- local r, g, b = AftermathhUI.ColorGradient((content.memory / 800), unpack(gradient))
- GameTooltip:AddDoubleLine(content.name, Minimap_FormatValue(content.memory), 1, 1, 1, r, g, b)
- end
- local r, g, b = AftermathhUI.ColorGradient((entry.memory / 800), unpack(gradient))
- GameTooltip:AddLine(' ')
- GameTooltip:AddDoubleLine('AddOns', Minimap_FormatValue(total), AftermathhUI.Classcolor.r, AftermathhUI.Classcolor.g, AftermathhUI.Classcolor.b, r, g, b)
- GameTooltip:Show()
- end)--]]
- -- Move bars
- MultiBarBottomRight:ClearAllPoints()
- MultiBarBottomRight:SetPoint("BOTTOM",-254,100)
- MainMenuBar:ClearAllPoints()
- MainMenuBar:SetPoint("BOTTOMRIGHT",50,0)
- -- reduce the size of some main menu bar objects
- --[[for _, object in pairs({
- _G['MainMenuBar'],
- _G['MainMenuExpBar'],
- _G['MainMenuBarMaxLevelBar'],
- _G['ReputationWatchBar'],
- _G['ReputationWatchStatusBar'],
- }) do
- object:SetWidth(512)
- end]]
- -- <Config> --
- -- If you are in-game and want to change some optinos, simply change them in this .lua file and /rl (reload ui)
- -- 1 = Enabled , 0 = Disabled --
- -- // Frames
- local ClassPortraits = 1 -- Class icons instead of portraits.
- local CurrentHPMPValues = 1 -- Only displays current values: eg. instead of 154.1k/154.3k it displays just 154.1k
- local MoveToT = 1 -- Moves the target of target, so that all buffs/debuffs are visible.
- local MoveFT = 1 -- Moves focus target to make all buffs/debuffs visible.
- local PlayerPetHitIndicatorHide = 1 -- Hides player and pet hit indicator. (the combat text on the portraits.)
- local PlayerNameOff = 1 -- Hides player name.
- local PetNameOff = 1 -- Hides pet name.
- local PvPIconOff = 1 -- Hides the pvp icons on player/target.
- local displayUA = 1 -- Always display UA on raid frames.
- local arenatrinkets = 1 -- Says in party when enemy trinkets are used & use /baf to show arena frames out of arena.
- local MoveArenaFrames = 1 -- /Movearena to move arena frames.
- -- // Bars
- local KeybindsHide = 0 -- Hides the keybinding text on the action bars.
- local MacroTextHide = 1 -- Hides the macro text on the action bars.
- local TexturesHide = 1 -- Hides various action bar textures.
- local RedOutofRange = 0 -- Makes the whole button red when out of range, instead of just the keybinding.
- local HideShapeShift = 1 -- Hides the various shapeshift bars.
- local hideBags = 1 -- Fades the bags if not mouseovered.
- local menuHide = 1 -- Fades the menu icons if not mouseovered.
- local expFade = 1 -- Fades the exp bar if not mouseovered.
- -- // Misc
- local HbitErrors = 1 -- Hides the error frame (unfortunately this also hides quest progress)
- local LanguageFilterOff = 1 -- Forces mature language filter off.
- local AutoQuest = 1 -- Automatically accepts/completes quests if shift is held down.
- local SellGrey = 1 -- Sells all greys without asking.
- local autoRepair = 1 -- Auto repairs.
- local autoGRepair = 0 -- Auto repairs with guild funds. Only one of the repair options should be enabled.
- local tabChangerPvP = 1 -- Changes tab to only target nearest player in PvP.
- local arenaMinimapHide = 0 -- Hides the minimap when in arena.
- 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".
- local altBuy = 1 -- Automatically buys a stack of whatever by a merchant if alt is held down.
- -- // Minimap
- local HbitMinimap = 1 -- Hides minimap clutter, and enables minimap mousewheel zoom.
- -- // Chat
- local ChatMouseScroll = 1 -- Enables chat scroll with mousewheel (holding shift goes either to the top if scrolling up and down if scrolling down.)
- local ChatClutterHide = 1 -- Hides various clutter on the chat.
- local altInvite = 1 -- Hold alt and click on player name to invite in the chat.
- local chatShorten = 1 -- Shortens the various channel names.
- local tellTarget = 1 -- Use either /tt or /telltarget to whisper your current target.
- local NUM_LINES_TO_SCROLL = 4 -- Number of lines to scroll with mousewheel.
- local urlCopy = 1 -- Makes urls clickable to copy them.
- local chatTabs = 1 -- Makes the chattabs prettier and cleaner.
- local slashCommands = 1 -- /gm for opening a ticket. /rc for readycheck /rl for reload ui.
- -- </Config> --
- if (ClassPortraits == 1) then
- UFP="UnitFramePortrait_Update" UICC="Interface\\TargetingFrame\\UI-Classes-Circles" CIT=CLASS_ICON_TCOORDS UC=UnitClass
- 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)
- end
- if (KeybindsHide == 1) then
- for i=1,12 do _G["ActionButton"..i.."HotKey"]:SetAlpha(0)end;for i=1,12 do
- _G["MultiBarBottomRightButton"..i.."HotKey"]:SetAlpha(0)end;for i=1,12 do
- _G["MultiBarBottomLeftButton"..i.."HotKey"]:SetAlpha(0)end; for i=1,12 do
- _G["MultiBarRightButton"..i.."HotKey"]:SetAlpha(0)end; for i=1,12 do
- _G["MultiBarLeftButton"..i.."HotKey"]:SetAlpha(0)end
- end
- if (MacroTextHide == 1) then
- for i=1,12 do _G["ActionButton"..i.."Name"]:SetAlpha(0)end;for i=1,12 do
- _G["MultiBarBottomRightButton"..i.."Name"]:SetAlpha(0)end;for i=1,12 do
- _G["MultiBarBottomLeftButton"..i.."Name"]:SetAlpha(0)end; for i=1,12 do
- _G["MultiBarRightButton"..i.."Name"]:SetAlpha(0)end; for i=1,12 do
- _G["MultiBarLeftButton"..i.."Name"]:SetAlpha(0)end
- end
- if (HbitErrors == 1) then
- UIErrorsFrame:Hide()
- end
- if (HbitMinimap == 1) then
- MinimapCluster:SetScale(0.9)
- MinimapCluster:SetPoint("TOPRIGHT", "UIParent", "TOPRIGHT", -5, 0)
- MinimapCluster:SetAlpha(0.835)
- MinimapBorderTop:Hide()
- MiniMapWorldMapButton:Hide()
- MinimapZoneText:SetPoint("TOPLEFT","MinimapZoneTextButton","TOPLEFT", 8, 0)
- MinimapZoomIn:Hide()
- MinimapZoomOut:Hide()
- Minimap:SetScript('OnMouseWheel', function(self, delta)
- if delta > 0 then
- Minimap_ZoomIn()
- else
- Minimap_ZoomOut()
- end
- end)
- local EventFrame = CreateFrame("Frame")
- EventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
- EventFrame:SetScript("OnEvent", function(self,event,...)
- MinimapNorthTag:Hide()
- end)
- end
- if (TexturesHide == 1) then
- MainMenuBarTexture0:Hide()
- MainMenuBarTexture1:Hide()
- MainMenuBarTexture2:Hide()
- MainMenuBarTexture3:Hide()
- BonusActionBarFrameTexture1:SetAlpha(0)
- BonusActionBarFrameTexture2:SetAlpha(0)
- BonusActionBarFrameTexture3:SetAlpha(0)
- BonusActionBarFrameTexture4:SetAlpha(0)
- MainMenuMaxLevelBar0:Hide()
- MainMenuMaxLevelBar1:Hide()
- MainMenuMaxLevelBar2:Hide()
- MainMenuMaxLevelBar3:Hide()
- MainMenuBarLeftEndCap:Hide()
- MainMenuBarRightEndCap:Hide()
- end
- if (CurrentHPMPValues == 1) then
- local CurrentValues = CreateFrame("Frame")
- CurrentValues:SetScript("OnUpdate", function(self, e)
- local PlayerHealth = UnitHealth("player")
- local PlayerMana = UnitMana("player")
- local TargetHealth = UnitHealth("target")
- local TargetMana = UnitMana("target")
- local FocusHealth = UnitHealth("focus")
- local FocusMana = UnitMana("focus")
- local PetHealth = UnitHealth("pet")
- local PetMana = UnitMana("pet")
- PlayerFrameHealthBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(PlayerHealth))
- PlayerFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(PlayerMana))
- TargetFrameHealthBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(TargetHealth))
- TargetFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(TargetMana))
- FocusFrameHealthBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(FocusHealth))
- FocusFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(FocusMana))
- PetFrameHealthBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(PetHealth))
- PetFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(PetMana))
- end)
- end
- if (MoveToT == 1) then
- TargetFrameToT:ClearAllPoints()
- TargetFrameToT:SetPoint("CENTER","TargetFrame", "CENTER", 52, -38)
- end
- if (MoveFT == 1) then
- FocusFrameToT:ClearAllPoints()
- FocusFrameToT:SetPoint("CENTER","FocusFrame", "CENTER", 52, -38)
- end
- if (LanguageFilterOff == 1) then
- BNSetMatureLanguageFilter(false)
- end
- if (PlayerPetHitIndicatorHide == 1) then
- PlayerFrame:UnregisterEvent("UNIT_COMBAT")PetFrame:UnregisterEvent("UNIT_COMBAT")
- end
- if (RedOutofRange == 1) then
- hooksecurefunc("ActionButton_OnEvent",function(self, event, ...)
- if ( event == "PLAYER_TARGET_CHANGED" ) then
- self.newTimer = self.rangeTimer
- end
- end)
- hooksecurefunc("ActionButton_UpdateUsable",function(self)
- local icon = _G[self:GetName().."Icon"]
- local valid = IsActionInRange(self.action)
- if ( valid == 0 ) then
- icon:SetVertexColor(1.0, 0.1, 0.1)
- end
- end)
- hooksecurefunc("ActionButton_OnUpdate",function(self, elapsed)
- local rangeTimer = self.newTimer
- if ( rangeTimer ) then
- rangeTimer = rangeTimer - elapsed
- if ( rangeTimer <= 0 ) then
- ActionButton_UpdateUsable(self)
- rangeTimer = TOOLTIP_UPDATE_TIME
- end
- self.newTimer = rangeTimer
- end
- end)
- end
- if (PlayerNameOff == 1) then
- PlayerFrame.name:Hide()
- end
- if (PetNameOff == 1) then
- PetFrame.name:Hide()
- end
- if (ChatMouseScroll == 1) then
- function FloatingChatFrame_OnMouseScroll(self, delta)
- if delta > 0 then
- if IsShiftKeyDown() then
- self:ScrollToTop()
- elseif IsControlKeyDown() then
- self:PageUp()
- else
- for i = 1, NUM_LINES_TO_SCROLL do
- self:ScrollUp()
- end
- end
- elseif delta < 0 then
- if IsShiftKeyDown() then
- self:ScrollToBottom()
- elseif IsControlKeyDown() then
- self:PageDown()
- else
- for i = 1, NUM_LINES_TO_SCROLL do
- self:ScrollDown()
- end
- end
- end end end
- --[[FloatingChatFrame_OnMouseScroll = function(self, dir)
- if(dir > 0) then
- if(IsShiftKeyDown()) then
- self:ScrollToTop() else self:ScrollUp() end
- else if(IsShiftKeyDown()) then
- self:ScrollToBottom() else self:ScrollDown() end
- end
- end
- end--]]
- if (ChatClutterHide == 1) then
- FriendsMicroButton:SetAlpha(0)
- FriendsMicroButton:EnableMouse(false)
- FriendsMicroButton:UnregisterAllEvents()
- ChatFrameMenuButton:SetAlpha(0)
- ChatFrameMenuButton:EnableMouse(false)
- -- ChatFrame1ButtonFrame:Hide()
- local _G = _G
- local type = type
- local select = select
- local unpack = unpack
- local gsub = string.gsub
- local format = string.format
- CHAT_FRAME_TAB_SELECTED_MOUSEOVER_ALPHA = 1
- CHAT_FRAME_TAB_SELECTED_NOMOUSE_ALPHA = 0
- CHAT_FRAME_TAB_NORMAL_MOUSEOVER_ALPHA = 0.5
- CHAT_FRAME_TAB_NORMAL_NOMOUSE_ALPHA = 0
- CHAT_FRAME_FADE_OUT_TIME = 0
- CHAT_FRAME_FADE_TIME = 0
- CHAT_TAB_HIDE_DELAY = 0
- local newAddMsg = {}
- for i = 1, NUM_CHAT_WINDOWS do
- local cf = 'ChatFrame'..i
- local tex = ({_G[cf..'EditBox']:GetRegions()})
- _G[cf..'ButtonFrame'].Show = _G[cf..'ButtonFrame'].Hide
- _G[cf..'ButtonFrame']:Hide()
- _G[cf..'EditBox']:SetAltArrowKeyMode(false)
- _G[cf..'EditBox']:ClearAllPoints()
- _G[cf..'EditBox']:SetPoint('BOTTOMLEFT', ChatFrame1, 'TOPLEFT', -4, 6)
- _G[cf..'EditBox']:SetPoint('TOPRIGHT', _G.ChatFrame1, 'TOPRIGHT', 6, 30)
- _G[cf..'EditBox']:SetShadowOffset(0, 0)
- _G[cf..'EditBox']:SetBackdrop({bgFile = 'Interface\\Buttons\\WHITE8x8', edgeFile = 'Interface\\Buttons\\WHITE8x8', edgeSize = 2})
- _G[cf..'EditBox']:SetBackdropColor(0,0,0,.8)
- _G[cf..'EditBox']:SetBackdropBorderColor(0,0,0,1)
- _G[cf..'EditBox']:HookScript("OnEditFocusGained", function(self) self:Show() end)
- _G[cf..'EditBox']:HookScript("OnEditFocusLost", function(self) self:Hide() end)
- _G[cf..'EditBoxHeader']:SetShadowOffset(0, 0)
- _G["ChatFrame"..i.."Tab"]:HookScript("OnClick", function() _G["ChatFrame"..i.."EditBox"]:Hide() end)
- tex[6]:SetAlpha(0) tex[7]:SetAlpha(0) tex[8]:SetAlpha(0) tex[9]:SetAlpha(0) tex[10]:SetAlpha(0) tex[11]:SetAlpha(0)
- _G[cf]:SetMinResize(0,0)
- _G[cf]:SetMaxResize(0,0)
- _G[cf]:SetFading(false)
- _G[cf]:SetClampRectInsets(0,0,0,0)
- _G[cf..'ResizeButton']:SetPoint("BOTTOMRIGHT", cf, "BOTTOMRIGHT", 9,-5)
- _G[cf..'ResizeButton']:SetScale(.4)
- _G[cf..'ResizeButton']:SetAlpha(0.5)
- if i ~= 2 then
- local f = _G[format("%s%d", "ChatFrame", i)]
- newAddMsg[format("%s%d", "ChatFrame", i)] = f.AddMessage
- f.AddMessage = AddMessage
- end
- end end
- if (PvPIconOff == 1) then
- PlayerPVPIcon:Hide();
- TargetFrame.pvpIcon:Hide();
- end
- if (AutoQuest == 1) then
- local addon = CreateFrame('Frame')
- addon.completed_quests = {}
- addon.incomplete_quests = {}
- function addon:canAutomate ()
- if IsShiftKeyDown() then
- return true
- else
- return false
- end
- end
- function addon:strip_text (text)
- if not text then return end
- text = text:gsub('|c%x%x%x%x%x%x%x%x(.-)|r','%1')
- text = text:gsub('%[.*%]%s*','')
- text = text:gsub('(.+) %(.+%)', '%1')
- text = text:trim()
- return text
- end
- function addon:QUEST_PROGRESS ()
- if not self:canAutomate() then return end
- if IsQuestCompletable() then
- CompleteQuest()
- end
- end
- function addon:QUEST_LOG_UPDATE ()
- if not self:canAutomate() then return end
- local start_entry = GetQuestLogSelection()
- local num_entries = GetNumQuestLogEntries()
- local title
- local is_complete
- local no_objectives
- self.completed_quests = {}
- self.incomplete_quests = {}
- if num_entries > 0 then
- for i = 1, num_entries do
- SelectQuestLogEntry(i)
- title, _, _, _, _, _, is_complete = GetQuestLogTitle(i)
- no_objectives = GetNumQuestLeaderBoards(i) == 0
- if title then
- if is_complete or no_objectives then
- self.completed_quests[title] = true
- else
- self.incomplete_quests[title] = true
- end
- end
- end
- end
- SelectQuestLogEntry(start_entry)
- end
- function addon:GOSSIP_SHOW ()
- if not self:canAutomate() then return end
- local button
- local text
- for i = 1, 32 do
- button = _G['GossipTitleButton' .. i]
- if button:IsVisible() then
- text = self:strip_text(button:GetText())
- ABCDE={button:GetText(), text}
- if button.type == 'Available' then
- button:Click()
- elseif button.type == 'Active' then
- if self.completed_quests[text] then
- button:Click()
- end
- end
- end
- end
- end
- function addon:QUEST_GREETING (...)
- if not self:canAutomate() then return end
- local button
- local text
- for i = 1, 32 do
- button = _G['QuestTitleButton' .. i]
- if button:IsVisible() then
- text = self:strip_text(button:GetText())
- if self.completed_quests[text] then
- button:Click()
- elseif not self.incomplete_quests[text] then
- button:Click()
- end
- end
- end
- end
- function addon:QUEST_DETAIL ()
- if not self:canAutomate() then return end
- AcceptQuest()
- end
- function addon:QUEST_COMPLETE (event)
- if not self:canAutomate() then return end
- if GetNumQuestChoices() <= 1 then
- GetQuestReward(QuestFrameRewardPanel.itemChoice)
- end end
- function addon.onevent (self, event, ...)
- if self[event] then
- self[event](self, ...)
- end
- end
- addon:SetScript('OnEvent', addon.onevent)
- addon:RegisterEvent('GOSSIP_SHOW')
- addon:RegisterEvent('QUEST_COMPLETE')
- addon:RegisterEvent('QUEST_DETAIL')
- addon:RegisterEvent('QUEST_FINISHED')
- addon:RegisterEvent('QUEST_GREETING')
- addon:RegisterEvent('QUEST_LOG_UPDATE')
- addon:RegisterEvent('QUEST_PROGRESS')
- _G.HbitAutoQuest = addon
- end
- if (SellGrey == 1) then
- local function OnEvent()
- for bag=0,4 do
- for slot=0,GetContainerNumSlots(bag) do
- local link = GetContainerItemLink(bag, slot)
- if link and select(3, GetItemInfo(link)) == 0 then
- ShowMerchantSellCursor(1)
- UseContainerItem(bag, slot)
- end
- end
- end
- end
- local f = CreateFrame("Frame")
- f:RegisterEvent("MERCHANT_SHOW")
- f:SetScript("OnEvent", OnEvent)
- if MerchantFrame:IsVisible() then OnEvent() end
- end
- if (displayUA == 1) then
- local oldCompactUnitFrame_UtilIsPriorityDebuff = CompactUnitFrame_UtilIsPriorityDebuff
- CompactUnitFrame_UtilIsPriorityDebuff = function(...)
- local unit, index, filter = ...
- if select(11, UnitDebuff(unit, index, filter)) == 30108 then -- UA
- return true
- end
- return oldCompactUnitFrame_UtilIsPriorityDebuff(...)
- end end
- if (arenatrinkets == 1) then
- local trinkets = {}
- local events = CreateFrame("Frame")
- function events:ADDON_LOADED(addonName)
- if addonName ~= "Blizzard_ArenaUI" then
- return
- end
- local arenaFrame, trinket
- for i = 1, MAX_ARENA_ENEMIES do
- arenaFrame = "ArenaEnemyFrame"..i
- trinket = CreateFrame("Cooldown", arenaFrame.."Trinket", ArenaEnemyFrames)
- trinket:SetPoint("Right", arenaFrame, 29, -5)
- trinket:SetSize(30, 30)
- trinket.icon = trinket:CreateTexture(nil, "BACKGROUND")
- trinket.icon:SetAllPoints()
- trinket.icon:SetTexture("Interface\\Icons\\inv_jewelry_trinketpvp_01")
- trinket:Hide()
- trinkets["arena"..i] = trinket
- end
- self:UnregisterEvent("ADDON_LOADED")
- end
- function events:UNIT_SPELLCAST_SUCCEEDED(unitID, spell, rank, lineID, spellID)
- if not trinkets[unitID] then
- return
- end
- if spellID == 59752 or spellID == 42292 then
- CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 120, 1)
- SendChatMessage("Trinket used by: "..GetUnitName(unitID, true), "PARTY")
- elseif spellID == 7744 then
- CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 45, 1)
- SendChatMessage("WotF used by: "..GetUnitName(unitID, true), "PARTY")
- end
- end
- function events:PLAYER_ENTERING_WORLD()
- local _, instanceType = IsInInstance()
- if instanceType == "arena" then
- self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
- elseif self:IsEventRegistered("UNIT_SPELLCAST_SUCCEEDED") then
- self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED")
- for _, trinket in pairs(trinkets) do
- trinket:SetCooldown(0, 0)
- trinket:Hide()
- end
- end
- end
- SLASH_BAF1 = "/baf"
- SlashCmdList["BAF"] = function(msg, editBox)
- if not IsAddOnLoaded("Blizzard_ArenaUI") then
- LoadAddOn("Blizzard_ArenaUI")
- end
- ArenaEnemyFrames:Show()
- local arenaFrame
- for i = 1, MAX_ARENA_ENEMIES do
- arenaFrame = _G["ArenaEnemyFrame"..i]
- arenaFrame.classPortrait:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles")
- arenaFrame.classPortrait:SetTexCoord(unpack(CLASS_ICON_TCOORDS["WARRIOR"]))
- arenaFrame.name:SetText("Dispelme")
- arenaFrame:Show()
- CooldownFrame_SetTimer(trinkets["arena"..i], GetTime(), 120, 1)
- end
- end
- events:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end)
- events:RegisterEvent("ADDON_LOADED")
- events:RegisterEvent("PLAYER_ENTERING_WORLD")
- end
- if (altInvite == 1) then
- local AltInvite = SetItemRef
- SetItemRef = function(link, text, button)
- local linkType = string.sub(link, 1, 6)
- if IsAltKeyDown() and linkType == "player" then
- local name = string.match(link, "player:([^:]+)")
- InviteUnit(name)
- return nil
- end
- return AltInvite(link,text,button)
- end end
- if (MoveArenaFrames == 1) then
- 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
- SLASH_MOVEARENA1 = "/movearena"
- end
- if (HideShapeShift == 1) then
- --[[local EventFrame = CreateFrame("Frame")
- EventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
- EventFrame:SetScript("OnEvent", function(self,event,...)
- ShapeshiftBarFrame:Hide() end) end]]
- for i = 1, NUM_SHAPESHIFT_SLOTS do
- local button = _G['ShapeshiftButton'..i]
- button:SetAlpha(0)
- button.SetAlpha = function() end
- button:EnableMouse(false)
- button.EnableMouse = function() end
- end end
- if (chatShorten == 1) then
- --guild
- CHAT_GUILD_GET = "|Hchannel:GUILD|hG|h %s "
- CHAT_OFFICER_GET = "|Hchannel:OFFICER|hO|h %s "
- --raid
- CHAT_RAID_GET = "|Hchannel:RAID|hR|h %s "
- CHAT_RAID_WARNING_GET = "RW %s "
- CHAT_RAID_LEADER_GET = "|Hchannel:RAID|hRL|h %s "
- --party
- CHAT_PARTY_GET = "|Hchannel:PARTY|hP|h %s "
- CHAT_PARTY_LEADER_GET = "|Hchannel:PARTY|hPL|h %s "
- CHAT_PARTY_GUIDE_GET = "|Hchannel:PARTY|hPG|h %s "
- --bg
- CHAT_BATTLEGROUND_GET = "|Hchannel:BATTLEGROUND|hB|h %s "
- CHAT_BATTLEGROUND_LEADER_GET = "|Hchannel:BATTLEGROUND|hBL|h %s "
- --whisper
- CHAT_WHISPER_INFORM_GET = "to %s "
- CHAT_WHISPER_GET = "%s " -- from
- CHAT_BN_WHISPER_INFORM_GET = "to %s "
- CHAT_BN_WHISPER_GET = "%s " -- from
- --say / yell
- CHAT_SAY_GET = "%s "
- CHAT_YELL_GET = "%s "
- --flags
- CHAT_FLAG_AFK = "[AFK] "
- CHAT_FLAG_DND = "[DND] "
- CHAT_FLAG_GM = "[GM] "
- local gsub = _G.string.gsub
- for i = 1, NUM_CHAT_WINDOWS do
- if ( i ~= 2 ) then
- local f = _G["ChatFrame"..i]
- local am = f.AddMessage
- f.AddMessage = function(frame, text, ...)
- return am(frame, text:gsub('|h%[(%d+)%. .-%]|h', '|h%1|h'), ...)
- end
- end
- end
- end
- if (autoRepair == 1) then
- local function OnEvent()
- RepairAllItems()
- end
- local f = CreateFrame("Frame")
- f:RegisterEvent("MERCHANT_SHOW")
- f:SetScript("OnEvent", OnEvent)
- if MerchantFrame:IsVisible() then OnEvent() end
- end
- if (autoGRepair == 1) then
- local function OnEvent()
- RepairAllItems(1)
- end
- local f = CreateFrame("Frame")
- f:RegisterEvent("MERCHANT_SHOW")
- f:SetScript("OnEvent", OnEvent)
- if MerchantFrame:IsVisible() then OnEvent() end
- end
- if (tellTarget == 1) then
- for i=1, NUM_CHAT_WINDOWS do
- local editbox = _G["ChatFrame"..i.."EditBox"]
- editbox:HookScript("OnTextChanged", function(self)
- local text = self:GetText()
- if text:len() < 5 then
- if text:sub(1, 4) == "/tt " then
- local unitname, realm
- unitname, realm = UnitName("target")
- if unitname then unitname = gsub(unitname, " ", "") end
- if unitname and not UnitIsSameServer("player", "target") then
- unitname = unitname .. "-" .. gsub(realm, " ", "")
- end
- ChatFrame_SendTell((unitname or L.chat_invalidtarget), ChatFrame1)
- end
- end
- end)
- end
- SLASH_TELLTARGET1 = "/tt"
- SLASH_TELLTARGET2 = "/telltarget"
- SlashCmdList.TELLTARGET = function(msg)
- local unitname, realm
- unitname, realm = UnitName("target")
- if not unitname then return end
- if unitname then unitname = gsub(unitname, " ", "") end
- if unitname and not UnitIsSameServer("player", "target") then
- unitname = unitname .. "-" .. gsub(realm, " ", "")
- end
- SendChatMessage(msg, "WHISPER", nil, unitname)
- end end
- if (hideBags == 1) then
- local t = {
- "MainMenuBarBackpackButton",
- "CharacterBag0Slot",
- "CharacterBag1Slot",
- "CharacterBag2Slot",
- "CharacterBag3Slot",
- }
- local function showFoo(self)
- for _, v in ipairs(t) do
- _G[v]:SetAlpha(1)
- end
- end
- local function hideFoo(self)
- for _, v in ipairs(t) do
- _G[v]:SetAlpha(0)
- end
- end
- for _, v in ipairs(t) do
- v = _G[v]
- v:HookScript("OnEnter", showFoo)
- v:HookScript("OnLeave", hideFoo)
- v:SetAlpha(0)
- end end
- if (tabChangerPvP == 1) then
- local tabChanger = CreateFrame("Frame")
- tabChanger:SetScript("OnEvent", function(self, event, ...)
- if self[event] then
- return self[event](self, event, ...)
- end
- end)
- tabChanger:RegisterEvent("PLAYER_ENTERING_WORLD")
- tabChanger:RegisterEvent("ZONE_CHANGED_NEW_AREA")
- function tabChanger:PLAYER_ENTERTING_WORLD()
- self:ZONE_CHANGED_NEW_AREA()
- end
- function tabChanger:ZONE_CHANGED_NEW_AREA()
- local type = select(2, IsInInstance())
- local TabZone = {
- ["pvp"] = true,
- ["arena"] = true,
- }
- if TabZone[type] then
- SetBinding("TAB", "TARGETNEARESTENEMYPLAYER", 1)
- else
- SetBinding("TAB", "TARGETNEARESTENEMY", 1)
- end
- end end
- if (arenaMinimapHide == 1) then
- local MinimapHide = CreateFrame("Frame")
- MinimapHide:SetScript("OnEvent", function(self, event, ...)
- if self[event] then
- return self[event](self, event, ...)
- end
- end)
- MinimapHide:RegisterEvent("PLAYER_ENTERING_WORLD")
- MinimapHide:RegisterEvent("ZONE_CHANGED_NEW_AREA")
- function MinimapHide:PLAYER_ENTERTING_WORLD()
- self:ZONE_CHANGED_NEW_AREA()
- end
- function MinimapHide:ZONE_CHANGED_NEW_AREA()
- local type = select(2, IsInInstance())
- local TabZone = {
- ["pvp"] = true,
- ["arena"] = true,
- }
- if TabZone[type] then
- MinimapCluster:Hide()
- else
- MinimapCluster:Show()
- end
- end end
- if (autoInvite == 1) then
- ------------------------------------------------------------------------
- -- Auto invite by whisper
- ------------------------------------------------------------------------
- local ainvenabled = false
- local ainvkeyword = "invite"
- local autoinvite = CreateFrame("frame")
- autoinvite:RegisterEvent("CHAT_MSG_WHISPER")
- autoinvite:SetScript("OnEvent", function(self,event,arg1,arg2)
- if ((not UnitExists("party1") or IsPartyLeader("player") or IsRaidOfficer("player") or IsRaidLeader("player")) and arg1:lower():match(ainvkeyword)) and ainvenabled == true then
- InviteUnit(arg2)
- end
- end)
- function SlashCmdList.AUTOINVITE(msg, editbox)
- if msg == "off" then
- ainvenabled = false
- elseif msg == "" then
- ainvenabled = true
- ainvkeyword = "invite"
- else
- ainvenabled = true
- ainvkeyword = msg
- end
- end
- SLASH_AUTOINVITE1 = "/ainv" end
- if (menuHide == 1) then
- local function showFoo(self)
- for _, v in ipairs(MICRO_BUTTONS) do
- _G[v]:SetAlpha(1)
- end
- end
- local function hideFoo(self)
- for _, v in ipairs(MICRO_BUTTONS) do
- _G[v]:SetAlpha(0)
- end
- end
- for _, v in ipairs(MICRO_BUTTONS) do
- v = _G[v]
- v:HookScript("OnEnter", showFoo)
- v:HookScript("OnLeave", hideFoo)
- v:SetAlpha(0)
- end end
- if (urlCopy == 1) then
- local color = "C0C0C0"
- local pattern = "[wWhH][wWtT][wWtT][\46pP]%S+[^%p%s]"
- function string.color(text, color)
- return "|cff"..color..text.."|r"
- end
- function string.link(text, type, value, color)
- return "|H"..type..":"..tostring(value).."|h"..tostring(text):color(color or "ffffff").."|h"
- end
- StaticPopupDialogs["LINKME"] = {
- text = "URL COPY",
- button2 = CANCEL,
- hasEditBox = true,
- editBoxWidth = 400,
- timeout = 0,
- exclusive = 1,
- hideOnEscape = 1,
- EditBoxOnEscapePressed = function(self) self:GetParent():Hide() end,
- whileDead = 1,
- maxLetters = 255,
- }
- local function f(url)
- return string.link("["..url.."]", "url", url, color)
- end
- local function hook(self, text, ...)
- self:f(text:gsub(pattern, f), ...)
- end
- function LinkMeURL()
- for i = 1, NUM_CHAT_WINDOWS do
- if ( i ~= 2 ) then
- local lframe = _G["ChatFrame"..i]
- lframe.f = lframe.AddMessage
- lframe.AddMessage = hook
- end
- end
- end
- LinkMeURL()
- local ur = ChatFrame_OnHyperlinkShow
- function ChatFrame_OnHyperlinkShow(self, link, text, button)
- local type, value = link:match("(%a+):(.+)")
- if ( type == "url" ) then
- local dialog = StaticPopup_Show("LINKME")
- local editbox1 = _G[dialog:GetName().."EditBox"]
- editbox1:SetText(value)
- editbox1:SetFocus()
- editbox1:HighlightText()
- local button = _G[dialog:GetName().."Button2"]
- button:ClearAllPoints()
- button:SetPoint("CENTER", editbox1, "CENTER", 0, -30)
- else
- ur(self, link, text, button)
- end
- end end
- if (expFade == 1) then
- local function show(self)
- self:SetAlpha(1)
- end
- local function hide(self)
- self:SetAlpha(0)
- end
- local f = MainMenuExpBar
- f:HookScript("OnEnter", show)
- f:HookScript("OnLeave", hide)
- f:SetAlpha(0)
- end
- local function updatehotkey(self, actionButtonType)
- local hotkey = _G[self:GetName() .. 'HotKey']
- local text = hotkey:GetText()
- local replace = string.gsub
- text = replace(text, '(s%-)', 'S')
- text = replace(text, '(a%-)', 'A')
- text = replace(text, '(c%-)', 'C')
- text = replace(text, '(Mouse Button )', 'M')
- text = replace(text, '(Mouse Wheel Up)', 'MU')
- text = replace(text, '(Mouse Wheel Down)', 'MD')
- text = replace(text, '(Middle Mouse)', 'M3')
- text = replace(text, '(Num Pad )', 'N')
- text = replace(text, '(Page Up)', 'PU')
- text = replace(text, '(Page Down)', 'PD')
- text = replace(text, '(Spacebar)', 'SpB')
- text = replace(text, '(Insert)', 'Ins')
- text = replace(text, '(Home)', 'Hm')
- text = replace(text, '(Delete)', 'Del')
- if hotkey:GetText() == _G['RANGE_INDICATOR'] then
- hotkey:SetText('')
- else
- hotkey:SetText(text)
- end
- end
- if (chatTabs == 1) then
- --[[
- Fane
- All credits of this chattabs script is by Fane and his author Haste.
- --]]
- local Fane = CreateFrame'Frame'
- local inherit = GameFontNormalSmall
- local updateFS = function(self, inc, flags, ...)
- local fstring = self:GetFontString()
- local font, fontSize = inherit:GetFont()
- if(inc) then
- fstring:SetFont(font, fontSize + 1, flags)
- else
- fstring:SetFont(font, fontSize, flags)
- end
- if((...)) then
- fstring:SetTextColor(...)
- end
- end
- local OnEnter = function(self)
- local emphasis = _G["ChatFrame"..self:GetID()..'TabFlash']:IsShown()
- updateFS(self, emphasis, 'OUTLINE', 1, 1, 1, 1)
- end
- local OnLeave = function(self)
- local r, g, b, al
- local id = self:GetID()
- local emphasis = _G["ChatFrame"..id..'TabFlash']:IsShown()
- if (_G["ChatFrame"..id] == SELECTED_CHAT_FRAME) then
- r, g, b, al = 1, 1, 1, 0
- elseif emphasis then
- r, g, b, al = 1, 0, 0, 1
- else
- r, g, b, al = 1, 1, 1, 0
- end
- updateFS(self, emphasis, nil, r, g, b, al)
- end
- local ChatFrame2_SetAlpha = function(self, alpha)
- if(CombatLogQuickButtonFrame_Custom) then
- CombatLogQuickButtonFrame_Custom:SetAlpha(alpha)
- end
- end
- local ChatFrame2_GetAlpha = function(self)
- if(CombatLogQuickButtonFrame_Custom) then
- return CombatLogQuickButtonFrame_Custom:GetAlpha()
- end
- end
- local faneifyTab = function(frame, sel)
- local i = frame:GetID()
- if(not frame.Fane) then
- frame.leftTexture:Hide()
- frame.middleTexture:Hide()
- frame.rightTexture:Hide()
- frame.leftSelectedTexture:Hide()
- frame.middleSelectedTexture:Hide()
- frame.rightSelectedTexture:Hide()
- frame.leftSelectedTexture.Show = frame.leftSelectedTexture.Hide
- frame.middleSelectedTexture.Show = frame.middleSelectedTexture.Hide
- frame.rightSelectedTexture.Show = frame.rightSelectedTexture.Hide
- frame.leftHighlightTexture:Hide()
- frame.middleHighlightTexture:Hide()
- frame.rightHighlightTexture:Hide()
- frame:HookScript('OnEnter', OnEnter)
- frame:HookScript('OnLeave', OnLeave)
- frame:SetAlpha(1)
- if(i ~= 2) then
- -- Might not be the best solution, but we avoid hooking into the UIFrameFade
- -- system this way.
- frame.SetAlpha = UIFrameFadeRemoveFrame
- else
- frame.SetAlpha = ChatFrame2_SetAlpha
- frame.GetAlpha = ChatFrame2_GetAlpha
- -- We do this here as people might be using AddonLoader together with Fane.
- if(CombatLogQuickButtonFrame_Custom) then
- CombatLogQuickButtonFrame_Custom:SetAlpha(.4)
- end
- end
- frame.Fane = true
- end
- -- We can't trust sel. :(
- if(i == SELECTED_CHAT_FRAME:GetID()) then
- updateFS(frame, nil, nil, 1, 1, 1, 0)
- else
- updateFS(frame, nil, nil, 1, 1, 1, 0)
- end
- end
- hooksecurefunc('FCF_StartAlertFlash', function(frame)
- local tab = _G['ChatFrame' .. frame:GetID() .. 'Tab']
- updateFS(tab, true, nil, 1, 0, 0)
- end)
- hooksecurefunc('FCFTab_UpdateColors', faneifyTab)
- for i=1,7 do
- faneifyTab(_G['ChatFrame' .. i .. 'Tab'])
- end
- function Fane:ADDON_LOADED(event, addon)
- if(addon == 'Blizzard_CombatLog') then
- self:UnregisterEvent(event)
- self[event] = nil
- return CombatLogQuickButtonFrame_Custom:SetAlpha(.4)
- end
- end
- Fane:RegisterEvent'ADDON_LOADED'
- Fane:SetScript('OnEvent', function(self, event, ...)
- return self[event](self, event, ...)
- end)
- end
- if (slashCommands == 1) then
- -- Some Slash Commands
- SlashCmdList["RELOADUI"] = function() ReloadUI() end
- SLASH_RELOADUI1 = "/rl"
- SlashCmdList["RCSLASH"] = function() DoReadyCheck() end
- SLASH_RCSLASH1 = "/rc"
- SlashCmdList["TICKET"] = function() ToggleHelpFrame() end
- SLASH_TICKET1 = "/gm"
- end
- if (altBuy == 1) then
- -- buy max number value with alt
- local savedMerchantItemButton_OnModifiedClick = MerchantItemButton_OnModifiedClick
- function MerchantItemButton_OnModifiedClick(self, ...)
- if ( IsAltKeyDown() ) then
- local maxStack = select(8, GetItemInfo(GetMerchantItemLink(self:GetID())))
- if ( maxStack and maxStack > 1 ) then
- BuyMerchantItem(self:GetID(), GetMerchantItemMaxStack(self:GetID()))
- end
- end
- savedMerchantItemButton_OnModifiedClick(self, ...)
- end end
- --[[ TEMPLATE --
- local function show(self)
- self:SetAlpha(1)
- end
- local function hide(self)
- self:SetAlpha(0)
- end
- local f = PlayerFrame
- f:SetScript("OnEnter", showFoo)
- f:SetScript("OnLeave", hideFoo)
- f:SetAlpha(0)
- end--]]
Add Comment
Please, Sign In to add comment