-- red bars
hooksecurefunc('CooldownFrame_SetTimer', function(self) if self.currentCooldownType == COOLDOWN_TYPE_LOSS_OF_CONTROL then self:SetCooldown(0,0) end end)
-- no bling on GCD
for k,v in pairs(_G) do if type(v)=="table" and type(v.SetDrawBling)=="function" then v:SetDrawBling(false) end end
hooksecurefunc(getmetatable(ActionButton1Cooldown).__index, 'SetCooldown', function(self) self:SetDrawBling(false) end)
--- percent hp on target frame
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(statusFrame, textString, value, valueMin, valueMax)
if valueMax == 0 then return end
if statusFrame.powerToken then return end
if string.find(statusFrame:GetName(),"PlayerFrame") == 1 then return end
if string.find(statusFrame:GetName(),"FocusFrame") == 1 then return end
if string.find(statusFrame:GetName(),"PetFrame") == 1 then return end
local unit = statusFrame:GetParent().unit
if unit and UnitIsDead(unit) then return end
textString:SetText(tostring(AbbreviateLargeNumbers(value)).." / "..tostring(AbbreviateLargeNumbers(valueMax)).." "..tostring(math.ceil((value / valueMax) * 100)).."%");
if(statusFrame.LeftText and statusFrame.RightText) then
statusFrame.LeftText:Hide();
statusFrame.RightText:Hide();
textString:Show();
end
end)
function AbbreviateLargeNumbers(value)
local strLen = strlen(value);
local retString = value;
if ( strLen > 6 ) then
retString = string.sub(value, 1, -7)..SECOND_NUMBER_CAP;
elseif ( strLen > 4 ) then
retString = string.sub(value, 1, -4)..FIRST_NUMBER_CAP;
elseif (strLen > 3 ) then
retString = BreakUpLargeNumbers(value);
end
return retString;
end
---
-- /rl command in chat to Reload
SlashCmdList["RELOADUI"] = function() ReloadUI() end
SLASH_RELOADUI1 = "/rl"
-- /clear command to clear chat window
SlashCmdList["CLEAR"] = function()
SELECTED_CHAT_FRAME:Clear()
end
-- /clearcombat
SlashCmdList["CLEARCOMBAT"] = function() CombatLogClearEntries() end
SLASH_CLEARCOMBAT1 = "/clearcombat"
-- leaves group
SlashCmdList["LEAVEGROUP"] = function() LeaveParty() end
SLASH_LEAVEGROUP1 = "/lg"
-- Hides gryphons
MainMenuBarLeftEndCap:Hide()
MainMenuBarRightEndCap:Hide()
-- No delay on Combo points
COMBOFRAME_FADE_IN = 0
COMBOFRAME_FADE_OUT = 0
COMBOFRAME_SHINE_FADE_IN = 0
COMBOFRAME_SHINE_FADE_OUT = 0
COMBOFRAME_HIGHLIGHT_FADE_IN = 0
-- Hide minimap zoom icons, enable scroll wheel zooming
MinimapZoomIn:Hide()
MinimapZoomOut:Hide()
Minimap:EnableMouseWheel(true)
Minimap:SetScript('OnMouseWheel', function(self, arg1)
if arg1 > 0 then
Minimap_ZoomIn()
else
Minimap_ZoomOut()
end
end)
-- loot money
local f = CreateFrame("Frame")
f:RegisterEvent("LOOT_OPENED")
f:SetScript("OnEvent", function(self, event, ...)
for i = GetNumLootItems(), 1, -1 do
local slotType = GetLootSlotType(i)
local _, _, _, _, locked, isQuestItem = GetLootSlotInfo(i)
if not locked and (slotType == LOOT_SLOT_MONEY or slotType == LOOT_SLOT_CURRENCY) then
LootSlot(i)
end
end
end)
-- adds caster of buffs/debuffs to their tooltips
hooksecurefunc(GameTooltip,"SetUnitAura",function(self,unit,index,filter)
local caster = select(8,UnitAura(unit,index,filter))
if caster and UnitExists(caster) then
GameTooltip:AddLine("Cast by: "..UnitName(caster),.65,.85,1,1)
GameTooltip:Show()
end
end)
-- disable healing prediction
local oldfunc=CompactUnitFrameUtil_UpdateFillBar;
function CompactUnitFrameUtil_UpdateFillBar(frame,previous,bar,...)
if bar==frame.myHealPrediction or bar==frame.otherHealPrediction then
return previous;
end
return oldfunc(frame,previous,bar,...);
end
hooksecurefunc("CompactUnitFrame_SetUpFrame",function(frame)
frame.myHealPrediction:Hide();
frame.otherHealPrediction:Hide();
end);
-- repair
local f = CreateFrame'Frame'
f:RegisterEvent'MERCHANT_SHOW'
f:SetScript('OnEvent', function()
local cost, canRepair = GetRepairAllCost()
if canRepair and GetMoney() > cost then
ChatFrame1:AddMessage('Your items have been repaired for '..GetCoinText(cost, ", ")..".", 1, 1, 0)
RepairAllItems()
end
end)
--- tooltip stuff
local SET_TEXT = TARGET .. ": |cff%02x%02x%02x%s|r"
local MATCH_TEXT = "^" .. TARGET
local last
GameTooltip:HookScript("OnUpdate", function(self)
local name = UnitName("mouseovertarget")
if not name or name == "" then return end
last = name
local r, g, b
if UnitIsPlayer("mouseovertarget") then
local _, class = UnitClass("mouseovertarget")
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
r, g, b = color.r, color.g, color.b
else
r, g, b = GameTooltip_UnitColor("mouseovertarget")
end
for i = 2, self:NumLines() do
local line = _G["GameTooltipTextLeft"..i]
if strfind(line:GetText() or "", MATCH_TEXT) then
line:SetFormattedText(SET_TEXT, r * 255, g * 255, b * 255, name)
return self:Show()
end
end
self:AddLine(format(SET_TEXT, r * 255, g * 255, b * 255, name))
self:Show()
end)
-- color
GameTooltip:HookScript("OnTooltipSetUnit", function(GameTooltip)
local _, unit = GameTooltip:GetUnit()
if UnitIsPlayer(unit) then
local _, class = UnitClass(unit)
local color = class and (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
if color then
local text = GameTooltipTextLeft1:GetText()
GameTooltipTextLeft1:SetFormattedText("|cff%02x%02x%02x%s|r", color.r * 255, color.g * 255, color.b * 255, text:match("|cff\x\x\x\x\x\x(.+)|r") or text)
end
end
end)
--- class color on unit frames
local frame = CreateFrame("FRAME")
frame:RegisterEvent("GROUP_ROSTER_UPDATE")
frame:RegisterEvent("PLAYER_TARGET_CHANGED")
frame:RegisterEvent("PLAYER_FOCUS_CHANGED")
frame:RegisterEvent("UNIT_FACTION")
local function eventHandler(self, event, ...)
if UnitIsPlayer("target") then
local c = RAID_CLASS_COLORS[select(2, UnitClass("target"))]
if c then
TargetFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
end
end
if UnitIsPlayer("focus") then
local c = RAID_CLASS_COLORS[select(2, UnitClass("focus"))]
if c then
FocusFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
end
end
end
frame:SetScript("OnEvent", eventHandler)
for _, BarTextures in pairs({TargetFrameNameBackground, FocusFrameNameBackground}) do
BarTextures:SetTexture("Interface\\TargetingFrame\\UI-StatusBar")
end
local fontStrings = {
PlayerName,
TargetFrameTextureFrameName,
TargetFrameTextureFrameDeadText,
FocusFrameTextureFrameName,
FocusFrameTextureFrameDeadText
}
for _, v in pairs(fontStrings) do
v:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
v:SetShadowOffset(0, 0)
v:SetTextColor(1,.92,0)
end
TargetFrameTextureFrameName:SetWidth(117)
TargetFrameToTTextureFrameName:SetWidth(64)
FocusFrameTextureFrameName:SetWidth(117)
FocusFrameToTTextureFrameName:SetWidth(64)
local fontStrings = {
TargetFrameToTTextureFrameName,
FocusFrameToTTextureFrameName
}
for _, v in pairs(fontStrings) do
v:SetTextColor(1,.92,0)
end