Advertisement
Guest User

Unitframes.lua

a guest
Apr 25th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.12 KB | None | 0 0
  1. local Addon = LibStub("AceAddon-3.0"):GetAddon("BasicUI")
  2. local Module = Addon:NewModule("Unitframes")
  3.  
  4. local L = setmetatable({}, { __index = function(t,k)
  5. local v = tostring(k)
  6. rawset(t, k, v)
  7. return v
  8. end })
  9.  
  10. local db
  11. local defaults = {
  12. profile = {
  13. enable = true,
  14. abbrevRealmNames = true,
  15. player = {
  16. enable = true, -- Enable Player Frame Adjustments
  17. scale = 1.15, -- Player Frame Scale
  18. fontSize = 13, -- Stausbar Font Size
  19. fontSizepet = 10, -- Stausbar Font Size
  20. },
  21. target = {
  22. enable = true, -- Enable Target Frame Adjustments
  23. scale = 1.15, -- Target Frame Scale
  24. fontSize = 13, -- Stausbar Font Size
  25. },
  26. focus = {
  27. enable = true, -- Enable Focus Frame Adjustments
  28. scale = 1.15, -- Focus Frame Scale
  29. fontSize = 13, -- Stausbar Font Size
  30. },
  31. party = {
  32. enable = true,
  33. scale = 1.15,
  34. fontSize = 11, -- Stausbar Font Size
  35. position = {
  36. relAnchor = "TOPLEFT",
  37. offSetX = 10, -- Controls the X offset. (Left - Right)
  38. offSetY = -150, -- Controls the Y offset. (Up - Down)
  39. },
  40. },
  41. arena = {
  42. enable = true,
  43. scale = 1.5,
  44. fontSize = 11, -- Stausbar Font Size
  45. },
  46. boss = {
  47. enable = true,
  48. scale = 1.15,
  49. --fontSize = 13, -- Stausbar Font Size
  50. position = {
  51. relAnchor = "RIGHT",
  52. offSet = -50, -- Controls the X offset. (Left - Right)
  53. offSetY = -250, -- Controls the Y offset. (Up - Down)
  54. },
  55. },
  56. }
  57. }
  58.  
  59. local CUSTOM_FACTION_BAR_COLORS = {
  60. [1] = {r = 1, g = 0, b = 0},
  61. [2] = {r = 1, g = 0, b = 0},
  62. [3] = {r = 1, g = 1, b = 0},
  63. [4] = {r = 1, g = 1, b = 0},
  64. [5] = {r = 0, g = 1, b = 0},
  65. [6] = {r = 0, g = 1, b = 0},
  66. [7] = {r = 0, g = 1, b = 0},
  67. [8] = {r = 0, g = 1, b = 0},
  68. }
  69.  
  70. -- Font Style
  71. local shorts = {
  72. { 1e10, 1e9, "%.0fB" }, -- 10b+ as 12b
  73. { 1e9, 1e9, "%.1fB" }, -- 1b+ as 8.3b
  74. { 1e7, 1e6, "%.0fM" }, -- 10m+ as 14m
  75. { 1e6, 1e6, "%.1fM" }, -- 1m+ as 7.4m
  76. { 1e5, 1e3, "%.0fK" }, -- 100k+ as 840k
  77. { 1e3, 1e3, "%.1fK" }, -- 1k+ as 2.5k
  78. { 0, 1, "%d" }, -- < 1k as 974
  79. }
  80. for i = 1, #shorts do
  81. shorts[i][4] = shorts[i][3] .. " (%.0f%%)"
  82. end
  83.  
  84. function Module:OnInitialize()
  85. self.db = Addon.db:RegisterNamespace("Unitframes", defaults)
  86. db = self.db.profile
  87.  
  88. self:SetEnabledState(Addon:GetModuleEnabled("Unitframes"))
  89. end
  90.  
  91. function Module:OnEnable()
  92.  
  93. --[[if InCombatLockdown() then
  94. return self:RegisterEvent("PLAYER_REGEN_ENABLED", "OnEnable")
  95. end
  96. self:UnregisterEvent("PLAYER_REGEN_ENABLED")]]
  97.  
  98. db = self.db.profile
  99.  
  100. if enabled or not db.enable then return end
  101. enabled = true -- since most of this stuff is non-undoable (eg. hooksecurefunc)
  102.  
  103. -- Move Party Frames
  104. PartyMemberFrame1:SetPoint(db.party.position.relAnchor, UIParent, db.party.position.offSetX, db.party.position.offSetY);
  105.  
  106. -- Move Boss Frames
  107. local movingBossFrame
  108. hooksecurefunc(Boss1TargetFrame, "SetPoint", function(f, ...)
  109. if movingBossFrame or InCombatLockdown() then
  110. return
  111. end
  112. movingBossFrame = true
  113. Boss1TargetFrame:ClearAllPoints()
  114. Boss1TargetFrame:SetPoint(db.boss.position.relAnchor, UIParent, db.boss.position.offSetX, db.boss.position.offSetY)
  115. movingBossFrame = nil
  116. end)
  117.  
  118. -- Update Unit Frames
  119. self:ApplySettings()
  120.  
  121. -- Disable healing/damage spam over player/pet frame:
  122. PlayerHitIndicator:SetText(nil)
  123. PlayerHitIndicator.SetText = function() end
  124. PetHitIndicator:SetText(nil)
  125. PetHitIndicator.SetText = function() end
  126.  
  127. -- Change other frames' name backgrounds to match player frame
  128. for _, region in pairs({
  129. TargetFrameNameBackground,
  130. FocusFrameNameBackground,
  131. Boss1TargetFrameNameBackground,
  132. Boss2TargetFrameNameBackground,
  133. Boss3TargetFrameNameBackground,
  134. Boss4TargetFrameNameBackground,
  135. }) do
  136. region:SetTexture(0, 0, 0, 0.5)
  137. end
  138.  
  139. -- Font Style / Color thanks to Phanx from WoWinterface.
  140. hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", function(statusBar, fontString, value, valueMin, valueMax)
  141. if value == 0 then
  142. return fontString:SetText("")
  143. end
  144.  
  145. local style = GetCVar("statusTextDisplay")
  146. if style == "PERCENT" then
  147. return fontString:SetFormattedText("%.0f%%", value / valueMax * 100)
  148. end
  149. for i = 1, #shorts do
  150. local t = shorts[i]
  151. if value >= t[1] then
  152. if style == "BOTH" then
  153. return fontString:SetFormattedText(t[4], value / t[2], value / valueMax * 100)
  154. else
  155. if value < valueMax then
  156. for j = 1, #shorts do
  157. local v = shorts[j]
  158. if valueMax >= v[1] then
  159. return fontString:SetFormattedText(t[3] .. " / " .. v[3], value / t[2], valueMax / v[2])
  160. end
  161. end
  162. end
  163. return fontString:SetFormattedText(t[3], value / t[2])
  164. end
  165. end
  166. end
  167. end)
  168.  
  169. -- Font Color
  170. hooksecurefunc("UnitFrame_Update", function(self, isParty)
  171. if not self.name or not self:IsShown() then return end
  172.  
  173. local PET_COLOR = { r = 157/255, g = 197/255, b = 255/255 }
  174. local unit, color = self.unit
  175. if UnitPlayerControlled(unit) then
  176. if UnitIsPlayer(unit) then
  177. local _, class = UnitClass(unit)
  178. color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
  179. else
  180. color = PET_COLOR
  181. end
  182. elseif UnitIsDeadOrGhost(unit) or UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) then
  183. color = GRAY_FONT_COLOR
  184. else
  185. color = CUSTOM_FACTION_BAR_COLORS[UnitIsEnemy(unit, "player") and 1 or UnitReaction(unit, "player") or 5]
  186. end
  187.  
  188. if not color then
  189. color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)["PRIEST"]
  190. end
  191.  
  192. self.name:SetTextColor(color.r, color.g, color.b)
  193. if isParty then
  194. self.name:SetText(GetUnitName(self.overrideName or unit))
  195. end
  196. end)
  197. end
  198.  
  199. function Module:ApplySettings(event)
  200.  
  201. db = self.db.profile
  202.  
  203. if event then
  204. self:UnregisterEvent(event)
  205. end
  206.  
  207. if InCombatLockdown() then
  208. return self:RegisterEvent("PLAYER_REGEN_ENABLED", "ApplySettings")
  209. end
  210.  
  211. local failure
  212. for unit, func in pairs(self.UnitFunctions) do
  213. if db[unit].enable then
  214. if func(self) then
  215. failure = true
  216. end
  217. end
  218. end
  219.  
  220. if failure then
  221. self:RegisterEvent("ADDON_LOADED", "ApplySettings")
  222. end
  223. end
  224.  
  225. ------------------------------------------------------------------------
  226.  
  227. Module.UnitFunctions = {
  228.  
  229. player = function(self)
  230. PlayerFrame:SetScale(db.player.scale)
  231. PlayerFrameHealthBarText:SetFont(Addon.db.profile.media.fontNormal, db.player.fontSize,"THINOUTLINE")
  232. PlayerFrameManaBarText:SetFont(Addon.db.profile.media.fontNormal, db.player.fontSize, "THINOUTLINE")
  233. PlayerFrameAlternateManaBarText:SetFont(Addon.db.profile.media.fontNormal, db.player.fontSize, "THINOUTLINE")
  234.  
  235. PetFrameHealthBarText:SetFont(Addon.db.profile.media.fontNormal, db.player.fontSizepet,"THINOUTLINE")
  236. PetFrameManaBarText:SetFont(Addon.db.profile.media.fontNormal, db.player.fontSizepet, "THINOUTLINE")
  237. end,
  238.  
  239. target = function(self)
  240. TargetFrame:SetScale(db.target.scale)
  241. TargetFrameTextureFrameHealthBarText:SetFont(Addon.db.profile.media.fontNormal, db.target.fontSize, "THINOUTLINE")
  242. TargetFrameTextureFrameManaBarText:SetFont(Addon.db.profile.media.fontNormal, db.target.fontSize, "THINOUTLINE")
  243. end,
  244.  
  245. focus = function(self)
  246. FocusFrame:SetScale(db.focus.scale)
  247. FocusFrameTextureFrameHealthBarText:SetFont(Addon.db.profile.media.fontNormal, db.focus.fontSize,"THINOUTLINE")
  248. FocusFrameTextureFrameManaBarText:SetFont(Addon.db.profile.media.fontNormal, db.focus.fontSize,"THINOUTLINE")
  249. end,
  250.  
  251. party = function(self)
  252. for i = 1, MAX_PARTY_MEMBERS do
  253. local partyFrame = "PartyMemberFrame"..i
  254. _G[partyFrame]:SetScale(db.party.scale)
  255. _G[partyFrame.."HealthBarText"]:SetFont(Addon.db.profile.media.fontNormal, db.party.fontSize, "THINOUTLINE")
  256. _G[partyFrame.."ManaBarText"]:SetFont(Addon.db.profile.media.fontNormal, db.party.fontSize, "THINOUTLINE")
  257. end
  258. end,
  259.  
  260. arena = function(self)
  261. if not ArenaEnemyFrame1 then
  262. return true
  263. end
  264.  
  265. for i = 1, MAX_ARENA_ENEMIES do
  266. local prepFrame = "ArenaPrepFrame"..i
  267. _G[prepFrame]:SetScale(db.arena.scale)
  268. _G[prepFrame.."HealthBarText"]:SetFont(Addon.db.profile.media.fontNormal, db.arena.fontSize,"THINOUTLINE")
  269. _G[prepFrame.."ManaBarText"]:SetFont(Addon.db.profile.media.fontNormal, db.arena.fontSize, "THINOUTLINE")
  270.  
  271. local arenaFrame = "ArenaEnemyFrame"..i
  272. _G[arenaFrame]:SetScale(db.arena.scale)
  273. _G[arenaFrame.."HealthBarText"]:SetFont(Addon.db.profile.media.fontNormal, db.arena.fontSize,"THINOUTLINE")
  274. _G[arenaFrame.."ManaBarText"]:SetFont(Addon.db.profile.media.fontNormal, db.arena.fontSize, "THINOUTLINE")
  275. end
  276. end,
  277.  
  278. boss = function(self)
  279. for i = 1, MAX_BOSS_FRAMES do
  280. local bossFrame = "Boss"..i.."TargetFrame"
  281. _G[bossFrame]:SetScale(db.boss.scale)
  282. end
  283. end,
  284.  
  285. }
  286. ------------------------------------------------------------------------------
  287.  
  288. -- Leave this out if the module doesn't have any settings:
  289. function Module:Refresh()
  290. db = self.db.profile -- update the upvalue
  291.  
  292. -- change stuff here
  293. end
  294.  
  295. -- Leave this out if the module doesn't have any options:
  296. local options
  297. function Module:GetOptions()
  298.  
  299. local regions = {
  300. ['BOTTOM'] = L['Bottom'],
  301. ['BOTTOMLEFT'] = L['Bottom Left'],
  302. ['BOTTOMRIGHT'] = L['Bottom Right'],
  303. ['CENTER'] = L['Center'],
  304. ['LEFT'] = L['Left'],
  305. ['RIGHT'] = L['Right'],
  306. ['TOP'] = L['Top'],
  307. ['TOPLEFT'] = L['Top Left'],
  308. ['TOPRIGHT'] = L['Top Right'],
  309. }
  310.  
  311. options = options or {
  312. type = "group",
  313. name = L["Unitframes"],
  314. desc = L["Unitframes Module for BasicUI."],
  315. childGroups = "tree",
  316. get = function(info) return db[ info[#info] ] end,
  317. set = function(info, value) db[ info[#info] ] = value; GetUnitFrames:ApplySettings() end,
  318. args = {
  319. ---------------------------
  320. --Option Type Seperators
  321. sep1 = {
  322. type = "description",
  323. order = 1,
  324. name = " ",
  325. },
  326. sep2 = {
  327. type = "description",
  328. order = 2,
  329. name = " ",
  330. },
  331. sep3 = {
  332. type = "description",
  333. order = 3,
  334. name = " ",
  335. },
  336. sep4 = {
  337. type = "description",
  338. order = 4,
  339. name = " ",
  340. },
  341. sep5 = {
  342. type = "description",
  343. order = 5,
  344. name = " ",
  345. },
  346. sep6 = {
  347. type = "description",
  348. order = 6,
  349. name = " ",
  350. },
  351. sep7 = {
  352. type = "description",
  353. order = 7,
  354. name = " ",
  355. },
  356. ---------------------------
  357. reloadUI = {
  358. type = "execute",
  359. name = "Reload UI",
  360. desc = " ",
  361. order = 0,
  362. func = function()
  363. ReloadUI()
  364. end,
  365. },
  366. Text = {
  367. type = "description",
  368. order = 0,
  369. name = "When you enable or disable a Unitframe a reload of the UI is needed.",
  370. width = "full",
  371. },
  372. Text1 = {
  373. type = "description",
  374. order = 1,
  375. name = " ",
  376. width = "full",
  377. },
  378. enable = {
  379. type = "toggle",
  380. order = 1,
  381. name = L["Enable"],
  382. desc = L["Enables Uniframes Module"],
  383. },
  384. player = {
  385. type = "group",
  386. order = 3,
  387. name = L["Player Frame"],
  388. desc = L["Adjust the Player Frame."],
  389. get = function(info) return db.player[ info[#info] ] end,
  390. set = function(info, value) db.player[ info[#info] ] = value; GetUnitFrames:ApplySettings() end,
  391. guiInline = true,
  392. args = {
  393. ---------------------------
  394. --Option Type Seperators
  395. sep1 = {
  396. type = "description",
  397. order = 1,
  398. name = " ",
  399. },
  400. sep2 = {
  401. type = "description",
  402. order = 2,
  403. name = " ",
  404. },
  405. sep3 = {
  406. type = "description",
  407. order = 3,
  408. name = " ",
  409. },
  410. sep4 = {
  411. type = "description",
  412. order = 4,
  413. name = " ",
  414. },
  415. ---------------------------
  416. enable = {
  417. type = "toggle",
  418. order = 0,
  419. name = L["Enable"],
  420. desc = L["Enables Player Frame Adjustments"],
  421. },
  422. scale = {
  423. type = "range",
  424. order = 1,
  425. name = L["Frame Scale"],
  426. desc = L["Controls the scaling of Blizzard's Player Frame"],
  427. min = 0.5, max = 2, step = 0.05,
  428. disabled = function() return not db.enable or not db.player.enable end,
  429. },
  430. fontSize= {
  431. type = "range",
  432. order = 2,
  433. name = L["HP/Mana Font Size"],
  434. desc = L["Controls the Player Healthbar/Manabar value font size."],
  435. min = 8, max = 25, step = 1,
  436. disabled = function() return not db.enable or not db.player.enable end,
  437. },
  438. fontSizepet= {
  439. type = "range",
  440. order = 2,
  441. name = L["HP/Mana Font Size for your pet"],
  442. desc = L["Controls the Player Pet Healthbar/Manabar value font size."],
  443. min = 8, max = 25, step = 1,
  444. disabled = function() return not db.enable or not db.player.enable end,
  445. },
  446. },
  447. },
  448. target = {
  449. type = "group",
  450. order = 4,
  451. name = L["Target Frame"],
  452. desc = L["Adjust the Target Frame."],
  453. get = function(info) return db.target[ info[#info] ] end,
  454. set = function(info, value) db.target[ info[#info] ] = value; GetUnitFrames:ApplySettings() end,
  455. guiInline = true,
  456. args = {
  457. ---------------------------
  458. --Option Type Seperators
  459. sep1 = {
  460. type = "description",
  461. order = 1,
  462. name = " ",
  463. },
  464. sep2 = {
  465. type = "description",
  466. order = 2,
  467. name = " ",
  468. },
  469. sep3 = {
  470. type = "description",
  471. order = 3,
  472. name = " ",
  473. },
  474. sep4 = {
  475. type = "description",
  476. order = 4,
  477. name = " ",
  478. },
  479. ---------------------------
  480. enable = {
  481. type = "toggle",
  482. order = 0,
  483. name = L["Enable"],
  484. desc = L["Enables Target Frame Adjustments"],
  485. },
  486. scale = {
  487. type = "range",
  488. order = 1,
  489. name = L["Frame Scale"],
  490. desc = L["Controls the scaling of Blizzard's Target Frame"],
  491. min = 0.5, max = 2, step = 0.05,
  492. disabled = function() return not db.enable or not db.target.enable end,
  493. },
  494. fontSize= {
  495. type = "range",
  496. order = 2,
  497. name = L["HP/Mana Font Size"],
  498. desc = L["Controls the Target Healthbar/Manabar value font size."],
  499. min = 8, max = 25, step = 1,
  500. disabled = function() return not db.enable or not db.target.enable end,
  501. },
  502. },
  503. },
  504. focus = {
  505. type = "group",
  506. order = 5,
  507. name = L["Focus Frame"],
  508. desc = L["Adjust the Focus Frame."],
  509. get = function(info) return db.focus[ info[#info] ] end,
  510. set = function(info, value) db.focus[ info[#info] ] = value; GetUnitFrames:ApplySettings() end,
  511. guiInline = true,
  512. args = {
  513. ---------------------------
  514. --Option Type Seperators
  515. sep1 = {
  516. type = "description",
  517. order = 1,
  518. name = " ",
  519. },
  520. sep2 = {
  521. type = "description",
  522. order = 2,
  523. name = " ",
  524. },
  525. sep3 = {
  526. type = "description",
  527. order = 3,
  528. name = " ",
  529. },
  530. sep4 = {
  531. type = "description",
  532. order = 4,
  533. name = " ",
  534. },
  535. ---------------------------
  536. enable = {
  537. type = "toggle",
  538. order = 0,
  539. name = L["Enable"],
  540. desc = L["Enables Focus Frame Adjustments"],
  541. },
  542. scale = {
  543. type = "range",
  544. order = 1,
  545. name = L["Frame Scale"],
  546. desc = L["Controls the scaling of Blizzard's Focus Frame"],
  547. min = 0.5, max = 2, step = 0.05,
  548. disabled = function() return not db.enable or not db.focus.enable end,
  549. },
  550. fontSize= {
  551. type = "range",
  552. order = 2,
  553. name = L["HP/Mana Font Size"],
  554. desc = L["Controls the Focus Healthbar/Manabar value font size."],
  555. min = 8, max = 25, step = 1,
  556. disabled = function() return not db.enable or not db.focus.enable end,
  557. },
  558. },
  559. },
  560. party = {
  561. type = "group",
  562. order = 6,
  563. name = L["Party Frame"],
  564. desc = L["Adjust the scale of Blizzards Unit Frames."],
  565. get = function(info) return db.party[ info[#info] ] end,
  566. set = function(info, value) db.party[ info[#info] ] = value; GetUnitFrames:ApplySettings() end,
  567. guiInline = true,
  568. args = {
  569. ---------------------------
  570. sep1 = {
  571. type = "description",
  572. order = 1,
  573. name = " ",
  574. },
  575. sep2 = {
  576. type = "description",
  577. order = 2,
  578. name = " ",
  579. },
  580. sep3 = {
  581. type = "description",
  582. order = 3,
  583. name = " ",
  584. },
  585. sep4 = {
  586. type = "description",
  587. order = 4,
  588. name = " ",
  589. },
  590. sep5 = {
  591. type = "description",
  592. order = 5,
  593. name = " ",
  594. },
  595. ---------------------------
  596. enable = {
  597. type = "toggle",
  598. order = 0,
  599. name = L["Enable"],
  600. desc = L["Enables Party Frame Adjustments"],
  601. },
  602. scale = {
  603. type = "range",
  604. order = 1,
  605. name = L["Scale"],
  606. desc = L["Controls the scaling of Blizzard's Party Frame"],
  607. min = 0.5, max = 2, step = 0.05,
  608. disabled = function() return not db.enable or not db.party.enable end,
  609. },
  610. fontSize= {
  611. type = "range",
  612. order = 2,
  613. name = L["HP/Mana Font Size"],
  614. desc = L["Controls the Party Healthbar/Manabar value font size."],
  615. min = 8, max = 25, step = 1,
  616. disabled = function() return not db.enable or not db.party.enable end,
  617. },
  618. position = {
  619. type = "group",
  620. order = 2,
  621. childGroups = "tree",
  622. name = L["Position"],
  623. --desc = L["Combo Points Options"],
  624. disabled = function() return not db.enable end,
  625. get = function(info) return db.party.position[ info[#info] ] end,
  626. set = function(info, value) db.party.position[ info[#info] ] = value; GetUnitFrames:ApplySettings() end,
  627.  
  628. args = {
  629. ---------------------------
  630. --Option Type Seperators
  631. sep1 = {
  632. type = "description",
  633. order = 1,
  634. name = " ",
  635. },
  636. sep2 = {
  637. type = "description",
  638. order = 2,
  639. name = " ",
  640. },
  641. sep3 = {
  642. type = "description",
  643. order = 3,
  644. name = " ",
  645. },
  646. sep4 = {
  647. type = "description",
  648. order = 4,
  649. name = " ",
  650. },
  651. ---------------------------
  652. relAnchor = {
  653. order = 1,
  654. name = L["Self Anchor"],
  655. --desc = L["Style of Border for Sqaure Minimap."],
  656. type = "select",
  657. values = regions,
  658. disabled = function() return not db.enable or not db.party.enable end,
  659. },
  660. offSetX = {
  661. type = "range",
  662. order = 2,
  663. name = L["X Offset"],
  664. desc = L["Controls the X offset. (Left - Right)"],
  665. min = -250, max = 250, step = 5,
  666. disabled = function() return not db.enable or not db.party.enable end,
  667. },
  668. offSetY = {
  669. type = "range",
  670. order = 3,
  671. name = L["Y Offset"],
  672. desc = L["Controls the Y offset. (Up - Down)"],
  673. min = -250, max = 250, step = 5,
  674. disabled = function() return not db.enable or not db.party.enable end,
  675. },
  676. },
  677. },
  678. },
  679. },
  680. arena = {
  681. type = "group",
  682. order = 7,
  683. name = L["Arena Frames"],
  684. desc = L["Adjust the Arena Frames."],
  685. get = function(info) return db.arena[ info[#info] ] end,
  686. set = function(info, value) db.arena[ info[#info] ] = value; GetUnitFrames:ApplySettings() end,
  687. guiInline = true,
  688. args = {
  689. ---------------------------
  690. sep1 = {
  691. type = "description",
  692. order = 1,
  693. name = " ",
  694. },
  695. sep2 = {
  696. type = "description",
  697. order = 2,
  698. name = " ",
  699. },
  700. sep3 = {
  701. type = "description",
  702. order = 3,
  703. name = " ",
  704. },
  705. sep4 = {
  706. type = "description",
  707. order = 4,
  708. name = " ",
  709. },
  710. ---------------------------
  711. enable = {
  712. type = "toggle",
  713. order = 0,
  714. name = L["Enable"],
  715. desc = L["Enables Arena Frame Adjustments"],
  716. },
  717. scale = {
  718. type = "range",
  719. order = 2,
  720. name = L["Scale"],
  721. desc = L["Controls the scaling of Blizzard's Arena Frames"],
  722. min = 0.5, max = 2, step = 0.05,
  723. disabled = function() return not db.enable or not db.arena.enable end,
  724. },
  725. fontSize= {
  726. type = "range",
  727. order = 2,
  728. name = L["HP/Mana Font Size"],
  729. desc = L["Controls the Arena Healthbar/Manabar value font size."],
  730. min = 8, max = 25, step = 1,
  731. disabled = function() return not db.enable or not db.arena.enable end,
  732. },
  733. },
  734. },
  735. boss = {
  736. type = "group",
  737. order = 8,
  738. name = L["Boss Frame"],
  739. desc = L["Adjust the Boss Frames."],
  740. get = function(info) return db.boss[ info[#info] ] end,
  741. set = function(info, value) db.boss[ info[#info] ] = value; GetUnitFrames:ApplySettings() end,
  742. guiInline = true,
  743. args = {
  744. ---------------------------
  745. sep1 = {
  746. type = "description",
  747. order = 1,
  748. name = " ",
  749. },
  750. sep2 = {
  751. type = "description",
  752. order = 2,
  753. name = " ",
  754. },
  755. sep3 = {
  756. type = "description",
  757. order = 3,
  758. name = " ",
  759. },
  760. sep4 = {
  761. type = "description",
  762. order = 4,
  763. name = " ",
  764. },
  765. sep5 = {
  766. type = "description",
  767. order = 5,
  768. name = " ",
  769. },
  770. ---------------------------
  771. enable = {
  772. type = "toggle",
  773. order = 0,
  774. name = L["Enable"],
  775. desc = L["Enables Boss Frame Adjustments"],
  776. },
  777. scale = {
  778. type = "range",
  779. order = 1,
  780. name = L["Scale"],
  781. desc = L["Controls the scaling of Blizzard's Boss Frames"],
  782. min = 0.5, max = 2, step = 0.05,
  783. disabled = function() return not db.enable or not db.boss.enable end,
  784. },
  785. --[[fontSize= {
  786. type = "range",
  787. order = 2,
  788. name = L["HP/Mana Font Size"],
  789. desc = L["Controls the Boss Healthbar/Manabar value font size."],
  790. min = 8, max = 25, step = 1,
  791. disabled = function() return not db.enable or not db.boss.enable end,
  792. },]]
  793. position = {
  794. type = "group",
  795. order = 5,
  796. childGroups = "tree",
  797. name = L["Position"],
  798. --desc = L["Combo Points Options"],
  799. disabled = function() return not db.enable or not db.boss.enable end,
  800. get = function(info) return db.boss.position[ info[#info] ] end,
  801. set = function(info, value) db.boss.position[ info[#info] ] = value; GetUnitFrames:ApplySettings() end,
  802. args = {
  803. ---------------------------
  804. --Option Type Seperators
  805. sep1 = {
  806. type = "description",
  807. order = 1,
  808. name = " ",
  809. },
  810. sep2 = {
  811. type = "description",
  812. order = 2,
  813. name = " ",
  814. },
  815. sep3 = {
  816. type = "description",
  817. order = 3,
  818. name = " ",
  819. },
  820. sep4 = {
  821. type = "description",
  822. order = 4,
  823. name = " ",
  824. },
  825. ---------------------------
  826. relAnchor = {
  827. type = "select",
  828. order = 1,
  829. name = L["Relative Anchor"],
  830. desc = L["Relative Anchor Position."],
  831. disabled = function() return not db.enable or not db.boss.enable end,
  832. values = regions,
  833. },
  834. offSetX = {
  835. type = "range",
  836. order = 2,
  837. name = L["X Offset"],
  838. desc = L["Controls the X offset. (Left - Right)"],
  839. min = -250, max = 250, step = 5,
  840. disabled = function() return not db.enable or not db.boss.enable end,
  841. },
  842. offSetY = {
  843. type = "range",
  844. order = 3,
  845. name = L["Y Offset"],
  846. desc = L["Controls the Y offset. (Up - Down)"],
  847. min = -250, max = 250, step = 5,
  848. disabled = function() return not db.enable or not db.boss.enable end,
  849. },
  850. },
  851. }
  852. },
  853. },
  854. },
  855. }
  856. return options
  857. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement