Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Contents
- -- Trinket
- -- Хелз бары по цвету класса
- -- Цвет бэкграунда по цвету класса
- -- Выбор позиции всплывающего текста
- -- Align (координатная сетка)
- -- Hide the error (red text) frame
- -- ToT Focus Frame
- -- ToT Target Frame
- -- Big Debuffs
- -- Focuser
- -- Arena Trinkets
- -- Scaling
- -- Экшн бары
- -- CD Tracker
- -- Flashy spellsteal border for non-mages and/or enrage effects
- -- Тринкет (слот 1) Proc Trinket 92224
- local f = CreateFrame("Frame")
- f:RegisterEvent("PLAYER_ENTERING_WORLD")
- f:RegisterEvent("UNIT_AURA")
- f:RegisterEvent("ZONE_CHANGED_NEW_AREA")
- f:SetScript("OnEvent", function(self, event, ...)
- local SE = GetSpellInfo(126702)
- if event=="PLAYER_ENTERING_WORLD" then
- local TRINKET3 = _G["TRINKET3"] or CreateFrame("Frame", "TRINKET3", UIParent)
- TRINKET3.c = TRINKET3.c or CreateFrame("Cooldown","$parentCooldown", TRINKET3)
- TRINKET3.c:SetAllPoints(TRINKET3)
- TRINKET3:SetPoint("CENTER", 100, 0)
- TRINKET3:SetSize(40,40)
- TRINKET3.t = TRINKET3.t or TRINKET3:CreateTexture("$parentIcon","BORDER")
- TRINKET3.t:SetAllPoints()
- end
- if event=="UNIT_AURA" or event=="ZONE_CHANGED_NEW_AREA" then
- local found = false
- for i=1,40 do
- local N,_,t, _, _,d,x = UnitBuff("player", i)
- if not N then break end
- if N==SE then found = true TRINKET3:Show() TRINKET3.t:SetTexture(t) if d>0 then TRINKET3.c:SetCooldown(x-d-0.5,d) end end
- if not found then TRINKET3:Hide() end
- end
- end
- end)
- -- Тринкет (слот 2) Use PVP Trinket 126702
- local f = CreateFrame("Frame")
- f:RegisterEvent("PLAYER_ENTERING_WORLD")
- f:RegisterEvent("UNIT_AURA")
- f:RegisterEvent("ZONE_CHANGED_NEW_AREA")
- f:SetScript("OnEvent", function(self, event, ...)
- local SE = GetSpellInfo(126679)
- if event=="PLAYER_ENTERING_WORLD" then
- local PVPTRINKET = _G["PVPTRINKET"] or CreateFrame("Frame", "PVPTRINKET", UIParent)
- PVPTRINKET.c = PVPTRINKET.c or CreateFrame("Cooldown","$parentCooldown", PVPTRINKET)
- PVPTRINKET.c:SetAllPoints(PVPTRINKET)
- PVPTRINKET:SetPoint("CENTER", 141, 0)
- PVPTRINKET:SetSize(40,40)
- PVPTRINKET.t = PVPTRINKET.t or PVPTRINKET:CreateTexture("$parentIcon","BORDER")
- PVPTRINKET.t:SetAllPoints()
- end
- if event=="UNIT_AURA" or event=="ZONE_CHANGED_NEW_AREA" then
- local found = false
- for i=1,40 do
- local N,_,t, _, _,d,x = UnitBuff("player", i)
- if not N then break end
- if N==SE then found = true PVPTRINKET:Show() PVPTRINKET.t:SetTexture(t) if d>0 then PVPTRINKET.c:SetCooldown(x-d-0.5,d) end end
- if not found then PVPTRINKET:Hide() end
- end
- end
- end)
- -- Хелз бары по цвету класса
- local function colour(statusbar, unit)
- local _, class, c
- if UnitIsPlayer(unit) and UnitIsConnected(unit) and unit == statusbar.unit and UnitClass(unit) then
- _, class = UnitClass(unit)
- c = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
- statusbar:SetStatusBarColor(c.r, c.g, c.b)
- PlayerFrameHealthBar:SetStatusBarColor(0,1,0)
- end
- end
- hooksecurefunc("UnitFrameHealthBar_Update", colour)
- hooksecurefunc("HealthBar_OnValueChanged", function(self)
- colour(self, self.unit)
- end)
- -- Цвет бэкграунда по цвету класса
- UnitSelectionColor = function(unit)
- if not UnitExists(unit) then return 1,1,1,1 end
- local color = UnitIsPlayer(unit) and RAID_CLASS_COLORS[select(2, UnitClass(unit))] or FACTION_BAR_COLORS[UnitReaction(unit, 'player')]
- if color then
- if not UnitIsConnected(unit) then
- return .5, .5, .5, 1
- else
- return color.r*.8, color.g*.8, color.b*.8, 1
- end
- else
- if UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) then
- return .5, .5, .5, 1
- end
- end
- end
- -- Выбор позиции всплывающего текста
- local f = CreateFrame("FRAME");
- f:SetScript("OnEvent", function(self,event,...)
- local arg1 =...;
- if (arg1=="Blizzard_CombatText") then
- f:UnregisterEvent("ADDON_LOADED");
- hooksecurefunc("CombatText_UpdateDisplayedMessages",
- function ()
- COMBAT_TEXT_LOCATIONS =
- {startX = 200,
- startY = 270 * COMBAT_TEXT_Y_SCALE,
- endX = 200,
- endY = 345 * COMBAT_TEXT_Y_SCALE};
- end);
- end
- end);
- f:RegisterEvent("ADDON_LOADED");
- -- Align (координатная сетка)
- SLASH_EA1 = "/align"
- local f
- SlashCmdList["EA"] = function()
- if f then
- f:Hide()
- f = nil
- else
- f = CreateFrame('Frame', nil, UIParent)
- f:SetAllPoints(UIParent)
- local w = GetScreenWidth() / 64
- local h = GetScreenHeight() / 36
- for i = 0, 64 do
- local t = f:CreateTexture(nil, 'BACKGROUND')
- if i == 32 then
- t:SetTexture(1, 0, 0, 0.5)
- else
- t:SetTexture(0, 0, 0, 0.5)
- end
- t:SetPoint('TOPLEFT', f, 'TOPLEFT', i * w - 1, 0)
- t:SetPoint('BOTTOMRIGHT', f, 'BOTTOMLEFT', i * w + 1, 0)
- end
- for i = 0, 36 do
- local t = f:CreateTexture(nil, 'BACKGROUND')
- if i == 18 then
- t:SetTexture(1, 0, 0, 0.5)
- else
- t:SetTexture(0, 0, 0, 0.5)
- end
- t:SetPoint('TOPLEFT', f, 'TOPLEFT', 0, -i * h + 1)
- t:SetPoint('BOTTOMRIGHT', f, 'TOPRIGHT', 0, -i * h - 1)
- end
- end
- end
- -- Hide the error (red text) frame
- UIErrorsFrame:SetAlpha(0)
- -- ToT Focus Frame
- FocusFrameToT:ClearAllPoints() FocusFrameToT:SetPoint("TOP",FocusFrame,"TOP",-95, 20)
- -- ToT Target Frame
- TargetFrameToT:ClearAllPoints() TargetFrameToT:SetPoint("RIGHT",TargetFrame,"RIGHT",10, -25)
- -- Big Debuffs
- local numIcons = 6
- hooksecurefunc("TargetFrame_UpdateAuraPositions", function(self, auraName, numAuras, numOppositeAuras,largeAuraList, updateFunc, maxRowWidth, offsetX)
- local AURA_OFFSET_Y = 3
- local LARGE_AURA_SIZE = 22 -- развер ВАШИХ баффов/дебаффов.
- local SMALL_AURA_SIZE = 18.5 -- развер чужих баффов/дебаффов.
- local size
- local offsetY = AURA_OFFSET_Y
- local rowWidth = 0
- local firstBuffOnRow = 1
- maxRowWidth = LARGE_AURA_SIZE * numIcons
- for i=1, numAuras do
- if largeAuraList[i] then
- size = LARGE_AURA_SIZE
- offsetY = AURA_OFFSET_Y + AURA_OFFSET_Y
- else
- size = SMALL_AURA_SIZE
- end
- if i == 1 then
- rowWidth = size
- self.auraRows = self.auraRows + 1
- else
- rowWidth = rowWidth + size + offsetX
- end
- if rowWidth > maxRowWidth then
- updateFunc(self, auraName, i, numOppositeAuras, firstBuffOnRow, size, offsetX, offsetY)
- rowWidth = size
- self.auraRows = self.auraRows + 1
- firstBuffOnRow = i
- offsetY = AURA_OFFSET_Y
- else
- updateFunc(self, auraName, i, numOppositeAuras, i - 1, size, offsetX, offsetY)
- end
- end
- end)
- -- Focuser
- local modifier = "alt"
- local mouseButton = "1"
- local function SetFocusHotkey(frame)
- frame:SetAttribute(modifier.."-type"..mouseButton,"focus")
- end
- local function CreateFrame_Hook(type, name, parent, template)
- if template == "SecureUnitButtonTemplate" then
- SetFocusHotkey(_G[name])
- end
- end
- hooksecurefunc("CreateFrame", CreateFrame_Hook)
- local f = CreateFrame("CheckButton", "FocuserButton", UIParent, "SecureActionButtonTemplate")
- f:SetAttribute("type1","macro")
- f:SetAttribute("macrotext","/focus mouseover")
- SetOverrideBindingClick(FocuserButton,true,modifier.."-BUTTON"..mouseButton,"FocuserButton")
- local duf = {
- PlayerFrame,
- PetFrame,
- PartyMemberFrame1,
- PartyMemberFrame2,
- PartyMemberFrame3,
- PartyMemberFrame4,
- PartyMemberFrame1PetFrame,
- PartyMemberFrame2PetFrame,
- PartyMemberFrame3PetFrame,
- PartyMemberFrame4PetFrame,
- TargetFrame,
- TargetofTargetFrame,
- ArenaEnemyFrame1,
- ArenaEnemyFrame2,
- ArenaEnemyFrame3,
- ArenaEnemyFrame4,
- ArenaEnemyFrame5,
- ArenaEnemyFrame1PetFrame,
- ArenaEnemyFrame2PetFrame,
- ArenaEnemyFrame3PetFrame,
- ArenaEnemyFrame4PetFrame,
- ArenaEnemyFrame5PetFrame,
- }
- for i,frame in pairs(duf) do
- SetFocusHotkey(frame)
- end
- -- Arena Trinkets
- local arenaframes = CreateFrame("Frame")
- local _, instanceType = IsInInstance()
- arenaframes:RegisterEvent("ADDON_LOADED")
- arenaframes:RegisterEvent("PLAYER_ENTERING_WORLD")
- arenaframes:RegisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS")
- arenaframes:SetScript("OnEvent", function(self, event, addon)
- if addon=="Blizzard_ArenaUI" and not (IsAddOnLoaded("Shadowed Unit Frames")) then
- for i = 1, MAX_ARENA_ENEMIES do
- local ArenaFrame = _G["ArenaEnemyFrame"..i]
- local CastBar = _G["ArenaEnemyFrame"..i.."CastingBar"]
- ArenaFrame:ClearAllPoints()
- ArenaFrame:SetPoint("CENTER",UIParent,"CENTER",240,150-50*(i-1))
- ArenaFrame.SetPoint = function() end
- CastBar:SetSize(90,14)
- end
- elseif event == "ARENA_PREP_OPPONENT_SPECIALIZATIONS" or (event == "PLAYER_ENTERING_WORLD" and instanceType == "arena") then
- for i = 1, MAX_ARENA_ENEMIES do
- local PrepFrame = _G["ArenaPrepFrame"..i]
- PrepFrame:ClearAllPoints()
- PrepFrame:SetPoint("CENTER",UIParent,"CENTER",240,150-50*(i-1))
- end
- end
- end)
- ArenaTrinkets = CreateFrame("Frame", nil, UIParent)
- function ArenaTrinkets:Initialize()
- for i = 1, MAX_ARENA_ENEMIES do
- local ArenaFrame = _G["ArenaEnemyFrame"..i]
- self:CreateIcon(ArenaFrame)
- end
- end
- function ArenaTrinkets:CreateIcon(frame)
- local trinket = CreateFrame("Cooldown", nil, frame, "CooldownFrameTemplate")
- trinket:SetFrameLevel(frame:GetFrameLevel() + 3)
- trinket:SetDrawEdge(false)
- trinket:ClearAllPoints()
- trinket:SetPoint("LEFT", frame, "RIGHT", 5, -1)
- trinket:SetSize(22, 22)
- trinket.Icon = CreateFrame("Frame", nil, trinket)
- trinket.Icon:SetFrameLevel(trinket:GetFrameLevel() - 1)
- trinket.Icon:SetAllPoints()
- trinket.Icon.Texture = trinket.Icon:CreateTexture(nil, "BORDER")
- trinket.Icon.Texture:SetPoint("TOPLEFT", -3, 2)
- trinket.Icon.Texture:SetSize(24, 24)
- SetPortraitToTexture(trinket.Icon.Texture, UnitFactionGroup('player') == "Horde" and "Interface\\Icons\\inv_jewelry_trinketpvp_02" or "Interface\\Icons\\inv_jewelry_trinketpvp_01")
- trinket.Icon.Border = CreateFrame("Frame", nil, trinket.Icon)
- trinket.Icon.Border:SetFrameLevel(trinket:GetFrameLevel() + 1)
- trinket.Icon.Border:SetAllPoints()
- trinket.Icon.Border.Texture = trinket.Icon.Border:CreateTexture(nil, "ARTWORK")
- trinket.Icon.Border.Texture:SetTexture("Interface\\Minimap\\MiniMap-TrackingBorder")
- if IsAddOnLoaded("Lorti UI") then
- trinket.Icon.Border.Texture:SetVertexColor(.005,.005,.005)
- end
- trinket.Icon.Border.Texture:SetPoint("TOPLEFT", -9, 7)
- trinket.Icon.Border.Texture:SetSize(63, 63)
- local id = frame:GetID()
- self["arena"..id] = trinket
- if ( trinket ) then
- trinket.Icon:SetParent(trinket:GetParent())
- trinket.Icon:SetScale(1)
- trinket.Icon:SetFrameLevel(trinket:GetFrameLevel() - 1)
- else
- for i = 1, MAX_ARENA_ENEMIES do
- trinket.Icon:SetParent(trinket:GetParent())
- trinket.Icon:SetScale(1)
- trinket.Icon:SetFrameLevel(trinket:GetFrameLevel() - 1)
- end
- end
- end
- function ArenaTrinkets:ShowTrinkets()
- for i = 1, MAX_ARENA_ENEMIES do
- self["arena"..i].Icon:Show()
- self["arena"..i]:Show()
- self["arena"..i]:SetCooldown(0, 0)
- end
- end
- function ArenaTrinkets:HideTrinkets()
- for i = 1, MAX_ARENA_ENEMIES do
- self["arena"..i].Icon:Hide()
- self["arena"..i]:Hide()
- self["arena"..i]:SetCooldown(0, 0)
- end
- end
- ArenaTrinkets:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end)
- function ArenaTrinkets:UNIT_SPELLCAST_SUCCEEDED(unitID, spell)
- if not ArenaTrinkets[unitID] then return end
- if spell == GetSpellInfo(42292) or spell == GetSpellInfo(59752) then -- Trinket and EMFH
- CooldownFrame_SetTimer(self[unitID], GetTime(), 120, 1)
- elseif spell == GetSpellInfo(7744) then -- WOTF
- CooldownFrame_SetTimer(self[unitID], GetTime(), 30, 1)
- end
- end
- function ArenaTrinkets:PLAYER_ENTERING_WORLD()
- local _, instanceType = IsInInstance()
- if instanceType == "arena" then
- self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
- ArenaTrinkets:ShowTrinkets()
- SetBinding("TAB", "TARGETNEARESTENEMYPLAYER")
- else
- ArenaTrinkets:HideTrinkets()
- SetBinding("TAB", "TARGETNEARESTENEMY")
- if ( self:IsEventRegistered("UNIT_SPELLCAST_SUCCEEDED") ) then
- self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED")
- end
- end
- end
- ArenaTrinkets:RegisterEvent("PLAYER_ENTERING_WORLD")
- function ArenaTrinkets:PLAYER_LOGIN()
- if not IsAddOnLoaded("Blizzard_ArenaUI") then
- LoadAddOn("Blizzard_ArenaUI")
- end
- self:Initialize()
- end
- ArenaTrinkets:RegisterEvent("PLAYER_LOGIN")
- --[[
- DR Tracker
- drx = x position
- drs = icon size
- DRt={{DRLIST1},{DRLIST2},{DRLIST3}...}
- DEFAULT : DRt={{fear},{polymorph}}
- -- show frame in left of arena enemyframe
- drx : set minus value(ex drx : -120)
- dp : "LEFT"
- and insert in macro 5
- drx+(r-1) -> drx-(r-1)
- ]]--
- -- DRt={{46968,5211,22570,9005,44572,408,1833,88625,30283,54785,89766,108269,47481,91797,20549,19577,90337,853,105593},{118,6770,1776,28272,28271,61305,61721,61780,82691,51514,3355}}
- -- drx=130;drs=40;dp="RIGHT";dre="COMBAT_LOG_EVENT_UNFILTERED"drp="PLAYER_ENTERING_WORLD"dra="ARENA_OPPONENT_UPDATE"LoadAddOn("Blizzard_ArenaUI")function gaef(f,n)return _G["ArenaEnemyFrame"..n.."HealthBar"]end
- -- function rDR(f)f.e=1;f.t:SetTexture(nil)f.c:Hide()end function sDR(f)f.e=f.e+1;f.c:Show()end function gDRt(i,j)return _G["drc"..i..":"..j]end function runDR(f,n)CooldownFrame_SetTimer(f.c,GetTime(),18,1)eDR(f,n)sDR(f)oDR(n)end
- -- function eDR(f,n)local t=1;f:SetScript("OnUpdate",function(s,e)t=t+e;if(t>=18)then f:SetScript("OnUpdate",nil)rDR(f)oDR(n)end end)end function cDR(f,n,s)if f.e<4 then local _,_,t=GetSpellInfo(s)f.t:SetTexture(t)runDR(f,n)end end
- -- function oDR(n)local r=1;for j in ipairs(DRt)do local f=gDRt(n,j)f:SetPoint(dp,gaef(f,n),dp,drx+(r-1)*50,0)r=r+1;end end function uDR(n,s)for i,t in ipairs(DRt)do for _,j in ipairs(t)do if s==j then cDR(gDRt(n,i),n,s)end end end end
- -- function DRc(i,j)local f=CreateFrame("Frame",nil,UIParent)f:SetSize(drs,drs)f.t=f:CreateTexture(nil,"BORDER")f.t:SetAllPoints(true)f.c=CreateFrame("Cooldown",nil,f)f.c:SetAllPoints(f)f.e=1 return f end
- -- function clDR(_,e,_,_,_,_,_,d,_,_,_,s)if(e=="SPELL_AURA_REMOVED" or e=="SPELL_AURA_REFRESH")then for i=1,5 do local ag=UnitGUID("arena"..i)if(ag ~= nil and d==ag)then uDR(i,s)end end end end
- -- function iDRt(o,m)for i=1,m do for j in ipairs(DRt)do local f=gDRt(i,j)rDR(f)if o then f:Show()end end end end for i=1,5 do for j in ipairs(DRt)do _G["drc"..i..":"..j]=DRc(i,j)end end
- -- dt=CreateFrame("Frame")dt:SetScript("OnEvent",function(_,e,...)if e==dre then clDR(...)elseif e==dra then iDRt(1,GetNumArenaOpponents())else iDRt(nil,5)end end)dt:RegisterEvent(dra)dt:RegisterEvent(drp)dt:RegisterEvent(dre)
- -- Scaling
- PartyMemberFrame1:SetScale(1.4)
- PartyMemberFrame2:SetScale(1.4)
- PartyMemberFrame3:SetScale(1.4)
- PartyMemberFrame4:SetScale(1.4)
- PlayerFrame:SetScale(0.92)
- TargetFrame:SetScale(0.92)
- FocusFrame:SetScale(0.92)
- FocusFrameSpellBar:SetScale(1.2)
- TargetFrameSpellBar:SetScale(1.05)
- --Экшн бары
- -- if things seem odd you can adjust here
- -- scale of action bars
- local SCALE = 1 -- 0.5 / 0.64
- -- height of exp and rep bars
- local HEIGHT = 4
- -- fade micro buttons and bags
- local FADE_BOX = 1
- -- show bags except the main bag
- local ShowAllBags = 0
- -- end of config
- do
- -- local Y_OFFSET = 30 -- сдвиг по вертикали
- -- for i=1,12 do
- -- _G['ActionButton'..i]:ClearAllPoints()
- -- _G['ActionButton'..i]:SetPoint('BOTTOMLEFT', MainMenuBar, 'BOTTOMLEFT', (i-1)*42, Y_OFFSET)
- -- end
- local Y_OFFSET = 30 -- сдвиг по вертикали
- for i=1,12 do
- _G['ActionButton'..i]:ClearAllPoints()
- _G['ActionButton'..i]:SetPoint('BOTTOMLEFT', MainMenuBar, 'BOTTOMLEFT', i*42, Y_OFFSET)
- end
- -- two rows MultiBarBottomRight
- --MultiBarBottomRightButton1:ClearAllPoints()
- --MultiBarBottomRightButton1:SetPoint("BOTTOMLEFT", MultiBarBottomLeftButton12, "BOTTOMRIGHT", 12, 0)
- MultiBarBottomRightButton7:ClearAllPoints()
- MultiBarBottomRightButton7:SetPoint("BOTTOMLEFT", ActionButton12, "BOTTOMRIGHT", 12, 0)
- -- adjusts MultiBarRight and MultiBarLeft
- -- MultiBarRightButton1:ClearAllPoints()
- -- MultiBarRightButton1:SetPoint("TOPRIGHT", UIParent, -2.5, -200)
- -- MultiBarLeftButton1:ClearAllPoints()
- -- MultiBarLeftButton1:SetPoint("TOPRIGHT", MultiBarLeft, x, y)
- -- StanceButtons on the left side
- StanceButton1:ClearAllPoints()
- StanceButton1:SetPoint("BOTTOMLEFT", MultiBarBottomLeftButton2, "TOPRIGHT", -30, 10)
- -- PetActionButtons on the right side
- PetActionButton1:ClearAllPoints()
- PetActionButton1:SetPoint("BOTTOMLEFT", MultiBarBottomRightButton6, "TOPRIGHT", -370, 8) -- 372 + 32
- PetActionBarFrame:SetHeight(0.001) --FIX ACTION BAR CAN'T CLICK
- PetActionBarFrame:SetWidth(0.001)
- -- concerned things with MainMenuBar
- MainMenuExpBar:SetWidth(761 - 5 )
- MainMenuExpBar:SetHeight(HEIGHT)
- MainMenuExpBar:ClearAllPoints()
- MainMenuExpBar:SetPoint("CENTER", MainMenuBar, "TOP", 35, 20)
- local fontFile, fontHeight, fontFlags = MainMenuBarExpText:GetFont()
- MainMenuBarExpText:SetFont(fontFile, floor(fontHeight / SCALE + 0.5), fontFlags)
- ExhaustionLevelFillBar:SetHeight(HEIGHT)
- ReputationWatchBar:SetWidth(761 - 5 )
- ReputationWatchBar:SetHeight(HEIGHT)
- ReputationWatchStatusBar:SetWidth(761 - 5)
- local fontFile, fontHeight, fontFlags = ReputationWatchStatusBarText:GetFont()
- ReputationWatchStatusBarText:SetFont(fontFile, floor(fontHeight / SCALE + 0.5), fontFlags)
- -- re-reconfigure ReputationWatchBar
- -- we can't use events because of the delay issue
- local function ReputationWatchBar_Update_posthook(...)
- local name, reaction, _, _, value = GetWatchedFactionInfo()
- local hasExpBar = MainMenuExpBar:IsShown()
- if ( not name ) then
- if ( hasExpBar and MainMenuBarExpText:GetPoint() ~= "CENTER" ) then
- MainMenuBarExpText:ClearAllPoints()
- MainMenuBarExpText:SetPoint("CENTER", MainMenuExpBar, 0, 1)
- end
- return ...
- end
- ReputationWatchStatusBar:SetHeight(HEIGHT)
- ReputationWatchStatusBarText:SetText(ReputationWatchStatusBarText:GetText() .. " " .. GetText("FACTION_STANDING_LABEL" .. reaction, UnitSex("player"))) -- adds standing label
- if ( hasExpBar ) then
- ReputationWatchBar:ClearAllPoints()
- ReputationWatchBar:SetPoint("CENTER", MainMenuBar, "TOP", 0, 4.5)
- if ( ReputationWatchStatusBarText:GetPoint() ~= "RIGHT" ) then
- ReputationWatchStatusBarText:ClearAllPoints()
- ReputationWatchStatusBarText:SetPoint("RIGHT", ReputationWatchBarOverlayFrame, -128, 1)
- end
- if ( MainMenuBarExpText:GetPoint() ~= "LEFT" ) then
- MainMenuBarExpText:ClearAllPoints()
- MainMenuBarExpText:SetPoint("LEFT", MainMenuExpBar, 128, 1)
- end
- else
- ReputationWatchBar:ClearAllPoints()
- ReputationWatchBar:SetPoint("CENTER", MainMenuBar, "TOP", 0, -4.5)
- if ( ReputationWatchStatusBarText:GetPoint() ~= "CENTER" ) then
- ReputationWatchStatusBarText:ClearAllPoints()
- ReputationWatchStatusBarText:SetPoint("CENTER", ReputationWatchBarOverlayFrame, 0, 1)
- end
- end
- -- removes watched faction if we ware exalted
- if ( value == 42999 ) then
- SetWatchedFactionIndex(0)
- end
- return ...
- end
- local ReputationWatchBar_Update_original = ReputationWatchBar_Update
- function ReputationWatchBar_Update(...)
- return ReputationWatchBar_Update_posthook(ReputationWatchBar_Update_original(...))
- end
- -- actual new MainMenuBar's width
- MainMenuBar:SetWidth(777 - 5) -- 761 + 8 * 2
- -- who cares? but i do
- MainMenuBar:EnableMouse(false)
- -- unloads un-wanted textures
- for _, texture in next, {
- MainMenuXPBarTextureLeftCap,MainMenuXPBarTextureRightCap,MainMenuXPBarTextureMid, MainMenuMaxLevelBar0, MainMenuMaxLevelBar1, MainMenuMaxLevelBar2, MainMenuMaxLevelBar3, MainMenuBarTexture0, MainMenuBarTexture1, --[[MainMenuBarTexture2, MainMenuBarTexture3,]] MainMenuBarLeftEndCap, MainMenuBarRightEndCap,
- ReputationWatchBarTexture0, ReputationWatchBarTexture1, ReputationWatchBarTexture2, ReputationWatchBarTexture3, ReputationXPBarTexture0, ReputationXPBarTexture1, ReputationXPBarTexture2, ReputationXPBarTexture3,
- BonusActionBarTexture0, BonusActionBarTexture1, ShapeshiftBarLeft, ShapeshiftBarMiddle, ShapeshiftBarRight, PossessBackground1, PossessBackground2,
- SlidingActionBarTexture0, SlidingActionBarTexture1,
- } do
- texture:SetTexture(nil)
- end
- -- scales these bars
- for _, bar in next, {
- MainMenuBar, --[[ VehicleMenuBar,]] MultiBarRight
- } do
- bar:SetScale(SCALE)
- end
- end
- -- modified by smaltore @2011-11-16
- ---------------------------------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------------------------------
- -- hide the art frames from mainmenu action bar
- hooksecurefunc("UIParent_ManageFramePosition", function ()
- for _,frame in next, {
- MainMenuBarTexture0,MainMenuBarTexture1,--主动作条背景
- MainMenuBarTexture2,MainMenuBarTexture3, --钥匙和背包背景
- MainMenuBarLeftEndCap, MainMenuBarRightEndCap, --主动作条两端的鹰
- MainMenuBarPageNumber,ActionBarUpButton,ActionBarDownButton, --翻页按钮
- }
- do frame:Hide() end
- for i=1,19 do _G["MainMenuXPBarDiv"..i]:SetTexture(nil) end --经验条的格格
- end)
- -------------------------------------bags and micro menu----------------------------------
- -- [[create fade function
- local function fade(frame,button)
- local function showhide(alpha)
- frame:SetAlpha(alpha)
- end
- frame:EnableMouse(true)
- frame:SetAlpha(0.1)
- frame:SetScript("OnEnter", function(self) showhide(1) end)
- frame:SetScript("OnLeave", function(self) showhide(0.1) end)
- button:HookScript("OnEnter", function(self) showhide(1) end)
- button:HookScript("OnLeave", function(self) showhide(0.1) end)
- end --]]
- --bags and micromenu buttons
- local MicroButtons = {
- CharacterMicroButton,
- SpellbookMicroButton,
- TalentMicroButton,
- AchievementMicroButton,
- QuestLogMicroButton,
- GuildMicroButton,
- --PVPMicroButton,
- LFDMicroButton,
- CompanionsMicroButton,
- EJMicroButton,
- StoreMicroButton,
- MainMenuMicroButton,
- --HelpMicroButton,
- }
- local BagButtons = {
- MainMenuBarBackpackButton,
- CharacterBag0Slot,
- CharacterBag1Slot,
- CharacterBag2Slot,
- CharacterBag3Slot,
- }
- local box = CreateFrame("Frame","Micro_and_Bags_Frame",UIParent)
- box:SetWidth(210)
- box:SetHeight(55)
- box:SetPoint("BOTTOMRIGHT", UIParent, 0, 0);
- --box:SetScale(SCALE * 0.8)
- local function mybox()
- --bags
- for _, button in pairs(BagButtons) do
- if button ~= MainMenuBarBackpackButton then
- button:SetScale(1.8)
- button:SetParent(box)
- if ShowAllBags == 0 then button:Hide() end
- else
- MainMenuBarBackpackButton:SetParent(box)
- MainMenuBarBackpackButton:SetScale( 2.3 )
- end
- end
- MainMenuBarBackpackButton:ClearAllPoints();
- MainMenuBarBackpackButton:SetPoint("BOTTOMRIGHT",box,0,0);
- CharacterBag0Slot:ClearAllPoints();
- CharacterBag0Slot:SetPoint("BOTTOMRIGHT",MainMenuBarBackpackButton,"TOPRIGHT",0,0);
- -- micro menu bar 系统菜单
- for _, button in pairs(MicroButtons) do
- button:SetParent(box);
- end
- CharacterMicroButton:ClearAllPoints();
- CharacterMicroButton:SetPoint("BOTTOMLEFT", MainMenuBarBackpackButton, -158, 32);
- LFDMicroButton:ClearAllPoints();
- LFDMicroButton:SetPoint("TOPLEFT", CharacterMicroButton, "BOTTOMLEFT", 0, 25);
- end
- mybox()
- hooksecurefunc("UpdateMicroButtons",mybox)
- --fade and move the side bars
- if FADE_BOX == 1 then
- for _,button in pairs(MicroButtons) do fade(box,button) end
- for _,button in pairs(BagButtons) do fade(box,button) end
- end
- --------------------------------------------------------------------------------------------
- --------------------------------------------------------------------------------------------
- --OverRideBar patch from rActionBarStyler
- local textureList = {
- "_BG",
- "EndCapL",
- "EndCapR",
- "_Border",
- "Divider1",
- "Divider2",
- "Divider3",
- "ExitBG",
- "MicroBGL",
- "MicroBGR",
- "_MicroBGMid",
- "ButtonBGL",
- "ButtonBGR",
- "_ButtonBGMid",
- }
- for _,tex in pairs(textureList) do
- OverrideActionBar[tex]:SetAlpha(0)
- end
- local HideOverRide = CreateFrame("frame")
- HideOverRide:Hide()
- for _,f in next,{
- OverrideActionBarExpBar,
- OverrideActionBarHealthBar,
- OverrideActionBarPowerBar,
- OverrideActionBarPitchFrame,
- } do
- f:SetParent(HideOverRide)
- end
- for i=1, 6 do
- local button = _G["OverrideActionBarButton"..i]
- if not button then break end
- button:SetSize(40, 40)
- button:ClearAllPoints()
- if i == 1 then
- button:SetPoint("BOTTOMLEFT",ActionButton1)
- else
- local previous = _G["OverrideActionBarButton"..i-1]
- button:SetPoint("LEFT", previous, "RIGHT", 10, 0)
- end
- end
- OverrideActionBar.LeaveButton:SetSize(40, 40)
- OverrideActionBar.LeaveButton:ClearAllPoints()
- OverrideActionBar.LeaveButton:SetPoint("BOTTOMRIGHT",ActionButton12)
- --========================================================= oCastBar modify =======================================================--
- local CAST_SHOW,CASTBAR_X,CASTBAR_Y = 1,0,125
- local CASTBAR_X,CASTBAR_Y = 0,125
- if CAST_SHOW == 1 then
- local cast_x,cast_y = CASTBAR_X,CASTBAR_Y
- --player casting bar
- CastingBarFrameIcon:Show()
- CastingBarFrameIcon:SetHeight( 25 )
- CastingBarFrameIcon:SetWidth( 25 )
- CastingBarFrameIcon:ClearAllPoints()
- CastingBarFrameIcon:SetPoint( "RIGHT", CastingBarFrame, "LEFT", -10, 2.5 )
- --CastingBarFrameBorder:SetTexture(nil) --("Interface\\CastingBar\\UI-CastingBar-Border-Small")
- --CastingBarFrameFlash:SetTexture("Interface\\CastingBar\\UI-CastingBar-Flash-Small")
- --CastingBarFrame:ClearAllPoints()
- --CastingBarFrame:SetPoint("TOP", MainMenuBar, cast_x, cast_y)
- --CastingBarFrame.SetPoint = function() end
- -- Castbar timer from thek
- CastingBarFrame.timer = CastingBarFrame:CreateFontString(nil)
- CastingBarFrame.timer:SetFont("Fonts\\ARIALN.ttf", 18, "THINOUTLINE")
- CastingBarFrame.timer:SetPoint("LEFT", CastingBarFrame, "RIGHT", 10, 2.5)
- CastingBarFrame.update = .1
- TargetFrameSpellBar.timer = TargetFrameSpellBar:CreateFontString(nil)
- TargetFrameSpellBar.timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
- TargetFrameSpellBar.timer:SetPoint("LEFT", TargetFrameSpellBar, "RIGHT", 5, 0)
- TargetFrameSpellBar.update = .1
- FocusFrameSpellBar.timer = FocusFrameSpellBar:CreateFontString(nil)
- FocusFrameSpellBar.timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
- FocusFrameSpellBar.timer:SetPoint("LEFT", FocusFrameSpellBar, "RIGHT", 5, 0)
- FocusFrameSpellBar.update = .1
- hooksecurefunc("CastingBarFrame_OnUpdate", function(self, elapsed)
- if not self.timer then return end
- if self.update and self.update < elapsed then
- if self.casting then
- self.timer:SetText(format("%.1f", max(self.maxValue - self.value, 0)))
- elseif self.channeling then
- self.timer:SetText(format("%.1f", max(self.value, 0)))
- else
- self.timer:SetText("")
- end
- self.update = .1
- else
- self.update = self.update - elapsed
- end
- end)
- end
- -- Flashy spellsteal border for non-mages and/or enrage effects
- hooksecurefunc("TargetFrame_UpdateAuras", function(s)
- for i = 1, MAX_TARGET_BUFFS do
- _, _, ic, _, dT = UnitBuff(s.unit, i)
- if(ic and (not s.maxBuffs or i<=s.maxBuffs)) then
- fS=_G[s:GetName()..'Buff'..i..'Stealable']
- if(UnitIsEnemy(PlayerFrame.unit, s.unit) and dT=='Magic') then
- fS:Show()
- else
- fS:Hide()
- end
- end
- end
- end)
- -- Положение фреймов по align
- -- Таргет фрейм: 5 сверху, 8 от центра по портрету.
- -- Фокус фрейм: 12 слева, по центру.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement