Advertisement
Guest User

Untitled

a guest
Nov 12th, 2014
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.61 KB | None | 0 0
  1. -- Contents
  2. -- Trinket
  3. -- Хелз бары по цвету класса
  4. -- Цвет бэкграунда по цвету класса
  5. -- Выбор позиции всплывающего текста
  6. -- Align (координатная сетка)
  7. -- Hide the error (red text) frame
  8. -- ToT Focus Frame
  9. -- ToT Target Frame
  10. -- Big Debuffs
  11. -- Focuser
  12. -- Arena Trinkets
  13. -- Scaling
  14. -- Экшн бары
  15. -- CD Tracker
  16. -- Flashy spellsteal border for non-mages and/or enrage effects
  17.  
  18. -- Тринкет (слот 1) Proc Trinket 92224
  19.  
  20. local f = CreateFrame("Frame")
  21. f:RegisterEvent("PLAYER_ENTERING_WORLD")
  22. f:RegisterEvent("UNIT_AURA")
  23. f:RegisterEvent("ZONE_CHANGED_NEW_AREA")
  24. f:SetScript("OnEvent", function(self, event, ...)
  25. local SE = GetSpellInfo(126702)
  26. if event=="PLAYER_ENTERING_WORLD" then
  27. local TRINKET3 = _G["TRINKET3"] or CreateFrame("Frame", "TRINKET3", UIParent)
  28. TRINKET3.c = TRINKET3.c or CreateFrame("Cooldown","$parentCooldown", TRINKET3)
  29. TRINKET3.c:SetAllPoints(TRINKET3)
  30. TRINKET3:SetPoint("CENTER", 100, 0)
  31. TRINKET3:SetSize(40,40)
  32. TRINKET3.t = TRINKET3.t or TRINKET3:CreateTexture("$parentIcon","BORDER")
  33. TRINKET3.t:SetAllPoints()
  34. end
  35. if event=="UNIT_AURA" or event=="ZONE_CHANGED_NEW_AREA" then
  36. local found = false
  37. for i=1,40 do
  38. local N,_,t, _, _,d,x = UnitBuff("player", i)
  39. if not N then break end
  40. 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
  41. if not found then TRINKET3:Hide() end
  42. end
  43. end
  44. end)
  45.  
  46. -- Тринкет (слот 2) Use PVP Trinket 126702
  47. local f = CreateFrame("Frame")
  48. f:RegisterEvent("PLAYER_ENTERING_WORLD")
  49. f:RegisterEvent("UNIT_AURA")
  50. f:RegisterEvent("ZONE_CHANGED_NEW_AREA")
  51. f:SetScript("OnEvent", function(self, event, ...)
  52. local SE = GetSpellInfo(126679)
  53. if event=="PLAYER_ENTERING_WORLD" then
  54. local PVPTRINKET = _G["PVPTRINKET"] or CreateFrame("Frame", "PVPTRINKET", UIParent)
  55. PVPTRINKET.c = PVPTRINKET.c or CreateFrame("Cooldown","$parentCooldown", PVPTRINKET)
  56. PVPTRINKET.c:SetAllPoints(PVPTRINKET)
  57. PVPTRINKET:SetPoint("CENTER", 141, 0)
  58. PVPTRINKET:SetSize(40,40)
  59. PVPTRINKET.t = PVPTRINKET.t or PVPTRINKET:CreateTexture("$parentIcon","BORDER")
  60. PVPTRINKET.t:SetAllPoints()
  61. end
  62. if event=="UNIT_AURA" or event=="ZONE_CHANGED_NEW_AREA" then
  63. local found = false
  64. for i=1,40 do
  65. local N,_,t, _, _,d,x = UnitBuff("player", i)
  66. if not N then break end
  67. 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
  68. if not found then PVPTRINKET:Hide() end
  69. end
  70. end
  71. end)
  72.  
  73. -- Хелз бары по цвету класса
  74.  
  75. local function colour(statusbar, unit)
  76. local _, class, c
  77. if UnitIsPlayer(unit) and UnitIsConnected(unit) and unit == statusbar.unit and UnitClass(unit) then
  78. _, class = UnitClass(unit)
  79. c = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
  80. statusbar:SetStatusBarColor(c.r, c.g, c.b)
  81. PlayerFrameHealthBar:SetStatusBarColor(0,1,0)
  82. end
  83. end
  84.  
  85. hooksecurefunc("UnitFrameHealthBar_Update", colour)
  86. hooksecurefunc("HealthBar_OnValueChanged", function(self)
  87. colour(self, self.unit)
  88. end)
  89.  
  90. -- Цвет бэкграунда по цвету класса
  91.  
  92. UnitSelectionColor = function(unit)
  93. if not UnitExists(unit) then return 1,1,1,1 end
  94. local color = UnitIsPlayer(unit) and RAID_CLASS_COLORS[select(2, UnitClass(unit))] or FACTION_BAR_COLORS[UnitReaction(unit, 'player')]
  95. if color then
  96. if not UnitIsConnected(unit) then
  97. return .5, .5, .5, 1
  98. else
  99. return color.r*.8, color.g*.8, color.b*.8, 1
  100. end
  101. else
  102. if UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) then
  103. return .5, .5, .5, 1
  104. end
  105. end
  106. end
  107.  
  108.  
  109. -- Выбор позиции всплывающего текста
  110.  
  111. local f = CreateFrame("FRAME");
  112. f:SetScript("OnEvent", function(self,event,...)
  113. local arg1 =...;
  114. if (arg1=="Blizzard_CombatText") then
  115. f:UnregisterEvent("ADDON_LOADED");
  116. hooksecurefunc("CombatText_UpdateDisplayedMessages",
  117. function ()
  118. COMBAT_TEXT_LOCATIONS =
  119. {startX = 200,
  120. startY = 270 * COMBAT_TEXT_Y_SCALE,
  121. endX = 200,
  122. endY = 345 * COMBAT_TEXT_Y_SCALE};
  123. end);
  124. end
  125. end);
  126. f:RegisterEvent("ADDON_LOADED");
  127.  
  128. -- Align (координатная сетка)
  129.  
  130. SLASH_EA1 = "/align"
  131.  
  132. local f
  133.  
  134. SlashCmdList["EA"] = function()
  135. if f then
  136. f:Hide()
  137. f = nil
  138. else
  139. f = CreateFrame('Frame', nil, UIParent)
  140. f:SetAllPoints(UIParent)
  141. local w = GetScreenWidth() / 64
  142. local h = GetScreenHeight() / 36
  143. for i = 0, 64 do
  144. local t = f:CreateTexture(nil, 'BACKGROUND')
  145. if i == 32 then
  146. t:SetTexture(1, 0, 0, 0.5)
  147. else
  148. t:SetTexture(0, 0, 0, 0.5)
  149. end
  150. t:SetPoint('TOPLEFT', f, 'TOPLEFT', i * w - 1, 0)
  151. t:SetPoint('BOTTOMRIGHT', f, 'BOTTOMLEFT', i * w + 1, 0)
  152. end
  153. for i = 0, 36 do
  154. local t = f:CreateTexture(nil, 'BACKGROUND')
  155. if i == 18 then
  156. t:SetTexture(1, 0, 0, 0.5)
  157. else
  158. t:SetTexture(0, 0, 0, 0.5)
  159. end
  160. t:SetPoint('TOPLEFT', f, 'TOPLEFT', 0, -i * h + 1)
  161. t:SetPoint('BOTTOMRIGHT', f, 'TOPRIGHT', 0, -i * h - 1)
  162. end
  163. end
  164. end
  165.  
  166. -- Hide the error (red text) frame
  167.  
  168. UIErrorsFrame:SetAlpha(0)
  169.  
  170. -- ToT Focus Frame
  171.  
  172. FocusFrameToT:ClearAllPoints() FocusFrameToT:SetPoint("TOP",FocusFrame,"TOP",-95, 20)
  173.  
  174. -- ToT Target Frame
  175.  
  176. TargetFrameToT:ClearAllPoints() TargetFrameToT:SetPoint("RIGHT",TargetFrame,"RIGHT",10, -25)
  177.  
  178. -- Big Debuffs
  179.  
  180. local numIcons = 6
  181. hooksecurefunc("TargetFrame_UpdateAuraPositions", function(self, auraName, numAuras, numOppositeAuras,largeAuraList, updateFunc, maxRowWidth, offsetX)
  182. local AURA_OFFSET_Y = 3
  183. local LARGE_AURA_SIZE = 22 -- развер ВАШИХ баффов/дебаффов.
  184. local SMALL_AURA_SIZE = 18.5 -- развер чужих баффов/дебаффов.
  185. local size
  186. local offsetY = AURA_OFFSET_Y
  187. local rowWidth = 0
  188. local firstBuffOnRow = 1
  189.  
  190. maxRowWidth = LARGE_AURA_SIZE * numIcons
  191.  
  192. for i=1, numAuras do
  193. if largeAuraList[i] then
  194. size = LARGE_AURA_SIZE
  195. offsetY = AURA_OFFSET_Y + AURA_OFFSET_Y
  196. else
  197. size = SMALL_AURA_SIZE
  198. end
  199. if i == 1 then
  200. rowWidth = size
  201. self.auraRows = self.auraRows + 1
  202. else
  203. rowWidth = rowWidth + size + offsetX
  204. end
  205. if rowWidth > maxRowWidth then
  206. updateFunc(self, auraName, i, numOppositeAuras, firstBuffOnRow, size, offsetX, offsetY)
  207. rowWidth = size
  208. self.auraRows = self.auraRows + 1
  209. firstBuffOnRow = i
  210. offsetY = AURA_OFFSET_Y
  211. else
  212. updateFunc(self, auraName, i, numOppositeAuras, i - 1, size, offsetX, offsetY)
  213. end
  214. end
  215. end)
  216.  
  217.  
  218. -- Focuser
  219.  
  220. local modifier = "alt"
  221. local mouseButton = "1"
  222.  
  223. local function SetFocusHotkey(frame)
  224. frame:SetAttribute(modifier.."-type"..mouseButton,"focus")
  225. end
  226.  
  227. local function CreateFrame_Hook(type, name, parent, template)
  228. if template == "SecureUnitButtonTemplate" then
  229. SetFocusHotkey(_G[name])
  230. end
  231. end
  232.  
  233. hooksecurefunc("CreateFrame", CreateFrame_Hook)
  234.  
  235. local f = CreateFrame("CheckButton", "FocuserButton", UIParent, "SecureActionButtonTemplate")
  236. f:SetAttribute("type1","macro")
  237. f:SetAttribute("macrotext","/focus mouseover")
  238. SetOverrideBindingClick(FocuserButton,true,modifier.."-BUTTON"..mouseButton,"FocuserButton")
  239.  
  240. local duf = {
  241. PlayerFrame,
  242. PetFrame,
  243. PartyMemberFrame1,
  244. PartyMemberFrame2,
  245. PartyMemberFrame3,
  246. PartyMemberFrame4,
  247. PartyMemberFrame1PetFrame,
  248. PartyMemberFrame2PetFrame,
  249. PartyMemberFrame3PetFrame,
  250. PartyMemberFrame4PetFrame,
  251. TargetFrame,
  252. TargetofTargetFrame,
  253. ArenaEnemyFrame1,
  254. ArenaEnemyFrame2,
  255. ArenaEnemyFrame3,
  256. ArenaEnemyFrame4,
  257. ArenaEnemyFrame5,
  258. ArenaEnemyFrame1PetFrame,
  259. ArenaEnemyFrame2PetFrame,
  260. ArenaEnemyFrame3PetFrame,
  261. ArenaEnemyFrame4PetFrame,
  262. ArenaEnemyFrame5PetFrame,
  263. }
  264.  
  265. for i,frame in pairs(duf) do
  266. SetFocusHotkey(frame)
  267. end
  268.  
  269. -- Arena Trinkets
  270.  
  271. local arenaframes = CreateFrame("Frame")
  272. local _, instanceType = IsInInstance()
  273. arenaframes:RegisterEvent("ADDON_LOADED")
  274. arenaframes:RegisterEvent("PLAYER_ENTERING_WORLD")
  275. arenaframes:RegisterEvent("ARENA_PREP_OPPONENT_SPECIALIZATIONS")
  276. arenaframes:SetScript("OnEvent", function(self, event, addon)
  277. if addon=="Blizzard_ArenaUI" and not (IsAddOnLoaded("Shadowed Unit Frames")) then
  278. for i = 1, MAX_ARENA_ENEMIES do
  279. local ArenaFrame = _G["ArenaEnemyFrame"..i]
  280. local CastBar = _G["ArenaEnemyFrame"..i.."CastingBar"]
  281. ArenaFrame:ClearAllPoints()
  282. ArenaFrame:SetPoint("CENTER",UIParent,"CENTER",240,150-50*(i-1))
  283. ArenaFrame.SetPoint = function() end
  284. CastBar:SetSize(90,14)
  285. end
  286. elseif event == "ARENA_PREP_OPPONENT_SPECIALIZATIONS" or (event == "PLAYER_ENTERING_WORLD" and instanceType == "arena") then
  287. for i = 1, MAX_ARENA_ENEMIES do
  288. local PrepFrame = _G["ArenaPrepFrame"..i]
  289. PrepFrame:ClearAllPoints()
  290. PrepFrame:SetPoint("CENTER",UIParent,"CENTER",240,150-50*(i-1))
  291. end
  292. end
  293. end)
  294.  
  295. ArenaTrinkets = CreateFrame("Frame", nil, UIParent)
  296. function ArenaTrinkets:Initialize()
  297. for i = 1, MAX_ARENA_ENEMIES do
  298. local ArenaFrame = _G["ArenaEnemyFrame"..i]
  299. self:CreateIcon(ArenaFrame)
  300. end
  301. end
  302. function ArenaTrinkets:CreateIcon(frame)
  303. local trinket = CreateFrame("Cooldown", nil, frame, "CooldownFrameTemplate")
  304. trinket:SetFrameLevel(frame:GetFrameLevel() + 3)
  305. trinket:SetDrawEdge(false)
  306. trinket:ClearAllPoints()
  307. trinket:SetPoint("LEFT", frame, "RIGHT", 5, -1)
  308. trinket:SetSize(22, 22)
  309.  
  310. trinket.Icon = CreateFrame("Frame", nil, trinket)
  311. trinket.Icon:SetFrameLevel(trinket:GetFrameLevel() - 1)
  312. trinket.Icon:SetAllPoints()
  313. trinket.Icon.Texture = trinket.Icon:CreateTexture(nil, "BORDER")
  314. trinket.Icon.Texture:SetPoint("TOPLEFT", -3, 2)
  315. trinket.Icon.Texture:SetSize(24, 24)
  316. SetPortraitToTexture(trinket.Icon.Texture, UnitFactionGroup('player') == "Horde" and "Interface\\Icons\\inv_jewelry_trinketpvp_02" or "Interface\\Icons\\inv_jewelry_trinketpvp_01")
  317.  
  318. trinket.Icon.Border = CreateFrame("Frame", nil, trinket.Icon)
  319. trinket.Icon.Border:SetFrameLevel(trinket:GetFrameLevel() + 1)
  320. trinket.Icon.Border:SetAllPoints()
  321. trinket.Icon.Border.Texture = trinket.Icon.Border:CreateTexture(nil, "ARTWORK")
  322. trinket.Icon.Border.Texture:SetTexture("Interface\\Minimap\\MiniMap-TrackingBorder")
  323. if IsAddOnLoaded("Lorti UI") then
  324. trinket.Icon.Border.Texture:SetVertexColor(.005,.005,.005)
  325. end
  326. trinket.Icon.Border.Texture:SetPoint("TOPLEFT", -9, 7)
  327. trinket.Icon.Border.Texture:SetSize(63, 63)
  328. local id = frame:GetID()
  329. self["arena"..id] = trinket
  330.  
  331. if ( trinket ) then
  332. trinket.Icon:SetParent(trinket:GetParent())
  333. trinket.Icon:SetScale(1)
  334. trinket.Icon:SetFrameLevel(trinket:GetFrameLevel() - 1)
  335. else
  336. for i = 1, MAX_ARENA_ENEMIES do
  337. trinket.Icon:SetParent(trinket:GetParent())
  338. trinket.Icon:SetScale(1)
  339. trinket.Icon:SetFrameLevel(trinket:GetFrameLevel() - 1)
  340. end
  341. end
  342. end
  343. function ArenaTrinkets:ShowTrinkets()
  344. for i = 1, MAX_ARENA_ENEMIES do
  345. self["arena"..i].Icon:Show()
  346. self["arena"..i]:Show()
  347. self["arena"..i]:SetCooldown(0, 0)
  348. end
  349. end
  350. function ArenaTrinkets:HideTrinkets()
  351. for i = 1, MAX_ARENA_ENEMIES do
  352. self["arena"..i].Icon:Hide()
  353. self["arena"..i]:Hide()
  354. self["arena"..i]:SetCooldown(0, 0)
  355. end
  356. end
  357. ArenaTrinkets:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end)
  358. function ArenaTrinkets:UNIT_SPELLCAST_SUCCEEDED(unitID, spell)
  359. if not ArenaTrinkets[unitID] then return end
  360.  
  361. if spell == GetSpellInfo(42292) or spell == GetSpellInfo(59752) then -- Trinket and EMFH
  362. CooldownFrame_SetTimer(self[unitID], GetTime(), 120, 1)
  363. elseif spell == GetSpellInfo(7744) then -- WOTF
  364. CooldownFrame_SetTimer(self[unitID], GetTime(), 30, 1)
  365. end
  366. end
  367. function ArenaTrinkets:PLAYER_ENTERING_WORLD()
  368. local _, instanceType = IsInInstance()
  369. if instanceType == "arena" then
  370. self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  371. ArenaTrinkets:ShowTrinkets()
  372. SetBinding("TAB", "TARGETNEARESTENEMYPLAYER")
  373. else
  374. ArenaTrinkets:HideTrinkets()
  375. SetBinding("TAB", "TARGETNEARESTENEMY")
  376. if ( self:IsEventRegistered("UNIT_SPELLCAST_SUCCEEDED") ) then
  377. self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  378. end
  379. end
  380. end
  381. ArenaTrinkets:RegisterEvent("PLAYER_ENTERING_WORLD")
  382. function ArenaTrinkets:PLAYER_LOGIN()
  383. if not IsAddOnLoaded("Blizzard_ArenaUI") then
  384. LoadAddOn("Blizzard_ArenaUI")
  385. end
  386. self:Initialize()
  387. end
  388. ArenaTrinkets:RegisterEvent("PLAYER_LOGIN")
  389.  
  390. --[[
  391. DR Tracker
  392.  
  393. drx = x position
  394. drs = icon size
  395.  
  396. DRt={{DRLIST1},{DRLIST2},{DRLIST3}...}
  397. DEFAULT : DRt={{fear},{polymorph}}
  398.  
  399.  
  400. -- show frame in left of arena enemyframe
  401.  
  402. drx : set minus value(ex drx : -120)
  403. dp : "LEFT"
  404.  
  405. and insert in macro 5
  406.  
  407. drx+(r-1) -> drx-(r-1)
  408.  
  409. ]]--
  410.  
  411. -- 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}}
  412.  
  413. -- 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
  414.  
  415. -- 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
  416.  
  417. -- 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
  418.  
  419. -- 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
  420.  
  421. -- 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
  422.  
  423. -- 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
  424.  
  425. -- 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
  426.  
  427. -- 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)
  428.  
  429. -- Scaling
  430.  
  431. PartyMemberFrame1:SetScale(1.4)
  432. PartyMemberFrame2:SetScale(1.4)
  433. PartyMemberFrame3:SetScale(1.4)
  434. PartyMemberFrame4:SetScale(1.4)
  435. PlayerFrame:SetScale(0.92)
  436. TargetFrame:SetScale(0.92)
  437. FocusFrame:SetScale(0.92)
  438. FocusFrameSpellBar:SetScale(1.2)
  439. TargetFrameSpellBar:SetScale(1.05)
  440.  
  441. --Экшн бары
  442.  
  443. -- if things seem odd you can adjust here
  444.  
  445. -- scale of action bars
  446. local SCALE = 1 -- 0.5 / 0.64
  447.  
  448. -- height of exp and rep bars
  449. local HEIGHT = 4
  450.  
  451. -- fade micro buttons and bags
  452. local FADE_BOX = 1
  453.  
  454. -- show bags except the main bag
  455. local ShowAllBags = 0
  456.  
  457. -- end of config
  458.  
  459. do
  460. -- local Y_OFFSET = 30 -- сдвиг по вертикали
  461. -- for i=1,12 do
  462. -- _G['ActionButton'..i]:ClearAllPoints()
  463. -- _G['ActionButton'..i]:SetPoint('BOTTOMLEFT', MainMenuBar, 'BOTTOMLEFT', (i-1)*42, Y_OFFSET)
  464. -- end
  465.  
  466. local Y_OFFSET = 30 -- сдвиг по вертикали
  467. for i=1,12 do
  468. _G['ActionButton'..i]:ClearAllPoints()
  469. _G['ActionButton'..i]:SetPoint('BOTTOMLEFT', MainMenuBar, 'BOTTOMLEFT', i*42, Y_OFFSET)
  470. end
  471.  
  472. -- two rows MultiBarBottomRight
  473. --MultiBarBottomRightButton1:ClearAllPoints()
  474. --MultiBarBottomRightButton1:SetPoint("BOTTOMLEFT", MultiBarBottomLeftButton12, "BOTTOMRIGHT", 12, 0)
  475. MultiBarBottomRightButton7:ClearAllPoints()
  476. MultiBarBottomRightButton7:SetPoint("BOTTOMLEFT", ActionButton12, "BOTTOMRIGHT", 12, 0)
  477.  
  478. -- adjusts MultiBarRight and MultiBarLeft
  479. -- MultiBarRightButton1:ClearAllPoints()
  480. -- MultiBarRightButton1:SetPoint("TOPRIGHT", UIParent, -2.5, -200)
  481. -- MultiBarLeftButton1:ClearAllPoints()
  482. -- MultiBarLeftButton1:SetPoint("TOPRIGHT", MultiBarLeft, x, y)
  483.  
  484. -- StanceButtons on the left side
  485.  
  486. StanceButton1:ClearAllPoints()
  487. StanceButton1:SetPoint("BOTTOMLEFT", MultiBarBottomLeftButton2, "TOPRIGHT", -30, 10)
  488.  
  489. -- PetActionButtons on the right side
  490. PetActionButton1:ClearAllPoints()
  491. PetActionButton1:SetPoint("BOTTOMLEFT", MultiBarBottomRightButton6, "TOPRIGHT", -370, 8) -- 372 + 32
  492. PetActionBarFrame:SetHeight(0.001) --FIX ACTION BAR CAN'T CLICK
  493. PetActionBarFrame:SetWidth(0.001)
  494.  
  495. -- concerned things with MainMenuBar
  496. MainMenuExpBar:SetWidth(761 - 5 )
  497. MainMenuExpBar:SetHeight(HEIGHT)
  498. MainMenuExpBar:ClearAllPoints()
  499. MainMenuExpBar:SetPoint("CENTER", MainMenuBar, "TOP", 35, 20)
  500.  
  501. local fontFile, fontHeight, fontFlags = MainMenuBarExpText:GetFont()
  502. MainMenuBarExpText:SetFont(fontFile, floor(fontHeight / SCALE + 0.5), fontFlags)
  503.  
  504. ExhaustionLevelFillBar:SetHeight(HEIGHT)
  505.  
  506. ReputationWatchBar:SetWidth(761 - 5 )
  507. ReputationWatchBar:SetHeight(HEIGHT)
  508.  
  509. ReputationWatchStatusBar:SetWidth(761 - 5)
  510.  
  511. local fontFile, fontHeight, fontFlags = ReputationWatchStatusBarText:GetFont()
  512. ReputationWatchStatusBarText:SetFont(fontFile, floor(fontHeight / SCALE + 0.5), fontFlags)
  513.  
  514. -- re-reconfigure ReputationWatchBar
  515. -- we can't use events because of the delay issue
  516. local function ReputationWatchBar_Update_posthook(...)
  517. local name, reaction, _, _, value = GetWatchedFactionInfo()
  518. local hasExpBar = MainMenuExpBar:IsShown()
  519.  
  520. if ( not name ) then
  521. if ( hasExpBar and MainMenuBarExpText:GetPoint() ~= "CENTER" ) then
  522. MainMenuBarExpText:ClearAllPoints()
  523. MainMenuBarExpText:SetPoint("CENTER", MainMenuExpBar, 0, 1)
  524. end
  525.  
  526. return ...
  527. end
  528.  
  529. ReputationWatchStatusBar:SetHeight(HEIGHT)
  530. ReputationWatchStatusBarText:SetText(ReputationWatchStatusBarText:GetText() .. " " .. GetText("FACTION_STANDING_LABEL" .. reaction, UnitSex("player"))) -- adds standing label
  531.  
  532. if ( hasExpBar ) then
  533. ReputationWatchBar:ClearAllPoints()
  534. ReputationWatchBar:SetPoint("CENTER", MainMenuBar, "TOP", 0, 4.5)
  535.  
  536. if ( ReputationWatchStatusBarText:GetPoint() ~= "RIGHT" ) then
  537. ReputationWatchStatusBarText:ClearAllPoints()
  538. ReputationWatchStatusBarText:SetPoint("RIGHT", ReputationWatchBarOverlayFrame, -128, 1)
  539. end
  540.  
  541. if ( MainMenuBarExpText:GetPoint() ~= "LEFT" ) then
  542. MainMenuBarExpText:ClearAllPoints()
  543. MainMenuBarExpText:SetPoint("LEFT", MainMenuExpBar, 128, 1)
  544. end
  545. else
  546. ReputationWatchBar:ClearAllPoints()
  547. ReputationWatchBar:SetPoint("CENTER", MainMenuBar, "TOP", 0, -4.5)
  548.  
  549. if ( ReputationWatchStatusBarText:GetPoint() ~= "CENTER" ) then
  550. ReputationWatchStatusBarText:ClearAllPoints()
  551. ReputationWatchStatusBarText:SetPoint("CENTER", ReputationWatchBarOverlayFrame, 0, 1)
  552. end
  553. end
  554.  
  555. -- removes watched faction if we ware exalted
  556. if ( value == 42999 ) then
  557. SetWatchedFactionIndex(0)
  558. end
  559.  
  560. return ...
  561. end
  562. local ReputationWatchBar_Update_original = ReputationWatchBar_Update
  563. function ReputationWatchBar_Update(...)
  564. return ReputationWatchBar_Update_posthook(ReputationWatchBar_Update_original(...))
  565. end
  566.  
  567. -- actual new MainMenuBar's width
  568. MainMenuBar:SetWidth(777 - 5) -- 761 + 8 * 2
  569.  
  570. -- who cares? but i do
  571. MainMenuBar:EnableMouse(false)
  572.  
  573. -- unloads un-wanted textures
  574. for _, texture in next, {
  575. MainMenuXPBarTextureLeftCap,MainMenuXPBarTextureRightCap,MainMenuXPBarTextureMid, MainMenuMaxLevelBar0, MainMenuMaxLevelBar1, MainMenuMaxLevelBar2, MainMenuMaxLevelBar3, MainMenuBarTexture0, MainMenuBarTexture1, --[[MainMenuBarTexture2, MainMenuBarTexture3,]] MainMenuBarLeftEndCap, MainMenuBarRightEndCap,
  576. ReputationWatchBarTexture0, ReputationWatchBarTexture1, ReputationWatchBarTexture2, ReputationWatchBarTexture3, ReputationXPBarTexture0, ReputationXPBarTexture1, ReputationXPBarTexture2, ReputationXPBarTexture3,
  577. BonusActionBarTexture0, BonusActionBarTexture1, ShapeshiftBarLeft, ShapeshiftBarMiddle, ShapeshiftBarRight, PossessBackground1, PossessBackground2,
  578. SlidingActionBarTexture0, SlidingActionBarTexture1,
  579. } do
  580. texture:SetTexture(nil)
  581. end
  582.  
  583. -- scales these bars
  584. for _, bar in next, {
  585. MainMenuBar, --[[ VehicleMenuBar,]] MultiBarRight
  586. } do
  587. bar:SetScale(SCALE)
  588. end
  589.  
  590. end
  591.  
  592.  
  593.  
  594.  
  595. -- modified by smaltore @2011-11-16
  596. ---------------------------------------------------------------------------------------------------------
  597. ---------------------------------------------------------------------------------------------------------
  598. -- hide the art frames from mainmenu action bar
  599. hooksecurefunc("UIParent_ManageFramePosition", function ()
  600. for _,frame in next, {
  601. MainMenuBarTexture0,MainMenuBarTexture1,--主动作条背景
  602. MainMenuBarTexture2,MainMenuBarTexture3, --钥匙和背包背景
  603. MainMenuBarLeftEndCap, MainMenuBarRightEndCap, --主动作条两端的鹰
  604. MainMenuBarPageNumber,ActionBarUpButton,ActionBarDownButton, --翻页按钮
  605. }
  606. do frame:Hide() end
  607.  
  608. for i=1,19 do _G["MainMenuXPBarDiv"..i]:SetTexture(nil) end --经验条的格格
  609.  
  610. end)
  611.  
  612. -------------------------------------bags and micro menu----------------------------------
  613. -- [[create fade function
  614. local function fade(frame,button)
  615. local function showhide(alpha)
  616. frame:SetAlpha(alpha)
  617. end
  618. frame:EnableMouse(true)
  619. frame:SetAlpha(0.1)
  620. frame:SetScript("OnEnter", function(self) showhide(1) end)
  621. frame:SetScript("OnLeave", function(self) showhide(0.1) end)
  622. button:HookScript("OnEnter", function(self) showhide(1) end)
  623. button:HookScript("OnLeave", function(self) showhide(0.1) end)
  624. end --]]
  625.  
  626.  
  627.  
  628. --bags and micromenu buttons
  629. local MicroButtons = {
  630. CharacterMicroButton,
  631. SpellbookMicroButton,
  632. TalentMicroButton,
  633. AchievementMicroButton,
  634. QuestLogMicroButton,
  635. GuildMicroButton,
  636. --PVPMicroButton,
  637. LFDMicroButton,
  638. CompanionsMicroButton,
  639. EJMicroButton,
  640. StoreMicroButton,
  641. MainMenuMicroButton,
  642. --HelpMicroButton,
  643. }
  644. local BagButtons = {
  645. MainMenuBarBackpackButton,
  646. CharacterBag0Slot,
  647. CharacterBag1Slot,
  648. CharacterBag2Slot,
  649. CharacterBag3Slot,
  650. }
  651.  
  652. local box = CreateFrame("Frame","Micro_and_Bags_Frame",UIParent)
  653. box:SetWidth(210)
  654. box:SetHeight(55)
  655. box:SetPoint("BOTTOMRIGHT", UIParent, 0, 0);
  656. --box:SetScale(SCALE * 0.8)
  657. local function mybox()
  658. --bags
  659. for _, button in pairs(BagButtons) do
  660. if button ~= MainMenuBarBackpackButton then
  661. button:SetScale(1.8)
  662. button:SetParent(box)
  663. if ShowAllBags == 0 then button:Hide() end
  664. else
  665. MainMenuBarBackpackButton:SetParent(box)
  666. MainMenuBarBackpackButton:SetScale( 2.3 )
  667. end
  668. end
  669. MainMenuBarBackpackButton:ClearAllPoints();
  670. MainMenuBarBackpackButton:SetPoint("BOTTOMRIGHT",box,0,0);
  671. CharacterBag0Slot:ClearAllPoints();
  672. CharacterBag0Slot:SetPoint("BOTTOMRIGHT",MainMenuBarBackpackButton,"TOPRIGHT",0,0);
  673.  
  674. -- micro menu bar 系统菜单
  675. for _, button in pairs(MicroButtons) do
  676. button:SetParent(box);
  677. end
  678. CharacterMicroButton:ClearAllPoints();
  679. CharacterMicroButton:SetPoint("BOTTOMLEFT", MainMenuBarBackpackButton, -158, 32);
  680. LFDMicroButton:ClearAllPoints();
  681. LFDMicroButton:SetPoint("TOPLEFT", CharacterMicroButton, "BOTTOMLEFT", 0, 25);
  682. end
  683. mybox()
  684. hooksecurefunc("UpdateMicroButtons",mybox)
  685.  
  686.  
  687. --fade and move the side bars
  688. if FADE_BOX == 1 then
  689. for _,button in pairs(MicroButtons) do fade(box,button) end
  690. for _,button in pairs(BagButtons) do fade(box,button) end
  691. end
  692.  
  693. --------------------------------------------------------------------------------------------
  694. --------------------------------------------------------------------------------------------
  695. --OverRideBar patch from rActionBarStyler
  696.  
  697. local textureList = {
  698. "_BG",
  699. "EndCapL",
  700. "EndCapR",
  701. "_Border",
  702. "Divider1",
  703. "Divider2",
  704. "Divider3",
  705. "ExitBG",
  706. "MicroBGL",
  707. "MicroBGR",
  708. "_MicroBGMid",
  709. "ButtonBGL",
  710. "ButtonBGR",
  711. "_ButtonBGMid",
  712. }
  713. for _,tex in pairs(textureList) do
  714. OverrideActionBar[tex]:SetAlpha(0)
  715. end
  716.  
  717. local HideOverRide = CreateFrame("frame")
  718. HideOverRide:Hide()
  719. for _,f in next,{
  720. OverrideActionBarExpBar,
  721. OverrideActionBarHealthBar,
  722. OverrideActionBarPowerBar,
  723. OverrideActionBarPitchFrame,
  724. } do
  725. f:SetParent(HideOverRide)
  726. end
  727.  
  728.  
  729. for i=1, 6 do
  730. local button = _G["OverrideActionBarButton"..i]
  731. if not button then break end
  732. button:SetSize(40, 40)
  733. button:ClearAllPoints()
  734. if i == 1 then
  735. button:SetPoint("BOTTOMLEFT",ActionButton1)
  736. else
  737. local previous = _G["OverrideActionBarButton"..i-1]
  738. button:SetPoint("LEFT", previous, "RIGHT", 10, 0)
  739. end
  740. end
  741. OverrideActionBar.LeaveButton:SetSize(40, 40)
  742. OverrideActionBar.LeaveButton:ClearAllPoints()
  743. OverrideActionBar.LeaveButton:SetPoint("BOTTOMRIGHT",ActionButton12)
  744.  
  745.  
  746.  
  747. --========================================================= oCastBar modify =======================================================--
  748.  
  749. local CAST_SHOW,CASTBAR_X,CASTBAR_Y = 1,0,125
  750. local CASTBAR_X,CASTBAR_Y = 0,125
  751.  
  752.  
  753. if CAST_SHOW == 1 then
  754.  
  755. local cast_x,cast_y = CASTBAR_X,CASTBAR_Y
  756. --player casting bar
  757. CastingBarFrameIcon:Show()
  758. CastingBarFrameIcon:SetHeight( 25 )
  759. CastingBarFrameIcon:SetWidth( 25 )
  760. CastingBarFrameIcon:ClearAllPoints()
  761. CastingBarFrameIcon:SetPoint( "RIGHT", CastingBarFrame, "LEFT", -10, 2.5 )
  762.  
  763. --CastingBarFrameBorder:SetTexture(nil) --("Interface\\CastingBar\\UI-CastingBar-Border-Small")
  764. --CastingBarFrameFlash:SetTexture("Interface\\CastingBar\\UI-CastingBar-Flash-Small")
  765.  
  766. --CastingBarFrame:ClearAllPoints()
  767. --CastingBarFrame:SetPoint("TOP", MainMenuBar, cast_x, cast_y)
  768. --CastingBarFrame.SetPoint = function() end
  769.  
  770. -- Castbar timer from thek
  771. CastingBarFrame.timer = CastingBarFrame:CreateFontString(nil)
  772. CastingBarFrame.timer:SetFont("Fonts\\ARIALN.ttf", 18, "THINOUTLINE")
  773. CastingBarFrame.timer:SetPoint("LEFT", CastingBarFrame, "RIGHT", 10, 2.5)
  774. CastingBarFrame.update = .1
  775.  
  776. TargetFrameSpellBar.timer = TargetFrameSpellBar:CreateFontString(nil)
  777. TargetFrameSpellBar.timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
  778. TargetFrameSpellBar.timer:SetPoint("LEFT", TargetFrameSpellBar, "RIGHT", 5, 0)
  779. TargetFrameSpellBar.update = .1
  780.  
  781. FocusFrameSpellBar.timer = FocusFrameSpellBar:CreateFontString(nil)
  782. FocusFrameSpellBar.timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
  783. FocusFrameSpellBar.timer:SetPoint("LEFT", FocusFrameSpellBar, "RIGHT", 5, 0)
  784. FocusFrameSpellBar.update = .1
  785.  
  786. hooksecurefunc("CastingBarFrame_OnUpdate", function(self, elapsed)
  787. if not self.timer then return end
  788. if self.update and self.update < elapsed then
  789. if self.casting then
  790. self.timer:SetText(format("%.1f", max(self.maxValue - self.value, 0)))
  791. elseif self.channeling then
  792. self.timer:SetText(format("%.1f", max(self.value, 0)))
  793. else
  794. self.timer:SetText("")
  795. end
  796. self.update = .1
  797. else
  798. self.update = self.update - elapsed
  799. end
  800. end)
  801. end
  802.  
  803. -- Flashy spellsteal border for non-mages and/or enrage effects
  804.  
  805. hooksecurefunc("TargetFrame_UpdateAuras", function(s)
  806. for i = 1, MAX_TARGET_BUFFS do
  807. _, _, ic, _, dT = UnitBuff(s.unit, i)
  808. if(ic and (not s.maxBuffs or i<=s.maxBuffs)) then
  809. fS=_G[s:GetName()..'Buff'..i..'Stealable']
  810. if(UnitIsEnemy(PlayerFrame.unit, s.unit) and dT=='Magic') then
  811. fS:Show()
  812. else
  813. fS:Hide()
  814. end
  815. end
  816. end
  817. end)
  818.  
  819.  
  820. -- Положение фреймов по align
  821. -- Таргет фрейм: 5 сверху, 8 от центра по портрету.
  822. -- Фокус фрейм: 12 слева, по центру.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement